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

Function make_pen

plugins/design.cpp:121–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121Screen::Pen make_pen(const std::pair<int, int> &direction, bool is_drag_point,
122 bool is_mouse_over, bool inshape, bool extra_point) {
123 color_value color = COLOR_GREEN;
124 int ycursor_mod = 0;
125
126 if (!extra_point) {
127 if (is_drag_point) {
128 color = COLOR_CYAN;
129 ycursor_mod += 6;
130 if (is_mouse_over) {
131 color = COLOR_MAGENTA;
132 ycursor_mod += 3;
133 }
134 }
135 } else {
136 ycursor_mod += 15;
137 color = COLOR_LIGHTRED;
138
139 if (is_mouse_over) {
140 color = COLOR_RED;
141 ycursor_mod += 3;
142 }
143 }
144
145 Screen::Pen pen;
146 pen.ch = inshape ? 'X' : 'o';
147 pen.fg = color;
148 int selected_tile_texpos = 0;
149 Screen::findGraphicsTile("CURSORS", direction.first,
150 direction.second + ycursor_mod,
151 &selected_tile_texpos);
152 pen.tile = selected_tile_texpos;
153
154 return pen;
155}
156
157void get_pen(Screen::Pen * tile_pen, int * highlight_tile,
158 int x, int y, ShapeMap &arr, const std::string &type = "")

Callers 1

get_penFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected