Created
August 23, 2021 21:22
-
-
Save Micrologist/9694a611154d8a8ad8780cc0cdce904e 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 : 0x043DA590, 0x30, 0x250, 0x288, 0x25C; | |
float yVel : 0x043DA590, 0x30, 0x250, 0x288, 0x260; | |
float lastJumpStrength : 0x043DA590, 0x30, 0x250, 0x288, 0x6A8; | |
float ZFallBoostMult : 0x043DA590, 0x30, 0x250, 0x288, 0x670; | |
float JumpBoost : 0x043DA590, 0x30, 0x250, 0x288, 0x66C; | |
float igt : 0x043F0610, 0x128, 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