Example #1
0
        public override void Begin()
        {
            Engine.MapLoaded = true;
            Logger.Log("Beginning map editor.");

            // Initialize room list window
            RoomListWindow = new WindowRoomList();
            ToolListWindow = new WindowToolList(BGAutotiler, FGAutotiler);

            List <string> roomNames = new List <string>();

            foreach (Room room in State.LoadedLevel.Rooms)
            {
                roomNames.Add(room.Name);
            }
            RoomListWindow.RoomNames = roomNames.ToArray();

            Engine.CreateWindow(RoomListWindow);
            Engine.CreateWindow(ToolListWindow);

            Engine.Instance.GraphicsDevice.SetRenderTarget(null);
            Engine.OnViewportUpdate += UpdateViewport;
            RoomListWindow.UpdateListHeight();
            ToolListWindow.UpdateListHeight();

            // Initialize shortcuts
            Shortcuts = new ShortcutManager();

            Shortcuts.RegisterShortcut(new Shortcut(Menubar.Open, Keys.LeftControl, Keys.O));
            Shortcuts.RegisterShortcut(new Shortcut(new Action(() => { Menubar.Save(); }), Keys.LeftControl, Keys.S));
            Shortcuts.RegisterShortcut(new Shortcut(Menubar.SaveAs, Keys.LeftControl, Keys.LeftShift, Keys.S));
            Shortcuts.RegisterShortcut(new Shortcut(State.Redo, Keys.LeftControl, Keys.LeftShift, Keys.Z));
            Shortcuts.RegisterShortcut(new Shortcut(State.Undo, Keys.LeftControl, Keys.Z));
        }
Example #2
0
 public void UpdateViewport()
 {
     RoomListWindow.UpdateListHeight();
     ToolListWindow.UpdateListHeight();
 }