Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b554f74

Browse files
committed
add stocks plugin (but comment out contents)
1 parent 6a1f3a8 commit b554f74

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

plugins/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if(BUILD_SUPPORTED)
162162
add_subdirectory(spectate)
163163
#dfhack_plugin(stockflow stockflow.cpp LINK_LIBRARIES lua)
164164
add_subdirectory(stockpiles)
165-
#dfhack_plugin(stocks stocks.cpp)
165+
dfhack_plugin(stocks stocks.cpp LINK_LIBRARIES lua)
166166
dfhack_plugin(strangemood strangemood.cpp)
167167
dfhack_plugin(tailor tailor.cpp LINK_LIBRARIES lua)
168168
dfhack_plugin(tiletypes tiletypes.cpp Brushes.h LINK_LIBRARIES lua)

plugins/stocks.cpp

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
#include "PluginManager.h"
2+
3+
using std::vector;
4+
using std::string;
5+
6+
using namespace DFHack;
7+
8+
DFHACK_PLUGIN("stocks");
9+
10+
/*
111
#include "uicommon.h"
212
#include "listcolumn.h"
313
@@ -41,12 +51,12 @@ DFhackCExport command_result plugin_shutdown ( color_ostream &out )
4151
4252
#define MAX_NAME 30
4353
#define SIDEBAR_WIDTH 30
44-
54+
*/
4555

4656
/*
4757
* Utility
4858
*/
49-
59+
/*
5060
static string get_quality_name(const df::item_quality quality)
5161
{
5262
if (gps->dimx - SIDEBAR_WIDTH < 60)
@@ -66,12 +76,12 @@ static df::item *get_container_of(df::unit *unit)
6676
auto ref = Units::getGeneralRef(unit, general_ref_type::CONTAINED_IN_ITEM);
6777
return (ref) ? ref->getItem() : nullptr;
6878
}
69-
79+
*/
7080

7181
/*
7282
* Trade Info
7383
*/
74-
84+
/*
7585
class TradeDepotInfo
7686
{
7787
public:
@@ -168,12 +178,12 @@ class TradeDepotInfo
168178
};
169179
170180
static TradeDepotInfo depot_info;
171-
181+
*/
172182

173183
/*
174184
* Item manipulation
175185
*/
176-
186+
/*
177187
static map<df::item *, bool> items_in_cages;
178188
179189
static df::job *get_item_job(df::item *item)
@@ -950,7 +960,7 @@ class ViewscreenStocks : public dfhack_viewscreen
950960
951961
OutputHotkeyString(x, y, "Min Qual: ", "-+");
952962
OutputString(COLOR_BROWN, x, y, get_quality_name(min_quality), true, left_margin);
953-
OutputHotkeyString(x, y, "Max Qual: ", "/*");
963+
OutputHotkeyString(x, y, "Max Qual: ", "/ *");
954964
OutputString(COLOR_BROWN, x, y, get_quality_name(max_quality), true, left_margin);
955965
OutputHotkeyString(x, y, "Min Wear: ", "Shift-W");
956966
OutputString(COLOR_BROWN, x, y, int_to_string(min_wear), true, left_margin);
@@ -1466,19 +1476,22 @@ static command_result stocks_cmd(color_ostream &out, vector <string> & parameter
14661476
14671477
return CR_WRONG_USAGE;
14681478
}
1479+
*/
14691480

1470-
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
1481+
DFhackCExport command_result plugin_init (color_ostream &out, vector <PluginCommand> &commands)
14711482
{
1483+
/*
14721484
commands.push_back(PluginCommand(
14731485
"stocks",
14741486
"An improved stocks management screen.",
14751487
stocks_cmd));
14761488
14771489
ViewscreenStocks::reset();
1478-
1490+
*/
14791491
return CR_OK;
14801492
}
14811493

1494+
/*
14821495
DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event)
14831496
{
14841497
switch (event) {
@@ -1491,3 +1504,4 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan
14911504
14921505
return CR_OK;
14931506
}
1507+
*/

0 commit comments

Comments
 (0)