diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-10-31 19:39:09 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 0f64ee5ce1548d9cda69917f27c5b1a3cb91823d (patch) | |
tree | 161f0e6ac300e604de61b8203b5a58279637f9eb /src/story_gui.cpp | |
parent | e740c24eb7a90bc771f5976d64d80639ee7576e5 (diff) | |
download | openttd-0f64ee5ce1548d9cda69917f27c5b1a3cb91823d.tar.xz |
Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
Diffstat (limited to 'src/story_gui.cpp')
-rw-r--r-- | src/story_gui.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 5330b8a30..21dba8fd1 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -25,6 +25,7 @@ #include "company_base.h" #include "tilehighlight_func.h" #include "vehicle_base.h" +#include "story_cmd.h" #include "widgets/story_widget.h" @@ -566,7 +567,7 @@ protected: this->SetTimeout(); this->SetWidgetDirty(WID_SB_PAGE_PANEL); - DoCommandP(CMD_STORY_PAGE_BUTTON, 0, pe.index, 0); + Command<CMD_STORY_PAGE_BUTTON>::Post(0, pe.index, 0, {}); break; case SPET_BUTTON_TILE: @@ -921,7 +922,7 @@ public: return; } - DoCommandP(CMD_STORY_PAGE_BUTTON, tile, pe->index, 0); + Command<CMD_STORY_PAGE_BUTTON>::Post(tile, pe->index, 0, {}); ResetObjectToPlace(); } @@ -940,7 +941,7 @@ public: VehicleType wanted_vehtype = data.GetVehicleType(); if (wanted_vehtype != VEH_INVALID && wanted_vehtype != v->type) return false; - DoCommandP(CMD_STORY_PAGE_BUTTON, 0, pe->index, v->index); + Command<CMD_STORY_PAGE_BUTTON>::Post(0, pe->index, v->index, {}); ResetObjectToPlace(); return true; } |