public static void SetWorldTempTool(WEFuncTool tool) { WETools.WETempTool = tool; // Update Helper Text (if applicable) WETools.UpdateHelperText(); }
private void EndSelection() { this.activity = false; // If we're currently using selection as a temporary tool, force it to be an active tool now that we have a selected area. if (WETools.WETempTool is WEFuncToolMove) { WETools.SetWorldFuncTool(this); } }
public static WEFuncTool WETempTool; // The highest priority tool; runs because the user is forcing a temporary tool to activate. public static void SetWorldTileTool(WETileTool tool, byte index = 0) { WETools.WETileTool = tool; WETools.WEFuncTool = null; WETools.WETempTool = null; WE_UI.curWESlotGroup = WETools.WETileTool.slotGroup; // Assign Index and SubIndex to WorldTileTool (if applicable) WETools.WETileTool.SetIndex(index); // Update Helper Text (if applicable) WETools.UpdateHelperText(); }
public void RunTick() { this.MouseOver = this.GetMouseOverState(); if (this.MouseOver == UIMouseOverState.On) { UIComponent.ComponentWithFocus = this; WEFuncBut WorldFuncBut = null; // Identify which Bar Number is being highlighted: byte barIndex = this.GetBarIndex(Cursor.MouseX); // Check if a Function Button is highlighted: if (buttonMap.ContainsKey(barIndex)) { WorldFuncBut = buttonMap[barIndex]; // Draw the Helper Text associated with the Function Button UIHandler.RunToolTip(WorldFuncBut.title, WorldFuncBut.title, WorldFuncBut.description, UIPrimaryDirection.Top); } // Mouse was pressed if (Cursor.LeftMouseState == Cursor.MouseDownState.Clicked) { // Clicked a Tile Tool if (barIndex < 10) { WETools.SetWorldTileToolBySlotGroup(WE_UI.curWESlotGroup, barIndex); } // Clicked a Function Button if (WorldFuncBut != null) { WorldFuncBut.ActivateWorldFuncButton(); } } } // If the Mouse just exited this component: else if (this.MouseOver == UIMouseOverState.Exited) { WETools.UpdateHelperText(); // Update the Helper Text (since it may have changed from overlaps) } }
public void RunTick() { this.MouseOver = this.GetMouseOverState(); if (this.MouseOver == UIMouseOverState.On) { UIComponent.ComponentWithFocus = this; UIHandler.RunToolTip("scroll", "Tile Scroller", "Use the Mouse Scroll to change between tile variants.", UIPrimaryDirection.Left); } // Mouse Scroll (if WorldTileTool is selected as active tool) if (WETools.WETileTool is WETileTool == true) { sbyte scrollVal = Cursor.MouseScrollDelta; if (scrollVal == 0) { return; } WETools.WETileTool.CycleSubIndex(scrollVal); // Cycles the SubIndex by -1 or +1 WETools.UpdateHelperText(); } }
public static void SetWorldTileToolBySlotGroup(byte slotGroup, byte index = 0) { // If the current slot group is being changed: if (WETools.WETileTool == null || WETools.WETileTool.slotGroup != slotGroup) { if (WETileTool.WorldTileToolMap.ContainsKey(slotGroup)) { WETileTool tool = WETileTool.WorldTileToolMap[slotGroup]; if (tool == null) { return; } WETools.SetWorldTileTool(tool, tool.index); } } // If the current slot group is the same, need to change the index only. else { WETileTool tool = WETools.WETileTool; WETools.SetWorldTileTool(tool, index); } }
public override void OnClick() { byte menuOpt = this.GetContextOpt(Cursor.MouseX, Cursor.MouseY); // World Tile Tool Options if (menuOpt <= 5) { WE_UI.curWESlotGroup = menuOpt; WETools.SetWorldTileToolBySlotGroup(WE_UI.curWESlotGroup); WETools.UpdateHelperText(); } // Resize Option else if (menuOpt == 6) { UIHandler.worldEditConsole.Open(); UIHandler.worldEditConsole.SendCommand("resize ", false); ChatConsole.SendMessage("--------------------", Color.White); ChatConsole.SendMessage("Resize the World Map", Color.Red); ChatConsole.SendMessage("--------------------", Color.White); } this.CloseMenu(); }
public override void ActivateWorldFuncButton() { WETools.SetWorldFuncTool(WEFuncTool.WEFuncToolMap[(byte)WEFuncToolEnum.Eraser]); }
public override void ActivateWorldFuncButton() { WETools.SetWorldFuncTool(WEFuncTool.WEFuncToolMap[(byte)WEFuncToolEnum.Wand]); GameValues.LastAction = "WEWandTool"; }