Feature #1086 ยป 0076-Turn-production_class_type-to-genenum.patch
| client/gui-gtk-3.22/cityrep.c | ||
|---|---|---|
|
if (NULL != pcity
|
||
|
&& ((which == PCT_UNIT && VUT_UTYPE == pcity->production.kind)
|
||
|
|| (which == PCT_NORMAL_IMPROVEMENT
|
||
|
|| (which == PCT_IMPROVEMENT
|
||
|
&& VUT_IMPROVEMENT == pcity->production.kind
|
||
|
&& !is_wonder(pcity->production.value.building))
|
||
|
|| (which == PCT_WONDER
|
||
| ... | ... | |
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
||
|
g_signal_connect(item, "activate",
|
||
|
G_CALLBACK(city_select_building_callback),
|
||
|
GINT_TO_POINTER(PCT_NORMAL_IMPROVEMENT));
|
||
|
GINT_TO_POINTER(PCT_IMPROVEMENT));
|
||
|
item = gtk_menu_item_new_with_label(_("Building Wonders"));
|
||
|
gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
|
||
| client/gui-gtk-4.0/cityrep.c | ||
|---|---|---|
|
if (NULL != pcity
|
||
|
&& ((which == PCT_UNIT && VUT_UTYPE == pcity->production.kind)
|
||
|
|| (which == PCT_NORMAL_IMPROVEMENT
|
||
|
|| (which == PCT_IMPROVEMENT
|
||
|
&& VUT_IMPROVEMENT == pcity->production.kind
|
||
|
&& !is_wonder(pcity->production.value.building))
|
||
|
|| (which == PCT_WONDER
|
||
| ... | ... | |
|
act = g_simple_action_new("select_build_impr", NULL);
|
||
|
g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
|
||
|
g_signal_connect(act, "activate", G_CALLBACK(city_select_building_callback),
|
||
|
GINT_TO_POINTER(PCT_NORMAL_IMPROVEMENT));
|
||
|
GINT_TO_POINTER(PCT_IMPROVEMENT));
|
||
|
menu_item_append_unref(select_menu, g_menu_item_new(_("Building Improvements"),
|
||
|
"win.select_build_impr"));
|
||
| client/gui-gtk-5.0/cityrep.c | ||
|---|---|---|
|
if (NULL != pcity
|
||
|
&& ((which == PCT_UNIT && VUT_UTYPE == pcity->production.kind)
|
||
|
|| (which == PCT_NORMAL_IMPROVEMENT
|
||
|
|| (which == PCT_IMPROVEMENT
|
||
|
&& VUT_IMPROVEMENT == pcity->production.kind
|
||
|
&& !is_wonder(pcity->production.value.building))
|
||
|
|| (which == PCT_WONDER
|
||
| ... | ... | |
|
act = g_simple_action_new("select_build_impr", NULL);
|
||
|
g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
|
||
|
g_signal_connect(act, "activate", G_CALLBACK(city_select_building_callback),
|
||
|
GINT_TO_POINTER(PCT_NORMAL_IMPROVEMENT));
|
||
|
GINT_TO_POINTER(PCT_IMPROVEMENT));
|
||
|
menu_item_append_unref(select_menu, g_menu_item_new(_("Building Improvements"),
|
||
|
"win.select_build_impr"));
|
||
| common/city.c | ||
|---|---|---|
|
if (is_wonder(pcity->changed_from.value.building)) {
|
||
|
orig_class = PCT_WONDER;
|
||
|
} else {
|
||
|
orig_class = PCT_NORMAL_IMPROVEMENT;
|
||
|
orig_class = PCT_IMPROVEMENT;
|
||
|
}
|
||
|
break;
|
||
|
case VUT_UTYPE:
|
||
| ... | ... | |
|
if (is_wonder(target->value.building)) {
|
||
|
new_class = PCT_WONDER;
|
||
|
} else {
|
||
|
new_class = PCT_NORMAL_IMPROVEMENT;
|
||
|
new_class = PCT_IMPROVEMENT;
|
||
|
}
|
||
|
break;
|
||
|
case VUT_UTYPE:
|
||
| common/city.h | ||
|---|---|---|
|
struct vision;
|
||
|
struct packet_city_rally_point;
|
||
|
enum production_class_type {
|
||
|
PCT_UNIT,
|
||
|
PCT_NORMAL_IMPROVEMENT,
|
||
|
PCT_WONDER,
|
||
|
PCT_LAST
|
||
|
};
|
||
|
#include "city_enums_gen.h"
|
||
|
#define PCT_LAST PCT_COUNT
|
||
|
/* Various city options. These are stored by the server and can be
|
||
|
* toggled by the user. Each one defaults to off. Adding new ones
|
||
| gen_headers/enums/Makefile.am | ||
|---|---|---|
|
ENUMS_GEN = \
|
||
|
actions_enums_gen.h \
|
||
|
city_enums_gen.h \
|
||
|
effects_enums_gen.h \
|
||
|
fc_types_enums_gen.h \
|
||
|
manual_enums_gen.h \
|
||
| ... | ... | |
|
EXTRA_DIST = \
|
||
|
actions_enums.def \
|
||
|
city_enums.def \
|
||
|
effects_enums.def \
|
||
|
fc_types_enums.def \
|
||
|
manual_enums.def \
|
||
| gen_headers/enums/city_enums.def | ||
|---|---|---|
|
enum production_class_type
|
||
|
prefix PCT_
|
||
|
count
|
||
|
values
|
||
|
UNIT "Unit"
|
||
|
IMPROVEMENT "Improvement"
|
||
|
WONDER "Wonder"
|
||
|
end
|
||
| meson.build | ||
|---|---|---|
|
enum_defs = {
|
||
|
'common': {
|
||
|
'actions_enums': ['actions_enums.def', 'actions_enums_gen.h'],
|
||
|
'city_enums': ['city_enums.def', 'city_enums_gen.h'],
|
||
|
'effects_enums': ['effects_enums.def', 'effects_enums_gen.h'],
|
||
|
'fc_types_enums': ['fc_types_enums.def', 'fc_types_enums_gen.h'],
|
||
|
'terrain_enums': ['terrain_enums.def', 'terrain_enums_gen.h'],
|
||