Ejemplo n.º 1
0
        private void Start()
        {
            ModLoader.MakeModule(this);

            key = Keybindings.AddKeybinding("Keymaper",
                                            new Key(KeyCode.LeftControl, KeyCode.J));
        }
Ejemplo n.º 2
0
        private void Start()
        {
            ModLoader.MakeModule(this);

            key = Keybindings.AddKeybinding("Mod Toggle",
                                            new Key(KeyCode.LeftControl, KeyCode.M));
        }
Ejemplo n.º 3
0
        private void Start()
        {
            ModLoader.MakeModule(this);

            HierarchyPanel = gameObject.AddComponent <HierarchyPanel>();
            InspectorPanel = gameObject.AddComponent <InspectorPanel>();

            key = Keybindings.AddKeybinding("Object Explorer",
                                            new Key(KeyCode.LeftControl, KeyCode.O));
        }
Ejemplo n.º 4
0
        public override void OnLoad()
        {
            UnityEngine.Object.DontDestroyOnLoad(EnhancedCamera.Instance);

            Keybindings.AddKeybinding("Forward", new Key(KeyCode.None, KeyCode.W));
            Keybindings.AddKeybinding("Backward", new Key(KeyCode.None, KeyCode.S));
            Keybindings.AddKeybinding("Left", new Key(KeyCode.None, KeyCode.A));
            Keybindings.AddKeybinding("Right", new Key(KeyCode.None, KeyCode.D));
            Keybindings.AddKeybinding("Up", new Key(KeyCode.None, KeyCode.Q));
            Keybindings.AddKeybinding("Down", new Key(KeyCode.None, KeyCode.E));
            Keybindings.AddKeybinding("Menu", new Key(KeyCode.LeftAlt, KeyCode.C));
        }
Ejemplo n.º 5
0
        private void OnEnable()
        {
            ModLoader.MakeModule(this);

            Application.logMessageReceived += HandleLog;
            entries    = new List <LogEntry>();
            windowRect = new Rect(50f, 50f, Elements.Settings.ConsoleSize.x,
                                  Elements.Settings.ConsoleSize.y);

            initMessageFiltering();
            registerClear();

            key = Keybindings.AddKeybinding("Console",
                                            new Key(KeyCode.LeftControl, KeyCode.K));
        }
Ejemplo n.º 6
0
        public void Start()
        {
            DontDestroyOnLoad(this);

            button = new SettingsButton()
            {
                Text     = "Keys",
                Value    = false,
                OnToggle = OnInterfaceToggle
            };
            button.Create();

            windowRect.x      = Configuration.GetFloat("main-x", 1100f);
            windowRect.y      = Configuration.GetFloat("main-y", 309);
            windowRect.width  = 400;
            windowRect.height = 500;
            editInterface.LoadWindowPosition();

            toggleKey = Keybindings.AddKeybinding("Key Manager",
                                                  new Key(KeyCode.RightControl, KeyCode.M));
        }
Ejemplo n.º 7
0
 public override void OnLoad()
 {
     String[] strs = Application.dataPath.Split('/');
     for (int i = 0; i < strs.Length - 1; i++)
     {
         str += strs[i] + "/";
     }
     File.Copy(Resource + "Plugins/x86/lua52.dll", str + "lua52.dll", true); 
     Key = Keybindings.AddKeybinding("Open scripting mod", Key);
     selecting = Keybindings.AddKeybinding("Selected gameobject", selecting);
     settingsGUI = Keybindings.AddKeybinding("Settings GUI", settingsGUI);
     blockInfo = Keybindings.AddKeybinding("Block Info", blockInfo);
     Commands.RegisterCommand("ScaleX", ScaleX, "Scales width of the Scripting Mod");
     Commands.RegisterCommand("ScaleY", ScaleY, "Scales heigth of the Scripting Mod");
     foreach (string s in _list)
     {
         Assembly.LoadFrom(Resource + s);
     }
     Assembly mod = Assembly.LoadFrom(Resource + "BesiegeScriptingMod.dll");
     bsmType = mod.GetType("BesiegeScriptingMod.BesiegeScriptingMod");
     bsm = Activator.CreateInstance(bsmType);
     bsmType.GetMethod("OnLoad").Invoke(bsm, new object[]{Key, selecting, settingsGUI, blockInfo});
 }
Ejemplo n.º 8
0
        public override void OnLoad()
        {
            Keybindings.AddKeybinding("Pipette",
                                      new Key(KeyCode.LeftControl, KeyCode.Mouse1));
            Keybindings.AddKeybinding("Open Block Settings",
                                      new Key(KeyCode.LeftAlt, KeyCode.Mouse1));

            Keybindings.AddKeybinding("Next Tab",
                                      new Key(KeyCode.LeftControl, KeyCode.Tab));
            Keybindings.AddKeybinding("Previous Tab",
                                      new Key(KeyCode.LeftShift, KeyCode.Tab));

            Keybindings.AddKeybinding("Increase time scale",
                                      new Key(KeyCode.RightControl, KeyCode.RightArrow));
            Keybindings.AddKeybinding("Decrease time scale",
                                      new Key(KeyCode.RightControl, KeyCode.LeftArrow));
            Keybindings.AddKeybinding("Set time scale to 100%",
                                      new Key(KeyCode.RightShift, KeyCode.RightArrow));
            Keybindings.AddKeybinding("Set time scale to 0%",
                                      new Key(KeyCode.RightShift, KeyCode.LeftArrow));

            for (int i = 1; i < 10; i++)
            {
                Keybindings.AddKeybinding("Block " + i,
                                          new Key(KeyCode.None,
                                                  (KeyCode)Enum.Parse(typeof(KeyCode), "Alpha" + i)));
            }

            for (int i = 1; i < 8; i++)
            {
                Keybindings.AddKeybinding("Tab " + i,
                                          new Key(KeyCode.LeftControl,
                                                  (KeyCode)Enum.Parse(typeof(KeyCode), "Alpha" + i)));
            }

            UnityEngine.Object.DontDestroyOnLoad(KeyboardShortcuts.Instance);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Instantiates the mod and it's components.
        /// Looks for and loads assemblies.
        /// </summary>
        public override void OnLoad()
        {
            UnityEngine.Object.DontDestroyOnLoad(Internal.Scripter.Instance);
            Game.OnSimulationToggle += Internal.Scripter.Instance.OnSimulationToggle;
            Game.OnBlockPlaced      += (Transform block) => Internal.Scripter.Instance.rebuildIDs = true;
            Game.OnBlockRemoved     += () => Internal.Scripter.Instance.rebuildIDs = true;

            XmlSaver.OnSave  += Internal.MachineData.Save;
            XmlLoader.OnLoad += Internal.MachineData.Load;

            Keybindings.AddKeybinding("Show Block ID", new Key(KeyCode.None, KeyCode.LeftShift));
            Keybindings.AddKeybinding("Watchlist", new Key(KeyCode.LeftControl, KeyCode.I));
            Keybindings.AddKeybinding("Script Options", new Key(KeyCode.LeftControl, KeyCode.U));

            Commands.RegisterCommand("lsm", Internal.Scripter.Instance.ConfigurationCommand, "Scripter Mod configuration command.");
            Commands.RegisterCommand("py", Internal.Scripter.Instance.PythonCommand, "Executes Python expression.");
            Commands.RegisterCommand("python", Internal.Scripter.Instance.PythonCommand, "Executes Python expression.");

            SettingsMenu.RegisterSettingsButton("SCRIPT", Internal.Scripter.Instance.RunScriptSettingToggle, true, 12);

            Internal.Configuration.Load();

            LoadedAPI = true;
        }