53 screenoccupation = screenoccupation_;
55 factioncolours = factioncolours_;
86 head =
new navdrawnode( type, size, x, y, source, NULL );
89 head =
new navdrawnode( type, size, x, y, source, head );
98 while (temp != NULL) {
128 bool ignore_occupied_areas,
142 bool ignore_occupied_areas,
146 if (text.size() == 0)
150 displayname.
col = col;
152 int length = text.size();
153 float offset = (
float(length)*0.005);
154 if (ignore_occupied_areas) {
155 displayname.
SetPos( (x_-offset), y_ );
160 displayname.
SetPos( (x_-offset), new_y );
164 static float background_alpha =
167 bool automatte = (0 == tpbg.a);
168 if (automatte) displayname.
bgcol =
GFXColor( 0, 0, 0, background_alpha );
169 displayname.
Draw( text, 0,
true,
false, automatte );
170 displayname.
bgcol = tpbg;
178 #define INIT_COL_ARRAY( col, r, g, b, a ) do{ col[0] = r; col[1] = g; col[2] = b; col[3] = a; }while(0)
182 vs_config->
getColor(
"nav", (std::string(
"unhighlighted_" )+name)+(text ?
"_text" :
""), col,
true );
184 if (name !=
"unit" && col[0] == 0 && col[1] == 0 && col[2] == 0) {
191 temp.
a = unselectedalpha;
195 col[3] = unselectedalpha;
197 return GFXColor( col[0], col[1], col[2], col[3] );
208 float unselectedalpha,
211 float relation = 0.0;
212 static GFXColor unhighlighted_sun_col;
213 static GFXColor unhighlighted_sun_text;
214 static GFXColor unhighlighted_planet_text;
215 static GFXColor unhighlighted_c_player_col;
216 static GFXColor unhighlighted_c_player_text;
217 static GFXColor unhighlighted_player_col;
218 static GFXColor unhighlighted_player_text;
219 static GFXColor unhighlighted_asteroid_col;
220 static GFXColor unhighlighted_asteroid_text;
221 static GFXColor unhighlighted_nebula_col;
222 static GFXColor unhighlighted_nebula_text;
223 static GFXColor unhighlighted_jump_col;
224 static GFXColor unhighlighted_jump_text;
225 static GFXColor unhighlighted_station_text;
226 static GFXColor unhighlighted_fighter_text;
227 static GFXColor unhighlighted_unit_text;
228 static GFXColor highlighted_tail_col;
229 static GFXColor highlighted_tail_text;
230 static GFXColor highlighted_untail_col;
231 static GFXColor unhighlighted_capship_text;
232 static bool init =
false;
239 highlighted_tail_col =
GFXColor( col[0], col[1], col[2], col[3] );
243 highlighted_tail_text =
GFXColor( col[0], col[1], col[2], col[3] );
247 highlighted_untail_col =
GFXColor( col[0], col[1], col[2], col[3] );
250 unhighlighted_sun_col =
getUnitTypeColor(
"sun",
false, col, unselectedalpha );
252 unhighlighted_sun_text =
getUnitTypeColor(
"sun",
true, col, unselectedalpha );
256 unhighlighted_planet_text =
getUnitTypeColor(
"planet",
true, col, unselectedalpha );
259 unhighlighted_c_player_col =
getUnitTypeColor(
"curplayer",
false, col, .8 );
261 unhighlighted_c_player_text =
getUnitTypeColor(
"curplayer",
true, col, unselectedalpha );
266 unhighlighted_player_text =
getUnitTypeColor(
"player",
true, col, unselectedalpha );
271 unhighlighted_player_text =
getUnitTypeColor(
"player",
true, col, unselectedalpha );
274 unhighlighted_asteroid_col =
getUnitTypeColor(
"asteroid",
false, col, .6 );
276 unhighlighted_asteroid_text =
getUnitTypeColor(
"asteroid",
true, col, unselectedalpha );
281 unhighlighted_nebula_text =
getUnitTypeColor(
"nebula",
true, col, unselectedalpha );
286 unhighlighted_jump_text =
getUnitTypeColor(
"jump",
true, col, unselectedalpha );
290 unhighlighted_station_text =
getUnitTypeColor(
"station",
true, col, unselectedalpha );
292 unhighlighted_fighter_text =
getUnitTypeColor(
"fighter",
true, col, unselectedalpha );
294 unhighlighted_capship_text =
getUnitTypeColor(
"capship",
true, col, unselectedalpha );
296 unhighlighted_unit_text =
getUnitTypeColor(
"unit",
true, col, unselectedalpha );
309 relation = relation*0.5;
310 relation = relation+0.5;
313 GFXColor relColor( (1.0-relation), relation, ( 1.0-( 2.0*
Delta( relation, 0.5 ) ) ), .7 );
318 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_sun_text );
328 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_planet_text );
338 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_c_player_text );
348 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_player_col );
358 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_station_text );
367 if (factioncolours == NULL) {
369 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_fighter_text );
373 thecolor.
a = unselectedalpha;
374 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, thecolor );
384 if (factioncolours == NULL) {
386 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_capship_text );
391 thecolor.
a = unselectedalpha;
393 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, thecolor );
416 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_asteroid_text );
426 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_nebula_text );
436 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_jump_text );
446 GFXColor( (1.0-relation), relation, ( 1.0-( 2.0*
Delta( relation, 0.5 ) ) ), .6 ) );
447 drawdescription( source, x, y, 1.0, 1.0,
false, screenoccupation, unhighlighted_unit_text );
456 if ( (currentistail) && (inmouserange == 1) )
458 drawdescription( source, x, y, 2.0, 2.0,
false, screenoccupation,
GFXColor( 1, 1, .7, 1 ) );
467 while (current != NULL) {