From 9ecb7a352ccf1ff67f70e31b50ccdf39bcbc1983 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 27 Aug 2022 10:10:13 +0300
Subject: [PATCH 40/40] Open editor gui immediately when entering edit mode

See osdn #45456

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/packhand.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/client/packhand.c b/client/packhand.c
index c7bc531e59..9f4ca6e371 100644
--- a/client/packhand.c
+++ b/client/packhand.c
@@ -2221,6 +2221,7 @@ void handle_game_info(const struct packet_game_info *pinfo)
 {
   bool boot_help;
   bool update_aifill_button = FALSE, update_ai_skill_level = FALSE;
+  bool enable_edit_ui = FALSE;
 
   if (game.info.aifill != pinfo->aifill) {
     update_aifill_button = TRUE;
@@ -2234,8 +2235,10 @@ void handle_game_info(const struct packet_game_info *pinfo)
     /* Clears the current goto command. */
     clear_hover_state();
 
-    if (pinfo->is_edit_mode && game.scenario.handmade) {
-      if (!handmade_scenario_warning()) {
+    if (pinfo->is_edit_mode) {
+      enable_edit_ui = TRUE;
+
+      if (game.scenario.handmade && !handmade_scenario_warning()) {
         /* Gui didn't handle this */
         output_window_append(ftc_client,
                              _("This scenario may have manually set properties the editor "
@@ -2280,6 +2283,10 @@ void handle_game_info(const struct packet_game_info *pinfo)
     update_info_label();
   }
 
+  if (enable_edit_ui) {
+    editgui_refresh();
+  }
+
   editgui_notify_object_changed(OBJTYPE_GAME, 1, FALSE);
 }
 
-- 
2.35.1