mirror of https://github.com/OpenTTD/OpenTTD
(svn r17401) -Fix [FS#3171] (r17384): order deletion didn't (correctly) update the order window
parent
b294497f2a
commit
75aad2a186
|
@ -606,6 +606,7 @@ private:
|
||||||
|
|
||||||
if (DoCommandP(w->vehicle->tile, w->vehicle->index, w->OrderGetSel(), CMD_DELETE_ORDER | CMD_MSG(STR_ERROR_CAN_T_DELETE_THIS_ORDER))) {
|
if (DoCommandP(w->vehicle->tile, w->vehicle->index, w->OrderGetSel(), CMD_DELETE_ORDER | CMD_MSG(STR_ERROR_CAN_T_DELETE_THIS_ORDER))) {
|
||||||
w->selected_order = selected >= w->vehicle->GetNumOrders() ? -1 : selected;
|
w->selected_order = selected >= w->vehicle->GetNumOrders() ? -1 : selected;
|
||||||
|
w->UpdateButtonState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -725,7 +726,7 @@ public:
|
||||||
void UpdateButtonState()
|
void UpdateButtonState()
|
||||||
{
|
{
|
||||||
bool shared_orders = this->vehicle->IsOrderListShared();
|
bool shared_orders = this->vehicle->IsOrderListShared();
|
||||||
int sel = OrderGetSel();
|
int sel = this->OrderGetSel();
|
||||||
const Order *order = this->vehicle->GetOrder(sel);
|
const Order *order = this->vehicle->GetOrder(sel);
|
||||||
|
|
||||||
if (this->vehicle->owner == _local_company) {
|
if (this->vehicle->owner == _local_company) {
|
||||||
|
@ -833,7 +834,7 @@ public:
|
||||||
virtual void OnPaint()
|
virtual void OnPaint()
|
||||||
{
|
{
|
||||||
bool shared_orders = this->vehicle->IsOrderListShared();
|
bool shared_orders = this->vehicle->IsOrderListShared();
|
||||||
int sel = OrderGetSel();
|
int sel = this->OrderGetSel();
|
||||||
const Order *order = this->vehicle->GetOrder(sel);
|
const Order *order = this->vehicle->GetOrder(sel);
|
||||||
|
|
||||||
if (this->vehicle->owner == _local_company) {
|
if (this->vehicle->owner == _local_company) {
|
||||||
|
@ -1083,6 +1084,7 @@ public:
|
||||||
if (!(from_order == to_order || from_order == INVALID_ORDER || from_order > this->vehicle->GetNumOrders() || to_order == INVALID_ORDER || to_order > this->vehicle->GetNumOrders()) &&
|
if (!(from_order == to_order || from_order == INVALID_ORDER || from_order > this->vehicle->GetNumOrders() || to_order == INVALID_ORDER || to_order > this->vehicle->GetNumOrders()) &&
|
||||||
DoCommandP(this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16), CMD_MOVE_ORDER | CMD_MSG(STR_ERROR_CAN_T_MOVE_THIS_ORDER))) {
|
DoCommandP(this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16), CMD_MOVE_ORDER | CMD_MSG(STR_ERROR_CAN_T_MOVE_THIS_ORDER))) {
|
||||||
this->selected_order = -1;
|
this->selected_order = -1;
|
||||||
|
this->UpdateButtonState();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue