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

Method feed

plugins/manipulator.cpp:1038–1062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1036 }
1037 std::string getFocusString() { return "unitlabors/profession"; }
1038 void feed(set<df::interface_key> *events)
1039 {
1040 if (events->count(interface_key::LEAVESCREEN))
1041 {
1042 Screen::dismiss(this);
1043 return;
1044 }
1045 if (menu_options.feed(events))
1046 {
1047 // Allow left mouse button to trigger menu options
1048 if (menu_options.feed_mouse_set_highlight)
1049 events->insert(interface_key::SELECT);
1050 else
1051 return;
1052 }
1053 if (events->count(interface_key::SELECT))
1054 {
1055 if (menu_options.hasSelection())
1056 {
1057 select_profession(menu_options.getFirstSelectedElem());
1058 }
1059 Screen::dismiss(this);
1060 return;
1061 }
1062 }
1063 void select_profession(size_t selected)
1064 {
1065 if (manager.templates.empty() || selected >= manager.templates.size())

Callers

nothing calls this directly

Calls 5

hasSelectionMethod · 0.80
getFirstSelectedElemMethod · 0.80
countMethod · 0.45
feedMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected