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 #862433 ยป 0002-Qt-act-sel-dlg-store-all-sub-target-kinds.patch

Sveinung Kvilhaugsvik, 2020-02-29 03:51 PM

View differences:

client/gui-qt/dialogs.cpp
target_id[ATK_UNIT] = IDENTITY_NUMBER_ZERO;
target_id[ATK_UNITS] = TILE_INDEX_NONE;
target_id[ATK_TILE] = TILE_INDEX_NONE;
target_extra_id = EXTRA_NONE;
sub_target_id[ASTK_BUILDING] = B_LAST;
sub_target_id[ASTK_TECH] = A_UNSET;
sub_target_id[ASTK_EXTRA] = EXTRA_NONE;
sub_target_id[ASTK_EXTRA_NOT_THERE] = EXTRA_NONE;
targeted_unit = nullptr;
/* No buttons are added yet. */
......
unit_skip->setParent(nullptr);
action_selection_refresh(game_unit_by_number(unit_id), nullptr,
targeted_unit, targeted_unit->tile,
(target_extra_id != EXTRA_NONE
? extra_by_number(target_extra_id)
(sub_target_id[ASTK_EXTRA] != EXTRA_NONE
? extra_by_number(sub_target_id[ASTK_EXTRA])
: NULL),
act_probs);
layout->addLayout(unit_skip);
......
cd->target_id[ATK_TILE] = TILE_INDEX_NONE;
}
/* No target building or target tech supplied. (Feb 2020) */
cd->sub_target_id[ASTK_BUILDING] = B_LAST;
cd->sub_target_id[ASTK_TECH] = A_UNSET;
if (target_extra) {
cd->target_extra_id = extra_number(target_extra);
cd->sub_target_id[ASTK_EXTRA] = extra_number(target_extra);
cd->sub_target_id[ASTK_EXTRA_NOT_THERE] = extra_number(target_extra);
} else {
cd->target_extra_id = EXTRA_NONE;
cd->sub_target_id[ASTK_EXTRA] = EXTRA_NONE;
cd->sub_target_id[ASTK_EXTRA_NOT_THERE] = EXTRA_NONE;
}
/* Unit acting against a city */
......
choice_dialog *cd = gui()->get_diplo_dialog();
if (cd != NULL) {
return cd->target_extra_id;
return cd->sub_target_id[ASTK_EXTRA];
} else {
return EXTRA_NONE;
}
client/gui-qt/dialogs.h
Choice_dialog_button *get_identified_button(const int id);
int unit_id;
int target_id[ATK_COUNT];
int target_extra_id;
int sub_target_id[ASTK_COUNT];
struct unit* targeted_unit;
void update_dialog(const struct act_prob *act_probs);
public slots:
    (1-1/1)