internal void Update() { if (CustomKeybindings.GetKeyDown(MENU_KEY)) { BuildingMenu.Show = !BuildingMenu.Show; } }
internal void Update() { try { if (MenuManager.Instance.IsInMainMenuScene || NetworkLevelLoader.Instance.IsGameplayPaused) { return; } } catch { return; } if (CustomKeybindings.GetKeyDown(NextKeyToggle, out int playerID)) { var player = SplitScreenManager.Instance.LocalPlayers[playerID]; CycleQuickslotBar(player.AssignedCharacter, true); } if (CustomKeybindings.GetKeyDown(PrevKeyToggle, out playerID)) { var player = SplitScreenManager.Instance.LocalPlayers[playerID]; CycleQuickslotBar(player.AssignedCharacter, false); } }
public override void Update() { if (CustomKeybindings.GetKeyDown(MENU_KEY)) { BuildingMenu.Show = !BuildingMenu.Show; } }
internal void Awake() { cfg_NumberOfExtraBars = Config.Bind(CTG_NAME, "Extra Quickslot Bars", 1, "How many extra quickslot bars to add."); CustomKeybindings.AddAction(NextKeyToggle, KeybindingsCategory.CustomKeybindings, ControlType.Both); CustomKeybindings.AddAction(PrevKeyToggle, KeybindingsCategory.CustomKeybindings, ControlType.Both); }
// custom keybinding input internal void Update() { if (CustomKeybindings.GetKeyDown(TOGGLE_KEY, out int playerID)) { MinimapScript.Instances[playerID].ToggleEnable(); } }
public override void Initialize() { Instance = this; base.Initialize(); CustomKeybindings.AddAction(TOGGLE_KEY, KeybindingsCategory.CustomKeybindings, ControlType.Both); }
public override void Update() { if (CustomKeybindings.GetKeyDown(TOGGLE_KEY, out int playerID)) { var player = SplitScreenManager.Instance.LocalPlayers[playerID].AssignedCharacter; CustomToggleTarget(player); } }
public override void Initialize() { Instance = this; base.Initialize(); CustomKeybindings.AddAction(MENU_KEY, KeybindingsCategory.CustomKeybindings, ControlType.Keyboard); SL.OnPacksLoaded += SL_OnPacksLoaded; SL.OnSceneLoaded += SL_OnSceneLoaded; }
private void Setup() { SlotsToAdd = (int)(float)Settings.GetValue(SettingNames.QUICKSLOTS_TO_ADD); CenterSlots = (bool)Settings.GetValue(SettingNames.CENTER_QUICKSLOTS); // Add CustomKeybindings for (int i = 0; i < SlotsToAdd; i++) { CustomKeybindings.AddAction($"QS_Instant{i + 12}", KeybindingsCategory.QuickSlot, ControlType.Both); } }
internal void Awake() { Instance = this; CustomKeybindings.AddAction(MENU_KEY, KeybindingsCategory.CustomKeybindings, ControlType.Keyboard); SL.OnPacksLoaded += SL_OnPacksLoaded; SL.OnSceneLoaded += SL_OnSceneLoaded; LoadSettings(); new Harmony(GUID).PatchAll(); }
// OnEnable(): called when a mod is enabled // Also called when a mod is loaded public override void OnEnable() { // REQUIRED base.OnEnable(); CustomKeybindings.AddAction("Switch Quick Slot Bars", CustomKeybindings.KeybindingsCategory.Actions, true, 5, CustomKeybindings.InputActionType.Button); ScriptLoad.betterQuickSlots = this; LoadConfig(); GameObject obj = new GameObject(); betterQuickSlotsPatch = obj.AddComponent <ScriptLoad>(); betterQuickSlotsPatch.Initialise(); }
internal void Awake() { try { var harmony = new HarmonyLib.Harmony(ID); harmony.PatchAll(); CustomKeybindings.AddAction("QuickSave", KeybindingsCategory.CustomKeybindings, ControlType.Keyboard); //CustomKeybindings.AddAction("QuickLoad", KeybindingsCategory.Actions, ControlType.Both, 5); MyLogger.LogDebug("Awaken"); } catch (Exception ex) { MyLogger.LogError(ex.Message); } }
internal void Update() { for (int i = 0; i < SlotsToAdd; i++) { if (CustomKeybindings.GetKeyDown($"QS_Instant{i + 12}", out int playerID)) { var character = SplitScreenManager.Instance.LocalPlayers[playerID].AssignedCharacter; character.QuickSlotMngr.QuickSlotInput(i + 11); break; } } foreach (SplitPlayer player in SplitScreenManager.Instance.LocalPlayers) { var character = player.AssignedCharacter; int id = character.OwnerPlayerSys.PlayerID; if (QuickSlotInstant9(id)) { character.QuickSlotMngr.QuickSlotInput(12); } if (QuickSlotInstant10(id)) { character.QuickSlotMngr.QuickSlotInput(13); } if (QuickSlotInstant11(id)) { character.QuickSlotMngr.QuickSlotInput(14); } if (QuickSlotInstant12(id)) { character.QuickSlotMngr.QuickSlotInput(15); } } if (!fixedDictionary && !LocalizationManager.Instance.IsLoading && LocalizationManager.Instance.Loaded) { fixedDictionary = true; var genLoc = SideLoader.References.GENERAL_LOCALIZATION; for (int i = 0; i < SlotsToAdd; i++) { genLoc[$"InputAction_QS_Instant{i + 12}"] = $"Quick Slot {i + 9}"; } } }
internal void Awake() { // setup keybinding CustomKeybindings.AddAction(TOGGLE_KEY, KeybindingsCategory.Menus, ControlType.Both); // setup harmony new Harmony(GUID).PatchAll(); // setup config Settings.SetupConfig(); // global scene change event SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; // Load bundle var bundle = AssetBundle.LoadFromFile(ASSETBUNDLE_PATH); AlwaysOnTopMaterial = bundle.LoadAsset <Material>("UI_AlwaysOnTop"); }
internal void Update() { if (NetworkLevelLoader.Instance.IsGameplayPaused || !SplitScreenManager.Instance || SplitScreenManager.Instance.LocalPlayers == null) { return; } for (int i = 0; i < SlotsToAdd; i++) { if (CustomKeybindings.GetKeyDown($"QS_Instant{i + 12}", out int playerID)) { var character = SplitScreenManager.Instance.LocalPlayers[playerID].AssignedCharacter; character.QuickSlotMngr.QuickSlotInput(i + 11); break; } } foreach (SplitPlayer player in SplitScreenManager.Instance.LocalPlayers) { var character = player.AssignedCharacter; int id = character.OwnerPlayerSys.PlayerID; if (QuickSlotInstant9(id)) { character.QuickSlotMngr.QuickSlotInput(12); } if (QuickSlotInstant10(id)) { character.QuickSlotMngr.QuickSlotInput(13); } if (QuickSlotInstant11(id)) { character.QuickSlotMngr.QuickSlotInput(14); } if (QuickSlotInstant12(id)) { character.QuickSlotMngr.QuickSlotInput(15); } } }
internal void Awake() { Instance = this; // setup keybinding CustomKeybindings.AddAction(TOGGLE_KEY, KeybindingsCategory.Menus, ControlType.Both); // setup harmony new Harmony(GUID).PatchAll(); // setup config Settings.Init(Config); // global scene change event SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; // Load bundle var bundle = AssetBundle.LoadFromFile(ASSETBUNDLE_PATH); AlwaysOnTopMaterial = bundle.LoadAsset <Material>("UI_AlwaysOnTop"); GameObject.DontDestroyOnLoad(AlwaysOnTopMaterial); AlwaysOnTopMaterial.hideFlags |= HideFlags.HideAndDontSave; }
public static void UpdateInteraction(LocalCharacterControl __instance) { if (__instance.InputLocked) { return; } try { if (CustomKeybindings.GetKeyDown("QuickSave")) { SaveSystemReworked.MyLogger.LogDebug("QuickSave"); SaveManager.Instance.Save(true, true); //QuickSave = SaveManager.Instance.ChooseCharacterSaveInstance(charUID, 0); if ((bool)Global.AudioManager) { Global.AudioManager.PlaySound(GlobalAudioManager.Sounds.UI_NEWGAME_SelectSave); } } //if (CustomKeybindings.GetKeyDown("QuickLoad")) //{ // SaveSystemReworked.MyLogger.LogDebug("QuickLoad"); // if (QuickSave == null) // { // QuickSave = SaveManager.Instance.ChooseCharacterSaveInstance(charUID, 0); // } // SplitScreenManager.Instance.LocalPlayers[0].SetChosenSave(QuickSave); // QuickSave.ApplyLoadedSaveToChar(__instance.Character); //} } catch (Exception ex) { SaveSystemReworked.MyLogger.LogError(ex.Message); } }
public void Initialise() { Patch(); CustomKeybindings.AddAction(AggroToggleKey, KeybindingsCategory.Actions, ControlType.Both, 5); }