Created
November 29, 2021 05:44
-
-
Save Micrologist/742fc372cdc3838465a47d1088072e2d 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 : 0x04E8A2B0, 0x30, 0x250, 0x288, 0x25C; | |
float yVel : 0x04E8A2B0, 0x30, 0x250, 0x288, 0x260; | |
float lastJumpStrength : 0x04E8A2B0, 0x30, 0x250, 0x288, 0xBDC; | |
float igt : 0x04EA1C90, 0x118, 0x3D0; | |
} | |
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 | |
{ | |
float x = current.xVel; | |
float y = current.yVel; | |
current.hVel = Math.Floor(Math.Sqrt(x*x + y*y)+0.5); | |
vars.SetTextComponent("Timer", current.igt.ToString("0.000")+ " s"); | |
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