Skip to content

Commit

Permalink
Merge pull request #116 from Redmoonwow/main
Browse files Browse the repository at this point in the history
[Update] R4S Electrope Edge update
  • Loading branch information
Limiana authored Aug 10, 2024
2 parents d47e403 + 6e2cd34 commit ae85c7c
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion SplatoonScripts/Duties/Dawntrail/R4S Electrope Edge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,31 @@ public override void OnUpdate()
int i = 0;
foreach(var x in Svc.Objects.OfType<IPlayerCharacter>())
{
bool tooFew = false;
var num = Hits.Count(s => s == x.EntityId);
string tooFewString = "";
if(num > 0 && Controller.TryGetElementByName($"Count{i}", out var e))
{
e.Enabled = true;
var l = Longs.Contains(x.EntityId);
if(l)
{
if(num == 1) tooFew = true;
}
else
{
if(num == 2) tooFew = true;
}
if(tooFew)
{
tooFewString = Controller.GetConfig<Config>().stringFew;
}
else
{
tooFewString = Controller.GetConfig<Config>().stringMuch;
}
e.overlayText = l ? "Long" : "Short";
e.overlayText += $"\n {num + (Controller.GetConfig<Config>().AddOne && l?1:0)}";
e.overlayText += $"\n {num + (Controller.GetConfig<Config>().AddOne && l?1:0)} {(Controller.GetConfig<Config>().showMuchFew? tooFewString:"")}";
e.overlayTextColor = (x.StatusList.FirstOrDefault(x => x.StatusId == Debuff)?.RemainingTime < 16f?EColor.RedBright:EColor.White).ToUint();
e.overlayFScale = x.Address == Player.Object.Address ? 2f : 1f;
e.refActorObjectID = x.EntityId;
Expand Down Expand Up @@ -113,6 +131,15 @@ public override void OnSettingsDraw()
ImGui.SetNextItemWidth(150f);
ImGui.Checkbox("Add 1 to long debuff bearers", ref C.AddOne);
ImGuiEx.HelpMarker("If you have long debuff, visually will add 1 to it's count. Does not affects actual functions of the script.");
ImGui.Checkbox("Show much fewer", ref C.showMuchFew);
ImGuiEx.HelpMarker("If selected, In addition to short and long, display much and few.");
ImGui.TextWrapped("You can change the string to be displayed instead of much and few.");
ImGui.TextWrapped("Much");
ImGui.SameLine();
ImGui.InputText("##much", ref C.stringMuch, 100);
ImGui.TextWrapped("Few");
ImGui.SameLine();
ImGui.InputText("##few", ref C.stringFew, 100);
ImGui.Checkbox("Resolve safe spots", ref C.ResolveBox);
ImGuiEx.HelpMarker("If selected, these safe spots will be highlighted when it's time for you to explode.");

Expand Down Expand Up @@ -217,6 +244,9 @@ public override void OnActionEffectEvent(ActionEffectSet set)
public class Config : IEzConfig
{
public bool AddOne = false;
public bool showMuchFew = false;
public string stringMuch = "Much";
public string stringFew = "Few";
public bool ResolveBox = false;
public (int, int) Position2 = (1, 4);
public (int, int) Position3 = (4, 4);
Expand Down

0 comments on commit ae85c7c

Please sign in to comment.