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

Method feed

plugins/dwarfmonitor.cpp:305–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303 }
304
305 void feed(set<df::interface_key> *input)
306 {
307 bool key_processed = false;
308 switch (selected_column)
309 {
310 case 0:
311 key_processed = dwarves_column.feed(input);
312 break;
313 case 1:
314 key_processed = dwarf_activity_column.feed(input);
315 break;
316 }
317
318 if (key_processed)
319 {
320 if (selected_column == 0 && dwarves_column.feed_changed_highlight)
321 populateActivityColumn();
322
323 return;
324 }
325
326 if (input->count(interface_key::LEAVESCREEN))
327 {
328 input->clear();
329 Screen::dismiss(this);
330 return;
331 }
332 else if (input->count(interface_key::CUSTOM_SHIFT_D))
333 {
334 Screen::dismiss(this);
335 open_stats_screen();
336 }
337 else if (input->count(interface_key::CUSTOM_SHIFT_Z))
338 {
339 df::unit *selected_unit = (selected_column == 0) ? dwarves_column.getFirstSelectedElem() : nullptr;
340 if (selected_unit)
341 {
342 input->clear();
343 Screen::dismiss(this);
344 Gui::resetDwarfmodeView(true);
345 send_key(interface_key::D_VIEWUNIT);
346 move_cursor(selected_unit->pos);
347 }
348 }
349 else if (input->count(interface_key::SECONDSCROLL_PAGEDOWN))
350 {
351 window_days += min_window;
352 if (window_days > max_history_days)
353 window_days = min_window;
354
355 populateDwarfColumn();
356 }
357 else if (input->count(interface_key::CURSOR_LEFT))
358 {
359 --selected_column;
360 validateColumn();
361 }
362 else if (input->count(interface_key::CURSOR_RIGHT))

Callers

nothing calls this directly

Calls 8

open_stats_screenFunction · 0.85
send_keyFunction · 0.85
move_cursorFunction · 0.85
getFirstSelectedElemMethod · 0.80
setHighlightByMouseMethod · 0.80
feedMethod · 0.45
countMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected