Ejemplo n.º 1
0
        public static void SetWorldTempTool(WEFuncTool tool)
        {
            WETools.WETempTool = tool;

            // Update Helper Text (if applicable)
            WETools.UpdateHelperText();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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)
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
        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();
        }