Created
September 11, 2021 19:05
-
-
Save Micrologist/61890f6ac78650670880e2953014a8b6 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 : 0x04E080B0, 0x30, 0x250, 0x288, 0x25C; | |
| float yVel : 0x04E080B0, 0x30, 0x250, 0x288, 0x260; | |
| float lastJumpStrength : 0x04E080B0, 0x30, 0x250, 0x288, 0xBAC; | |
| float igt : 0x04E1FA90, 0x118, 0x3C0; | |
| } | |
| 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