Merge branch 'master' into jgrpp

# Conflicts:
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
This commit is contained in:
Jonathan G Rennison
2023-04-17 20:51:54 +01:00
19 changed files with 125 additions and 102 deletions

View File

@@ -2676,7 +2676,7 @@ public:
add_colour(COLOUR_ORANGE);
add_colour(COLOUR_PINK);
}
ShowDropDownList(this, std::move(list), 0x100 + order->GetColour(), widget, 0, true, false, DDSF_LOST_FOCUS);
ShowDropDownList(this, std::move(list), 0x100 + order->GetColour(), widget, 0, true, DDSF_LOST_FOCUS);
break;
}
@@ -2779,7 +2779,7 @@ public:
const Order *order = this->vehicle->GetOrder(this->OrderGetSel());
TraceRestrictSlotID value = order->GetXData();
DropDownList list = GetSlotDropDownList(this->vehicle->owner, value, selected, this->vehicle->type, order->GetConditionVariable() == OCV_SLOT_OCCUPANCY);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_COND_SLOT, 0, true);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_COND_SLOT, 0);
break;
}
@@ -2787,19 +2787,19 @@ public:
int selected;
TraceRestrictCounterID value = GB(this->vehicle->GetOrder(this->OrderGetSel())->GetXData(), 16, 16);
DropDownList list = GetCounterDropDownList(this->vehicle->owner, value, selected);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_COND_COUNTER, 0, true);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_COND_COUNTER, 0);
break;
}
case WID_O_COND_TIME_DATE: {
ShowDropDownMenu(this, _order_time_date_dropdown, this->vehicle->GetOrder(this->OrderGetSel())->GetConditionValue(),
WID_O_COND_TIME_DATE, _settings_game.game_time.time_in_minutes ? 0 : 7, 0, UINT_MAX);
WID_O_COND_TIME_DATE, _settings_game.game_time.time_in_minutes ? 0 : 7, 0);
break;
}
case WID_O_COND_TIMETABLE: {
ShowDropDownMenu(this, _order_timetable_dropdown, this->vehicle->GetOrder(this->OrderGetSel())->GetConditionValue(),
WID_O_COND_TIMETABLE, 0, 0, UINT_MAX);
WID_O_COND_TIMETABLE, 0, 0);
break;
}
@@ -2814,13 +2814,13 @@ public:
item->SetParam(0, i + 1);
list.emplace_back(item);
}
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_COND_SCHED_SELECT, 0, true);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_COND_SCHED_SELECT, 0);
break;
}
case WID_O_COND_SCHED_TEST: {
ShowDropDownMenu(this, _order_dispatch_slot_dropdown, this->vehicle->GetOrder(this->OrderGetSel())->GetConditionValue() / 2,
WID_O_COND_SCHED_TEST, 0, 0, UINT_MAX);
WID_O_COND_SCHED_TEST, 0, 0);
break;
}
@@ -2892,7 +2892,7 @@ public:
list.emplace_back(new DropDownListStringItem(STR_ORDER_CONDITIONAL_COMPARATOR_DISPATCH_SLOT_IS_LAST, 0x102, false));
list.emplace_back(new DropDownListStringItem(STR_ORDER_CONDITIONAL_COMPARATOR_DISPATCH_SLOT_IS_NOT_LAST, 0x103, false));
int selected = 0x100 + ((o->GetConditionValue() % 2) * 2) + ((o->GetConditionComparator() == OCC_IS_FALSE) ? 1 : 0);
ShowDropDownList(this, std::move(list), selected, WID_O_COND_COMPARATOR, 0, true);
ShowDropDownList(this, std::move(list), selected, WID_O_COND_COMPARATOR, 0);
break;
}
uint mask;
@@ -2971,7 +2971,7 @@ public:
int selected;
TraceRestrictSlotID value = this->vehicle->GetOrder(this->OrderGetSel())->GetDestination();
DropDownList list = GetSlotDropDownList(this->vehicle->owner, value, selected, this->vehicle->type, false);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_RELEASE_SLOT, 0, true);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_RELEASE_SLOT, 0);
break;
}
@@ -2981,7 +2981,7 @@ public:
list.emplace_back(new DropDownListStringItem(STR_TRACE_RESTRICT_COUNTER_DECREASE, 1, false));
list.emplace_back(new DropDownListStringItem(STR_TRACE_RESTRICT_COUNTER_SET, 2, false));
int selected = this->vehicle->GetOrder(this->OrderGetSel())->GetCounterOperation();
ShowDropDownList(this, std::move(list), selected, WID_O_COUNTER_OP, 0, true);
ShowDropDownList(this, std::move(list), selected, WID_O_COUNTER_OP, 0);
break;
}
@@ -2989,7 +2989,7 @@ public:
int selected;
TraceRestrictCounterID value = this->vehicle->GetOrder(this->OrderGetSel())->GetDestination();
DropDownList list = GetCounterDropDownList(this->vehicle->owner, value, selected);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_CHANGE_COUNTER, 0, true);
if (!list.empty()) ShowDropDownList(this, std::move(list), selected, WID_O_CHANGE_COUNTER, 0);
break;
}