From e98c70c3e53223a132118e29a888e8cc239b06f5 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Wed, 28 Apr 2021 20:32:00 +0200 Subject: [PATCH 2/2] Show a (cultivate|plant|transform)_time of 0. A cultivate_time, plant_time or transform_time of 0 isn't illegal. Show those values in the in game help. See osdn #42105 --- client/gui-gtk-3.0/helpdlg.c | 3 --- client/gui-gtk-3.22/helpdlg.c | 3 --- client/gui-gtk-4.0/helpdlg.c | 3 --- client/gui-qt/helpdlg.cpp | 3 --- 4 files changed, 12 deletions(-) diff --git a/client/gui-gtk-3.0/helpdlg.c b/client/gui-gtk-3.0/helpdlg.c index 48d24d93c6..741df8628e 100644 --- a/client/gui-gtk-3.0/helpdlg.c +++ b/client/gui-gtk-3.0/helpdlg.c @@ -1249,7 +1249,6 @@ static void help_update_terrain(const struct help_item *pitem, gtk_container_foreach(GTK_CONTAINER(help_vbox), (GtkCallback)gtk_widget_destroy, NULL); if (pterrain->cultivate_result != T_NONE - && pterrain->cultivate_time != 0 && action_id_univs_not_blocking(ACTION_CULTIVATE, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), @@ -1261,7 +1260,6 @@ static void help_update_terrain(const struct help_item *pitem, } if (pterrain->plant_result != T_NONE - && pterrain->plant_time != 0 && action_id_univs_not_blocking(ACTION_PLANT, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), PL_("%d turn", "%d turns", pterrain->plant_time), @@ -1272,7 +1270,6 @@ static void help_update_terrain(const struct help_item *pitem, } if (pterrain->transform_result != T_NONE - && pterrain->transform_time != 0 && action_id_univs_not_blocking(ACTION_TRANSFORM_TERRAIN, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), diff --git a/client/gui-gtk-3.22/helpdlg.c b/client/gui-gtk-3.22/helpdlg.c index f2b214f5e2..9a91465ebf 100644 --- a/client/gui-gtk-3.22/helpdlg.c +++ b/client/gui-gtk-3.22/helpdlg.c @@ -1249,7 +1249,6 @@ static void help_update_terrain(const struct help_item *pitem, gtk_container_foreach(GTK_CONTAINER(help_vbox), (GtkCallback)gtk_widget_destroy, NULL); if (pterrain->cultivate_result != T_NONE - && pterrain->cultivate_time != 0 && action_id_univs_not_blocking(ACTION_CULTIVATE, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), @@ -1261,7 +1260,6 @@ static void help_update_terrain(const struct help_item *pitem, } if (pterrain->plant_result != T_NONE - && pterrain->plant_time != 0 && action_id_univs_not_blocking(ACTION_PLANT, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), PL_("%d turn", "%d turns", pterrain->plant_time), @@ -1272,7 +1270,6 @@ static void help_update_terrain(const struct help_item *pitem, } if (pterrain->transform_result != T_NONE - && pterrain->transform_time != 0 && action_id_univs_not_blocking(ACTION_TRANSFORM_TERRAIN, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), diff --git a/client/gui-gtk-4.0/helpdlg.c b/client/gui-gtk-4.0/helpdlg.c index 0eeeb7dfc7..df675f27fd 100644 --- a/client/gui-gtk-4.0/helpdlg.c +++ b/client/gui-gtk-4.0/helpdlg.c @@ -1256,7 +1256,6 @@ static void help_update_terrain(const struct help_item *pitem, gtk_container_foreach(GTK_CONTAINER(help_vbox), (GtkCallback)gtk_widget_destroy, NULL); if (pterrain->cultivate_result != T_NONE - && pterrain->cultivate_time != 0 && action_id_univs_not_blocking(ACTION_CULTIVATE, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), @@ -1268,7 +1267,6 @@ static void help_update_terrain(const struct help_item *pitem, } if (pterrain->plant_result != T_NONE - && pterrain->plant_time != 0 && action_id_univs_not_blocking(ACTION_PLANT, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), PL_("%d turn", "%d turns", pterrain->plant_time), @@ -1279,7 +1277,6 @@ static void help_update_terrain(const struct help_item *pitem, } if (pterrain->transform_result != T_NONE - && pterrain->transform_time != 0 && action_id_univs_not_blocking(ACTION_TRANSFORM_TERRAIN, NULL, &for_terr)) { fc_snprintf(buf, sizeof(buf), diff --git a/client/gui-qt/helpdlg.cpp b/client/gui-qt/helpdlg.cpp index 2a81cd77b3..437f633523 100644 --- a/client/gui-qt/helpdlg.cpp +++ b/client/gui-qt/helpdlg.cpp @@ -1317,7 +1317,6 @@ void help_widget::set_topic_terrain(const help_item *topic, add_info_separator(); if (pterrain->cultivate_result != T_NONE - && pterrain->cultivate_time != 0 && action_id_univs_not_blocking(ACTION_CULTIVATE, NULL, &for_terr)) { QLabel *tb; @@ -1342,7 +1341,6 @@ void help_widget::set_topic_terrain(const help_item *topic, } if (pterrain->plant_result != T_NONE - && pterrain->plant_time != 0 && action_id_univs_not_blocking(ACTION_PLANT, NULL, &for_terr)) { QLabel *tb; char plant_buffer[1024]; @@ -1366,7 +1364,6 @@ void help_widget::set_topic_terrain(const help_item *topic, } if (pterrain->transform_result != T_NONE - && pterrain->transform_time != 0 && action_id_univs_not_blocking(ACTION_TRANSFORM_TERRAIN, NULL, &for_terr)) { QLabel *tb; -- 2.30.2