Merge branch 'master' into jgrpp
# Conflicts: # src/widgets/dropdown.cpp # src/widgets/dropdown_type.h
This commit is contained in:
@@ -1882,7 +1882,7 @@ public:
|
||||
hidden |= _program_signal_mode_hide_mask;
|
||||
}
|
||||
|
||||
this->ShowDropDownListWithValue(&_program_insert, 0, true, TR_WIDGET_INSERT, disabled, hidden, 0);
|
||||
this->ShowDropDownListWithValue(&_program_insert, 0, true, TR_WIDGET_INSERT, disabled, hidden);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1937,7 +1937,7 @@ public:
|
||||
if (!ElseInsertionDryRun(true)) disabled |= _condflags_dropdown_else_hide_mask;
|
||||
if (!ElseIfInsertionDryRun(true)) disabled |= _condflags_dropdown_else_if_hide_mask;
|
||||
|
||||
this->ShowDropDownListWithValue(&_condflags_dropdown, type, false, TR_WIDGET_CONDFLAGS, disabled, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_condflags_dropdown, type, false, TR_WIDGET_CONDFLAGS, disabled, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1953,7 +1953,7 @@ public:
|
||||
dlist.emplace_back(new DropDownListStringItem(item.str, item.type, false));
|
||||
}
|
||||
}
|
||||
ShowDropDownList(this, std::move(dlist), type, widget, 0, true);
|
||||
ShowDropDownList(this, std::move(dlist), type, widget, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1962,20 +1962,20 @@ public:
|
||||
TraceRestrictItem item = this->GetSelected();
|
||||
const TraceRestrictDropDownListSet *list_set = GetCondOpDropDownListSet(GetTraceRestrictTypeProperties(item));
|
||||
if (list_set) {
|
||||
this->ShowDropDownListWithValue(list_set, GetTraceRestrictCondOp(item), false, TR_WIDGET_COMPARATOR, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(list_set, GetTraceRestrictCondOp(item), false, TR_WIDGET_COMPARATOR, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TR_WIDGET_SLOT_OP: {
|
||||
TraceRestrictItem item = this->GetSelected();
|
||||
this->ShowDropDownListWithValue(&_slot_op_cond_ops, GetTraceRestrictCondOp(item), false, TR_WIDGET_SLOT_OP, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_slot_op_cond_ops, GetTraceRestrictCondOp(item), false, TR_WIDGET_SLOT_OP, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case TR_WIDGET_COUNTER_OP: {
|
||||
TraceRestrictItem item = this->GetSelected();
|
||||
this->ShowDropDownListWithValue(&_counter_op_cond_ops, GetTraceRestrictCondOp(item), false, TR_WIDGET_COUNTER_OP, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_counter_op_cond_ops, GetTraceRestrictCondOp(item), false, TR_WIDGET_COUNTER_OP, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2012,37 +2012,37 @@ public:
|
||||
TraceRestrictItem item = this->GetSelected();
|
||||
switch (GetTraceRestrictTypeProperties(item).value_type) {
|
||||
case TRVT_DENY:
|
||||
this->ShowDropDownListWithValue(&_deny_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_deny_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_CARGO_ID:
|
||||
this->ShowDropDownListWithValue(GetSortedCargoTypeDropDownListSet(), GetTraceRestrictValue(item), true, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0); // current cargo is permitted to not be in list
|
||||
this->ShowDropDownListWithValue(GetSortedCargoTypeDropDownListSet(), GetTraceRestrictValue(item), true, TR_WIDGET_VALUE_DROPDOWN, 0, 0); // current cargo is permitted to not be in list
|
||||
break;
|
||||
|
||||
case TRVT_DIRECTION:
|
||||
this->ShowDropDownListWithValue(&_direction_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_direction_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_PF_PENALTY:
|
||||
this->ShowDropDownListWithValue(&_pf_penalty_dropdown, GetPathfinderPenaltyDropdownIndex(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_pf_penalty_dropdown, GetPathfinderPenaltyDropdownIndex(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_RESERVE_THROUGH:
|
||||
this->ShowDropDownListWithValue(&_reserve_through_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_reserve_through_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_LONG_RESERVE:
|
||||
this->ShowDropDownListWithValue(&_long_reserve_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_long_reserve_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_WAIT_AT_PBS:
|
||||
this->ShowDropDownListWithValue(&_wait_at_pbs_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_wait_at_pbs_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_GROUP_INDEX: {
|
||||
int selected;
|
||||
DropDownList dlist = GetGroupDropDownList(this->GetOwner(), GetTraceRestrictValue(item), selected);
|
||||
ShowDropDownList(this, std::move(dlist), selected, TR_WIDGET_VALUE_DROPDOWN, 0, true);
|
||||
ShowDropDownList(this, std::move(dlist), selected, TR_WIDGET_VALUE_DROPDOWN, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2058,35 +2058,35 @@ public:
|
||||
}
|
||||
|
||||
case TRVT_TRAIN_STATUS:
|
||||
this->ShowDropDownListWithValue(&_train_status_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_train_status_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_REVERSE:
|
||||
this->ShowDropDownListWithValue(&_reverse_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_reverse_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_NEWS_CONTROL:
|
||||
this->ShowDropDownListWithValue(&_news_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_news_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_ENGINE_CLASS:
|
||||
this->ShowDropDownListWithValue(&_engine_class_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_engine_class_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_PF_PENALTY_CONTROL:
|
||||
this->ShowDropDownListWithValue(&_pf_penalty_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_pf_penalty_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);;
|
||||
break;
|
||||
|
||||
case TRVT_SPEED_ADAPTATION_CONTROL:
|
||||
this->ShowDropDownListWithValue(&_speed_adaptation_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_speed_adaptation_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_SIGNAL_MODE_CONTROL:
|
||||
this->ShowDropDownListWithValue(&_signal_mode_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_signal_mode_control_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case TRVT_ORDER_TARGET_DIAGDIR:
|
||||
this->ShowDropDownListWithValue(&_diagdir_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_diagdir_value, GetTraceRestrictValue(item), false, TR_WIDGET_VALUE_DROPDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -2113,12 +2113,12 @@ public:
|
||||
}
|
||||
|
||||
case TRVT_TIME_DATE_INT: {
|
||||
this->ShowDropDownListWithValue(&_time_date_value, GetTraceRestrictValue(item), false, TR_WIDGET_LEFT_AUX_DROPDOWN, _settings_game.game_time.time_in_minutes ? 0 : 7, 0, UINT_MAX);
|
||||
this->ShowDropDownListWithValue(&_time_date_value, GetTraceRestrictValue(item), false, TR_WIDGET_LEFT_AUX_DROPDOWN, _settings_game.game_time.time_in_minutes ? 0 : 7, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case TRVT_ORDER_TARGET_DIAGDIR: {
|
||||
this->ShowDropDownListWithValue(&_target_direction_aux_value, GetTraceRestrictAuxField(item), false, TR_WIDGET_LEFT_AUX_DROPDOWN, 0, 0, 0);
|
||||
this->ShowDropDownListWithValue(&_target_direction_aux_value, GetTraceRestrictAuxField(item), false, TR_WIDGET_LEFT_AUX_DROPDOWN, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3276,12 +3276,12 @@ private:
|
||||
* This asserts if @p value is not in @p list_set, and @p missing_ok is false
|
||||
*/
|
||||
void ShowDropDownListWithValue(const TraceRestrictDropDownListSet *list_set, uint value, bool missing_ok,
|
||||
int button, uint32 disabled_mask, uint32 hidden_mask, uint width)
|
||||
int button, uint32 disabled_mask, uint32 hidden_mask)
|
||||
{
|
||||
this->drop_down_list_mapping[button] = list_set;
|
||||
int selected = GetDropDownListIndexByValue(list_set, value, missing_ok);
|
||||
if (button == TR_WIDGET_VALUE_DROPDOWN) this->value_drop_down_is_company = false;
|
||||
ShowDropDownMenu(this, list_set->string_array, selected, button, disabled_mask, hidden_mask, width);
|
||||
ShowDropDownMenu(this, list_set->string_array, selected, button, disabled_mask, hidden_mask);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3303,7 +3303,7 @@ private:
|
||||
assert(button == TR_WIDGET_VALUE_DROPDOWN);
|
||||
this->value_drop_down_is_company = true;
|
||||
|
||||
ShowDropDownList(this, std::move(list), value, button, 0, true, false);
|
||||
ShowDropDownList(this, std::move(list), value, button, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user