Example #1
0
        private void HaEditor_Load(object sender, EventArgs e)
        {
            // This has to be here and not in .ctor for some reason, otherwise subwindows are not locating properly
            tilePanel = new TilePanel(hcsm)
            {
                Enabled = false
            };
            objPanel = new ObjPanel(hcsm)
            {
                Enabled = false
            };
            lifePanel = new LifePanel(hcsm)
            {
                Enabled = false
            };
            portalPanel = new PortalPanel(hcsm)
            {
                Enabled = false
            };
            bgPanel = new BackgroundPanel(hcsm)
            {
                Enabled = false
            };
            commonPanel = new CommonPanel(hcsm)
            {
                Enabled = false
            };

            List <DockContent> dockContents = new List <DockContent> {
                tilePanel, objPanel, lifePanel, portalPanel, bgPanel, commonPanel
            };

            dockContents.ForEach(x => x.Show(dockPanel));
            dockContents.ForEach(x => x.DockState = DockState.DockRight);
            dockContents.ForEach(x => x.DockAreas = DockAreas.DockRight);
            commonPanel.Pane = bgPanel.Pane = portalPanel.Pane = lifePanel.Pane = objPanel.Pane = tilePanel.Pane;

            if (!hcsm.backupMan.AttemptRestore())
            {
                hcsm.LoadMap(new Load(multiBoard, tabs, hcsm.MakeRightClickHandler()));
            }
        }
Example #2
0
        private void HaEditor2_Loaded(object sender, RoutedEventArgs e)
        {
            // helper classes
            handler              = new InputHandler(multiBoard);
            hcsm                 = new HaCreatorStateManager(multiBoard, ribbon, tabControl1, handler, textblock_CursorX, textblock_CursorY, textblock_RCursorX, textblock_RCursorY, textblock_selectedItem);
            hcsm.CloseRequested += Hcsm_CloseRequested;
            hcsm.FirstMapLoaded += Hcsm_FirstMapLoaded;

            tilePanel.Initialize(hcsm);
            objPanel.Initialize(hcsm);
            lifePanel.Initialize(hcsm);
            portalPanel.Initialize(hcsm);
            bgPanel.Initialize(hcsm);
            commonPanel.Initialize(hcsm);

            if (!hcsm.backupMan.AttemptRestore())
            {
                hcsm.LoadMap(new Load(multiBoard, tabControl1, hcsm.MakeRightClickHandler()));
            }
        }