Пример #1
0
 public void SetTool(Tool tool)
 {
     this.tool = tool;
     SetCategoryText();
     keyInput.Text   = "Key - " + ToolSwitcherSession.GetKeyName(tool.Keybind);
     slotInput.Text  = "Slot - " + (tool.Slot + 1);
     pageInput.Text  = "Page - " + (tool.Page + 1);
     btnEnabled.Text = "Enabled - " + tool.Enabled;
 }
Пример #2
0
 protected override void UnloadData()
 {
     Instance = null;
     config?.Unload();
     MyVisualScriptLogicProvider.ToolbarItemChanged -= ToolbarItemChanged;
     MyVisualScriptLogicProvider.PlayerDropped      -= ItemDropped;
     MyVisualScriptLogicProvider.PlayerPickedUp     -= ItemPickedUp;
     MyVisualScriptLogicProvider.PlayerSpawned      -= PlayerSpawned;
     MyAPIGateway.Multiplayer.UnregisterSecureMessageHandler(EventPacket.PacketId, EventPacket.Received);
     equippedTools.Clear();
 }
Пример #3
0
 public ToolMenu(HudAPIv2.MenuCategoryBase category, Tool tool, ToolGroups config)
 {
     this.tool    = tool;
     this.config  = config;
     toolCategory = new HudAPIv2.MenuSubCategory("", category, tool.Name);
     SetCategoryText();
     keyInput   = new HudAPIv2.MenuKeybindInput("Key - " + ToolSwitcherSession.GetKeyName(tool.Keybind), toolCategory, "Press any key.", OnKeySubmit);
     slotInput  = new HudAPIv2.MenuTextInput("Slot - " + (tool.Slot + 1), toolCategory, "Enter a slot number 1-9.", OnSlotSubmit);
     pageInput  = new HudAPIv2.MenuTextInput("Page - " + (tool.Page + 1), toolCategory, "Enter a page number 1-9.", OnPageSubmit);
     btnEnabled = new HudAPIv2.MenuItem("Enabled - " + tool.Enabled, toolCategory, OnEnabledSubmit);
 }
Пример #4
0
        private void OnKeySubmit(MyKeys key, bool shift, bool ctrl, bool alt)
        {
            if (!interactable)
            {
                return;
            }

            tool.Keybind = key;
            config.Save();
            keyInput.Text = "Key - " + ToolSwitcherSession.GetKeyName(key);
        }
Пример #5
0
 public override void LoadData()
 {
     Instance = this;
 }