Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #851696 ยป 0001-GTK-clients-deduplicate-actor-and-target-storage.patch

Sveinung Kvilhaugsvik, 2019-12-09 10:10 PM

View differences:

client/gui-gtk-3.0/action_dialog.c
static GtkWidget *act_sel_dialog;
static int action_button_map[BUTTON_COUNT];
static int actor_unit_id;
static int target_ids[ATK_COUNT];
static int target_extra_id;
static bool is_more_user_input_needed = FALSE;
static bool did_not_decide = FALSE;
static bool action_selection_restart = FALSE;
......
struct unit *actor_unit;
if ((actor_unit = game_unit_by_number(actor_unit_id))) {
if ((actor_unit = game_unit_by_number(
act_sel_dialog_data->actor_unit_id))) {
/* The action selection dialog wasn't closed because the actor unit
* was lost. */
......
action_selection_restart = FALSE;
} else {
/* The action selection process is over, at least for now. */
action_selection_no_longer_in_progress(actor_unit_id);
action_selection_no_longer_in_progress(
act_sel_dialog_data->actor_unit_id);
}
if (did_not_decide) {
......
did_not_decide = FALSE;
} else {
/* An action, or no action at all, was selected. */
action_decision_clear_want(actor_unit_id);
action_selection_next_in_focus(actor_unit_id);
action_decision_clear_want(act_sel_dialog_data->actor_unit_id);
action_selection_next_in_focus(act_sel_dialog_data->actor_unit_id);
}
}
}
......
actor_homecity = game_city_by_number(actor_unit->homecity);
actor_unit_id = actor_unit->id;
target_ids[ATK_SELF] = actor_unit_id;
target_ids[ATK_CITY] = target_city ?
target_city->id :
IDENTITY_NUMBER_ZERO;
target_ids[ATK_UNIT] = target_unit ?
target_unit->id :
IDENTITY_NUMBER_ZERO;
target_ids[ATK_UNITS] = target_tile ?
tile_index(target_tile) :
TILE_INDEX_NONE;
target_ids[ATK_TILE] = target_tile ?
tile_index(target_tile) :
TILE_INDEX_NONE;
target_extra_id = target_extra ?
extra_number(target_extra) :
EXTRA_NONE;
astr_set(&title,
/* TRANS: %s is a unit name, e.g., Spy */
_("Choose Your %s's Strategy"),
......
if (act_sel_dialog == NULL) {
return IDENTITY_NUMBER_ZERO;
}
return actor_unit_id;
return act_sel_dialog_data->actor_unit_id;
}
/**********************************************************************//**
......
if (act_sel_dialog == NULL) {
return IDENTITY_NUMBER_ZERO;
}
return target_ids[ATK_CITY];
return act_sel_dialog_data->target_city_id;
}
/**********************************************************************//**
......
return IDENTITY_NUMBER_ZERO;
}
return target_ids[ATK_UNIT];
return act_sel_dialog_data->target_unit_id;
}
/**********************************************************************//**
......
return TILE_INDEX_NONE;
}
return target_ids[ATK_TILE];
return act_sel_dialog_data->target_tile_id;
}
/**********************************************************************//**
......
return EXTRA_NONE;
}
return target_extra_id;
return act_sel_dialog_data->target_extra_id;
}
/**********************************************************************//**
client/gui-gtk-3.22/action_dialog.c
static GtkWidget *act_sel_dialog;
static int action_button_map[BUTTON_COUNT];
static int actor_unit_id;
static int target_ids[ATK_COUNT];
static int target_extra_id;
static bool is_more_user_input_needed = FALSE;
static bool did_not_decide = FALSE;
static bool action_selection_restart = FALSE;
......
struct unit *actor_unit;
if ((actor_unit = game_unit_by_number(actor_unit_id))) {
if ((actor_unit = game_unit_by_number(
act_sel_dialog_data->actor_unit_id))) {
/* The action selection dialog wasn't closed because the actor unit
* was lost. */
......
action_selection_restart = FALSE;
} else {
/* The action selection process is over, at least for now. */
action_selection_no_longer_in_progress(actor_unit_id);
action_selection_no_longer_in_progress(
act_sel_dialog_data->actor_unit_id);
}
if (did_not_decide) {
......
did_not_decide = FALSE;
} else {
/* An action, or no action at all, was selected. */
action_decision_clear_want(actor_unit_id);
action_selection_next_in_focus(actor_unit_id);
action_decision_clear_want(act_sel_dialog_data->actor_unit_id);
action_selection_next_in_focus(act_sel_dialog_data->actor_unit_id);
}
}
}
......
actor_homecity = game_city_by_number(actor_unit->homecity);
actor_unit_id = actor_unit->id;
target_ids[ATK_SELF] = actor_unit_id;
target_ids[ATK_CITY] = target_city ?
target_city->id :
IDENTITY_NUMBER_ZERO;
target_ids[ATK_UNIT] = target_unit ?
target_unit->id :
IDENTITY_NUMBER_ZERO;
target_ids[ATK_UNITS] = target_tile ?
tile_index(target_tile) :
TILE_INDEX_NONE;
target_ids[ATK_TILE] = target_tile ?
tile_index(target_tile) :
TILE_INDEX_NONE;
target_extra_id = target_extra ?
extra_number(target_extra) :
EXTRA_NONE;
astr_set(&title,
/* TRANS: %s is a unit name, e.g., Spy */
_("Choose Your %s's Strategy"),
......
if (act_sel_dialog == NULL) {
return IDENTITY_NUMBER_ZERO;
}
return actor_unit_id;
return act_sel_dialog_data->actor_unit_id;
}
/**********************************************************************//**
......
if (act_sel_dialog == NULL) {
return IDENTITY_NUMBER_ZERO;
}
return target_ids[ATK_CITY];
return act_sel_dialog_data->target_city_id;
}
/**********************************************************************//**
......
return IDENTITY_NUMBER_ZERO;
}
return target_ids[ATK_UNIT];
return act_sel_dialog_data->target_unit_id;
}
/**********************************************************************//**
......
return TILE_INDEX_NONE;
}
return target_ids[ATK_TILE];
return act_sel_dialog_data->target_tile_id;
}
/**********************************************************************//**
......
return EXTRA_NONE;
}
return target_extra_id;
return act_sel_dialog_data->target_extra_id;
}
/**********************************************************************//**
client/gui-gtk-4.0/action_dialog.c
static GtkWidget *act_sel_dialog;
static int action_button_map[BUTTON_COUNT];
static int actor_unit_id;
static int target_ids[ATK_COUNT];
static int target_extra_id;
static bool is_more_user_input_needed = FALSE;
static bool did_not_decide = FALSE;
static bool action_selection_restart = FALSE;
......
struct unit *actor_unit;
if ((actor_unit = game_unit_by_number(actor_unit_id))) {
if ((actor_unit = game_unit_by_number(
act_sel_dialog_data->actor_unit_id))) {
/* The action selection dialog wasn't closed because the actor unit
* was lost. */
......
action_selection_restart = FALSE;
} else {
/* The action selection process is over, at least for now. */
action_selection_no_longer_in_progress(actor_unit_id);
action_selection_no_longer_in_progress(
act_sel_dialog_data->actor_unit_id);
}
if (did_not_decide) {
......
did_not_decide = FALSE;
} else {
/* An action, or no action at all, was selected. */
action_decision_clear_want(actor_unit_id);
action_selection_next_in_focus(actor_unit_id);
action_decision_clear_want(act_sel_dialog_data->actor_unit_id);
action_selection_next_in_focus(act_sel_dialog_data->actor_unit_id);
}
}
}
......
actor_homecity = game_city_by_number(actor_unit->homecity);
actor_unit_id = actor_unit->id;
target_ids[ATK_SELF] = actor_unit_id;
target_ids[ATK_CITY] = target_city ?
target_city->id :
IDENTITY_NUMBER_ZERO;
target_ids[ATK_UNIT] = target_unit ?
target_unit->id :
IDENTITY_NUMBER_ZERO;
target_ids[ATK_UNITS] = target_tile ?
tile_index(target_tile) :
TILE_INDEX_NONE;
target_ids[ATK_TILE] = target_tile ?
tile_index(target_tile) :
TILE_INDEX_NONE;
target_extra_id = target_extra ?
extra_number(target_extra) :
EXTRA_NONE;
astr_set(&title,
/* TRANS: %s is a unit name, e.g., Spy */
_("Choose Your %s's Strategy"),
......
if (act_sel_dialog == NULL) {
return IDENTITY_NUMBER_ZERO;
}
return actor_unit_id;
return act_sel_dialog_data->actor_unit_id;
}
/**********************************************************************//**
......
if (act_sel_dialog == NULL) {
return IDENTITY_NUMBER_ZERO;
}
return target_ids[ATK_CITY];
return act_sel_dialog_data->target_city_id;
}
/**********************************************************************//**
......
return IDENTITY_NUMBER_ZERO;
}
return target_ids[ATK_UNIT];
return act_sel_dialog_data->target_unit_id;
}
/**********************************************************************//**
......
return TILE_INDEX_NONE;
}
return target_ids[ATK_TILE];
return act_sel_dialog_data->target_tile_id;
}
/**********************************************************************//**
......
return EXTRA_NONE;
}
return target_extra_id;
return act_sel_dialog_data->target_extra_id;
}
/**********************************************************************//**
    (1-1/1)