Fix train-only conditional orders being listed in non-train dropdown
This commit is contained in:
@@ -1494,6 +1494,7 @@ public:
|
|||||||
case WID_O_COND_VARIABLE: {
|
case WID_O_COND_VARIABLE: {
|
||||||
Dimension d = {0, 0};
|
Dimension d = {0, 0};
|
||||||
for (uint i = 0; i < lengthof(_order_conditional_variable); i++) {
|
for (uint i = 0; i < lengthof(_order_conditional_variable); i++) {
|
||||||
|
if (this->vehicle->type != VEH_TRAIN && (_order_conditional_variable[i] == OCV_TRAIN_IN_SLOT || _order_conditional_variable[i] == OCV_SLOT_OCCUPANCY || _order_conditional_variable[i] == OCV_FREE_PLATFORMS)) continue;
|
||||||
d = maxdim(d, GetStringBoundingBox(STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + _order_conditional_variable[i]));
|
d = maxdim(d, GetStringBoundingBox(STR_ORDER_CONDITIONAL_LOAD_PERCENTAGE + _order_conditional_variable[i]));
|
||||||
}
|
}
|
||||||
d.width += padding.width;
|
d.width += padding.width;
|
||||||
@@ -2147,6 +2148,7 @@ public:
|
|||||||
const OrderConditionVariable ocv = this->vehicle->GetOrder(this->OrderGetSel())->GetConditionVariable();
|
const OrderConditionVariable ocv = this->vehicle->GetOrder(this->OrderGetSel())->GetConditionVariable();
|
||||||
DropDownList list;
|
DropDownList list;
|
||||||
for (uint i = 0; i < lengthof(_order_conditional_variable); i++) {
|
for (uint i = 0; i < lengthof(_order_conditional_variable); i++) {
|
||||||
|
if (this->vehicle->type != VEH_TRAIN && (_order_conditional_variable[i] == OCV_TRAIN_IN_SLOT || _order_conditional_variable[i] == OCV_SLOT_OCCUPANCY || _order_conditional_variable[i] == OCV_FREE_PLATFORMS)) continue;
|
||||||
if (ocv != _order_conditional_variable[i]) {
|
if (ocv != _order_conditional_variable[i]) {
|
||||||
if ((_order_conditional_variable[i] == OCV_TRAIN_IN_SLOT || _order_conditional_variable[i] == OCV_SLOT_OCCUPANCY) && !_settings_client.gui.show_adv_tracerestrict_features) continue;
|
if ((_order_conditional_variable[i] == OCV_TRAIN_IN_SLOT || _order_conditional_variable[i] == OCV_SLOT_OCCUPANCY) && !_settings_client.gui.show_adv_tracerestrict_features) continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user