Created
August 19, 2021 21:45
-
-
Save Micrologist/ce2237d68aa10d0ba76cc71d93e5794d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
state("Warcry-Win64-Shipping") | |
{ | |
float xVel : 0x043DA550, 0x30, 0x250, 0x288, 0x25C; | |
float yVel : 0x043DA550, 0x30, 0x250, 0x288, 0x260; | |
float lastJumpStrength : 0x043DA550, 0x30, 0x250, 0x288, 0x6A8; | |
} | |
startup | |
{ | |
vars.SetTextComponent = (Action<string, string>)((id, text) => | |
{ | |
var textSettings = timer.Layout.Components.Where(x => x.GetType().Name == "TextComponent").Select(x => x.GetType().GetProperty("Settings").GetValue(x, null)); | |
var textSetting = textSettings.FirstOrDefault(x => (x.GetType().GetProperty("Text1").GetValue(x, null) as string) == id); | |
if (textSetting == null) | |
{ | |
var textComponentAssembly = Assembly.LoadFrom("Components\\LiveSplit.Text.dll"); | |
var textComponent = Activator.CreateInstance(textComponentAssembly.GetType("LiveSplit.UI.Components.TextComponent"), timer); | |
timer.Layout.LayoutComponents.Add(new LiveSplit.UI.Components.LayoutComponent("LiveSplit.Text.dll", textComponent as LiveSplit.UI.Components.IComponent)); | |
textSetting = textComponent.GetType().GetProperty("Settings", BindingFlags.Instance | BindingFlags.Public).GetValue(textComponent, null); | |
textSetting.GetType().GetProperty("Text1").SetValue(textSetting, id); | |
} | |
if (textSetting != null) | |
textSetting.GetType().GetProperty("Text2").SetValue(textSetting, text); | |
}); | |
vars.UpdateSpeedometer = (Action<float, float, bool>)((x, y, round) => | |
{ | |
double hvel = Math.Floor(Math.Sqrt(x*x + y*y)+0.5); | |
if(round) | |
vars.SetTextComponent("Speed", Math.Floor(hvel/100).ToString("") + " m/s"); | |
else | |
vars.SetTextComponent("Speed", (hvel/100).ToString("0.00") + " m/s"); | |
}); | |
} | |
update | |
{ | |
vars.UpdateSpeedometer(current.xVel, current.yVel, false); | |
vars.SetTextComponent("Last Jump", (current.lastJumpStrength/100).ToString("0.00") + " m/s"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment