Exemple #1
0
 private static void RegisterKeyBinds()
 {
     CustomKeyBindSystem.RegisterKeyBind <PressKeyBind>(new BuiltinKey
     {
         id            = 212,
         key           = new CombineKey((int)KeyCode.BackQuote, CombineKey.ALT_COMB, ECombineKeyAction.OnceClick, false),
         conflictGroup = 2052,
         name          = "NebulaChatWindow",
         canOverride   = true
     });
     ProtoRegistry.RegisterString("KEYNebulaChatWindow", "Show or Hide Chat Window");
 }
Exemple #2
0
        private void Awake()
        {
            logger = Logger;

            string pluginfolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            resources = new ResourceData(MODNAME, "RebindBuildBar", pluginfolder);
            resources.LoadAssetBundle("rebindbarbundle");

            ProtoRegistry.RegisterString("ResetBuildMenuTipTitle", "Reset Build Bar item binding");
            ProtoRegistry.RegisterString("ResetBuildMenuTip",
                                         "Pressing this button will reset Build Bar items in current category to their defaults. Holding ctrl (Rebindable) resets all items in all categories.");

            ProtoRegistry.RegisterString("ResetBuildMenuQuestionTitle", "Are you sure?");
            ProtoRegistry.RegisterString("ResetBuildMenuQuestion1", "This action will reset all Build Bar items in build bar to their defaults");
            ProtoRegistry.RegisterString("ResetBuildMenuQuestion2", "This action will reset Build Bar items in current category to their defaults");

            ProtoRegistry.RegisterString("KEYReassignBuildBar", "Reassign Build Bar item");
            ProtoRegistry.RegisterString("KEYClearBuildBar", "Clear Build Bar item");

            ProtoRegistry.RegisterString("LockedTipText", "Locked");

            CustomKeyBindSystem.RegisterKeyBind <HoldKeyBind>(new BuiltinKey
            {
                id            = 150,
                key           = new CombineKey(0, CombineKey.CTRL_COMB, ECombineKeyAction.OnceClick, false),
                conflictGroup = KeyBindConflict.KEYBOARD_KEYBIND | KeyBindConflict.UI,
                name          = "ReassignBuildBar",
                canOverride   = true
            });

            CustomKeyBindSystem.RegisterKeyBind <PressKeyBind>(new BuiltinKey
            {
                id            = 151,
                key           = new CombineKey((int)KeyCode.Mouse2, 0, ECombineKeyAction.OnceClick, false),
                conflictGroup = KeyBindConflict.MOUSE_KEYBIND | KeyBindConflict.UI,
                name          = "ClearBuildBar",
                canOverride   = true
            });

            Harmony harmony = new Harmony(MODGUID);

            harmony.PatchAll(typeof(Patches));

            logger.LogInfo("Rebind Build Bar mod is loaded successfully!");
        }
Exemple #3
0
        private static void RegisterKeyBinds()
        {
            if (cameraToggleEnabled.Value)
            {
                CustomKeyBindSystem.RegisterKeyBind <PressKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.J, 0, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 3071,
                    name          = "ToggleBPGodModeDesc",
                    canOverride   = true
                });
            }

            if (forcePasteEnabled.Value)
            {
                CustomKeyBindSystem.RegisterKeyBind <HoldKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey(0, 1, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "ForceBPPlace",
                    canOverride   = true
                });
            }

            if (axisLockEnabled.Value)
            {
                CustomKeyBindSystem.RegisterKeyBind <ReleaseKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.G, CombineKey.CTRL_COMB, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "LockLongAxis",
                    canOverride   = true
                });

                CustomKeyBindSystem.RegisterKeyBind <ReleaseKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.T, CombineKey.CTRL_COMB, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "LockLatAxis",
                    canOverride   = true
                });
            }

            if (gridControlFeature.Value)
            {
                CustomKeyBindSystem.RegisterKeyBind <ReleaseKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.B, CombineKey.CTRL_COMB, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "SetLocalOffset",
                    canOverride   = true
                });
            }

            if (blueprintMirroring.Value)
            {
                CustomKeyBindSystem.RegisterKeyBind <ReleaseKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.G, CombineKey.SHIFT_COMB, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "MirrorLongAxis",
                    canOverride   = true
                });

                CustomKeyBindSystem.RegisterKeyBind <ReleaseKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.T, CombineKey.SHIFT_COMB, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "MirrorLatAxis",
                    canOverride   = true
                });
            }

            if (factoryUndo.Value)
            {
                CustomKeyBindSystem.RegisterKeyBind <ReleaseKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.Z, CombineKey.CTRL_COMB, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "FactoryUndo",
                    canOverride   = true
                });

                CustomKeyBindSystem.RegisterKeyBind <ReleaseKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.Z, CombineKey.SHIFT_COMB, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "FactoryRedo",
                    canOverride   = true
                });

                CustomKeyBindSystem.RegisterKeyBind <PressKeyBind>(new BuiltinKey
                {
                    key           = new CombineKey((int)KeyCode.Z, 0, ECombineKeyAction.OnceClick, false),
                    conflictGroup = 2052,
                    name          = "DSPTrashButton",
                    canOverride   = true
                });
            }
        }