7 | NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),
| 7 | NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),
|
---|
8 | NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CHANGE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP),
| 8 | NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CHANGE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP),
|
---|
9 | - NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),
| 9 | - NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP),
|
---|
10 | + NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_JUST_STRING, STR_AI_DEBUG_SETTINGS_TOOLTIP),
| 10 | + NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_DEBUG_SETTINGS_TOOLTIP),
|
---|
11 | NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),
| 11 | NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, WID_AIC_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),
|
---|
12 | EndContainer(),
| 12 | EndContainer(),
|
---|
13 | NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),
| 13 | NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),
|
---|
18 | + case WID_AIC_CONFIGURE:
| 18 | +// case WID_AIC_CONFIGURE:
|
---|
19 | + switch (selected_slot) {
| 19 | +// switch (selected_slot) {
|
---|
20 | + case OWNER_DEITY:
| 20 | +// case OWNER_DEITY:
|
---|
21 | + if (_game_mode == GM_NORMAL && IsEditable(selected_slot)) {
| 21 | +// if (_game_mode == GM_NORMAL && IsEditable(selected_slot)) {
|
---|
22 | + SetDParam(0, STR_AI_DEBUG_SETTINGS);
| 22 | +// SetDParam(0, STR_AI_DEBUG_SETTINGS);
|
---|
23 | + } else {
| 23 | +// } else {
|
---|
24 | + SetDParam(0, STR_AI_CONFIG_CONFIGURE);
| 24 | +// SetDParam(0, STR_AI_CONFIG_CONFIGURE);
|
---|
25 | + }
| 25 | +// }
|
---|
26 | + break;
| 26 | +// break;
|
---|
32 | + default:
| 32 | +// default:
|
---|
33 | + if (_game_mode != GM_NORMAL || (_game_mode == GM_NORMAL && IsEditable((CompanyID)selected_slot) && (!Company::IsValidID(selected_slot) || Company::IsValidAiID(selected_slot) && Company::Get(selected_slot)->ai_instance->IsDead()))) {
| 33 | +// if (_game_mode != GM_NORMAL || (_game_mode == GM_NORMAL && IsEditable((CompanyID)selected_slot) && (!Company::IsValidID(selected_slot) || Company::IsValidAiID(selected_slot) && Company::Get(selected_slot)->ai_instance->IsDead()))) {
|
---|
34 | + SetDParam(0, STR_AI_CONFIG_CONFIGURE);
| 34 | +// SetDParam(0, STR_AI_CONFIG_CONFIGURE);
|
---|
35 | + } else {
| 35 | +// } else {
|
---|
36 | + SetDParam(0, STR_AI_DEBUG_SETTINGS);
| 36 | +// SetDParam(0, STR_AI_DEBUG_SETTINGS);
|
---|
37 | + }
| 37 | +// }
|
---|
38 | + break;
| 38 | +// break;
|
---|
39 | + }
| 39 | +// }
|
---|
40 | + break;
| 40 | +// break;
|
---|
42 | } | 42 | }
|
---|
| | 43 |
|
---|
| | 44 | @@ -925,6 +948,16 @@
|
---|
| | 45 | this->SetWidgetDisabledState(WID_AIC_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
|
---|
| | 46 | this->SetWidgetDisabledState(WID_AIC_CHANGE, (this->selected_slot == OWNER_DEITY && _game_mode == GM_NORMAL) || this->selected_slot == INVALID_COMPANY);
|
---|
| | 47 | this->SetWidgetDisabledState(WID_AIC_CONFIGURE, this->selected_slot == INVALID_COMPANY || GetConfig(this->selected_slot)->GetConfigList()->size() == 0);
|
---|
| | 48 | +
|
---|
| | 49 | + NWidgetCore *configure_button = this->GetWidget<NWidgetCore>(WID_AIC_CONFIGURE);
|
---|
| | 50 | + /* Display Configure button*/
|
---|
| | 51 | + if (this->selected_slot == INVALID_OWNER || (this->selected_slot == OWNER_DEITY && _game_mode != GM_NORMAL && IsEditable(this->selected_slot)) || ((this->selected_slot != OWNER_DEITY && this->selected_slot != INVALID_OWNER) && (_game_mode != GM_NORMAL || (_game_mode == GM_NORMAL && IsEditable((CompanyID)selected_slot) && (!Company::IsValidID(selected_slot) || Company::IsValidAiID(selected_slot) && Company::Get(selected_slot)->ai_instance->IsDead()))))) {
|
---|
| | 52 | + configure_button->SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP);
|
---|
| | 53 | + } else {
|
---|
| | 54 | + /* Display Settings button */
|
---|
| | 55 | + configure_button->SetDataTip(STR_AI_DEBUG_SETTINGS, STR_AI_DEBUG_SETTINGS_TOOLTIP);
|
---|
| | 56 | + }
|
---|
| | 57 | +
|
---|
| | 58 | this->SetWidgetDisabledState(WID_AIC_MOVE_UP, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot - 1)));
|
---|
| | 59 | this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot + 1))); |
---|