Example #1
0
        public static void DrawMapAttributes()
        {
            int X  = 0;
            int y  = 0;
            int tX = 0;
            int tY = 0;

            if (ReferenceEquals(FrmEditor_MapEditor.Default.tabpages.SelectedTab, FrmEditor_MapEditor.Default.tpAttributes))
            {
                for (X = C_Variables.TileView.Left; X <= C_Variables.TileView.Right; X++)
                {
                    for (y = C_Variables.TileView.Top; y <= C_Variables.TileView.Bottom; y++)
                    {
                        if (C_Graphics.IsValidMapPoint(X, y))
                        {
                            ref var with_1 = ref C_Maps.Map.Tile[X, y];
                            tX = System.Convert.ToInt32(((C_Graphics.ConvertMapX(X * C_Constants.PicX)) - 4) + (C_Constants.PicX * 0.5));
                            tY = System.Convert.ToInt32(((C_Graphics.ConvertMapY(y * C_Constants.PicY)) - 7) + (C_Constants.PicY * 0.5));
                            if (with_1.Type == (byte)Enums.TileType.Blocked)
                            {
                                DrawText(tX, tY, "B", Color.Red, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Warp)
                            {
                                DrawText(tX, tY, "W", Color.Blue, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Item)
                            {
                                DrawText(tX, tY, "I", Color.White, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.NpcAvoid)
                            {
                                DrawText(tX, tY, "N", Color.White, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Key)
                            {
                                DrawText(tX, tY, "K", Color.White, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.KeyOpen)
                            {
                                DrawText(tX, tY, "KO", Color.White, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Resource)
                            {
                                DrawText(tX, tY, "R", Color.Green, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Door)
                            {
                                DrawText(tX, tY, "D", Color.Black, Color.Red, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.NpcSpawn)
                            {
                                DrawText(tX, tY, "S", Color.Yellow, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Shop)
                            {
                                DrawText(tX, tY, "SH", Color.Blue, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Bank)
                            {
                                DrawText(tX, tY, "BA", Color.Blue, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Heal)
                            {
                                DrawText(tX, tY, "H", Color.Green, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Trap)
                            {
                                DrawText(tX, tY, "T", Color.Red, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.House)
                            {
                                DrawText(tX, tY, "H", Color.Green, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Craft)
                            {
                                DrawText(tX, tY, "C", Color.Green, Color.Black, C_Graphics.GameWindow);
                            }
                            else if (with_1.Type == (byte)Enums.TileType.Light)
                            {
                                DrawText(tX, tY, "L", Color.Yellow, Color.Black, C_Graphics.GameWindow);
                            }
                        }
                    }
                }
            }