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

Method feed

plugins/dwarfmonitor.cpp:911–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

909 }
910
911 void feed(set<df::interface_key> *input)
912 {
913 bool key_processed = false;
914 switch (selected_column)
915 {
916 case 0:
917 key_processed = fort_activity_column.feed(input);
918 break;
919 case 1:
920 key_processed = dwarf_activity_column.feed(input);
921 break;
922 }
923
924 if (key_processed)
925 {
926 if (selected_column == 0 && fort_activity_column.feed_changed_highlight)
927 {
928 populateDwarfColumn();
929 populateCategoryBreakdownColumn();
930 }
931
932 return;
933 }
934
935 if (input->count(interface_key::LEAVESCREEN))
936 {
937 input->clear();
938 Screen::dismiss(this);
939 return;
940 }
941 else if (input->count(interface_key::SECONDSCROLL_PAGEDOWN))
942 {
943 window_days += min_window;
944 if (window_days > max_history_days)
945 window_days = min_window;
946
947 populateFortColumn();
948 }
949 else if (input->count(interface_key::CUSTOM_SHIFT_D))
950 {
951 df::unit *selected_unit = (selected_column == 1) ? dwarf_activity_column.getFirstSelectedElem() : nullptr;
952 Screen::dismiss(this);
953 Screen::show(std::make_unique<ViewscreenDwarfStats>(selected_unit), plugin_self);
954 }
955 else if (input->count(interface_key::CUSTOM_SHIFT_Z))
956 {
957 df::unit *selected_unit = (selected_column == 1) ? dwarf_activity_column.getFirstSelectedElem() : nullptr;
958 if (selected_unit)
959 {
960 input->clear();
961 Screen::dismiss(this);
962 Gui::resetDwarfmodeView(true);
963 send_key(interface_key::D_VIEWUNIT);
964 move_cursor(selected_unit->pos);
965 }
966 }
967 else if (input->count(interface_key::CURSOR_LEFT))
968 {

Callers 3

send_keyFunction · 0.45
feedMethod · 0.45
feedMethod · 0.45

Calls 7

showFunction · 0.85
send_keyFunction · 0.85
move_cursorFunction · 0.85
getFirstSelectedElemMethod · 0.80
setHighlightByMouseMethod · 0.80
countMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected