예제 #1
0
        public void Draw()
        {
            // Only draw the scroll bar if there is a tile tool selected.
            if (WETools.WETileTool is WETileTool == false)
            {
                return;
            }

            byte tileHeight = (byte)WorldmapEnum.TileHeight + 2;

            // Draw Editor Scroller Background
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x, this.y, this.width, this.height), Color.DarkSlateGray);
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x + 2, this.y + 2, (byte)WorldmapEnum.TileWidth, this.height - 6), Color.White);

            // Grid Outline
            for (byte i = 1; i < (byte)WEScrollerEnum.NumTiles; i++)
            {
                Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x, this.y + i * tileHeight, this.width, 2), Color.DarkSlateGray);
            }

            // Draw WorldTileTool Subtype Buttons
            if (WETools.WETileTool is WETileTool)
            {
                List <WEPlaceholder[]> placeholders = WETools.WETileTool.placeholders;

                // Placeholder Loop
                WEPlaceholder[] pData = placeholders[WETools.WETileTool.index];

                byte phSubLen = (byte)pData.Length;
                for (byte s = 0; s < phSubLen; s++)
                {
                    WEPlaceholder ph = pData[s];

                    this.scene.DrawWorldTile(new byte[] { ph.tBase, ph.top, ph.topLay, ph.cover, ph.coverLay, ph.obj, ph.tNodeId }, this.x + 2, this.y + tileHeight * s + 2);
                }

                // Highlight the active color
                short my = (short)Snap.GridFloor(tileHeight, WETools.WETileTool.subIndex * tileHeight - this.y);
                //Systems.spriteBatch.Draw(Systems.tex2dDarkRed, new Rectangle(this.x, this.y + my * tileHeight, this.width, tileHeight), Color.White * 0.5f);
                UIHandler.atlas.DrawAdvanced("Small/Brush", this.x, this.y + my * tileHeight + 2, Color.White * 0.7f);
            }

            // Hovering Visual
            if (UIComponent.ComponentWithFocus is WEScroller)
            {
                short my = (short)Snap.GridFloor(tileHeight, Cursor.MouseY - this.y);
                //Systems.spriteBatch.Draw(Systems.tex2dDarkRed, new Rectangle(this.x, this.y + my * tileHeight, this.width, tileHeight), Color.White * 0.5f);
                UIHandler.atlas.Draw("Small/Brush", this.x, this.y + my * tileHeight + 2);
            }
        }
예제 #2
0
        public void Draw()
        {
            byte tileWidth = (byte)WorldmapEnum.TileWidth + 2;

            // Draw Utility Bar Background
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x, this.y - 2, this.width, this.height + 2), Color.DarkSlateGray);
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x + 2, this.y, this.width - 2, this.height), Color.White);

            // Tile Outlines
            for (byte i = 0; i <= (byte)WEUtilityBarEnum.BarTiles; i++)
            {
                Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x + i * tileWidth, this.y, 2, this.height), Color.DarkSlateGray);
            }

            // World Tile Icons
            if (WETileTool.WorldTileToolMap.ContainsKey(WE_UI.curWESlotGroup))
            {
                List <WEPlaceholder[]> placeholders = WETileTool.WorldTileToolMap[(byte)WE_UI.curWESlotGroup].placeholders;

                for (byte i = 0; i < placeholders.Count; i++)
                {
                    WEPlaceholder ph = placeholders[i][0];
                    this.scene.DrawWorldTile(new byte[] { ph.tBase, ph.top, ph.topLay, ph.cover, ph.coverLay, ph.obj, 0 }, this.x + i * tileWidth + 2, this.y);
                }
            }

            // Draw Keybind Text
            for (byte i = 0; i < 10; i++)
            {
                Systems.fonts.baseText.Draw((i + 1).ToString(), this.x + i * tileWidth + 4, this.y + this.height - 18, Color.DarkOrange);
            }

            // Function Icons
            foreach (KeyValuePair <byte, WEFuncBut> button in this.buttonMap)
            {
                byte barIndex = button.Key;
                button.Value.DrawFunctionTile(this.x + barIndex * tileWidth + 2, this.y);
            }

            // Hovering Visual
            if (UIComponent.ComponentWithFocus is WEUtilityBar)
            {
                short mx = (short)Snap.GridFloor(tileWidth, Cursor.MouseX - this.x);
                Systems.spriteBatch.Draw(Systems.tex2dDarkRed, new Rectangle(this.x + mx * tileWidth, this.y, tileWidth, this.height), Color.White * 0.5f);
            }
        }
예제 #3
0
        public void Draw()
        {
            if (!this.visible)
            {
                return;
            }

            // Draw White Background
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x, this.y, this.width, this.height), Color.White * 0.6f);

            // Draw Line Divisions & Menu Options

            // Loop through horizontal set:
            for (byte i = 0; i < this.xCount; i++)
            {
                Systems.spriteBatch.Draw(Systems.tex2dBlack, new Rectangle(this.x + this.size * i, this.y, 2, this.height), Color.Black);

                // Draw Each Slot while we're at it:
                for (byte j = 0; j < this.yCount; j++)
                {
                    this.DrawMenuOption((byte)(j * this.xCount + i + 1), (short)(this.x + this.size * i), (short)(this.y + this.size * j));
                }
            }

            // Loop through vertical set:
            for (byte i = 0; i <= this.yCount; i++)
            {
                Systems.spriteBatch.Draw(Systems.tex2dBlack, new Rectangle(this.x, this.y + this.size * i, this.width, 2), Color.Black);
            }

            // Hovering Visual
            if (UIComponent.ComponentWithFocus is ContextMenu)
            {
                short mx = (short)Snap.GridFloor(this.size, Cursor.MouseX - this.x);
                short my = (short)Snap.GridFloor(this.size, Cursor.MouseY - this.y);

                Systems.spriteBatch.Draw(Systems.tex2dDarkRed, new Rectangle(this.x + mx * this.size, this.y + my * this.size, this.size, this.size), Color.White * 0.5f);
            }
        }
