Beispiel #1
0
 void QuitEditor()
 {
     _lastSelectionGrid = editor.SelectionGrid;
     _lastWorld         = Levels.GetWorldOfLevel(map);
     _lastMapType       = MapType();
     editor             = null;
     mode = Mode.Menu;
     _paraPhysicalMapLogic = null;
     _inventories.Save();
 }
Beispiel #2
0
        bool LoadGrid()
        {
            int[,] grid;
            List <GridEditor.OverlayGrid> underlays = new List <GridEditor.OverlayGrid>();
            List <GridEditor.OverlayGrid> overlays  = new List <GridEditor.OverlayGrid>();
            string world = Levels.GetWorldOfLevel(map);

            Levels.MapType mapType   = MapType();
            string         levelPath = Levels.GetLevelPath(map, mapType);

            if (!File.Exists(levelPath)) // Should only happen in Paradise
            {
                return(false);
            }
            if (mode == Mode.Minimap)
            {
                grid = Levels.GetGridFromLines(File.ReadAllLines(levelPath), 64, 64,
                                               Levels.TilesOffset(world, Levels.MapType.Minimap));
                sset = new TilesSet(Load.MinimapColors, false, _ssetBounds, 64);
            }
            else
            {
                Load.LoadWorldTiles(GraphicsDevice, world);
                grid = Levels.GetGridFromLines(File.ReadAllLines(levelPath), Levels.TilesOffset(world, mapType));
                sset = new TilesSet(Load.Tiles[new Load.WorldAndType(world, mapType)], true, _ssetBounds, 64);

                if (Settings.Paradise && mode == Mode.Physical)
                {
                    string   objectsPath = Levels.GetObjectsPath(map);
                    string[] objects     = File.Exists(objectsPath) ? File.ReadAllLines(objectsPath) : new string[0];
                    _paraPhysicalMapLogic = new ParadisePhysicalMapLogic(objects);
                }

                int[,] ogrid;
                TilesSet osset;
                if (mode != Mode.Background)
                {
                    try
                    {
                        ogrid = Levels.GetGridFromLines(File.ReadAllLines(Levels.GetLevelPath(map, Levels.MapType.Background)),
                                                        Levels.TilesOffset(world, Levels.MapType.Background));
                        osset = new TilesSet(Load.Tiles[new Load.WorldAndType(world, Levels.MapType.Background)],
                                             true, Rectangle.Empty, 0);
                        underlays.Add(new GridEditor.OverlayGrid(osset, ogrid, false));
                    }
                    catch { }
                }
                if (mode != Mode.Graphical2)
                {
                    try
                    {
                        ogrid = Levels.GetGridFromLines(File.ReadAllLines(Levels.GetLevelPath(map, Levels.MapType.Graphical2)),
                                                        Levels.TilesOffset(world, Levels.MapType.Graphical2));
                        osset = new TilesSet(Load.Tiles[new Load.WorldAndType(world, Levels.MapType.Graphical2)],
                                             true, Rectangle.Empty, 0);
                        if (mode == Mode.Background)
                        {
                            overlays.Add(new GridEditor.OverlayGrid(osset, ogrid, false));
                        }
                        else
                        {
                            underlays.Add(new GridEditor.OverlayGrid(osset, ogrid, false));
                        }
                    }
                    catch { }
                }
                if (mode != Mode.Graphical)
                {
                    try
                    {
                        ogrid = Levels.GetGridFromLines(File.ReadAllLines(Levels.GetLevelPath(map, Levels.MapType.Graphical)),
                                                        Levels.TilesOffset(world, Levels.MapType.Graphical));
                        osset = new TilesSet(Load.Tiles[new Load.WorldAndType(world, Levels.MapType.Graphical)],
                                             true, Rectangle.Empty, 0);
                        if (mode == Mode.Physical)
                        {
                            underlays.Add(new GridEditor.OverlayGrid(osset, ogrid, false));
                        }
                        else
                        {
                            overlays.Add(new GridEditor.OverlayGrid(osset, ogrid, false));
                        }
                    }
                    catch { }
                }
                if (mode != Mode.Physical)
                {
                    try
                    {
                        ogrid = Levels.GetGridFromLines(File.ReadAllLines(Levels.GetLevelPath(map, Levels.MapType.Physical)),
                                                        Levels.TilesOffset(world, Levels.MapType.Physical));
                        osset = new TilesSet(Load.Tiles[new Load.WorldAndType(world, Levels.MapType.Physical)],
                                             true, Rectangle.Empty, 0);
                        overlays.Add(new GridEditor.OverlayGrid(osset, ogrid, true));
                    }
                    catch { }
                }
            }

            int[,] selectionGrid = null;
            if (_lastMapType == mapType /*&& (_lastWorld == world || mapType == Levels.MapType.Physical || mapType == Levels.MapType.Minimap)*/)
            {
                // Sometimes, inter-world copy paste can be relevant even for grounds and backgrounds
                selectionGrid = _lastSelectionGrid;
            }
            editor = new GridEditor(this, MapType(), _gridEditorBounds,
                                    sset, grid, new Point(-8, -8), overlays.ToArray(), underlays.ToArray(), selectionGrid, _inventories.GetInventory(MapType()));
            return(true);
        }
