public static void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index) { if (sender == pLoadoutMenu) { if (selectedItem == pGiveLoadout) { Logger.DebugLog("UI", "Give Loadout Menu Option Selected, Giving Loadout."); LoadoutHandler.GiveLoadout(); } } else { return; } }
//Game loop internal static void PluginLoop() { Logger.DebugLog("UI", "Starting plugin loop."); while (true) { GameFiber.Yield(); //Checking if keybinds for opening menu is pressed. Currently it doesn't check if any other menu is open, so it can overlap with other RageNativeUI menus. if (Game.IsKeyDownRightNow(Global.Controls.OpenMenuModifier) && Game.IsKeyDown(Global.Controls.OpenMenu) || Global.Controls.OpenMenuModifier == Keys.None && Game.IsKeyDown(Global.Controls.OpenMenu)) { Logger.DebugLog("UI", "Menu button pressed, toggling menu status"); pLoadoutMenu.Visible = !pLoadoutMenu.Visible; } if (Game.IsKeyDownRightNow(Global.Controls.GiveLoadoutModifier) && Game.IsKeyDown(Global.Controls.GiveLoadout) || Global.Controls.GiveLoadoutModifier == Keys.None && Game.IsKeyDown(Global.Controls.GiveLoadout)) { Logger.DebugLog("UI", "Quick Give Bind Pressed, Giving Loadout"); LoadoutHandler.GiveLoadout(); } pMenuPool.ProcessMenus(); } }
public void DutyStateChange(bool OnDuty) { LoadoutHandler.LSPDFRLoadout(OnDuty); }