private void OnHudReady() { category = new HudAPIv2.MenuRootCategory("Instant Projector", HudAPIv2.MenuRootCategory.MenuFlag.AdminMenu, "Instant Projector"); menuBlockBuildTime = new HudAPIv2.MenuTextInput("Block Build Time - " + config.BlockBuildTime, category, "Enter build time per block in seconds.", OnBlockTimeSubmit); config.OnBlockBuildTimeChanged += Config_OnBlockBuildTimeChanged; menuComponentCostModifier = new HudAPIv2.MenuTextInput("Component Cost Modifier - " + config.ComponentCostModifier, category, "Enter the component cost modifier.", OnCompCostSubmit); config.OnComponentCostModifierChanged += Config_OnComponentCostModifierChanged; menuMinBlocks = new HudAPIv2.MenuTextInput("Min Blocks - " + config.MinBlocks, category, "Enter the minimum number of blocks allowed to build.", OnMinBlocksSubmit); config.OnMinBlocksChanged += Config_OnMinBlocksChanged; menuMaxBlocks = new HudAPIv2.MenuTextInput("Max Blocks - " + config.MaxBlocks, category, "Enter the maximum number of blocks allowed to build.", OnMaxBlocksSubmit); config.OnMaxBlocksChanged += Config_OnMaxBlocksChanged; menuPowerModifier = new HudAPIv2.MenuTextInput("Power Modifier - " + config.PowerModifier, category, "Enter the power modifier.", OnPowerSubmit); config.OnPowerModifierChanged += Config_OnPowerModifierChanged; menuSubgrids = new HudAPIv2.MenuItem("Subgrids - " + config.Subgrids, category, OnSubgridsClick); config.OnSubgridsChanged += Config_OnSubgridsChanged; menuExtraComp = new HudAPIv2.MenuTextInput("Extra Component - " + config.GetExtraCompName(), category, "Enter the extra component with format <typeid>/<subtypeid>", OnExtraCompSubmit); config.OnExtraComponentChanged += Config_OnExtraComponentChanged; menuExtraCompCost = new HudAPIv2.MenuTextInput("Extra Component Cost - " + config.ExtraCompCost, category, "Enter the extra component cost.", OnExtraCompCostSubmit); config.OnExtraCompCostChanged += Config_OnExtraCompCostChanged; }
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); }