public MainForm() { InitializeComponent(); // Load global settings this.mGlobalSettings = new GlobalSettings(); this.mLocalSettings = LocalSettings.GetInstance(); // Restore the size Size = mLocalSettings.m_size; if ((Size.Height < 100) || (Size.Width < 200)) { Size lsize = new Size(); lsize.Height = 500; lsize.Width = 800; this.Size = lsize; } //register the viewer manager classes //qq there must be a better way of doing this, it seems a bit // odd. Could use reflection. Might be a little slow or have // unexpected side-effects. It's nice to be able to control // the order the tabs appear in, too. ViewTabActions.Tag = ActionsViewer.InitialiseViewer(this); ViewTabXML.Tag = XMLViewer.InitialiseViewer(this); ViewTabFlat.Tag = FlatViewer.InitialiseViewer(this); ViewTabImg.Tag = ImageViewer.InitialiseViewer(this); ViewTabBump.Tag = BumpViewer.InitialiseViewer(this); ViewTabSteering.Tag = SteeringViewer.InitialiseViewer(this); ViewTabCamera.Tag = CameraViewer.InitialiseViewer(this); ViewTabGrid.Tag = GridViewer.InitialiseViewer(this); ViewTab3D.Tag = ThreeDeeViewer.InitialiseViewer(this); ViewTabVRAM.Tag = VRAMViewer.InitialiseViewer(this); ViewTab3dEditor.Tag = ThreeDeeEditor.InitialiseViewer(this); ViewTabHistory.Tag = HistoryViewer.InitialiseViewer(this); //auto-load last level if (mLocalSettings.LastOpenedFile != null) { LoadInternal(mLocalSettings.LastOpenedType, mLocalSettings.LastOpenedFile); } }
public override void Initialize() { base.Initialize(); GameProcess.OnTurned += UpdateActions; GameProcess.OnTurned += LookAtPlayer; OpenBagImpact.OnBagOpened += OnBagOpened; DialogImpact.OnDialogOpened += OnDialogOpened; Location.Current.OnChange += UpdateMap; Location.Current.OnChange += UpdateActions; Location.Current.OnChange += LookAtPlayer; spriteBatch = new SpriteBatch(GraphicsDevice); var viewportAdapter = new BoxingViewportAdapter(Game.Window, GraphicsDevice, 1280, 1024); camera = new OrthographicCamera(viewportAdapter); LookAtPlayer(); mapRenderer = new TiledMapRenderer(GraphicsDevice); UpdateMap(); InputListeners.Keyboard.KeyReleased += KeyRelease; Game.UiSystem.Add("GameLog", new GameLogViewer()); movements = new MovementTiles(camera); abilities = new AbilitiesHotPanel(Anchor.BottomRight); Game.UiSystem.Add("Abilities", abilities); effects = new EffectsViewer(GameProcess.Player, Anchor.TopLeft, 1f, .1f); GameProcess.OnTurned += effects.Update; Game.UiSystem.Add("Effects", effects); actions = new ActionsViewer(); Game.UiSystem.Add("Actions", actions); UpdateActions(); }