Beispiel #3
0
 void DrawTile(SpriteBatch sprite_batch, TilesSet sprites, Rectangle dst, int tile, bool overridePalette, bool showSpecial)
 {
     if (type == Levels.MapType.Minimap)
     {
         sprites.Draw(sprite_batch, overridePalette ? sprites.SelectedSet : tile, 0, dst);
     }
     else
     {
         tile = overridePalette ? ChangePalette(tile, sprites.SelectedSet) : tile;
         int           tile_id = tile & 0x3FF;
         int           palette = (tile & 0xF000) >> 12;
         SpriteEffects effects =
             ((tile & 0x400) != 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) |
             ((tile & 0x800) != 0 ? SpriteEffects.FlipVertically : SpriteEffects.None);
         if (showSpecial)
         {
             if (Settings.Paradise)
             {
                 if (tile_id >= PhysicalMapLogic.CONTROL_MIN_ID)
                 {
                     // Rendering of non-graphic special elements
                     Color?c = null;
                     if (ParadisePhysicalMapLogic.STARTING_ZONE_IDS.Contains(tile_id))
                     {
                         c = ParadisePhysicalMapLogic.StartingZoneColor(tile_id);
                     }
                     else if (ParadisePhysicalMapLogic.HEALING_ZONE_IDS.Contains(tile_id))
                     {
                         c = ParadisePhysicalMapLogic.HealingZoneColor(tile_id);
                     }
                     else if (ParadisePhysicalMapLogic.ENDING_ZONE_IDS.Contains(tile_id))
                     {
                         c = ParadisePhysicalMapLogic.EndingZoneColor(tile_id);
                     }
                     else if (ParadisePhysicalMapLogic.FIXED_OBJECTS_IDS.Contains(tile_id))
                     {
                         sprite_batch.Draw(ParadisePhysicalMapLogic.TextureOfFixedObjects(tile_id), dst, null, Color.White, 0, Vector2.Zero, effects, 0F);
                     }
                     else if (ParadisePhysicalMapLogic.MOVING_OBJECTS_IDS.Contains(tile_id)) // Flips have no effect on moving objects tiles
                     {
                         sprite_batch.Draw(ParadisePhysicalMapLogic.TextureOfMovingObject(tile_id), dst, null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0F);
                     }
                     else if (ParadisePhysicalMapLogic.NUMBER_TILES.Contains(tile)) // Palette and flips matters for numbers
                     {
                         sprite_batch.Draw(ParadisePhysicalMapLogic.TextureOfNumber(tile), dst, null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0F);
                     }
                     else
                     {
                         c = ParadisePhysicalMapLogic.UNSUPPORTED_COLOR;
                     }
                     if (c.HasValue)
                     {
                         sprite_batch.FillRectangle(dst, c.Value);
                     }
                 }
                 if (tile_id <= PhysicalMapLogic.VISIBLE_MAX_ID)
                 {
                     sprites.Draw(sprite_batch, palette, tile_id, dst, effects);
                 }
             }
             else
             {
                 if (tile_id >= PhysicalMapLogic.CONTROL_MIN_ID)
                 {
                     // Rendering of non-graphic special elements
                     Color?c = null;
                     if (PhysicalMapLogic.STARTING_ZONE_IDS.Contains(tile_id))
                     {
                         c = PhysicalMapLogic.StartingZoneColor(tile_id);
                     }
                     else if (PhysicalMapLogic.HEALING_ZONE_IDS.Contains(tile_id))
                     {
                         c = PhysicalMapLogic.HealingZoneColor(tile_id);
                     }
                     else if (PhysicalMapLogic.ENDING_ZONE_IDS.Contains(tile_id))
                     {
                         c = PhysicalMapLogic.EndingZoneColor(tile_id);
                     }
                     else if (PhysicalMapLogic.SPRING_IDS.Contains(tile_id))
                     {
                         sprite_batch.Draw(PhysicalMapLogic.TextureOfSpring(tile_id), dst, null, Color.White, 0, Vector2.Zero, effects, 0F);
                     }
                     else if (PhysicalMapLogic.VISIBLE_CONTROL_TILES.Contains(tile_id))
                     {
                         sprite_batch.Draw(PhysicalMapLogic.UnderlayOfVisibleControlTile(tile_id), dst, null, Color.White, 0, Vector2.Zero, effects, 0F);
                     }
                     else if (PhysicalMapLogic.MOVING_OBJECTS_IDS.Contains(tile_id)) // Flips have no effect on moving objects tiles
                     {
                         sprite_batch.Draw(PhysicalMapLogic.TextureOfMovingObject(tile_id), dst, null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0F);
                     }
                     else if (PhysicalMapLogic.NUMBER_TILES.Contains(tile)) // Palette and flips matters for numbers
                     {
                         sprite_batch.Draw(PhysicalMapLogic.TextureOfNumber(tile), dst, null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0F);
                     }
                     else
                     {
                         c = PhysicalMapLogic.UNSUPPORTED_COLOR;
                     }
                     if (c.HasValue)
                     {
                         sprite_batch.FillRectangle(dst, c.Value);
                     }
                 }
                 if (tile_id <= PhysicalMapLogic.VISIBLE_MAX_ID || PhysicalMapLogic.VISIBLE_CONTROL_TILES.Contains(tile_id))
                 {
                     sprites.Draw(sprite_batch, palette, tile_id, dst, effects);
                 }
             }
         }
         else
         {
             sprites.Draw(sprite_batch, palette, tile_id, dst, effects);
         }
     }
 }
