/// <summary> /// Loading the world data, initializing the map /// </summary> private void FormMain_Load(object sender, EventArgs e) { Text = string.Format("TW Tactics v{0} - " + FormRes.MainForm_Title_By + " Sangu", AboutForm.ProgramVersion); #if DEBUG ToolStripDraw.Visible = true; ToolStripProgramSettings.Visible = true; this.Text += " - DEBUG"; #endif LeftNavigation_Location.Text = FormRes.MainForm_LeftNavigationLocation; LeftNavigation_QuickFind.Text = FormRes.MainForm_LeftNavigation_QuickFind; LeftNavigation_Markers.Text = FormRes.MainForm_LeftNavigation_MapMarkers; LeftNavigation_Distance.Text = FormRes.MainForm_LeftNavigation_PlanAttacks; World.Default.InitializeMaps(Map, MiniMap); World.Default.EventPublisher.Loaded += OnWorldLoaded; World.Default.EventPublisher.SettingsLoaded += OnWorldSettingsLoaded; World.Default.Map.EventPublisher.ManipulatorChanged += EventPublisher_ManipulatorChanged; World.Default.Map.EventPublisher.PolygonActivated += EventPublisher_PolygonActivated; World.Default.Map.EventPublisher.LocationChanged += EventPublisher_LocationChanged; World.Default.EventPublisher.Browse += EventPublisher_Browse; World.Default.Map.EventPublisher.VillagesSelected += EventPublisher_VillagesSelected; World.Default.Map.EventPublisher.PlayerSelected += EventPublisher_VillagesSelected; World.Default.Map.EventPublisher.TribeSelected += EventPublisher_VillagesSelected; // Auto load world string lastWorld = Properties.Settings.Default.LastWorld; string lastSettings = Properties.Settings.Default.LastSettings; if (!World.Default.LoadWorld(lastWorld, lastSettings)) { if (Directory.GetDirectories(World.InternalStructure.WorldDataDirectory).Length > 0) { // Load an existing world using (var loadForm = new LoadWorldForm()) { loadForm.ShowDialog(); } } else { // Here begins the wizard for creating a new world... using (var createForm = new NewWorldForm()) { createForm.ShowDialog(); } } } // If user has big enough screen, show the 4 Outlook pane buttons if (LeftNavigation.Height > 400) { LeftNavigation.VisibleButtonCount = 4; } Polygon.Initialize(); ToolStripDefaultManipulator.CheckState = CheckState.Checked; }
private void ToolStripOpen_Click(object sender, EventArgs e) { World.Default.SaveSettings(); using (var frm = new LoadWorldForm()) { frm.ShowDialog(); } }
private void MenuFileLoadWorld_Click(object sender, EventArgs e) { World.Default.SaveSettings(); var frm = new LoadWorldForm(); frm.ShowDialog(); }
/// <summary> /// Loading the world data, initializing the map /// </summary> private void FormMain_Load(object sender, EventArgs e) { Text = string.Format("TW Tactics v{0} - by Sangu", AboutForm.ProgramVersion); #if DEBUG ToolStripDraw.Visible = true; ToolStripProgramSettings.Visible = true; this.Text += " - DEBUG"; #endif World.Default.InitializeMaps(Map, MiniMap); World.Default.EventPublisher.Loaded += OnWorldLoaded; World.Default.EventPublisher.SettingsLoaded += OnWorldSettingsLoaded; World.Default.Map.EventPublisher.ManipulatorChanged += EventPublisher_ManipulatorChanged; World.Default.Map.EventPublisher.PolygonActivated += EventPublisher_PolygonActivated; World.Default.Map.EventPublisher.LocationChanged += EventPublisher_LocationChanged; World.Default.EventPublisher.Browse += EventPublisher_Browse; World.Default.Map.EventPublisher.VillagesSelected += EventPublisher_VillagesSelected; World.Default.Map.EventPublisher.PlayerSelected += EventPublisher_VillagesSelected; World.Default.Map.EventPublisher.TribeSelected += EventPublisher_VillagesSelected; // Auto load world string lastWorld = Properties.Settings.Default.LastWorld; string lastSettings = Properties.Settings.Default.LastSettings; if (!World.Default.LoadWorld(lastWorld, lastSettings)) { if (Directory.GetDirectories(World.InternalStructure.WorldDataDirectory).Length > 0) { // Load an existing world using (var loadForm = new LoadWorldForm()) { loadForm.ShowDialog(); } } else { // Here begins the wizard for creating a new world... using (var createForm = new NewWorldForm()) { createForm.ShowDialog(); } } } // If user has big enough screen, show the 4 Outlook pane buttons if (LeftNavigation.Height > 400) { LeftNavigation.VisibleButtonCount = 4; } Polygon.Initialize(); ToolStripDefaultManipulator.CheckState = CheckState.Checked; }