internal void Update()
 {
     if (CustomKeybindings.GetKeyDown(MENU_KEY))
     {
         BuildingMenu.Show = !BuildingMenu.Show;
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public override void Update()
 {
     if (CustomKeybindings.GetKeyDown(MENU_KEY))
     {
         BuildingMenu.Show = !BuildingMenu.Show;
     }
 }
예제 #4
0
        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);
        }
예제 #5
0
        // custom keybinding input

        internal void Update()
        {
            if (CustomKeybindings.GetKeyDown(TOGGLE_KEY, out int playerID))
            {
                MinimapScript.Instances[playerID].ToggleEnable();
            }
        }
예제 #6
0
        public override void Initialize()
        {
            Instance = this;

            base.Initialize();

            CustomKeybindings.AddAction(TOGGLE_KEY, KeybindingsCategory.CustomKeybindings, ControlType.Both);
        }
예제 #7
0
 public override void Update()
 {
     if (CustomKeybindings.GetKeyDown(TOGGLE_KEY, out int playerID))
     {
         var player = SplitScreenManager.Instance.LocalPlayers[playerID].AssignedCharacter;
         CustomToggleTarget(player);
     }
 }
예제 #8
0
        public override void Initialize()
        {
            Instance = this;
            base.Initialize();

            CustomKeybindings.AddAction(MENU_KEY, KeybindingsCategory.CustomKeybindings, ControlType.Keyboard);

            SL.OnPacksLoaded += SL_OnPacksLoaded;
            SL.OnSceneLoaded += SL_OnSceneLoaded;
        }
예제 #9
0
        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();
        }
예제 #11
0
        // 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();
        }
예제 #12
0
        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);
            }
        }
예제 #13
0
        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}";
                }
            }
        }
예제 #14
0
        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");
        }
예제 #15
0
        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);
                }
            }
        }
예제 #16
0
        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;
        }
예제 #17
0
        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);
            }
        }
예제 #18
0
 public void Initialise()
 {
     Patch();
     CustomKeybindings.AddAction(AggroToggleKey, KeybindingsCategory.Actions, ControlType.Both, 5);
 }