From b554f7472e8244502c951390b23daa8dfd7bd549 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 16 Oct 2023 01:55:38 -0700 Subject: [PATCH] add stocks plugin (but comment out contents) --- plugins/CMakeLists.txt | 2 +- plugins/stocks.cpp | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index be690edf1..114386ad3 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -162,7 +162,7 @@ if(BUILD_SUPPORTED) add_subdirectory(spectate) #dfhack_plugin(stockflow stockflow.cpp LINK_LIBRARIES lua) add_subdirectory(stockpiles) - #dfhack_plugin(stocks stocks.cpp) + dfhack_plugin(stocks stocks.cpp LINK_LIBRARIES lua) dfhack_plugin(strangemood strangemood.cpp) dfhack_plugin(tailor tailor.cpp LINK_LIBRARIES lua) dfhack_plugin(tiletypes tiletypes.cpp Brushes.h LINK_LIBRARIES lua) diff --git a/plugins/stocks.cpp b/plugins/stocks.cpp index 40ebdc960..771160b4a 100644 --- a/plugins/stocks.cpp +++ b/plugins/stocks.cpp @@ -1,3 +1,13 @@ +#include "PluginManager.h" + +using std::vector; +using std::string; + +using namespace DFHack; + +DFHACK_PLUGIN("stocks"); + +/* #include "uicommon.h" #include "listcolumn.h" @@ -41,12 +51,12 @@ DFhackCExport command_result plugin_shutdown ( color_ostream &out ) #define MAX_NAME 30 #define SIDEBAR_WIDTH 30 - +*/ /* * Utility */ - +/* static string get_quality_name(const df::item_quality quality) { if (gps->dimx - SIDEBAR_WIDTH < 60) @@ -66,12 +76,12 @@ static df::item *get_container_of(df::unit *unit) auto ref = Units::getGeneralRef(unit, general_ref_type::CONTAINED_IN_ITEM); return (ref) ? ref->getItem() : nullptr; } - +*/ /* * Trade Info */ - +/* class TradeDepotInfo { public: @@ -168,12 +178,12 @@ private: }; static TradeDepotInfo depot_info; - +*/ /* * Item manipulation */ - +/* static map items_in_cages; static df::job *get_item_job(df::item *item) @@ -950,7 +960,7 @@ public: OutputHotkeyString(x, y, "Min Qual: ", "-+"); OutputString(COLOR_BROWN, x, y, get_quality_name(min_quality), true, left_margin); - OutputHotkeyString(x, y, "Max Qual: ", "/*"); + OutputHotkeyString(x, y, "Max Qual: ", "/ *"); OutputString(COLOR_BROWN, x, y, get_quality_name(max_quality), true, left_margin); OutputHotkeyString(x, y, "Min Wear: ", "Shift-W"); 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 & parameter return CR_WRONG_USAGE; } +*/ -DFhackCExport command_result plugin_init (color_ostream &out, std::vector &commands) +DFhackCExport command_result plugin_init (color_ostream &out, vector &commands) { + /* commands.push_back(PluginCommand( "stocks", "An improved stocks management screen.", stocks_cmd)); ViewscreenStocks::reset(); - + */ return CR_OK; } +/* DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) { switch (event) { @@ -1491,3 +1504,4 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan return CR_OK; } +*/