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

Method display

plugins/listcolumn.h:109–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 virtual void display_extras(const T &elem, int32_t &x, int32_t &y) const {}
108
109 void display(const bool is_selected_column) const
110 {
111 int32_t y = 2;
112 paint_text(COLOR_TITLE, left_margin, y, title);
113
114 int last_index_able_to_display = display_start_offset + display_max_rows;
115 for (int i = display_start_offset; size_t(i) < display_list.size() && i < last_index_able_to_display; i++)
116 {
117 ++y;
118 UIColor fg_color = (is_selected_column && display_list[i]->selected) ? COLOR_SELECTED : display_list[i]->color;
119 UIColor bg_color = (is_selected_column && i == highlighted_index) ? COLOR_HIGHLIGHTED : COLOR_BLACK;
120
121 string item_label = display_list[i]->text;
122 if (text_clip_at > 0 && item_label.length() > text_clip_at)
123 item_label.resize(text_clip_at);
124
125 paint_text(fg_color, left_margin, y, item_label, bg_color);
126 int x = left_margin + display_list[i]->text.length() + 1;
127 display_extras(display_list[i]->elem, x, y);
128 }
129
130 if (is_selected_column && allow_search)
131 {
132 y = gps->dimy - 3;
133 int32_t x = search_margin;
134 OutputHotkeyString(x, y, "Search" ,"S");
135 OutputString(COLOR_WHITE, x, y, ": ");
136 OutputString(COLOR_WHITE, x, y, search_string);
137 OutputString(COLOR_LIGHTGREEN, x, y, "_");
138 }
139 }
140
141 virtual void tokenizeSearch (vector<string> *dest, const string search)
142 {

Callers 5

renderMethod · 0.80
renderMethod · 0.80
renderMethod · 0.80
renderMethod · 0.80
renderMethod · 0.80

Calls 6

paint_textFunction · 0.85
OutputHotkeyStringFunction · 0.85
OutputStringFunction · 0.85
lengthMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected