From 7fd23d46f03bf74cdf4c988cb3ce2ae4468fab84 Mon Sep 17 00:00:00 2001 From: JapaMala Date: Mon, 2 Jul 2018 22:04:47 +0530 Subject: [PATCH] Send the building preview over RFR --- plugins/proto/DwarfControl.proto | 1 + plugins/remotefortressreader/dwarf_control.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/plugins/proto/DwarfControl.proto b/plugins/proto/DwarfControl.proto index ec261b57d..707651079 100644 --- a/plugins/proto/DwarfControl.proto +++ b/plugins/proto/DwarfControl.proto @@ -86,4 +86,5 @@ message BuildSelector optional int32 radius_x_high = 10; optional int32 radius_y_high = 11; optional RemoteFortressReader.Coord cursor = 12; + repeated int32 tiles = 13; } diff --git a/plugins/remotefortressreader/dwarf_control.cpp b/plugins/remotefortressreader/dwarf_control.cpp index bb342c575..57c770301 100644 --- a/plugins/remotefortressreader/dwarf_control.cpp +++ b/plugins/remotefortressreader/dwarf_control.cpp @@ -291,6 +291,12 @@ void CopyBuildMenu(DwarfControl::SidebarState * out) send_cursor->set_y(cursor->y); send_cursor->set_z(cursor->z); } + + for (int y = 0; y < (y_low + y_high + 1); y++) + for (int x = 0; x < (x_low + x_high + 1); x++) + { + send_selector->add_tiles(build_selector->tiles[x][y]); + } } }