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 #862482 ยป 0001-clients-targeted-no-longer-hides-untargeted.patch

Sveinung Kvilhaugsvik, 2020-02-29 11:23 PM

View differences:

client/gui-gtk-3.0/action_dialog.c
}
}
/**********************************************************************//**
Get the targeted version of an action so it, if enabled, can hide the
non targeted action in the action selection dialog.
**************************************************************************/
static action_id get_targeted_action_id(action_id non_tgt_action_id)
{
/* Don't add an action mapping here unless the non targeted version is
* selectable in the targeted version's target selection dialog. */
switch ((enum gen_action)non_tgt_action_id) {
case ACTION_SPY_SABOTAGE_CITY:
return ACTION_SPY_TARGETED_SABOTAGE_CITY;
case ACTION_SPY_SABOTAGE_CITY_ESC:
return ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC;
case ACTION_SPY_STEAL_TECH:
return ACTION_SPY_TARGETED_STEAL_TECH;
case ACTION_SPY_STEAL_TECH_ESC:
return ACTION_SPY_TARGETED_STEAL_TECH_ESC;
default:
/* No targeted version found. */
return ACTION_NONE;
}
}
/**********************************************************************//**
User selected an action from the choice dialog and the action has no
special needs.
......
const gchar *tooltip;
GCallback cb;
if (get_targeted_action_id(act_id) != ACTION_NONE
&& action_prob_possible(act_probs[
get_targeted_action_id(act_id)])) {
/* The player can select the untargeted version from the target
* selection dialog. */
return;
}
if (af_map[act_id] == NULL) {
/* No special call back function needed for this action. */
cb = (GCallback)simple_action_callback;
client/gui-gtk-3.22/action_dialog.c
}
}
/**********************************************************************//**
Get the targeted version of an action so it, if enabled, can hide the
non targeted action in the action selection dialog.
**************************************************************************/
static action_id get_targeted_action_id(action_id non_tgt_action_id)
{
/* Don't add an action mapping here unless the non targeted version is
* selectable in the targeted version's target selection dialog. */
switch ((enum gen_action)non_tgt_action_id) {
case ACTION_SPY_SABOTAGE_CITY:
return ACTION_SPY_TARGETED_SABOTAGE_CITY;
case ACTION_SPY_SABOTAGE_CITY_ESC:
return ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC;
case ACTION_SPY_STEAL_TECH:
return ACTION_SPY_TARGETED_STEAL_TECH;
case ACTION_SPY_STEAL_TECH_ESC:
return ACTION_SPY_TARGETED_STEAL_TECH_ESC;
default:
/* No targeted version found. */
return ACTION_NONE;
}
}
/**********************************************************************//**
User selected an action from the choice dialog and the action has no
special needs.
......
const gchar *tooltip;
GCallback cb;
if (get_targeted_action_id(act_id) != ACTION_NONE
&& action_prob_possible(act_probs[
get_targeted_action_id(act_id)])) {
/* The player can select the untargeted version from the target
* selection dialog. */
return;
}
if (af_map[act_id] == NULL) {
/* No special call back function needed for this action. */
cb = (GCallback)simple_action_callback;
client/gui-gtk-4.0/action_dialog.c
}
}
/**********************************************************************//**
Get the targeted version of an action so it, if enabled, can hide the
non targeted action in the action selection dialog.
**************************************************************************/
static action_id get_targeted_action_id(action_id non_tgt_action_id)
{
/* Don't add an action mapping here unless the non targeted version is
* selectable in the targeted version's target selection dialog. */
switch ((enum gen_action)non_tgt_action_id) {
case ACTION_SPY_SABOTAGE_CITY:
return ACTION_SPY_TARGETED_SABOTAGE_CITY;
case ACTION_SPY_SABOTAGE_CITY_ESC:
return ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC;
case ACTION_SPY_STEAL_TECH:
return ACTION_SPY_TARGETED_STEAL_TECH;
case ACTION_SPY_STEAL_TECH_ESC:
return ACTION_SPY_TARGETED_STEAL_TECH_ESC;
default:
/* No targeted version found. */
return ACTION_NONE;
}
}
/**********************************************************************//**
User selected an action from the choice dialog and the action has no
special needs.
......
const gchar *tooltip;
GCallback cb;
if (get_targeted_action_id(act_id) != ACTION_NONE
&& action_prob_possible(act_probs[
get_targeted_action_id(act_id)])) {
/* The player can select the untargeted version from the target
* selection dialog. */
return;
}
if (af_map[act_id] == NULL) {
/* No special call back function needed for this action. */
cb = (GCallback)simple_action_callback;
client/gui-qt/dialogs.cpp
}
}
/***********************************************************************//**
Get the targeted version of an action so it, if enabled, can hide the
non targeted action in the action selection dialog.
***************************************************************************/
static action_id get_targeted_action_id(action_id non_tgt_action_id)
{
/* Don't add an action mapping here unless the non targeted version is
* selectable in the targeted version's target selection dialog. */
switch ((enum gen_action)non_tgt_action_id) {
case ACTION_SPY_SABOTAGE_CITY:
return ACTION_SPY_TARGETED_SABOTAGE_CITY;
case ACTION_SPY_SABOTAGE_CITY_ESC:
return ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC;
case ACTION_SPY_STEAL_TECH:
return ACTION_SPY_TARGETED_STEAL_TECH;
case ACTION_SPY_STEAL_TECH_ESC:
return ACTION_SPY_TARGETED_STEAL_TECH_ESC;
default:
/* No targeted version found. */
return ACTION_NONE;
}
}
/***********************************************************************//**
Show the user the action if it is enabled.
***************************************************************************/
......
QString title;
QString tool_tip;
if (get_targeted_action_id(act) != ACTION_NONE
&& action_prob_possible(act_probs[get_targeted_action_id(act)])) {
/* The player can select the untargeted version from the target
* selection dialog. */
return;
}
if (!af_map.contains(act)) {
/* The Qt client doesn't support ordering this action from the
* action selection dialog. */
client/gui-sdl2/action_dialog.c
}
}
/**********************************************************************//**
Get the targeted version of an action so it, if enabled, can hide the
non targeted action in the action selection dialog.
**************************************************************************/
static action_id get_targeted_action_id(action_id non_tgt_action_id)
{
/* Don't add an action mapping here unless the non targeted version is
* selectable in the targeted version's target selection dialog. */
switch ((enum gen_action)non_tgt_action_id) {
case ACTION_SPY_SABOTAGE_CITY:
return ACTION_SPY_TARGETED_SABOTAGE_CITY;
case ACTION_SPY_SABOTAGE_CITY_ESC:
return ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC;
case ACTION_SPY_STEAL_TECH:
return ACTION_SPY_TARGETED_STEAL_TECH;
case ACTION_SPY_STEAL_TECH_ESC:
return ACTION_SPY_TARGETED_STEAL_TECH_ESC;
default:
/* No targeted version found. */
return ACTION_NONE;
}
}
/**********************************************************************//**
User interacted with diplomat dialog.
**************************************************************************/
......
const char *ui_name;
act_func cb;
if (get_targeted_action_id(act) != ACTION_NONE
&& action_prob_possible(act_probs[get_targeted_action_id(act)])) {
/* The player can select the untargeted version from the target
* selection dialog. */
return;
}
if (af_map[act] == NULL) {
/* No special call back function needed for this action. */
cb = simple_action_callback;
    (1-1/1)