private void OnEnabledSubmit() { if (!interactable) { return; } tool.Enabled = !tool.Enabled; btnEnabled.Text = "Enabled - " + tool.Enabled; config.Save(); }
public void Do(ToolGroups config) { Tool t; ToolGroup tg; int index; if (config.ModEnabled && config.TryGetTool(id, out t, out index, out tg) && t.Enabled) { if (tg.IsSlot(page, slot)) { if (MyAPIGateway.Session.CreativeMode) { t.EquipIndex = index; } t.Equip(); } else { if (MyAPIGateway.Session.CreativeMode) { t.EquipIndex = index; } t.ClearSlot(); t.Page = page; t.Slot = slot; if (t.Menu != null) { t.Menu.SlotUpdated(); } config.ToolEdited(t, true); config.Save(); } } }