Beispiel #4
0
        public ParadiseSpecialItems(Game1 game, ParadisePhysicalMapLogic logic)
        {
            _game  = game;
            _logic = logic;

            Panel panel = new Panel()
            {
                Background = new SolidBrush(Color.Black),
                Padding    = new Myra.Graphics2D.Thickness(20, 20, 20, 20)
            };

            var grid = new Grid
            {
                RowSpacing    = 10,
                ColumnSpacing = 10
            };

            grid.ColumnsProportions.Add(new Proportion(ProportionType.Auto));
            grid.HorizontalAlignment = HorizontalAlignment.Left;
            grid.RowsProportions.Add(new Proportion(ProportionType.Part));
            grid.VerticalAlignment = VerticalAlignment.Top;

            // --- MOVING OBJECTS ---
            scroll = new ScrollViewer()
            {
                GridRow                 = 0,
                GridColumn              = 0,
                GridColumnSpan          = 6,
                GridRowSpan             = 21,
                ShowHorizontalScrollBar = false,
                ShowVerticalScrollBar   = true
            };
            movingObjects = new TextBox()
            {
                Multiline = true,
                Font      = Load.Monospace
            };
            scroll.Content = movingObjects;
            grid.Widgets.Add(scroll);

            TextBox id = new TextBox()
            {
                GridRow        = 0,
                GridColumn     = 6,
                GridColumnSpan = 2,
                HintText       = "ID",
            };

            grid.Widgets.Add(id);
            // Array
            TextBox array1 = new TextBox()
            {
                GridRow    = 2,
                GridColumn = 6,
                HintText   = "Length",
                Width      = 100
            };

            grid.Widgets.Add(array1);
            var arrayAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 2,
                Text       = "Array",
                Width      = 100,
            };

            arrayAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[0], array1.Text);
            };
            grid.Widgets.Add(arrayAdd);
            // Offset
            TextBox offset1 = new TextBox()
            {
                GridRow    = 3,
                GridColumn = 6,
                HintText   = "Offset X",
                Width      = 100
            };

            grid.Widgets.Add(offset1);
            TextBox offset2 = new TextBox()
            {
                GridRow    = 3,
                GridColumn = 7,
                HintText   = "Offset Y",
                Width      = 100
            };

            grid.Widgets.Add(offset2);
            var offsetAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 3,
                Text       = "Offset",
                Width      = 100,
            };

            offsetAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[1], offset1.Text, offset2.Text);
            };
            grid.Widgets.Add(offsetAdd);
            // Roller
            TextBox roller1 = new TextBox()
            {
                GridRow    = 5,
                GridColumn = 6,
                HintText   = "Direction",
                Width      = 100
            };

            grid.Widgets.Add(roller1);
            TextBox roller2 = new TextBox()
            {
                GridRow    = 5,
                GridColumn = 7,
                HintText   = "Speed",
                Width      = 100
            };

            grid.Widgets.Add(roller2);
            TextBox roller3 = new TextBox()
            {
                GridRow    = 5,
                GridColumn = 8,
                HintText   = "StartTime",
                Width      = 100
            };

            grid.Widgets.Add(roller3);
            TextBox roller4 = new TextBox()
            {
                GridRow    = 5,
                GridColumn = 9,
                HintText   = "Period",
                Width      = 100
            };

            grid.Widgets.Add(roller4);
            var rollerAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 5,
                Text       = "Roller",
                Width      = 100,
            };

            rollerAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[3], roller1.Text, roller2.Text, roller3.Text, roller4.Text);
            };
            grid.Widgets.Add(rollerAdd);
            // Piston
            TextBox piston1 = new TextBox()
            {
                GridRow    = 6,
                GridColumn = 6,
                HintText   = "Direction",
                Width      = 100
            };

            grid.Widgets.Add(piston1);
            TextBox piston2 = new TextBox()
            {
                GridRow    = 6,
                GridColumn = 7,
                HintText   = "MovePeriod",
                Width      = 100
            };

            grid.Widgets.Add(piston2);
            TextBox piston3 = new TextBox()
            {
                GridRow    = 6,
                GridColumn = 8,
                HintText   = "StrokeLength",
                Width      = 100
            };

            grid.Widgets.Add(piston3);
            TextBox piston4 = new TextBox()
            {
                GridRow    = 6,
                GridColumn = 9,
                HintText   = "StartTime",
                Width      = 100
            };

            grid.Widgets.Add(piston4);
            TextBox piston5 = new TextBox()
            {
                GridRow    = 6,
                GridColumn = 10,
                HintText   = "WaitPeriod",
                Width      = 100
            };

            grid.Widgets.Add(piston5);
            var pistonAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 6,
                Text       = "Piston",
                Width      = 100,
            };

            pistonAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[4], piston1.Text, piston2.Text, piston3.Text, piston4.Text, piston5.Text);
            };
            grid.Widgets.Add(pistonAdd);
            // MovingWall
            TextBox mw1 = new TextBox()
            {
                GridRow    = 7,
                GridColumn = 6,
                HintText   = "W+16H+256SL",
                Width      = 100
            };

            grid.Widgets.Add(mw1);
            TextBox mw2 = new TextBox()
            {
                GridRow    = 7,
                GridColumn = 7,
                HintText   = "MovePeriod",
                Width      = 100
            };

            grid.Widgets.Add(mw2);
            TextBox mw3 = new TextBox()
            {
                GridRow    = 7,
                GridColumn = 8,
                HintText   = "Dir + 4ST",
                Width      = 100
            };

            grid.Widgets.Add(mw3);
            TextBox mw4 = new TextBox()
            {
                GridRow    = 7,
                GridColumn = 9,
                HintText   = "WaitPeriod1",
                Width      = 100
            };

            grid.Widgets.Add(mw4);
            TextBox mw5 = new TextBox()
            {
                GridRow    = 7,
                GridColumn = 10,
                HintText   = "WaitPeriod2",
                Width      = 100
            };

            grid.Widgets.Add(mw5);
            var mwAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 7,
                Text       = "Moving Wall",
                Width      = 100,
            };

            mwAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[14], mw1.Text, mw2.Text, mw3.Text, mw4.Text, mw5.Text);
            };
            grid.Widgets.Add(mwAdd);
            // Shooter
            TextBox shooter1 = new TextBox()
            {
                GridRow    = 8,
                GridColumn = 6,
                HintText   = "MinDir",
                Width      = 100
            };

            grid.Widgets.Add(shooter1);
            TextBox shooter2 = new TextBox()
            {
                GridRow    = 8,
                GridColumn = 7,
                HintText   = "MaxDir",
                Width      = 100
            };

            grid.Widgets.Add(shooter2);
            TextBox shooter3 = new TextBox()
            {
                GridRow    = 8,
                GridColumn = 8,
                HintText   = "StartTime",
                Width      = 100
            };

            grid.Widgets.Add(shooter3);
            TextBox shooter4 = new TextBox()
            {
                GridRow    = 8,
                GridColumn = 9,
                HintText   = "Period",
                Width      = 100
            };

            grid.Widgets.Add(shooter4);
            var shooterAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 8,
                Text       = "Shooter",
                Width      = 100,
            };

            shooterAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[5], shooter1.Text, shooter2.Text, shooter3.Text, shooter4.Text);
            };
            grid.Widgets.Add(shooterAdd);
            // RollerRing
            TextBox rr1 = new TextBox()
            {
                GridRow    = 10,
                GridColumn = 6,
                HintText   = "NumBalls",
                Width      = 100
            };

            grid.Widgets.Add(rr1);
            TextBox rr2 = new TextBox()
            {
                GridRow    = 10,
                GridColumn = 7,
                HintText   = "Radius",
                Width      = 100
            };

            grid.Widgets.Add(rr2);
            TextBox rr3 = new TextBox()
            {
                GridRow    = 10,
                GridColumn = 8,
                HintText   = "MovePeriod",
                Width      = 100
            };

            grid.Widgets.Add(rr3);
            TextBox rr4 = new TextBox()
            {
                GridRow    = 10,
                GridColumn = 9,
                HintText   = "StartAngle",
                Width      = 100
            };

            grid.Widgets.Add(rr4);
            var rrAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 10,
                Text       = "Roller ring",
                Width      = 100,
            };

            rrAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[6], rr1.Text, rr2.Text, rr3.Text, rr4.Text);
            };
            grid.Widgets.Add(rrAdd);
            // Cog
            var cogAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 11,
                Text       = "Cog",
                Width      = 100,
            };

            cogAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[7], rr1.Text, rr2.Text, rr3.Text, rr4.Text);
            };
            grid.Widgets.Add(cogAdd);
            // RingOfFire
            var rfAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 12,
                Text       = "Ring of Fire",
                Width      = 100,
            };

            rfAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[9], rr1.Text, rr2.Text, rr3.Text, rr4.Text);
            };
            grid.Widgets.Add(rfAdd);
            // ArcOfFire
            TextBox af5 = new TextBox()
            {
                GridRow    = 13,
                GridColumn = 10,
                HintText   = "AngleRange",
                Width      = 100
            };

            grid.Widgets.Add(af5);
            var afAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 13,
                Text       = "Arc of Fire",
                Width      = 100,
            };

            afAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[8], rr1.Text, rr2.Text, rr3.Text, rr4.Text, af5.Text);
            };
            grid.Widgets.Add(afAdd);
            // ClockHand
            TextBox ch1 = new TextBox()
            {
                GridRow    = 15,
                GridColumn = 6,
                HintText   = "MovePeriod",
                Width      = 100
            };

            grid.Widgets.Add(ch1);
            TextBox ch2 = new TextBox()
            {
                GridRow    = 15,
                GridColumn = 7,
                HintText   = "BaseAngle",
                Width      = 100
            };

            grid.Widgets.Add(ch2);
            var chAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 15,
                Text       = "Clock Hand",
                Width      = 100,
            };

            chAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[10], ch1.Text, ch2.Text);
            };
            grid.Widgets.Add(chAdd);
            // Sword
            var swAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 16,
                Text       = "Sword",
                Width      = 100,
            };

            swAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[13], ch1.Text, ch2.Text);
            };
            grid.Widgets.Add(swAdd);
            // Pendulum
            TextBox pend1 = new TextBox()
            {
                GridRow    = 18,
                GridColumn = 6,
                HintText   = "MovePeriod",
                Width      = 100
            };

            grid.Widgets.Add(pend1);
            TextBox pend2 = new TextBox()
            {
                GridRow    = 18,
                GridColumn = 7,
                HintText   = "BaseAngle",
                Width      = 100
            };

            grid.Widgets.Add(pend2);
            TextBox pend3 = new TextBox()
            {
                GridRow    = 18,
                GridColumn = 8,
                HintText   = "AngleRange",
                Width      = 100
            };

            grid.Widgets.Add(pend3);
            TextBox pend4 = new TextBox()
            {
                GridRow    = 18,
                GridColumn = 9,
                HintText   = "BaseAnim",
                Width      = 100
            };

            grid.Widgets.Add(pend4);
            var pendAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 18,
                Text       = "Pendulum",
                Width      = 100,
            };

            pendAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[11], pend1.Text, pend2.Text, pend3.Text, pend4.Text);
            };
            grid.Widgets.Add(pendAdd);
            // Ghost
            TextBox gh1 = new TextBox()
            {
                GridRow    = 19,
                GridColumn = 6,
                HintText   = "Direction",
                Width      = 100
            };

            grid.Widgets.Add(gh1);
            TextBox gh2 = new TextBox()
            {
                GridRow    = 19,
                GridColumn = 7,
                HintText   = "MovePeriod",
                Width      = 100
            };

            grid.Widgets.Add(gh2);
            TextBox gh3 = new TextBox()
            {
                GridRow    = 19,
                GridColumn = 8,
                HintText   = "Distance",
                Width      = 100
            };

            grid.Widgets.Add(gh3);
            TextBox gh4 = new TextBox()
            {
                GridRow    = 19,
                GridColumn = 9,
                HintText   = "StartTime",
                Width      = 100
            };

            grid.Widgets.Add(gh4);
            TextBox gh5 = new TextBox()
            {
                GridRow    = 19,
                GridColumn = 10,
                HintText   = "WaitPeriod",
                Width      = 100
            };

            grid.Widgets.Add(gh5);
            var ghAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 19,
                Text       = "Ghost",
                Width      = 100,
            };

            ghAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[12], gh1.Text, gh2.Text, gh3.Text, gh4.Text, gh5.Text);
            };
            grid.Widgets.Add(ghAdd);
            // Gate
            TextBox g1 = new TextBox()
            {
                GridRow    = 20,
                GridColumn = 6,
                HintText   = "KeyID",
                Width      = 100
            };

            grid.Widgets.Add(g1);
            TextBox g2 = new TextBox()
            {
                GridRow    = 20,
                GridColumn = 7,
                HintText   = "Direction",
                Width      = 100
            };

            grid.Widgets.Add(g2);
            var gAdd = new TextButton
            {
                GridColumn = 11,
                GridRow    = 20,
                Text       = "Gate",
                Width      = 100,
            };

            gAdd.Click += (s, a) =>
            {
                addToMovingObjectsBox(id.Text, ParadisePhysicalMapLogic.ObjectsStr[15], g1.Text, g2.Text);
            };
            grid.Widgets.Add(gAdd);

            movingObjects.Text = _logic.GetPrettyText();

            // --- SUBMIT ---

            var buttonQuit = new TextButton
            {
                GridColumn = 1,
                GridRow    = 21,
                Text       = "Quit",
                Width      = 150,
            };

            buttonQuit.Click += (s, a) =>
            {
                saveChanges();
                _game.CloseSpecialItemMenu();
            };
            grid.Widgets.Add(buttonQuit);
            var buttonCancel = new TextButton
            {
                GridColumn = 2,
                GridRow    = 21,
                Text       = "Cancel",
                Width      = 150,
            };

            buttonCancel.Click += (s, a) =>
            {
                _game.CloseSpecialItemMenu();
            };
            grid.Widgets.Add(buttonCancel);

            panel.Widgets.Add(grid);
            _desktop      = new Desktop();
            _desktop.Root = panel;
        }