Beispiel #1
0
        /// <summary>
        /// Show the form as a dialog and update World.Default.You after closing
        /// </summary>
        public static void UpdateDefaultWorld()
        {
            using (var youChooser = new ActivePlayerForm())
            {
                youChooser.YouPlayer               = World.Default.You;
                youChooser.YourMarkerSettings      = World.Default.Map.MarkerManager.YourMarkerSettings;
                youChooser.YourTribeMarkerSettings = World.Default.Map.MarkerManager.YourTribeMarkerSettings;
                youChooser.You.SortOnText();
                var result = youChooser.ShowDialog();

                if (result == DialogResult.OK)
                {
                    World.Default.Map.MarkerManager.UpdateDefaultMarker(World.Default.Map, youChooser.YourMarkerSettings);
                    World.Default.Map.MarkerManager.UpdateDefaultMarker(World.Default.Map, youChooser.YourTribeMarkerSettings);

                    if (World.Default.You != youChooser.YouPlayer)
                    {
                        World.Default.You = youChooser.YouPlayer;
                        World.Default.Map.SetCenter(World.Default.You, false);
                        World.Default.Map.EventPublisher.SelectPlayer(youChooser, World.Default.You, VillageTools.PinPoint);
                        World.Default.Map.SaveHome();
                    }

                    World.Default.InvalidateMarkers();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Show the form as a dialog and update World.Default.You after closing
        /// </summary>
        public static void UpdateDefaultWorld()
        {
            using (var youChooser = new ActivePlayerForm())
            {
                youChooser.YouPlayer = World.Default.You;
                youChooser.YourMarkerSettings = World.Default.Map.MarkerManager.YourMarkerSettings;
                youChooser.YourTribeMarkerSettings = World.Default.Map.MarkerManager.YourTribeMarkerSettings;
                youChooser.You.SortOnText();
                var result = youChooser.ShowDialog();

                if (result == DialogResult.OK)
                {
                    World.Default.Map.MarkerManager.UpdateDefaultMarker(World.Default.Map, youChooser.YourMarkerSettings);
                    World.Default.Map.MarkerManager.UpdateDefaultMarker(World.Default.Map, youChooser.YourTribeMarkerSettings);

                    if (World.Default.You != youChooser.YouPlayer)
                    {
                        World.Default.You = youChooser.YouPlayer;
                        World.Default.Map.SetCenter(World.Default.You, false);
                        World.Default.Map.EventPublisher.SelectPlayer(youChooser, World.Default.You, VillageTools.PinPoint);
                        World.Default.Map.SaveHome();
                    }

                    World.Default.InvalidateMarkers();
                }
            }
        }
Beispiel #3
0
 public static void AskToSetSelf()
 {
     if (MessageBox.Show(
             FormRes.ActivePlayerForm_AskToSetSelf,
             FormRes.ActivePlayerForm_AskToSetSelf_Title,
             MessageBoxButtons.YesNo,
             MessageBoxIcon.Information) == DialogResult.Yes)
     {
         ActivePlayerForm.UpdateDefaultWorld();
     }
 }