forked from mirror/OpenTTD
Codechange: add and use SetString over directly accessing widget_data
This commit is contained in:
@@ -609,7 +609,7 @@ struct DepotWindow : Window {
|
||||
default: NOT_REACHED();
|
||||
|
||||
case VEH_TRAIN:
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->widget_data = STR_TRAIN;
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->SetString(STR_TRAIN);
|
||||
|
||||
/* Sprites */
|
||||
this->GetWidget<NWidgetCore>(WID_D_SELL)->SetSprite(SPR_SELL_TRAIN);
|
||||
@@ -618,7 +618,7 @@ struct DepotWindow : Window {
|
||||
break;
|
||||
|
||||
case VEH_ROAD:
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->widget_data = STR_LORRY;
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->SetString(STR_LORRY);
|
||||
|
||||
/* Sprites */
|
||||
this->GetWidget<NWidgetCore>(WID_D_SELL)->SetSprite(SPR_SELL_ROADVEH);
|
||||
@@ -627,7 +627,7 @@ struct DepotWindow : Window {
|
||||
break;
|
||||
|
||||
case VEH_SHIP:
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->widget_data = STR_SHIP;
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->SetString(STR_SHIP);
|
||||
|
||||
/* Sprites */
|
||||
this->GetWidget<NWidgetCore>(WID_D_SELL)->SetSprite(SPR_SELL_SHIP);
|
||||
@@ -636,7 +636,7 @@ struct DepotWindow : Window {
|
||||
break;
|
||||
|
||||
case VEH_AIRCRAFT:
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->widget_data = STR_PLANE;
|
||||
this->GetWidget<NWidgetCore>(WID_D_VEHICLE_LIST)->SetString(STR_PLANE);
|
||||
|
||||
/* Sprites */
|
||||
this->GetWidget<NWidgetCore>(WID_D_SELL)->SetSprite(SPR_SELL_AIRCRAFT);
|
||||
|
Reference in New Issue
Block a user