public override void StartClientSide(ICoreClientAPI api) { GuiDialogClaimUI gui = new GuiDialogClaimUI(api); api.Input.RegisterHotKey("claimgui", "Open Claim GUI", GlKeys.L, HotkeyType.GUIOrOtherControls); id = api.Event.RegisterGameTickListener(dt => { if (api.World.Player?.Entity != null) { if (api.Settings.Bool["claimGui"]) { gui.TryOpen(); } api.Event.UnregisterGameTickListener(id); } }, 1000); api.Input.SetHotKeyHandler("claimgui", a => { gui.Toggle(); return(true); }); }
public override void StartClientSide(ICoreClientAPI api) { GuiDialogClaimUI gui = new GuiDialogClaimUI(api); api.Input.RegisterHotKey("claimgui", "Open Claim GUI", GlKeys.L, HotkeyType.GUIOrOtherControls); api.Event.LevelFinalize += () => { if (api.Settings.Bool["claimGui"]) { gui.TryOpen(); } }; api.Input.SetHotKeyHandler("claimgui", a => { gui.Toggle(); return(true); }); }