Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Limiana committed Dec 19, 2024
1 parent b48f80a commit 2bff24d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FRU_Target_Enforcer : SplatoonScript
{

public override HashSet<uint>? ValidTerritories { get; } = [1238];
public override Metadata? Metadata => new(3, "NightmareXIV");
public override Metadata? Metadata => new(4, "NightmareXIV");
Config C => Controller.GetConfig<Config>();

public static class Enemies
Expand All @@ -48,6 +48,7 @@ public override void OnUpdate()
{
if(!Controller.InCombat) return;
if(Controller.CombatSeconds < C.CombatTreshold) return;
if(C.NoSwitchOffTarget && Svc.Targets.Target != null) return;
if(Player.Object.IsDead || Player.Object.CurrentHp == 0)
{
EzThrottler.Throttle($"{this.InternalData.FullName}_SetTarget", 10000, true);
Expand Down Expand Up @@ -126,6 +127,7 @@ public override void OnSettingsDraw()
ImGui.InputFloat($"Limit distance", ref C.MaxDistance);
ImGui.Unindent();
ImGui.Checkbox("Do not switch off players", ref C.KeepPlayers);
ImGui.Checkbox("Do not select target when player already has target", ref C.NoSwitchOffTarget);
ImGui.Separator();
var t = GetTargetToSet();
ImGuiEx.Text($"Current suggested target: {t} at {t?.Position} ({t?.IsTarget()})");
Expand All @@ -141,6 +143,7 @@ public class Config : IEzConfig
public bool DisableWhenMemberDead = true;
public bool EnableOracle = true;
public bool KeepPlayers = false;
public bool NoSwitchOffTarget = false;
}

public enum CrystalDirection { Disabled, North, West, South, East };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ public override void OnSetup()

Controller.RegisterElementFromCode("SplitPosition",
"{\"Name\":\"\",\"Enabled\":false,\"refX\":100.0,\"refY\":100.0,\"radius\":1.0,\"Filled\":false,\"fillIntensity\":0.5,\"overlayBGColor\":4278190080,\"overlayTextColor\":4294967295,\"thicc\":4.0,\"overlayText\":\"Spread!\",\"refActorTetherTimeMin\":0.0,\"refActorTetherTimeMax\":0.0}");

Controller.RegisterElementFromCode("KBHelper", "{\"Name\":\"\",\"type\":2,\"Enabled\":false,\"radius\":0.0,\"color\":3356425984,\"Filled\":false,\"fillIntensity\":0.345,\"thicc\":4.0,\"refActorTetherTimeMin\":0.0,\"refActorTetherTimeMax\":0.0}");
}

private void Alert(string text)
Expand Down
63 changes: 63 additions & 0 deletions SplatoonScripts/Generic/StatusbarFpsSwitcher.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using Dalamud.Game.Gui.Dtr;
using Dalamud.Plugin.Services;
using ECommons.DalamudServices;
using Splatoon.SplatoonScripting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SplatoonScriptsOfficial.Generic;
public class StatusbarFpsSwitcher : SplatoonScript
{
public override HashSet<uint>? ValidTerritories { get; } = null;

IDtrBarEntry Entry;

public override void OnEnable()
{
Entry = Svc.DtrBar.Get("Splatoon.FpsSwitcher", "");
Entry.Shown = true;
Entry.OnClick = () =>
{
Toggle();
};
Update();
}

void Update()
{
Entry = Svc.DtrBar.Get("Splatoon.FpsSwitcher", "");
var cfg = Svc.GameConfig.System.GetUInt("Fps");
if(cfg == 0)
{
Entry.Text = $"FPS: U";
}
else if(cfg == 1)
{
Entry.Text = $"FPS: D";
}
else if(cfg == 2)
{
Entry.Text = $"FPS: 60";
}
else if(cfg == 3)
{
Entry.Text = $"FPS: 30";
}
}

void Toggle()
{
var cfg = Svc.GameConfig.System.GetUInt("Fps");
Svc.GameConfig.System.Set("Fps", cfg == 3 ? 2u : 3u);
Update();
}

public override void OnDisable()
{
Entry = Svc.DtrBar.Get("Splatoon.FpsSwitcher", "");
Entry.Remove();
}
}

0 comments on commit 2bff24d

Please sign in to comment.