using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BBModMenu;
using JumpMacro;
using MelonLoader;
using UnityEngine;
using UnityEngine.UIElements;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(JumpMacroMod), "JumpMacro", "1.0.0", "Bowilla", null)]
[assembly: MelonGame("", "Beton Brutal")]
[assembly: AssemblyTitle("JumpMacro")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JumpMacro")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("84f6bd43-3650-43f0-940c-f7f6ed40d693")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace JumpMacro;
public class JumpMacroMod : MelonMod
{
private bool toggle_enable;
private string jumpKey;
public override void OnLateInitializeMelon()
{
MelonLogger.Msg("JumpMacro starting to load.");
GameObject val = GameObject.Find("GameUI");
GameUI component = val.GetComponent<GameUI>();
UIScreen? obj = ((typeof(GameUI)?.GetField("screens", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(component) is List<UIScreen> source) ? ((IEnumerable<UIScreen>)source).FirstOrDefault((Func<UIScreen, bool>)((UIScreen screen) => screen is ModMenu)) : null);
ModMenu val2 = (ModMenu)(object)((obj is ModMenu) ? obj : null);
if (val2 == null)
{
MelonLogger.Msg("ModMenu not found");
return;
}
string text = "Auto Jump";
VisualElement val3 = val2.AddSetting(text);
Toggle val4 = val2.CreateToggle(text, "Enable", true);
INotifyValueChangedExtensions.RegisterValueChangedCallback<bool>((INotifyValueChanged<bool>)(object)val4, (EventCallback<ChangeEvent<bool>>)delegate(ChangeEvent<bool> b)
{
toggle_enable = b.newValue;
});
HotKeyEntry val5 = val2.CreateHotKey(text, "JumpMacroKey", (KeyCode)324);
jumpKey = val5.Value;
val5.OnChanged = (Action<string>)Delegate.Combine(val5.OnChanged, (Action<string>)delegate(string newKey)
{
MelonLogger.Msg("Jump Macro Key : " + newKey);
jumpKey = newKey;
});
VisualElement val6 = val2.CreateGroup("Toggles");
VisualElement val7 = val2.CreateWrapper();
val7.Add((VisualElement)(object)val2.CreateLabel("Enable Jump Macro"));
val7.Add((VisualElement)(object)val4);
VisualElement val8 = val2.CreateWrapper();
val8.Add((VisualElement)(object)val2.CreateLabel("Jump Macro Key"));
val8.Add(val5.Root);
val6.Add(val7);
val6.Add(val8);
val3.Add(val6);
toggle_enable = ((BaseField<bool>)(object)val4).value;
}
public override void OnFixedUpdate()
{
if (toggle_enable && Utils.IsHotkeyHeld(jumpKey) && !GameModeManager.Instance.IsGameModeActive<MenuGameMode>())
{
GameModeManager.Instance.player.spaceDown = true;
}
}
}