예제 #4
0
        public void Draw()
        {
            byte tileWidth = (byte)TilemapEnum.TileWidth + 2;

            // Draw Utility Bar Background
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x, this.y - 2, this.width, this.height + 2), Color.DarkSlateGray);
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x + 2, this.y, this.width - 2, this.height), Color.White);

            // Tile Outlines
            for (byte i = 0; i <= (byte)UtilityBarEnum.BarTiles; i++)
            {
                Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x + i * tileWidth, this.y, 2, this.height), Color.DarkSlateGray);
            }

            // Tile Icons
            if (TileTool.tileToolMap.ContainsKey(EditorUI.currentSlotGroup))
            {
                List <EditorPlaceholder[]>    placeholders = TileTool.tileToolMap[EditorUI.currentSlotGroup].placeholders;
                Dictionary <byte, TileObject> tileDict     = Systems.mapper.TileDict;

                for (byte i = 0; i < 10; i++)
                {
                    if (placeholders.Count <= i)
                    {
                        continue;
                    }
                    EditorPlaceholder ph = placeholders[i][0];
                    byte tileId          = ph.tileId;

                    // Draw Tile
                    if (tileId > 0)
                    {
                        if (!tileDict.ContainsKey(tileId))
                        {
                            continue;
                        }
                        tileDict[tileId].Draw(null, ph.subType, this.x + i * tileWidth + 2, this.y);
                    }

                    // Draw Object (if tile is not present)
                    else if (ph.objectId > 0)
                    {
                        ShadowTile.Draw(ph.objectId, ph.subType, null, this.x + i * tileWidth + 2, this.y);
                    }
                }
            }

            // Draw Keybind Text
            for (byte i = 0; i < 10; i++)
            {
                Systems.fonts.baseText.Draw((i + 1).ToString(), this.x + i * tileWidth + 4, this.y + this.height - 18, Color.DarkOrange);
            }

            // Function Icons
            foreach (KeyValuePair <byte, FuncButton> button in this.buttonMap)
            {
                byte barIndex = button.Key;
                button.Value.DrawFunctionTile(this.x + barIndex * tileWidth + 2, this.y);
            }

            // Hovering Visual
            if (UIComponent.ComponentWithFocus is UtilityBar)
            {
                short mx = (short)Snap.GridFloor(tileWidth, Cursor.MouseX - this.x);

                Systems.spriteBatch.Draw(Systems.tex2dDarkRed, new Rectangle(this.x + mx * tileWidth, this.y, tileWidth, this.height), Color.White * 0.5f);
            }
        }
예제 #5
0
        public void Draw()
        {
            if (EditorTools.tileTool is TileTool == false)
            {
                return;
            }

            byte tileHeight = (byte)TilemapEnum.TileHeight + 2;

            // Draw Editor Scroller Background
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x, this.y, this.width, this.height), Color.DarkSlateGray);
            Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x + 2, this.y + 2, (byte)TilemapEnum.TileWidth, this.height - 6), Color.White);

            // Grid Outline
            for (byte i = 1; i < (byte)EScrollerEnum.NumTiles; i++)
            {
                Systems.spriteBatch.Draw(Systems.tex2dWhite, new Rectangle(this.x, this.y + i * tileHeight, this.width, 2), Color.DarkSlateGray);
            }

            // Draw TileTool Subtype Buttons
            List <EditorPlaceholder[]> placeholders = EditorTools.tileTool.placeholders;

            // Placeholder Loop
            byte len = (byte)placeholders.Count;

            EditorPlaceholder[] pData = placeholders[EditorTools.tileTool.index];

            byte phSubLen = (byte)pData.Length;

            for (byte s = 0; s < phSubLen; s++)
            {
                EditorPlaceholder ph = pData[s];

                byte subType = ph.subType;
                byte tileId  = ph.tileId;

                // Draw Tiles
                if (tileId > 0)
                {
                    if (Systems.mapper.TileDict.ContainsKey(tileId))
                    {
                        TileObject tgo = Systems.mapper.TileDict[tileId];
                        tgo.Draw(null, subType, this.x + 2, this.y + 50 * s + 2);
                    }
                }

                // Draw Objects
                else if (ph.objectId > 0)
                {
                    ShadowTile.Draw(ph.objectId, ph.subType, null, this.x + 2, this.y + 50 * s + 2);
                }
            }

            // Highlight the active color
            short my = (short)Snap.GridFloor(tileHeight, EditorTools.tileTool.subIndex * tileHeight - this.y);

            Systems.spriteBatch.Draw(Systems.tex2dDarkRed, new Rectangle(this.x, this.y + my * tileHeight, this.width, tileHeight), Color.White * 0.5f);

            // Hovering Visual
            if (UIComponent.ComponentWithFocus is EditorScroller)
            {
                short my2 = (short)Snap.GridFloor(tileHeight, Cursor.MouseY - this.y);

                Systems.spriteBatch.Draw(Systems.tex2dDarkRed, new Rectangle(this.x, this.y + my2 * tileHeight, this.width, tileHeight), Color.White * 0.5f);
            }
        }