MCPcopy Create free account
hub / github.com/DFHack/dfhack / handleInput

Method handleInput

plugins/stockflow.cpp:235–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233 typedef df::viewscreen_dwarfmodest interpose_base;
234
235 bool handleInput(set<df::interface_key> *input) {
236 if (Gui::inRenameBuilding())
237 return false;
238
239 building_stockpilest *sp = get_selected_stockpile();
240 if (!sp)
241 return false;
242
243 if (input->count(interface_key::CUSTOM_J)) {
244 // Select a new order for this stockpile.
245 if (!helper.stockpile_method("select_order", sp)) {
246 Core::printerr("Stockflow order selection failed!\n");
247 }
248
249 return true;
250 } else if (input->count(interface_key::CUSTOM_SHIFT_J)) {
251 // Toggle the order trigger for this stockpile.
252 if (!helper.stockpile_method("toggle_trigger", sp)) {
253 Core::printerr("Stockflow trigger toggle failed!\n");
254 }
255
256 return true;
257 }
258
259 return false;
260 }
261
262 DEFINE_VMETHOD_INTERPOSE(void, feed, (set<df::interface_key> *input)) {
263 if (!handleInput(input))

Callers

nothing calls this directly

Calls 3

stockpile_methodMethod · 0.80
printerrFunction · 0.50
countMethod · 0.45

Tested by

no test coverage detected