Oolite
Loading...
Searching...
No Matches
GuiDisplayGen Class Reference

#include <GuiDisplayGen.h>

Inheritance diagram for GuiDisplayGen:
Collaboration diagram for GuiDisplayGen:

Instance Methods

(id) - init
(id) - initWithPixelSize:columns:rows:rowHeight:rowStart:title:
(void) - resizeWithPixelSize:columns:rows:rowHeight:rowStart:title:
(void) - resizeTo:characterHeight:title:
(NSSize) - size
(unsigned) - columns
(unsigned) - rows
(unsigned) - rowHeight
(int) - rowStart
(NSString *) - title
(void) - setTitle:
(void) - dealloc
(void) - setDrawPosition:
(Vector) - drawPosition
(NSDictionary *) - userSettings
(void) - fadeOutFromTime:overDuration:
(void) - stopFadeOuts
(GLfloat) - alpha
(void) - setAlpha:
(void) - setMaxAlpha:
(void) - setBackgroundColor:
(OOColor *) - textColor
(void) - setTextColor:
(OOColor *) - textCommsColor
(void) - setTextCommsColor:
(OOColor *) - colorFromSetting:defaultValue:
(void) - setGLColorFromSetting:defaultValue:alpha:
(void) - setGuiColorSettingFromKey:color:
(void) - setCharacterSize:
(void) - setShowAdvancedNavArray:
(void) - setColor:forRow:
(id) - objectForRow:
(NSString *) - keyForRow:
(OOGUIRow) - rowForKey:
(OOGUIRow) - selectedRow
(BOOL) - setSelectedRow:
(BOOL) - setNextRow:
(BOOL) - setFirstSelectableRow
(BOOL) - setLastSelectableRow
(void) - setNoSelectedRow
(NSString *) - selectedRowText
(NSString *) - selectedRowKey
(void) - reportSelectedRow:
(void) - setShowTextCursor:
(void) - setCurrentRow:
(NSRange) - selectableRange
(void) - setSelectableRange:
(void) - setTabStops:
(void) - overrideTabs:from:length:
(void) - clear
(void) - clearAndKeepBackground:
(void) - setKey:forRow:
(void) - setText:forRow:
(void) - setText:forRow:align:
(NSString *) - reflowTextForMFD:
(OOGUIRow) - addLongText:startingAtRow:align:
(void) - printLongText:align:color:fadeTime:key:addToArray:
(void) - printLineNoScroll:align:color:fadeTime:key:addToArray:
(void) - setArray:forRow:
(void) - insertItemsFromArray:withKeys:intoRow:color:
(void) - scrollUp:
(void) - setBackgroundTextureSpecial:withBackground:
(BOOL) - setBackgroundTextureDescriptor:
(BOOL) - setForegroundTextureDescriptor:
(BOOL) - setBackgroundTextureKey:
(BOOL) - setForegroundTextureKey:
(BOOL) - preloadGUITexture:
(NSDictionary *) - textureDescriptorFromJSValue:inContext:callerDescription:
(void) - clearBackground
(void) - leaveLastLine
(NSArray *) - getLastLines
(int) - drawGUI:drawCursor:
(void) - drawGUIBackground
(void) - setStatusPage:
(NSUInteger) - statusPage
(void) - refreshStarChart
(void) - setStarChartTitle
(OOSystemID) - targetNextFoundSystem:
(void) - drawEquipmentList:z: [implementation]
(void) - drawGLDisplay:y:z:alpha: [implementation]
(void) - drawCrossHairsWithSize:x:y:z: [implementation]
(void) - drawStarChart:y:z:alpha:compact: [implementation]
(void) - drawSystemMarkers:atX:andY:andZ:withAlpha:andScale: [implementation]
(void) - drawSystemMarker:atX:andY:andZ:withAlpha:andScale: [implementation]
(void) - drawAdvancedNavArrayAtX:y:z:alpha:usingRoute:optimizedBy:zoom: [implementation]

Class Methods

(static OOTexture *) + TextureForGUITexture [implementation]
(static OOTextureSprite *) + NewTextureSpriteWithDescriptor [implementation]

Private Attributes

NSSize size_in_pixels
unsigned n_columns
unsigned n_rows
int pixel_row_center
unsigned pixel_row_height
int pixel_row_start
NSSize pixel_text_size
BOOL showAdvancedNavArray
NSSize pixel_title_size
OOColor * backgroundColor
OOColor * textColor
OOColor * textCommsColor
OOTextureSprite * backgroundSprite
OOTextureSprite * foregroundSprite
OOGUIBackgroundSpecial backgroundSpecial
NSString * title
NSMutableArray * rowText
NSMutableArray * rowKey
NSMutableArray * rowColor
Vector drawPosition
NSPoint rowPosition [GUI_MAX_ROWS]
OOGUIAlignment rowAlignment [GUI_MAX_ROWS]
float rowFadeTime [GUI_MAX_ROWS]
OOGUITabSettings tabStops
NSDictionary * guiUserSettings
NSRange rowRange
OOGUIRow selectedRow
NSRange selectableRange
BOOL showTextCursor
OOGUIRow currentRow
GLfloat max_alpha
GLfloat fade_alpha
GLfloat fade_sign
NSUInteger statusPage
OOSystemID foundSystem

Detailed Description

Definition at line 164 of file GuiDisplayGen.h.

Method Documentation

◆ addLongText:startingAtRow:align:

- (OOGUIRow) addLongText: (NSString*) str
startingAtRow: (OOGUIRow) row
align: (OOGUIAlignment) alignment 

Definition at line 628 of file GuiDisplayGen.m.

628 :(NSString*)str
629 startingAtRow:(OOGUIRow)row
630 align:(OOGUIAlignment)alignment
631{
632
633 if ([str rangeOfString:@"\n"].location != NSNotFound) {
634 NSArray* lines = [str componentsSeparatedByString:@"\n"];
635 unsigned i;
636 for (i = 0; i < [lines count]; i++) {
637 row = [self addLongText:[lines oo_stringAtIndex:i] startingAtRow:row align:alignment];
638 }
639 return row;
640 }
641
642 NSSize chSize = pixel_text_size;
643 NSSize strsize = OORectFromString(str, 0.0f, 0.0f, chSize).size;
644 if (strsize.width < size_in_pixels.width) {
645 [self setText:str forRow:row align:alignment];
646 return row + 1;
647 } else {
648 NSMutableArray* words = ScanTokensFromString(str);
649 NSMutableString* string1 = [NSMutableString stringWithCapacity:256];
650 NSMutableString* string2 = [NSMutableString stringWithCapacity:256];
651 strsize.width = 0.0f;
652 while ((strsize.width < size_in_pixels.width) && ([words count] > 0)) {
653 [string1 appendString:(NSString*)[words objectAtIndex:0]];
654 [string1 appendString:@" "];
655 [words removeObjectAtIndex:0];
656 strsize = OORectFromString(string1, 0.0f, 0.0f, chSize).size;
657 if ([words count] > 0)
658 strsize.width += OORectFromString((NSString*)[words objectAtIndex:0], 0.0f, 0.0f, chSize).size.width;
659 }
660 [string2 appendString:[words componentsJoinedByString:@" "]];
661 [self setText:string1 forRow:row align:alignment];
662 return [self addLongText:string2 startingAtRow:row + 1 align:alignment];
663 }
664}
NSInteger OOGUIRow
OOGUIAlignment
NSRect OORectFromString(NSString *text, GLfloat x, GLfloat y, NSSize siz)
unsigned count
NSMutableArray * ScanTokensFromString(NSString *values)
NSSize pixel_text_size
NSSize size_in_pixels

References addLongText:startingAtRow:align:, count, OORectFromString(), pixel_text_size, ScanTokensFromString(), setText:forRow:align:, and size_in_pixels.

Referenced by PlayerEntity(Scripting)::addLiteralMissionText:, addLongText:startingAtRow:align:, OOOXZManager::gui, OOOXZManager::processShowInfoKey, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToIntroFirstGo:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, PlayerEntity(OOLoadSavePrivate)::showCommanderShip:, PlayerEntity::showInformationForSelectedInterface, PlayerEntity::showInformationForSelectedUpgradeWithFormatString:, OOOXZManager::showInstallOptions, OOOXZManager::showRemoveOptions, PlayerEntity(LoadSave)::showScenarioDetails, and PlayerEntity(Contracts)::showShipyardInfoForSelection.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alpha

- (GLfloat) alpha

Definition at line 315 of file GuiDisplayGen.m.

316{
317 return fade_alpha;
318}

References alpha, and fade_alpha.

Referenced by alpha, drawGUI:drawCursor:, Universe::drawMessage, drawPosition, and setGLColorFromSetting:defaultValue:alpha:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear

◆ clearAndKeepBackground:

- (void) clearAndKeepBackground: (BOOL) keepBackground

Definition at line 589 of file GuiDisplayGen.m.

589 :(BOOL)keepBackground
590{
591 unsigned i;
592 [self setTitle:nil];
593 for (i = 0; i < n_rows; i++) {
594 [self setText:@"" forRow:i align:GUI_ALIGN_LEFT];
595 [self setColor:textColor forRow:i];
596 //
597 [self setKey:GUI_KEY_SKIP forRow:i];
598 //
599 rowFadeTime[i] = 0.0f;
600 }
601 [self setShowTextCursor:NO];
602 [self setSelectableRange:NSMakeRange(0, 0)];
603 if (!keepBackground)
604 [self clearBackground];
605}
float rowFadeTime[GUI_MAX_ROWS]

References clearBackground, n_rows, rowFadeTime, setColor:forRow:, setKey:forRow:, setSelectableRange:, setShowTextCursor:, setText:forRow:align:, and setTitle:.

Referenced by clear, OOOXZManager::gui, OOOXZManager::processShowInfoKey, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity::setGuiToLongRangeChartScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToShortRangeChartScreen, PlayerEntity::setGuiToStatusScreen, and PlayerEntity::setGuiToSystemDataScreenRefreshBackground:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearBackground

- (void) clearBackground

Definition at line 882 of file GuiDisplayGen.m.

883{
884 [self setBackgroundTextureDescriptor:nil];
885 [self setForegroundTextureDescriptor:nil];
886}

References clearBackground, setBackgroundTextureDescriptor:, and setForegroundTextureDescriptor:.

Referenced by clearAndKeepBackground:, clearBackground, PlayerEntity(OOControlsPrivate)::pollDemoControls:, and selectableRange.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ colorFromSetting:defaultValue:

- (OOColor *) colorFromSetting: (NSString*) setting
defaultValue: (OOColor*) def 

Definition at line 363 of file GuiDisplayGen.m.

363 :(NSString*)setting defaultValue:(OOColor*)def
364{
365
366 OOColor* col = nil;
367 if (setting != nil) {
368 col = [OOColor colorWithDescription:[guiUserSettings objectForKey:setting]];
369 }
370 if (col == nil) {
371 if (def != nil) {
372 col = def;
373 // def = nil => use default_text_color
374 } else {
375 col = textColor;
376 }
377 }
378 return [[col copy] autorelease];
379}
return nil
OOColor * textColor
OOColor * colorWithDescription:(id description)
Definition OOColor.m:135

References OOColor::colorWithDescription:, nil, and textColor.

Referenced by PlayerEntity(Contracts)::buySelectedShip, GuiDisplayGen(Internal)::drawAdvancedNavArrayAtX:y:z:alpha:usingRoute:optimizedBy:zoom:, GuiDisplayGen(Internal)::drawEquipmentList:z:, GlobalGetGuiColorSettingForKey(), GlobalGetGuiColorSettingForKey(), setGLColorFromSetting:defaultValue:alpha:, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToStatusScreen, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, PlayerEntity(OOLoadSavePrivate)::showCommanderShip:, PlayerEntity::showInformationForSelectedInterface, PlayerEntity::showInformationForSelectedUpgradeWithFormatString:, PlayerEntity(OOPrivate)::showMarketCashAndLoadLine, PlayerEntity(OOPrivate)::showMarketScreenDataLine:forGood:inMarket:holdQuantity:, PlayerEntity(OOPrivate)::showMarketScreenHeaders, PlayerEntity(Contracts)::showShipyardInfoForSelection, and PlayerEntity(Contracts)::showTradeInInformationFooter.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ columns

- (unsigned) columns

Definition at line 249 of file GuiDisplayGen.m.

250{
251 return n_columns;
252}
unsigned n_columns

References columns, and n_columns.

Referenced by columns.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dealloc

- (void) dealloc

Definition at line 160 of file GuiDisplayGen.m.

161{
162 [backgroundSprite release];
163 [foregroundSprite release];
164 [backgroundColor release];
165 [textColor release];
166 [title release];
167 [rowText release];
168 [rowKey release];
169 [rowColor release];
170 [guiUserSettings release];
171
172 [super dealloc];
173}

References dealloc.

Referenced by dealloc, and title.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawAdvancedNavArrayAtX:y:z:alpha:usingRoute:optimizedBy:zoom:

- (void) drawAdvancedNavArrayAtX: (float) x
y: (float) y
z: (float) z
alpha: (float) alpha
usingRoute: (NSDictionary*) routeInfo
optimizedBy: (OORouteType) optimizeBy
zoom: (OOScalar) zoom 
implementation

Provided by category GuiDisplayGen(Internal).

Definition at line 2177 of file GuiDisplayGen.m.

2177 :(float)x y:(float)y z:(float)z alpha:(float)alpha usingRoute:(NSDictionary*)routeInfo optimizedBy:(OORouteType)optimizeBy zoom:(OOScalar)zoom
2178{
2179 GLfloat lr, lg, lb, la, lr2, lg2, lb2, la2;
2180 double hscale = size_in_pixels.width / (CHART_WIDTH_AT_MAX_ZOOM * zoom);
2181 double vscale = -1.0 * size_in_pixels.height / (2 * CHART_HEIGHT_AT_MAX_ZOOM * zoom);
2182 NSPoint star = NSZeroPoint,
2183 star2 = NSZeroPoint,
2184 starabs = NSZeroPoint,
2185 star2abs = NSZeroPoint;
2186 OOSystemDescriptionManager* systemManager = [UNIVERSE systemManager];
2187 OOGalaxyID g = [PLAYER galaxyNumber];
2188 OOSystemID planetNumber = [PLAYER systemID];
2189
2190 OOColor* defaultConnectionColor = [self colorFromSetting:kGuiChartConnectionColor defaultValue:[OOColor colorWithWhite:0.25 alpha:1.0]];
2191 OOColor* currentJumpColorStart = [self colorFromSetting:kGuiChartCurrentJumpStartColor defaultValue:[OOColor colorWithWhite:0.25 alpha:0.0]];
2192 OOColor* currentJumpColorEnd = [self colorFromSetting:kGuiChartCurrentJumpEndColor defaultValue:[OOColor colorWithWhite:0.25 alpha:0.0]];
2193
2194 OOColor* thisConnectionColor = nil;
2195 OOColor* thatConnectionColor = nil;
2196
2197 float jumpRange = MAX_JUMP_RANGE * ((optimizeBy == OPTIMIZED_BY_NONE) ? [PLAYER dialFuel] : 1.0);
2198
2199 NSInteger concealment[256];
2200 for (NSUInteger i = 0; i < 256; i++) {
2201 NSDictionary* systemInfo = [systemManager getPropertiesForSystem:i inGalaxy:g];
2202 concealment[i] = [systemInfo oo_intForKey:@"concealment" defaultValue:OO_SYSTEMCONCEALMENT_NONE];
2203 }
2204
2205 OOGLBEGIN(GL_LINES);
2206 for (OOSystemID i = 0; i < 256; i++) {
2207
2208 if (concealment[i] >= OO_SYSTEMCONCEALMENT_NOTHING) {
2209 // system is not known
2210 continue;
2211 }
2212
2213 /* Concealment */
2214 if (optimizeBy == OPTIMIZED_BY_NONE && i != planetNumber) {
2215 continue;
2216 }
2217
2218 starabs = [systemManager getCoordinatesForSystem:i inGalaxy:g];
2219
2220 star.x = (float)(starabs.x * hscale);
2221 star.y = (float)(starabs.y * vscale);
2222
2223 // if in non-route mode, we're always starting from i, so need
2224 // to do <i here too.
2225 OOSystemID loopstart = (optimizeBy == OPTIMIZED_BY_NONE) ? 0 : (i + 1);
2226
2227 for (OOSystemID j = loopstart; j < 256; j++) {
2228 if (i == j) {
2229 continue; // for OPTIMIZED_BY_NONE case
2230 }
2231
2232 if (concealment[j] >= OO_SYSTEMCONCEALMENT_NOTHING) {
2233 // system is not known
2234 continue;
2235 }
2236
2237 star2abs = [systemManager getCoordinatesForSystem:j inGalaxy:g];
2238 double d = distanceBetweenPlanetPositions(starabs.x, starabs.y, star2abs.x, star2abs.y);
2239
2240 if (d <= jumpRange) // another_commander - Default to 7.0 LY.
2241 {
2242 star2.x = (float)(star2abs.x * hscale);
2243 star2.y = (float)(star2abs.y * vscale);
2244 if (optimizeBy == OPTIMIZED_BY_NONE) {
2245 [currentJumpColorStart getRed:&lr green:&lg blue:&lb alpha:&la];
2246 [currentJumpColorEnd getRed:&lr2 green:&lg2 blue:&lb2 alpha:&la2];
2247 OOGL(glColor4f(lr, lg, lb, la * alpha));
2248 glVertex3f(x + star.x, y + star.y, z);
2249
2250 float frac = (d / jumpRange);
2251 OOGL(glColor4f(
2252 OOLerp(lr, lr2, frac),
2253 OOLerp(lg, lg2, frac),
2254 OOLerp(lb, lb2, frac),
2255 OOLerp(la, la2, frac)));
2256 glVertex3f(x + star2.x, y + star2.y, z);
2257
2258 } else {
2259 thisConnectionColor = [OOColor colorWithDescription:[systemManager getProperty:@"link_color" forSystemKey:[NSString stringWithFormat:@"interstellar: %d %ld %ld", g, (long)i, (long)j]]];
2260
2261 if (thisConnectionColor == nil) {
2262 thisConnectionColor = defaultConnectionColor;
2263 }
2264 [thisConnectionColor getRed:&lr green:&lg blue:&lb alpha:&la];
2265 OOGL(glColor4f(lr, lg, lb, la * alpha));
2266
2267 glVertex3f(x + star.x, y + star.y, z);
2268
2269 // and the other colour for the other end
2270 thatConnectionColor = [OOColor colorWithDescription:[systemManager getProperty:@"link_color" forSystemKey:[NSString stringWithFormat:@"interstellar: %d %ld %ld", g, (long)j, (long)i]]];
2271
2272 if (thatConnectionColor == nil) {
2273 thatConnectionColor = thisConnectionColor;
2274 }
2275 [thatConnectionColor getRed:&lr green:&lg blue:&lb alpha:&la];
2276 OOGL(glColor4f(lr, lg, lb, la * alpha));
2277
2278 glVertex3f(x + star2.x, y + star2.y, z);
2279 }
2280 }
2281 }
2282 }
2283 OOGLEND();
2284
2285 if (optimizeBy == OPTIMIZED_BY_NONE) {
2286 return;
2287 }
2288
2289 if (routeInfo) {
2290 NSUInteger i, route_hops = [[routeInfo oo_arrayForKey:@"route"] count] - 1;
2291
2292 if (optimizeBy == OPTIMIZED_BY_JUMPS) {
2293 // route optimised by distance
2294 [self setGLColorFromSetting:kGuiChartRouteShortColor defaultValue:[OOColor yellowColor] alpha:alpha];
2295 } else {
2296 // route optimised by time
2297 [self setGLColorFromSetting:kGuiChartRouteQuickColor defaultValue:[OOColor cyanColor] alpha:alpha];
2298 }
2299 OOSystemID loc;
2300 for (i = 0; i < route_hops; i++) {
2301 loc = [[routeInfo objectForKey:@"route"] oo_intAtIndex:i];
2302 starabs = [systemManager getCoordinatesForSystem:loc inGalaxy:g];
2303 star2abs = [systemManager getCoordinatesForSystem:[[routeInfo objectForKey:@"route"] oo_intAtIndex:i + 1] inGalaxy:g];
2304
2305 star.x = (float)(starabs.x * hscale);
2306 star.y = (float)(starabs.y * vscale);
2307
2308 star2.x = (float)(star2abs.x * hscale);
2309 star2.y = (float)(star2abs.y * vscale);
2310
2311 OOGLBEGIN(GL_LINES);
2312 glVertex3f(x + star.x, y + star.y, z);
2313 glVertex3f(x + star2.x, y + star2.y, z);
2314 OOGLEND();
2315
2316 // Label the route, if not already labelled
2317 if (zoom > CHART_ZOOM_SHOW_LABELS && concealment[loc] < OO_SYSTEMCONCEALMENT_NONAME) {
2318 OODrawString([UNIVERSE systemNameIndex:loc], x + star.x + 2.0, y + star.y, z, NSMakeSize(8, 8));
2319 }
2320 }
2321 // Label the destination, which was not included in the above loop.
2322 if (zoom > CHART_ZOOM_SHOW_LABELS) {
2323 loc = [[routeInfo objectForKey:@"route"] oo_intAtIndex:i];
2324 if (concealment[loc] < OO_SYSTEMCONCEALMENT_NONAME) {
2325 OODrawString([UNIVERSE systemNameIndex:loc], x + star2.x + 2.0, y + star2.y, z, NSMakeSize(10, 10));
2326 }
2327 }
2328 }
2329}
void OODrawString(NSString *text, GLfloat x, GLfloat y, GLfloat z, NSSize siz)
OOINLINE float OOLerp(float v0, float v1, float fraction) INLINE_CONST_FUNC
GLfloat OOScalar
Definition OOMaths.h:49
#define OOGLBEGIN
Definition OOOpenGL.h:269
#define OOGL(statement)
Definition OOOpenGL.h:262
#define OOGLEND
Definition OOOpenGL.h:270
float y
float x
@ OO_SYSTEMCONCEALMENT_NOTHING
@ OO_SYSTEMCONCEALMENT_NONAME
OORouteType
Definition OOTypes.h:31
@ OPTIMIZED_BY_NONE
Definition OOTypes.h:32
@ OPTIMIZED_BY_JUMPS
Definition OOTypes.h:33
int16_t OOSystemID
Definition OOTypes.h:183
uint8_t OOGalaxyID
Definition OOTypes.h:182
#define CHART_WIDTH_AT_MAX_ZOOM
#define CHART_ZOOM_SHOW_LABELS
#define CHART_HEIGHT_AT_MAX_ZOOM
#define MAX_JUMP_RANGE
Definition ShipEntity.h:109
#define UNIVERSE
Definition Universe.h:827
OOColor * cyanColor()
Definition OOColor.m:274
OOColor * colorWithWhite:alpha:(float white,[alpha] float alpha)
Definition OOColor.m:114
void getRed:green:blue:alpha:(float *red,[green] float *green,[blue] float *blue,[alpha] float *alpha)
Definition OOColor.m:344
OOColor * yellowColor()
Definition OOColor.m:279
NSPoint getCoordinatesForSystem:inGalaxy:(OOSystemID s,[inGalaxy] OOGalaxyID g)
NSDictionary * getPropertiesForSystem:inGalaxy:(OOSystemID s,[inGalaxy] OOGalaxyID g)
id getProperty:forSystemKey:(NSString *property,[forSystemKey] NSString *key)
OOINLINE double distanceBetweenPlanetPositions(int x1, int y1, int x2, int y2) INLINE_CONST_FUNC

References CHART_HEIGHT_AT_MAX_ZOOM, CHART_WIDTH_AT_MAX_ZOOM, CHART_ZOOM_SHOW_LABELS, colorFromSetting:defaultValue:, OOColor::colorWithDescription:, OOColor::colorWithWhite:alpha:, OOColor::cyanColor, distanceBetweenPlanetPositions(), OOSystemDescriptionManager::getCoordinatesForSystem:inGalaxy:, OOSystemDescriptionManager::getPropertiesForSystem:inGalaxy:, OOSystemDescriptionManager::getProperty:forSystemKey:, OOColor::getRed:green:blue:alpha:, MAX_JUMP_RANGE, nil, OO_SYSTEMCONCEALMENT_NONAME, OO_SYSTEMCONCEALMENT_NOTHING, OODrawString(), OOGL, OOGLBEGIN, OOGLEND, OOLerp(), OPTIMIZED_BY_JUMPS, OPTIMIZED_BY_NONE, setGLColorFromSetting:defaultValue:alpha:, UNIVERSE, x, y, and OOColor::yellowColor.

Referenced by GuiDisplayGen(Internal)::drawStarChart:y:z:alpha:compact:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawCrossHairsWithSize:x:y:z:

- (void) drawCrossHairsWithSize: (GLfloat) size
x: (GLfloat) x
y: (GLfloat) y
z: (GLfloat) z 
implementation

Provided by category GuiDisplayGen(Internal).

Definition at line 1530 of file GuiDisplayGen.m.

1530 :(GLfloat)size x:(GLfloat)x y:(GLfloat)y z:(GLfloat)z
1531{
1532 OOGLBEGIN(GL_QUADS);
1533 glVertex3f(x - 1, y - size, z);
1534 glVertex3f(x + 1, y - size, z);
1535 glVertex3f(x + 1, y + size, z);
1536 glVertex3f(x - 1, y + size, z);
1537 glVertex3f(x - size, y - 1, z);
1538 glVertex3f(x + size, y - 1, z);
1539 glVertex3f(x + size, y + 1, z);
1540 glVertex3f(x - size, y + 1, z);
1541 OOGLEND();
1542}

References OOGLBEGIN, OOGLEND, x, and y.

Referenced by GuiDisplayGen(Internal)::drawStarChart:y:z:alpha:compact:.

Here is the caller graph for this function:

◆ drawEquipmentList:z:

- (void) drawEquipmentList: (NSArray*) eqptList
z: (GLfloat) z 
implementation

add color selection here

Provided by category GuiDisplayGen(Internal).

Definition at line 1103 of file GuiDisplayGen.m.

1103 :(NSArray*)eqptList z:(GLfloat)z
1104{
1105 if ([eqptList count] == 0)
1106 return;
1107
1109 NSUInteger maxRows = STATUS_EQUIPMENT_MAX_ROWS;
1110 if ([[PLAYER hud] allowBigGui]) {
1112 }
1113 NSUInteger itemsPerColumn = maxRows;
1114
1115 NSInteger firstY = 40; // firstRow =10 :-> 40 - firstRow=11 -> 24 etc...
1116 NSUInteger eqptCount = [eqptList count];
1117 NSUInteger pageCount = 1;
1118 NSUInteger i;
1119 NSInteger start;
1120 NSArray* info = nil;
1121 NSString* name = nil;
1122 BOOL damaged;
1123
1124 // Paging calculations. Assuming 10 lines we get - one page:20 items per page (ipp)
1125 // two pages: 18 ipp - three+ pages: 1st & last 18pp, middle pages 16ipp
1126
1127 i = itemsPerColumn * 2 + 2;
1128 if (eqptCount > i) // don't fit in one page?
1129 {
1130 [[UNIVERSE gameController] setMouseInteractionModeForUIWithMouseInteraction:YES];
1131
1132 i = itemsPerColumn * 4; // total items in the first and last pages
1133 itemsPerColumn--; // for all the middle pages.
1134 if (eqptCount <= i) // two pages
1135 {
1136 pageCount++;
1137 if (statusPage == 1) {
1138 start = 0;
1139 } else {
1140 statusPage = 2;
1141 start = i / statusPage; // for the for loop
1142 }
1143 } else // three or more
1144 {
1145 pageCount = ceil((float)(eqptCount - i) / (itemsPerColumn * 2)) + 2;
1146 statusPage = (NSInteger)OOClampInteger(statusPage, 1, pageCount);
1147 start = (statusPage == 1) ? 0 : (statusPage - 1) * itemsPerColumn * 2 + 2;
1148 }
1149 } else {
1150 statusPage = pageCount; // one page
1151 start = 0;
1152 // if we have mouse interaction active, it means that we had more than one
1153 // pages earlier, but only one now, as e.g. in the case of a hud that wss
1154 // subsequently hidden, resulting in the equip list fitting in one page,
1155 // so we need to deactivate it
1156 if (OOMouseInteractionModeIsUIScreen([[UNIVERSE gameController] mouseInteractionMode])) {
1157 // clear the gui-more and gui-back key rows first
1158 [self setText:@"" forRow:firstRow];
1159 [self setKey:GUI_KEY_SKIP forRow:firstRow];
1160 [self setText:@"" forRow:firstRow + STATUS_EQUIPMENT_MAX_ROWS];
1161 [self setKey:GUI_KEY_SKIP forRow:firstRow + STATUS_EQUIPMENT_MAX_ROWS];
1162 [self setSelectableRange:NSMakeRange(0, 0)];
1163
1164 [[UNIVERSE gameController] setMouseInteractionModeForUIWithMouseInteraction:NO];
1165 }
1166 }
1167
1168 if (statusPage > 1) {
1169 [self setColor:[self colorFromSetting:kGuiStatusEquipmentScrollColor defaultValue:[OOColor greenColor]] forRow:firstRow];
1170 [self setArray:[NSArray arrayWithObjects:DESC(@"gui-back"), @"", @" <-- ", nil] forRow:firstRow];
1171 [self setKey:GUI_KEY_OK forRow:firstRow];
1172 firstY -= 16; // start 1 row down!
1173 if (statusPage == pageCount) {
1174 [self setSelectableRange:NSMakeRange(firstRow, 1)];
1175 [self setSelectedRow:firstRow];
1176 }
1177 }
1178 if (statusPage < pageCount) {
1179 [self setColor:[self colorFromSetting:kGuiStatusEquipmentScrollColor defaultValue:[OOColor greenColor]] forRow:firstRow + maxRows];
1180 [self setArray:[NSArray arrayWithObjects:DESC(@"gui-more"), @"", @" --> ", nil] forRow:firstRow + maxRows];
1181 [self setKey:GUI_KEY_OK forRow:firstRow + maxRows];
1182 if (statusPage == 1) {
1183 [self setSelectableRange:NSMakeRange(firstRow + maxRows, 1)];
1184 [self setSelectedRow:firstRow + maxRows];
1185 }
1186 }
1187 if (statusPage > 1 && statusPage < pageCount) {
1188 [self setSelectableRange:NSMakeRange(firstRow, MIN(firstRow + maxRows, GUI_DEFAULT_ROWS - firstRow))];
1189 // default selected row to 'More -->' if we are looking at one of the middle pages
1190 if ([self selectedRow] == -1)
1191 [self setSelectedRow:firstRow + maxRows];
1192 }
1193
1194 if (statusPage == 1 || statusPage == pageCount)
1195 itemsPerColumn++;
1196 eqptCount = (NSInteger)OOClampInteger(eqptCount, 1, start + itemsPerColumn * 2);
1197 for (i = start; i < eqptCount; i++) {
1198 info = [eqptList oo_arrayAtIndex:i];
1199 name = [info oo_stringAtIndex:0];
1200 if ([name length] > 42)
1201 name = [[name substringToIndex:40] stringByAppendingString:@"..."];
1202
1203 damaged = ![info oo_boolAtIndex:1];
1204 if (damaged) {
1205 // Damaged items show up orange.
1206 [self setGLColorFromSetting:@"status_equipment_damaged_color" defaultValue:[OOColor orangeColor] alpha:1.0];
1207 } else
1208 {
1209 OOColor* dispCol = [info oo_objectAtIndex:2];
1210 // Normal items in default colour
1211 [self setGLColorFromSetting:@"status_equipment_ok_color" defaultValue:dispCol alpha:1.0];
1212 }
1213
1214 if (i - start < itemsPerColumn) {
1215 OODrawString(name, -220, firstY - 16 * (NSInteger)(i - start), z, NSMakeSize(15, 15));
1216 } else {
1217 OODrawString(name, 50, firstY - 16 * (NSInteger)(i - itemsPerColumn - start), z, NSMakeSize(15, 15));
1218 }
1219 }
1220}
OOINLINE long long OOClampInteger(long long value, long long minValue, long long maxValue) ALWAYS_INLINE_FUNC
BOOL OOMouseInteractionModeIsUIScreen(OOMouseInteractionMode mode)
@ STATUS_EQUIPMENT_FIRST_ROW
@ STATUS_EQUIPMENT_MAX_ROWS
@ STATUS_EQUIPMENT_BIGGUI_EXTRA_ROWS
#define PLAYER
OOGUIRow selectedRow
NSUInteger statusPage
OOColor * orangeColor()
Definition OOColor.m:289
OOColor * greenColor()
Definition OOColor.m:264

References colorFromSetting:defaultValue:, count, OOColor::greenColor, nil, OOClampInteger(), OODrawString(), OOMouseInteractionModeIsUIScreen(), OOColor::orangeColor, PLAYER, setArray:forRow:, setColor:forRow:, setGLColorFromSetting:defaultValue:alpha:, setKey:forRow:, setSelectableRange:, setSelectedRow:, setText:forRow:, STATUS_EQUIPMENT_BIGGUI_EXTRA_ROWS, STATUS_EQUIPMENT_FIRST_ROW, STATUS_EQUIPMENT_MAX_ROWS, and UNIVERSE.

Referenced by drawGUI:drawCursor:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawGLDisplay:y:z:alpha:

- (void) drawGLDisplay: (GLfloat) x
y: (GLfloat) y
z: (GLfloat) z
alpha: (GLfloat) alpha 
implementation

Provided by category GuiDisplayGen(Internal).

Definition at line 1321 of file GuiDisplayGen.m.

1321 :(GLfloat)x y:(GLfloat)y z:(GLfloat)z alpha:(GLfloat)alpha
1322{
1323 NSSize strsize;
1324 unsigned i;
1325 OOTimeDelta delta_t = [UNIVERSE getTimeDelta];
1326 NSSize characterSize = pixel_text_size;
1327 NSSize titleCharacterSize = pixel_title_size;
1328 float backgroundAlpha = self == [UNIVERSE messageGUI] && ![UNIVERSE permanentMessageLog] ? 0.0f : alpha;
1329 float row_alpha[n_rows];
1330
1331 // calculate fade out time and alpha for each row. Do it before
1332 // applying a potential background because we need the maximum alpha
1333 // of all rows to be the alpha applied to the background color
1334 for (i = 0; i < n_rows; i++) {
1335 row_alpha[i] = alpha;
1336
1337 if (![UNIVERSE autoMessageLogBg] && [PLAYER guiScreen] == GUI_SCREEN_MAIN)
1338 backgroundAlpha = alpha;
1339
1340 if (rowFadeTime[i] > 0.0f && ![UNIVERSE permanentMessageLog]) {
1341 rowFadeTime[i] -= (float)delta_t;
1342 if (rowFadeTime[i] <= 0.0f) {
1343 [rowText replaceObjectAtIndex:i withObject:@""];
1344 rowFadeTime[i] = 0.0f;
1345 continue;
1346 }
1347 if ((rowFadeTime[i] > 0.0f) && (rowFadeTime[i] < 1.0)) {
1348 row_alpha[i] *= rowFadeTime[i];
1349 if (backgroundAlpha < row_alpha[i])
1350 backgroundAlpha = row_alpha[i];
1351 } else {
1352 backgroundAlpha = alpha;
1353 }
1354 }
1355 }
1356
1357 // do backdrop
1358 // don't draw it if docked, unless message_gui is permanent
1359 // don't draw it on the intro screens
1360 if (backgroundColor) {
1361 int playerStatus = [PLAYER status];
1362 if (playerStatus != STATUS_START_GAME && playerStatus != STATUS_DEAD) {
1363 OOGL(glColor4f([backgroundColor redComponent], [backgroundColor greenComponent], [backgroundColor blueComponent], backgroundAlpha * [backgroundColor alphaComponent]));
1364 OOGLBEGIN(GL_QUADS);
1365 glVertex3f(x + 0.0f, y + 0.0f, z);
1366 glVertex3f(x + size_in_pixels.width, y + 0.0f, z);
1367 glVertex3f(x + size_in_pixels.width, y + size_in_pixels.height, z);
1368 glVertex3f(x + 0.0f, y + size_in_pixels.height, z);
1369 OOGLEND();
1370 }
1371 }
1372
1373 // show the 'foreground', aka overlay!
1374
1375 if (foregroundSprite != nil) {
1376 [foregroundSprite blitCentredToX:x + 0.5f * size_in_pixels.width Y:y + 0.5f * size_in_pixels.height Z:z alpha:alpha];
1377 }
1378
1380 selectedRow = -1; // out of Range;
1381
1383 // drawing operations here
1384
1385 if (title != nil) {
1386 //
1387 // draw the title
1388 //
1389 strsize = OORectFromString(title, 0.0f, 0.0f, titleCharacterSize).size;
1390 [self setGLColorFromSetting:kGuiScreenTitleColor defaultValue:[OOColor redColor] alpha:alpha];
1391
1392 OODrawString(title, x + pixel_row_center - strsize.width / 2.0, y + size_in_pixels.height - pixel_title_size.height, z, titleCharacterSize);
1393
1394 // draw a horizontal divider
1395 //
1396 [self setGLColorFromSetting:kGuiScreenDividerColor defaultValue:[OOColor colorWithWhite:0.75 alpha:1.0] alpha:alpha];
1397
1398 OOGLBEGIN(GL_QUADS);
1399 glVertex3f(x + 0, y + size_in_pixels.height - pixel_title_size.height + 4, z);
1400 glVertex3f(x + size_in_pixels.width, y + size_in_pixels.height - pixel_title_size.height + 4, z);
1401 glVertex3f(x + size_in_pixels.width, y + size_in_pixels.height - pixel_title_size.height + 2, z);
1402 glVertex3f(x + 0, y + size_in_pixels.height - pixel_title_size.height + 2, z);
1403 OOGLEND();
1404 }
1405
1406 // draw each row of text
1407 //
1409 for (i = 0; i < n_rows; i++) {
1410 OOColor* row_color = (OOColor*)[rowColor objectAtIndex:i];
1411 glColor4f([row_color redComponent], [row_color greenComponent], [row_color blueComponent], row_alpha[i]);
1412
1413 if ([[rowText objectAtIndex:i] isKindOfClass:[NSString class]]) {
1414 NSString* text = (NSString*)[rowText objectAtIndex:i];
1415 if (![text isEqual:@""]) {
1416 strsize = OORectFromString(text, 0.0f, 0.0f, characterSize).size;
1417 switch (rowAlignment[i]) {
1418 case GUI_ALIGN_LEFT:
1419 rowPosition[i].x = 0.0f;
1420 break;
1421 case GUI_ALIGN_RIGHT:
1422 rowPosition[i].x = size_in_pixels.width - strsize.width;
1423 break;
1424 case GUI_ALIGN_CENTER:
1425 rowPosition[i].x = (size_in_pixels.width - strsize.width) / 2.0f;
1426 break;
1427 }
1428 if (i == (unsigned)selectedRow) {
1429 NSRect block = OORectFromString(text, x + rowPosition[i].x + 2, y + rowPosition[i].y + 2, characterSize);
1431 [self setGLColorFromSetting:kGuiSelectedRowBackgroundColor defaultValue:[OOColor redColor] alpha:alpha];
1432 OOGLBEGIN(GL_QUADS);
1433 glVertex3f(block.origin.x, block.origin.y, z);
1434 glVertex3f(block.origin.x + block.size.width, block.origin.y, z);
1435 glVertex3f(block.origin.x + block.size.width, block.origin.y + block.size.height, z);
1436 glVertex3f(block.origin.x, block.origin.y + block.size.height, z);
1437 OOGLEND();
1438 [self setGLColorFromSetting:kGuiSelectedRowColor defaultValue:[OOColor blackColor] alpha:alpha];
1440 }
1441 OODrawStringQuadsAligned(text, x + rowPosition[i].x, y + rowPosition[i].y, z, characterSize, NO);
1442
1443 // draw cursor at end of current Row
1444 //
1445 if ((showTextCursor) && (i == (unsigned)currentRow)) {
1446 NSRect tr = OORectFromString(text, 0.0f, 0.0f, characterSize);
1447 NSPoint cu = NSMakePoint(x + rowPosition[i].x + tr.size.width + 0.2f * characterSize.width, y + rowPosition[i].y);
1448 tr.origin = cu;
1449 tr.size.width = 0.5f * characterSize.width;
1450 GLfloat g_alpha = 0.5f * (1.0f + (float)sin(6 * [UNIVERSE getTime]));
1452 [self setGLColorFromSetting:kGuiTextInputCursorColor defaultValue:[OOColor redColor] alpha:row_alpha[i] * g_alpha];
1453 OOGLBEGIN(GL_QUADS);
1454 glVertex3f(tr.origin.x, tr.origin.y, z);
1455 glVertex3f(tr.origin.x + tr.size.width, tr.origin.y, z);
1456 glVertex3f(tr.origin.x + tr.size.width, tr.origin.y + tr.size.height, z);
1457 glVertex3f(tr.origin.x, tr.origin.y + tr.size.height, z);
1458 OOGLEND();
1460 }
1461 }
1462 }
1463 if ([[rowText objectAtIndex:i] isKindOfClass:[NSArray class]]) {
1464 NSArray* array = [rowText oo_arrayAtIndex:i];
1465 NSUInteger j, max_columns = MIN([array count], n_columns);
1466 BOOL isLeftAligned;
1467
1468 for (j = 0; j < max_columns; j++) {
1469 NSString* text = [array oo_stringAtIndex:j];
1470 if ([text length] != 0) {
1471 isLeftAligned = tabStops[j] >= 0;
1472 rowPosition[i].x = llabs(tabStops[j]);
1473
1474 // we don't want to highlight leading space(s) or narrow spaces (\037s)
1475 NSString* hilitedText = [text stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@" \037"]];
1476 NSRange txtRange = [text rangeOfString:hilitedText];
1477 unsigned leadingSpaces = 0;
1478
1479 if (EXPECT_NOT(txtRange.location == NSNotFound)) {
1480 // This never happens!
1481 hilitedText = text;
1482 } else if (txtRange.location > 0) {
1483 // padded string!
1484 NSRange padRange;
1485 padRange.location = 0;
1486 padRange.length = txtRange.location;
1487 NSRect charBlock = OORectFromString([text substringWithRange:padRange], 0, 0, characterSize);
1488 leadingSpaces = (unsigned)charBlock.size.width;
1489
1490 /* // if we're displaying commodity-quantity-none, let's try and be pixel perfect!
1491 NSString *qtyNone = DESC(@"commodity-quantity-none");
1492 txtRange = [hilitedText rangeOfString:qtyNone];
1493
1494 if (txtRange.location == 0) // bingo!
1495 {
1496 rowPosition[i].x += OORectFromString(@"0", 0, 0, characterSize).size.width - OORectFromString(qtyNone, 0, 0, characterSize).size.width;
1497 } */
1498 }
1499
1500 // baseline text rect, needed for correct highlight positioning.
1501 NSRect block = OORectFromString(text, x + rowPosition[i].x + 2, y + rowPosition[i].y + 2, characterSize);
1502
1503 if (!isLeftAligned) {
1504 rowPosition[i].x -= block.size.width + 3;
1505 }
1506 block = OORectFromString(hilitedText, x + rowPosition[i].x + 1 + leadingSpaces, y + rowPosition[i].y + 2, characterSize);
1507 block.size.width += 3;
1508
1509 if (i == (unsigned)selectedRow) {
1511 [self setGLColorFromSetting:kGuiSelectedRowBackgroundColor defaultValue:[OOColor redColor] alpha:alpha];
1512 OOGLBEGIN(GL_QUADS);
1513 glVertex3f(block.origin.x, block.origin.y, z);
1514 glVertex3f(block.origin.x + block.size.width, block.origin.y, z);
1515 glVertex3f(block.origin.x + block.size.width, block.origin.y + block.size.height, z);
1516 glVertex3f(block.origin.x, block.origin.y + block.size.height, z);
1517 OOGLEND();
1518 [self setGLColorFromSetting:kGuiSelectedRowColor defaultValue:[OOColor blackColor] alpha:alpha];
1520 }
1521 OODrawStringQuadsAligned(text, x + rowPosition[i].x, y + rowPosition[i].y, z, characterSize, NO);
1522 }
1523 }
1524 }
1525 }
1528}
@ GUI_ALIGN_RIGHT
@ GUI_ALIGN_LEFT
@ GUI_ALIGN_CENTER
OOINLINE BOOL RowInRange(OOGUIRow row, NSRange range)
void OODrawStringQuadsAligned(NSString *text, GLfloat x, GLfloat y, GLfloat z, NSSize siz, BOOL rightAlign)
void OOStartDrawingStrings(void)
void OOStopDrawingStrings(void)
#define EXPECT_NOT(x)
#define MIN(A, B)
Definition OOMaths.h:91
double OOTimeDelta
Definition OOTypes.h:193
OOTextureSprite * foregroundSprite
NSRange selectableRange
NSMutableArray * rowColor
NSMutableArray * rowText
OOGUIAlignment rowAlignment[GUI_MAX_ROWS]
NSString * title
NSSize pixel_title_size
OOGUIRow currentRow
OOGUITabSettings tabStops
NSPoint rowPosition[GUI_MAX_ROWS]
OOColor * backgroundColor
OOColor * redColor()
Definition OOColor.m:259
OOColor * blackColor()
Definition OOColor.m:234
void applyNone()
Definition OOTexture.m:263

References OOTexture::applyNone, OOColor::blackColor, OOColor::colorWithWhite:alpha:, count, EXPECT_NOT, GUI_ALIGN_CENTER, GUI_ALIGN_LEFT, GUI_ALIGN_RIGHT, MIN, nil, OODrawString(), OODrawStringQuadsAligned(), OOGL, OOGLBEGIN, OOGLEND, OORectFromString(), OOStartDrawingStrings(), OOStopDrawingStrings(), PLAYER, OOColor::redColor, RowInRange(), setGLColorFromSetting:defaultValue:alpha:, UNIVERSE, x, and y.

Referenced by drawGUI:drawCursor:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawGUI:drawCursor:

- (int) drawGUI: (GLfloat) alpha
drawCursor: (BOOL) drawCursor 

Definition at line 1238 of file GuiDisplayGen.m.

1238 :(GLfloat)alpha drawCursor:(BOOL)drawCursor
1239{
1240 GLfloat x = drawPosition.x;
1241 GLfloat y = drawPosition.y;
1242 GLfloat z = [[UNIVERSE gameView] display_z];
1243
1244 if (alpha > 0.05f) {
1245 PlayerEntity* player = PLAYER;
1246
1247 [self drawGLDisplay:x - 0.5f * size_in_pixels.width y:y - 0.5f * size_in_pixels.height z:z alpha:alpha];
1248
1249 if (self == [UNIVERSE gui]) {
1251 [self drawStarChart:x - 0.5f * size_in_pixels.width y:y - 0.5f * size_in_pixels.height z:z alpha:alpha compact:NO];
1252 }
1254 [self drawStarChart:x - 0.5f * size_in_pixels.width y:y - 0.5f * size_in_pixels.height z:z alpha:alpha compact:YES];
1255 }
1256 if ([player guiScreen] == GUI_SCREEN_STATUS) {
1257 [self drawEquipmentList:[player equipmentList] z:z];
1258 }
1259 if ([player guiScreen] == GUI_SCREEN_STICKPROFILE) {
1260 [player stickProfileGraphAxisProfile:alpha screenAt:make_vector(x, y, z) screenSize:size_in_pixels];
1261 }
1262 }
1263
1264 if (fade_sign) {
1265 fade_alpha += (float)(fade_sign * [UNIVERSE getTimeDelta]);
1266 if (fade_alpha < 0.05f) // done fading out
1267 {
1268 fade_alpha = 0.0f;
1269 fade_sign = 0.0f;
1270 }
1271 if (fade_alpha >= max_alpha) // done fading in
1272 {
1274 fade_sign = 0.0f;
1275 }
1276 }
1277 }
1278
1279 int cursor_row = 0;
1280
1281 if (drawCursor) {
1282 NSPoint vjpos = [[UNIVERSE gameView] virtualJoystickPosition];
1283 double cursor_x = size_in_pixels.width * vjpos.x;
1284 if (cursor_x < -size_in_pixels.width * 0.5)
1285 cursor_x = -size_in_pixels.width * 0.5f;
1286 if (cursor_x > size_in_pixels.width * 0.5)
1287 cursor_x = size_in_pixels.width * 0.5f;
1288 double cursor_y = -size_in_pixels.height * vjpos.y;
1289 if (cursor_y < -size_in_pixels.height * 0.5)
1290 cursor_y = -size_in_pixels.height * 0.5f;
1291 if (cursor_y > size_in_pixels.height * 0.5)
1292 cursor_y = size_in_pixels.height * 0.5f;
1293
1294 cursor_row = 1 + (float)floor((0.5f * size_in_pixels.height - pixel_row_start - cursor_y) / pixel_row_height);
1295
1296 GLfloat h1 = 3.0f;
1297 GLfloat h3 = 9.0f;
1298 OOGL(glColor4f(0.6f, 0.6f, 1.0f, 1.0f)); // original value of (0.2f, 0.2f, 1.0f, 0.5f) too dark - Nikos 20130616
1299 OOGL(GLScaledLineWidth(2.0f));
1300
1301 cursor_x += x;
1302 cursor_y += y;
1303 [[UNIVERSE gameView] setVirtualJoystick:cursor_x / size_in_pixels.width vmy:-cursor_y / size_in_pixels.height];
1304
1305 OOGLBEGIN(GL_LINES);
1306 glVertex3f((float)cursor_x - h1, (float)cursor_y, z);
1307 glVertex3f((float)cursor_x - h3, (float)cursor_y, z);
1308 glVertex3f((float)cursor_x + h1, (float)cursor_y, z);
1309 glVertex3f((float)cursor_x + h3, (float)cursor_y, z);
1310 glVertex3f((float)cursor_x, (float)cursor_y - h1, z);
1311 glVertex3f((float)cursor_x, (float)cursor_y - h3, z);
1312 glVertex3f((float)cursor_x, (float)cursor_y + h1, z);
1313 glVertex3f((float)cursor_x, (float)cursor_y + h3, z);
1314 OOGLEND();
1315 OOGL(GLScaledLineWidth(1.0f));
1316 }
1317
1318 return cursor_row;
1319}
@ GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_QUICKEST
@ GUI_BACKGROUND_SPECIAL_SHORT_ANA_SHORTEST
@ GUI_BACKGROUND_SPECIAL_LONG
@ GUI_BACKGROUND_SPECIAL_LONG_ANA_SHORTEST
@ GUI_BACKGROUND_SPECIAL_SHORT
@ GUI_BACKGROUND_SPECIAL_SHORT_ANA_QUICKEST
@ GUI_BACKGROUND_SPECIAL_LONG_ANA_QUICKEST
@ GUI_BACKGROUND_SPECIAL_CUSTOM
@ GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_SHORTEST
void GLScaledLineWidth(GLfloat width)
Definition OOOpenGL.m:206
OOGUIBackgroundSpecial backgroundSpecial
unsigned pixel_row_height
NSArray * equipmentList()
void stickProfileGraphAxisProfile:screenAt:screenSize:(GLfloat alpha,[screenAt] Vector screenAt,[screenSize] NSSize screenSize)

References alpha, backgroundSpecial, drawEquipmentList:z:, drawGLDisplay:y:z:alpha:, drawPosition, drawStarChart:y:z:alpha:compact:, PlayerEntity::equipmentList, fade_alpha, fade_sign, GLScaledLineWidth(), GUI_BACKGROUND_SPECIAL_CUSTOM, GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_SHORTEST, GUI_BACKGROUND_SPECIAL_LONG, GUI_BACKGROUND_SPECIAL_LONG_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_LONG_ANA_SHORTEST, GUI_BACKGROUND_SPECIAL_SHORT, GUI_BACKGROUND_SPECIAL_SHORT_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_SHORT_ANA_SHORTEST, int(), max_alpha, OOGL, OOGLBEGIN, OOGLEND, pixel_row_height, pixel_row_start, PLAYER, size_in_pixels, PlayerEntity::stickProfileGraphAxisProfile:screenAt:screenSize:, UNIVERSE, x, and y.

Referenced by Universe::drawMessage, and Universe::pauseGame.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawGUIBackground

- (void) drawGUIBackground

Definition at line 1222 of file GuiDisplayGen.m.

1223{
1224 GLfloat x = drawPosition.x;
1225 GLfloat y = drawPosition.y;
1226 GLfloat z = [[UNIVERSE gameView] display_z];
1227
1228 if (backgroundSprite != nil) {
1229 [backgroundSprite blitBackgroundCentredToX:x Y:y Z:z alpha:1.0f];
1230 }
1231}
OOTextureSprite * backgroundSprite

References backgroundSprite, OOTextureSprite::blitBackgroundCentredToX:Y:Z:alpha:, drawGUIBackground, drawPosition, nil, x, and y.

Referenced by drawGUIBackground, Universe::drawUniverse, and selectableRange.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawPosition

References alpha, drawPosition, stopFadeOuts, and userSettings.

Here is the call graph for this function:

◆ drawStarChart:y:z:alpha:compact:

- (void) drawStarChart: (GLfloat) x
y: (GLfloat) y
z: (GLfloat) z
alpha: (GLfloat) alpha
compact: (BOOL) compact 
implementation

Provided by category GuiDisplayGen(Internal).

Definition at line 1563 of file GuiDisplayGen.m.

1563 :(GLfloat)x y:(GLfloat)y z:(GLfloat)z alpha:(GLfloat)alpha compact:(BOOL)compact
1564{
1565 PlayerEntity* player = PLAYER;
1566
1567 if (!player)
1568 return;
1569
1570 OOSystemDescriptionManager* systemManager = [UNIVERSE systemManager];
1571
1572 OOScalar zoom = [player chart_zoom];
1573 NSPoint chart_centre_coordinates = [player adjusted_chart_centre];
1574 NSPoint galaxy_coordinates = [player galaxy_coordinates];
1575 NSPoint cursor_coordinates = [player cursor_coordinates];
1576 NSPoint info_system_coordinates = [[UNIVERSE systemManager] getCoordinatesForSystem:[player infoSystemID] inGalaxy:[player galaxyNumber]];
1577 OOLongRangeChartMode chart_mode = [player longRangeChartMode];
1578 OOGalaxyID galaxy_id = [player galaxyNumber];
1579 GLfloat r = 1.0, g = 1.0, b = 1.0;
1580 BOOL noNova;
1581 NSPoint cu;
1582 NSUInteger systemParameter;
1583
1584 double fuel = 35.0 * [player dialFuel];
1585
1586 double hcenter = size_in_pixels.width / 2.0;
1587 double hscale = size_in_pixels.width / (CHART_WIDTH_AT_MAX_ZOOM * zoom);
1588 double vscale = -size_in_pixels.height / (2 * CHART_HEIGHT_AT_MAX_ZOOM * zoom);
1589 double vcenter = CHART_SCREEN_VERTICAL_CENTRE;
1590 double hoffset = hcenter - chart_centre_coordinates.x * hscale;
1591 double voffset = size_in_pixels.height - vcenter - chart_centre_coordinates.y * vscale;
1592
1593 if (compact) {
1594 hscale = size_in_pixels.width / 256.0;
1595 vscale = -1.0 * size_in_pixels.height / 512.0;
1596 hoffset = 0.0f;
1597 voffset = size_in_pixels.height - pixel_title_size.height - 5;
1599 chart_centre_coordinates.x = 128.0;
1600 chart_centre_coordinates.y = 128.0;
1601 zoom = CHART_MAX_ZOOM;
1602 }
1603
1604 int i;
1605 double d, distance = 0.0, time = 0.0;
1606 int jumps = 0;
1607 NSPoint star;
1608 OOScalar pixelRatio;
1609 NSRect clipRect;
1610
1611 OORouteType advancedNavArrayMode = [player ANAMode];
1612 BOOL routeExists = NO;
1613
1614 NSInteger concealment[256];
1615 for (i = 0; i < 256; i++) {
1616 NSDictionary* systemInfo = [systemManager getPropertiesForSystem:i inGalaxy:galaxy_id];
1617 concealment[i] = [systemInfo oo_intForKey:@"concealment" defaultValue:OO_SYSTEMCONCEALMENT_NONE];
1618 }
1619
1620 BOOL* systemsFound = [UNIVERSE systemsFound];
1621 NSSize viewSize = [[UNIVERSE gameView] backingViewSize];
1622 double aspect_ratio = viewSize.width / viewSize.height;
1623
1624 // default colours - match those in HeadUpDisplay:OODrawPlanetInfo
1625 GLfloat govcol[] = { 0.5, 0.0, 0.7,
1626 0.7, 0.5, 0.3,
1627 0.0, 1.0, 0.3,
1628 1.0, 0.8, 0.1,
1629 1.0, 0.0, 0.0,
1630 0.1, 0.5, 1.0,
1631 0.7, 0.7, 0.7,
1632 0.7, 1.0, 1.0 };
1633
1634 if (aspect_ratio > 4.0 / 3.0) {
1635 pixelRatio = viewSize.height / 480.0;
1636 } else {
1637 pixelRatio = viewSize.width / 640.0;
1638 }
1639
1640 NSInteger textRow = compact ? GUI_ROW_CHART_SYSTEM_COMPACT : GUI_ROW_CHART_SYSTEM;
1641
1642 clipRect = NSMakeRect((viewSize.width - size_in_pixels.width * pixelRatio) / 2.0,
1643 (viewSize.height + size_in_pixels.height * pixelRatio) / 2.0 - (pixel_title_size.height + 15 + (textRow - 2) * MAIN_GUI_ROW_HEIGHT) * pixelRatio,
1644 size_in_pixels.width * pixelRatio,
1645 (textRow - 1) * MAIN_GUI_ROW_HEIGHT * pixelRatio);
1646
1647 OOSystemID target = [PLAYER targetSystemID];
1648 double dx, dy;
1649
1650 // get a list of systems marked as contract destinations
1651 NSDictionary* markedDestinations = [player markedDestinations];
1652
1653 // get present location
1654 cu = NSMakePoint((float)(hscale * galaxy_coordinates.x + hoffset), (float)(vscale * galaxy_coordinates.y + voffset));
1655
1656 // enable draw clipping; limit drawing area within the chart area
1657 OOGL(glEnable(GL_SCISSOR_TEST));
1658 OOGL(glScissor(clipRect.origin.x, clipRect.origin.y, clipRect.size.width, clipRect.size.height));
1659
1660 // Cache nearby systems so that [UNIVERSE generateSystemData:] does not get called on every frame
1661 // Caching code submitted by Y A J, 20091022
1662
1663 static OOGalaxyID saved_galaxy_id;
1664 static struct saved_system {
1665 OOSystemID sysid;
1666 int tec, eco, gov;
1667 NSString* p_name;
1668 BOOL nova;
1669 } nearby_systems[256];
1670 static int num_nearby_systems = 0;
1671
1672 if (_refreshStarChart || galaxy_id != saved_galaxy_id) {
1673 // saved systems are stale; recompute
1674 _refreshStarChart = NO;
1675 for (i = 0; i < num_nearby_systems; i++)
1676 [nearby_systems[i].p_name release];
1677
1678 num_nearby_systems = 0;
1679 for (i = 0; i < 256; i++) {
1680
1681 NSDictionary* sys_info = [UNIVERSE generateSystemData:i];
1682 if (EXPECT_NOT([sys_info oo_boolForKey:@"sun_gone_nova"])) {
1683 nearby_systems[num_nearby_systems].gov = -1; // Flag up nova systems!
1684 } else {
1685 nearby_systems[num_nearby_systems].tec = [sys_info oo_intForKey:KEY_TECHLEVEL];
1686 nearby_systems[num_nearby_systems].eco = [sys_info oo_intForKey:KEY_ECONOMY];
1687 nearby_systems[num_nearby_systems].gov = [sys_info oo_intForKey:KEY_GOVERNMENT];
1688 }
1689 nearby_systems[num_nearby_systems].sysid = i;
1690 nearby_systems[num_nearby_systems].p_name = [[sys_info oo_stringForKey:KEY_NAME] retain];
1691 nearby_systems[num_nearby_systems].nova = [[UNIVERSE generateSystemData:i] oo_boolForKey:@"sun_gone_nova"];
1692 num_nearby_systems++;
1693 }
1694 saved_galaxy_id = [player galaxyNumber];
1695 }
1696
1697 static OOSystemID savedPlanetNumber = 0;
1698 static OOSystemID savedDestNumber = 0;
1699 static OORouteType savedArrayMode = OPTIMIZED_BY_NONE;
1700 static NSDictionary* routeInfo = nil;
1701
1702 /* May override current mode for mission screens */
1704 advancedNavArrayMode = OPTIMIZED_BY_JUMPS;
1706 advancedNavArrayMode = OPTIMIZED_BY_TIME;
1707 }
1708
1709 if (advancedNavArrayMode != OPTIMIZED_BY_NONE && [player hasEquipmentItemProviding:@"EQ_ADVANCED_NAVIGATIONAL_ARRAY"]) {
1710 OOSystemID planetNumber = [PLAYER systemID];
1711 OOSystemID destNumber = [PLAYER targetSystemID];
1712 if (routeInfo == nil || planetNumber != savedPlanetNumber || destNumber != savedDestNumber || advancedNavArrayMode != savedArrayMode) {
1713 [routeInfo release];
1714 routeInfo = [[UNIVERSE routeFromSystem:planetNumber toSystem:destNumber optimizedBy:advancedNavArrayMode] retain];
1715 savedPlanetNumber = planetNumber;
1716 savedDestNumber = destNumber;
1717 savedArrayMode = advancedNavArrayMode;
1718 }
1719 target = destNumber;
1720
1721 // if the ANA has been activated and we are in string input mode (i.e. planet search),
1722 // get out of it so that distance and time data can be displayed
1723 // if ([[[UNIVERSE gameView] typedString] length] > 0) [player clearPlanetSearchString];
1724
1725 if (routeInfo)
1726 routeExists = YES;
1727
1728 [self drawAdvancedNavArrayAtX:x + hoffset y:y + voffset z:z alpha:alpha usingRoute:(planetNumber != destNumber ? (id)routeInfo : nil) optimizedBy:advancedNavArrayMode zoom:zoom];
1729
1730 if (routeExists) {
1731 distance = [routeInfo oo_doubleForKey:@"distance"];
1732 time = [routeInfo oo_doubleForKey:@"time"];
1733 jumps = [routeInfo oo_intForKey:@"jumps"];
1734
1735 if (distance == 0.0 && planetNumber != destNumber) {
1736 // zero-distance double fix
1737 distance = 0.1;
1738 time = 0.01;
1739 }
1740 }
1741 } else {
1742 [self drawAdvancedNavArrayAtX:x + hoffset y:y + voffset z:z alpha:alpha usingRoute:nil optimizedBy:OPTIMIZED_BY_NONE zoom:zoom];
1743 }
1744 if (!routeExists) {
1745 NSPoint targetCoordinates = [systemManager getCoordinatesForSystem:target inGalaxy:galaxy_id];
1746
1747 distance = distanceBetweenPlanetPositions(targetCoordinates.x, targetCoordinates.y, galaxy_coordinates.x, galaxy_coordinates.y);
1748 if (distance == 0.0) {
1749 if (target != [PLAYER systemID]) {
1750 // looking at the other half of a zero-distance double
1751 // distance is treated as 0.1 LY
1752 distance = 0.1;
1753 }
1754 }
1755 if ([player hasHyperspaceMotor] && distance <= [player fuel] / 10.0) {
1756 time = distance * distance;
1757 } else {
1758 time = 0.0;
1759 }
1760 }
1761
1762 if ([player hasHyperspaceMotor]) {
1763 // draw fuel range circle
1764 OOGL(GLScaledLineWidth(2.0f));
1765 [self setGLColorFromSetting:kGuiChartRangeColor defaultValue:[OOColor greenColor] alpha:alpha];
1766
1767 GLDrawOval(x + cu.x, y + cu.y, z, NSMakeSize((float)(fuel * hscale), 2 * (float)(fuel * vscale)), 5);
1768 }
1769
1770 // draw crosshairs over current location
1771 //
1772 [self setGLColorFromSetting:kGuiChartCrosshairColor defaultValue:[OOColor greenColor] alpha:alpha];
1773
1774 [self drawCrossHairsWithSize:12 / zoom + 2 x:x + cu.x y:y + cu.y z:z];
1775
1776 // draw crosshairs over cursor
1777 //
1778 [self setGLColorFromSetting:kGuiChartCursorColor defaultValue:[OOColor redColor] alpha:alpha];
1779 cu = NSMakePoint((float)(hscale * cursor_coordinates.x + hoffset), (float)(vscale * cursor_coordinates.y + voffset));
1780 [self drawCrossHairsWithSize:7 / zoom + 2 x:x + cu.x y:y + cu.y z:z];
1781
1782 // draw marks and stars
1783 //
1784 OOGL(GLScaledLineWidth(1.5f));
1785 OOGL(glColor4f(1.0f, 1.0f, 0.75f, alpha)); // pale yellow
1786
1787 for (i = 0; i < num_nearby_systems; i++) {
1788 NSPoint sys_coordinates = [systemManager getCoordinatesForSystem:i inGalaxy:galaxy_id];
1789
1790 dx = fabs(chart_centre_coordinates.x - sys_coordinates.x);
1791 dy = fabs(chart_centre_coordinates.y - sys_coordinates.y);
1792
1793 if ((dx > zoom * (CHART_WIDTH_AT_MAX_ZOOM / 2.0 + CHART_CLIP_BORDER)) || (dy > zoom * (CHART_HEIGHT_AT_MAX_ZOOM + CHART_CLIP_BORDER)))
1794 continue;
1795
1796 if (concealment[i] >= OO_SYSTEMCONCEALMENT_NOTHING) {
1797 // system is not known
1798 continue;
1799 }
1800
1801 NSDictionary* systemInfo = [systemManager getPropertiesForSystem:i inGalaxy:galaxy_id];
1802 float blob_factor = [guiUserSettings oo_floatForKey:kGuiChartCircleScale defaultValue:0.0017];
1803 float blob_size = (1.0f + blob_factor * [systemInfo oo_floatForKey:@"radius"]) / zoom;
1804 if (blob_size < 0.5)
1805 blob_size = 0.5;
1806
1807 star.x = (float)(sys_coordinates.x * hscale + hoffset);
1808 star.y = (float)(sys_coordinates.y * vscale + voffset);
1809
1810 noNova = !nearby_systems[i].nova;
1811 NSAssert1(chart_mode <= OOLRC_MODE_TECHLEVEL, @"Long range chart mode %i out of range", (int)chart_mode);
1812
1813 NSArray* markers = [markedDestinations objectForKey:[NSNumber numberWithInt:i]];
1814 if (markers != nil) // is marked
1815 {
1816 GLfloat base_size = 0.5f * blob_size + 2.5f;
1817 [self drawSystemMarkers:markers atX:x + star.x andY:y + star.y andZ:z withAlpha:alpha andScale:base_size];
1818 }
1819
1820 if (concealment[i] >= OO_SYSTEMCONCEALMENT_NODATA) {
1821 // no system data available
1822 r = g = b = 0.7;
1823 OOGL(glColor4f(r, g, b, alpha));
1824 } else {
1825 switch (chart_mode) {
1826 case OOLRC_MODE_ECONOMY:
1827 if (EXPECT(noNova)) {
1828 systemParameter = nearby_systems[i].eco;
1829 GLfloat ce1 = 1.0f - 0.125f * systemParameter;
1830 [self setGLColorFromSetting:[NSString stringWithFormat:kGuiChartEconomyUColor, systemParameter]
1831 defaultValue:[OOColor colorWithRed:ce1 green:1.0f blue:0.0f alpha:1.0f]
1832 alpha:1.0];
1833 } else {
1834 r = g = b = 0.3;
1835 OOGL(glColor4f(r, g, b, alpha));
1836 }
1837 break;
1838 case OOLRC_MODE_GOVERNMENT:
1839 if (EXPECT(noNova)) {
1840 systemParameter = nearby_systems[i].gov;
1841 [self setGLColorFromSetting:[NSString stringWithFormat:kGuiChartGovernmentUColor, systemParameter]
1842 defaultValue:[OOColor colorWithRed:govcol[systemParameter * 3] green:govcol[1 + (systemParameter * 3)] blue:govcol[2 + (systemParameter * 3)] alpha:1.0f]
1843 alpha:1.0];
1844 } else {
1845 r = g = b = 0.3;
1846 OOGL(glColor4f(r, g, b, alpha));
1847 }
1848 break;
1849 case OOLRC_MODE_TECHLEVEL:
1850 if (EXPECT(noNova)) {
1851 systemParameter = nearby_systems[i].tec;
1852 r = 0.6;
1853 g = b = 0.20 + (0.05 * (GLfloat)systemParameter);
1854 } else {
1855 r = g = b = 0.3;
1856 }
1857 OOGL(glColor4f(r, g, b, alpha));
1858 break;
1859 case OOLRC_MODE_UNKNOWN:
1860 case OOLRC_MODE_SUNCOLOR:
1861 if (EXPECT(noNova)) {
1862 r = g = b = 1.0;
1863 OOColor* sunColor = [OOColor colorWithDescription:[[UNIVERSE systemManager] getProperty:@"sun_color" forSystem:i inGalaxy:galaxy_id]];
1864 if (sunColor != nil) {
1865 [sunColor getRed:&r green:&g blue:&b alpha:&alpha];
1866 alpha = 1.0; // reset
1867 }
1868 } else {
1869 r = 1.0;
1870 g = 0.2;
1871 b = 0.0;
1872 }
1873 OOGL(glColor4f(r, g, b, alpha));
1874 break;
1875 }
1876 }
1877
1878 GLDrawFilledOval(x + star.x, y + star.y, z, NSMakeSize(blob_size, blob_size), 15);
1879 }
1880
1881 // draw found stars and captions
1882 //
1883 GLfloat systemNameScale = [guiUserSettings oo_floatForKey:kGuiChartLabelScale defaultValue:1.0];
1884
1885 OOGL(GLScaledLineWidth(1.5f));
1886 [self setGLColorFromSetting:kGuiChartMatchBoxColor defaultValue:[OOColor greenColor] alpha:alpha];
1887
1888 int n_matches = 0, foundIndex = -1;
1889
1890 for (i = 0; i < 256; i++)
1891 if (systemsFound[i]) {
1892 if (foundSystem == n_matches)
1893 foundIndex = i;
1894 n_matches++;
1895 }
1896
1897 if (n_matches == 0) {
1898 foundSystem = 0;
1900 // do nothing at this stage
1901 } else {
1902 for (i = 0; i < 256; i++) {
1903 if (concealment[i] >= OO_SYSTEMCONCEALMENT_NONAME) {
1904 continue;
1905 }
1906
1907 BOOL mark = systemsFound[i];
1908 float marker_size = 8.0 / zoom;
1909 NSPoint sys_coordinates = [systemManager getCoordinatesForSystem:i inGalaxy:galaxy_id];
1910
1911 dx = fabs(chart_centre_coordinates.x - sys_coordinates.x);
1912 dy = fabs(chart_centre_coordinates.y - sys_coordinates.y);
1913
1914 if (mark && (dx <= zoom * (CHART_WIDTH_AT_MAX_ZOOM / 2.0 + CHART_CLIP_BORDER)) && (dy <= zoom * (CHART_HEIGHT_AT_MAX_ZOOM + CHART_CLIP_BORDER))) {
1915 star.x = (float)(sys_coordinates.x * hscale + hoffset);
1916 star.y = (float)(sys_coordinates.y * vscale + voffset);
1917 OOGLBEGIN(GL_LINE_LOOP);
1918 glVertex3f(x + star.x - marker_size, y + star.y - marker_size, z);
1919 glVertex3f(x + star.x + marker_size, y + star.y - marker_size, z);
1920 glVertex3f(x + star.x + marker_size, y + star.y + marker_size, z);
1921 glVertex3f(x + star.x - marker_size, y + star.y + marker_size, z);
1922 OOGLEND();
1923 if (i == foundIndex || n_matches == 1) {
1924 if (n_matches == 1)
1925 foundSystem = 0;
1926 if (zoom > CHART_ZOOM_SHOW_LABELS && advancedNavArrayMode == OPTIMIZED_BY_NONE) {
1927 [self setGLColorFromSetting:kGuiChartMatchLabelColor defaultValue:[OOColor cyanColor] alpha:alpha];
1928 OODrawString([UNIVERSE systemNameIndex:i], x + star.x + 2.0, y + star.y - 10.0f, z, NSMakeSize(10 * systemNameScale, 10 * systemNameScale));
1929 [self setGLColorFromSetting:kGuiChartMatchBoxColor defaultValue:[OOColor greenColor] alpha:alpha];
1930 }
1931 } else if (zoom > CHART_ZOOM_SHOW_LABELS) {
1932 OODrawString([UNIVERSE systemNameIndex:i], x + star.x + 2.0, y + star.y - 10.0f, z, NSMakeSize(10 * systemNameScale, 10 * systemNameScale));
1933 }
1934 }
1935 }
1936 }
1937
1938 // draw names
1939 //
1940 // OOGL(glColor4f(1.0f, 1.0f, 0.0f, alpha)); // yellow
1941
1942 int targetIdx = -1;
1943 struct saved_system* sys;
1944 NSSize chSize = NSMakeSize(pixel_row_height * systemNameScale / zoom, pixel_row_height * systemNameScale / zoom);
1945
1946 double jumpRange = MAX_JUMP_RANGE * [PLAYER dialFuel];
1947 for (i = 0; i < num_nearby_systems; i++) {
1948 if (concealment[i] >= OO_SYSTEMCONCEALMENT_NONAME) {
1949 continue;
1950 }
1951
1952 sys = nearby_systems + i;
1953 NSPoint sys_coordinates = [systemManager getCoordinatesForSystem:sys->sysid inGalaxy:galaxy_id];
1954
1955 dx = fabs(chart_centre_coordinates.x - sys_coordinates.x);
1956 dy = fabs(chart_centre_coordinates.y - sys_coordinates.y);
1957
1958 if ((dx > zoom * (CHART_WIDTH_AT_MAX_ZOOM / 2.0 + CHART_CLIP_BORDER)) || (dy > zoom * (CHART_HEIGHT_AT_MAX_ZOOM + CHART_CLIP_BORDER)))
1959 continue;
1960 star.x = (float)(sys_coordinates.x * hscale + hoffset);
1961 star.y = (float)(sys_coordinates.y * vscale + voffset);
1962 if (sys->sysid == target) // not overlapping twin? (example: Divees & Tezabi in galaxy 5)
1963 {
1964 targetIdx = i; // we have a winner!
1965 }
1966
1967 if (zoom < CHART_ZOOM_SHOW_LABELS) {
1968 if (![player showInfoFlag]) // System's name
1969 {
1970
1971 d = distanceBetweenPlanetPositions(galaxy_coordinates.x, galaxy_coordinates.y, sys_coordinates.x, sys_coordinates.y);
1972 if (d <= jumpRange) {
1973 [self setGLColorFromSetting:kGuiChartLabelReachableColor defaultValue:[OOColor yellowColor] alpha:alpha];
1974 } else {
1975 [self setGLColorFromSetting:kGuiChartLabelColor defaultValue:[OOColor yellowColor] alpha:alpha];
1976 }
1977
1978 OODrawString(sys->p_name, x + star.x + 2.0, y + star.y, z, chSize);
1979 } else if (EXPECT(sys->gov >= 0)) // Not a nova? Show the info.
1980 {
1981 if (concealment[i] >= OO_SYSTEMCONCEALMENT_NODATA) {
1982 [self setGLColorFromSetting:kGuiChartLabelColor defaultValue:[OOColor yellowColor] alpha:alpha];
1983 OODrawHilightedString(@"???", x + star.x + 2.0, y + star.y, z, chSize);
1984 } else {
1985 OODrawPlanetInfo(sys->gov, sys->eco, sys->tec, x + star.x + 2.0, y + star.y + 2.0, z, chSize);
1986 }
1987 }
1988 }
1989 }
1990
1991 // highlight the name of the currently selected system
1992 // (needed to get things right in closely-overlapping systems)
1993 if (targetIdx != -1 && zoom <= CHART_ZOOM_SHOW_LABELS) {
1994 if (concealment[targetIdx] < OO_SYSTEMCONCEALMENT_NONAME) {
1995 sys = nearby_systems + targetIdx;
1996 NSPoint sys_coordinates = [systemManager getCoordinatesForSystem:sys->sysid inGalaxy:galaxy_id];
1997
1998 star.x = (float)(sys_coordinates.x * hscale + hoffset);
1999 star.y = (float)(sys_coordinates.y * vscale + voffset);
2000
2001 if (![player showInfoFlag]) {
2002 d = distanceBetweenPlanetPositions(galaxy_coordinates.x, galaxy_coordinates.y, sys_coordinates.x, sys_coordinates.y);
2003 if (d <= jumpRange) {
2004 [self setGLColorFromSetting:kGuiChartLabelReachableColor defaultValue:[OOColor yellowColor] alpha:alpha];
2005 } else {
2006 [self setGLColorFromSetting:kGuiChartLabelColor defaultValue:[OOColor yellowColor] alpha:alpha];
2007 }
2008
2009 OODrawHilightedString(sys->p_name, x + star.x + 2.0, y + star.y, z, chSize);
2010 } else if (sys->gov >= 0) // Not a nova? Show the info.
2011 {
2012 if (concealment[targetIdx] >= OO_SYSTEMCONCEALMENT_NODATA) {
2013 [self setGLColorFromSetting:kGuiChartLabelColor defaultValue:[OOColor yellowColor] alpha:alpha];
2014 OODrawHilightedString(@"???", x + star.x + 2.0, y + star.y, z, chSize);
2015 } else {
2016 OODrawHilightedPlanetInfo(sys->gov, sys->eco, sys->tec, x + star.x + 2.0, y + star.y + 2.0, z, chSize);
2017 }
2018 }
2019 }
2020 }
2021
2022 OOGUITabSettings tab_stops;
2023 tab_stops[0] = 0;
2024 tab_stops[1] = 96;
2025 tab_stops[2] = 288;
2026 [self overrideTabs:tab_stops from:kGuiChartTraveltimeTabs length:3];
2027 [self setTabStops:tab_stops];
2028 NSString* targetName = [[UNIVERSE getSystemName:target] retain];
2029
2030 // distance-f & est-travel-time-f are identical between short & long range charts in standard Oolite, however can be alterered separately via OXPs
2031 NSString* travelDistLine = @"";
2032 if (distance > 0) {
2033 travelDistLine = OOExpandKey(@"long-range-chart-distance", distance);
2034 }
2035 NSString* travelTimeLine = @"";
2036 if (time > 0) {
2037 travelTimeLine = OOExpandKey(@"long-range-chart-est-travel-time", time);
2038 }
2039
2040 if (concealment[target] < OO_SYSTEMCONCEALMENT_NONAME) {
2041 [self setArray:[NSArray arrayWithObjects:targetName, travelDistLine, travelTimeLine, nil] forRow:textRow];
2042 } else {
2043 [self setArray:[NSArray arrayWithObjects:@"", travelDistLine, travelTimeLine, nil] forRow:textRow];
2044 }
2045 if ([PLAYER guiScreen] == GUI_SCREEN_SHORT_RANGE_CHART) {
2046 if (jumps > 0) {
2047 [self setArray:[NSArray arrayWithObjects:@"", OOExpandKey(@"short-range-chart-jumps", jumps), nil] forRow:textRow + 1];
2048 } else {
2049 [self setArray:[NSArray array] forRow:textRow + 1];
2050 }
2051 }
2052 [targetName release];
2053
2054 // draw planet info circle
2055 OOGL(GLScaledLineWidth(2.0f));
2056 [self setGLColorFromSetting:kGuiChartInfoMarkerColor defaultValue:[OOColor blueColor] alpha:alpha];
2057 cu = NSMakePoint((float)(hscale * info_system_coordinates.x + hoffset), (float)(vscale * info_system_coordinates.y + voffset));
2058 GLDrawOval(x + cu.x, y + cu.y, z, NSMakeSize(6.0f / zoom + 2.0f, 6.0f / zoom + 2.0f), 5);
2059
2060 // disable draw clipping
2061 OOGL(glDisable(GL_SCISSOR_TEST));
2062
2063 // Draw bottom divider
2064 [self setGLColorFromSetting:kGuiScreenDividerColor defaultValue:[OOColor colorWithWhite:0.75 alpha:1.0] alpha:alpha];
2065 OOGLBEGIN(GL_QUADS);
2066 glVertex3f(x + 0, (float)(y + size_in_pixels.height - (textRow - 1) * MAIN_GUI_ROW_HEIGHT - pixel_title_size.height), z);
2067 glVertex3f(x + size_in_pixels.width, (GLfloat)(y + size_in_pixels.height - (textRow - 1) * MAIN_GUI_ROW_HEIGHT - pixel_title_size.height), z);
2068 glVertex3f(x + size_in_pixels.width, (GLfloat)(y + size_in_pixels.height - (textRow - 1) * MAIN_GUI_ROW_HEIGHT - pixel_title_size.height - 2), z);
2069 glVertex3f(x + 0, (GLfloat)(y + size_in_pixels.height - (textRow - 1) * MAIN_GUI_ROW_HEIGHT - pixel_title_size.height - 2), z);
2070 OOGLEND();
2071}
OOGUITabStop OOGUITabSettings[GUI_MAX_COLUMNS]
#define MAIN_GUI_ROW_HEIGHT
static BOOL _refreshStarChart
void OODrawHilightedString(NSString *text, GLfloat x, GLfloat y, GLfloat z, NSSize siz)
void OODrawHilightedPlanetInfo(int gov, int eco, int tec, GLfloat x, GLfloat y, GLfloat z, NSSize siz)
void OODrawPlanetInfo(int gov, int eco, int tec, GLfloat x, GLfloat y, GLfloat z, NSSize siz)
#define EXPECT(x)
void GLDrawFilledOval(GLfloat x, GLfloat y, GLfloat z, NSSize siz, GLfloat step)
Definition OOOpenGL.m:158
void GLDrawOval(GLfloat x, GLfloat y, GLfloat z, NSSize siz, GLfloat step)
Definition OOOpenGL.m:149
#define OOExpandKey(key,...)
@ OO_SYSTEMCONCEALMENT_NODATA
OOLongRangeChartMode
Definition OOTypes.h:45
@ OPTIMIZED_BY_TIME
Definition OOTypes.h:34
OOINLINE OOScalar distance(Vector v1, Vector v2) INLINE_CONST_FUNC
Definition OOVector.h:280
#define CHART_SCREEN_VERTICAL_CENTRE
#define CHART_SCREEN_VERTICAL_CENTRE_COMPACT
#define CHART_MAX_ZOOM
@ GUI_ROW_CHART_SYSTEM_COMPACT
@ GUI_ROW_CHART_SYSTEM
#define CHART_CLIP_BORDER
OOSystemID foundSystem
OOColor * colorWithRed:green:blue:alpha:(float red,[green] float green,[blue] float blue,[alpha] float alpha)
Definition OOColor.m:107
OOColor * blueColor()
Definition OOColor.m:269
OOLongRangeChartMode longRangeChartMode
OOGalaxyID galaxyNumber()
OORouteType ANAMode()
NSPoint galaxy_coordinates
NSPoint cursor_coordinates
OOScalar chart_zoom
OOSystemID infoSystemID()
NSPoint adjusted_chart_centre()
NSDictionary * markedDestinations()
GLfloat dialFuel()

References _refreshStarChart, PlayerEntity::adjusted_chart_centre, PlayerEntity::ANAMode, OOColor::blueColor, CHART_CLIP_BORDER, CHART_HEIGHT_AT_MAX_ZOOM, CHART_MAX_ZOOM, CHART_SCREEN_VERTICAL_CENTRE, CHART_SCREEN_VERTICAL_CENTRE_COMPACT, CHART_WIDTH_AT_MAX_ZOOM, PlayerEntity::chart_zoom, CHART_ZOOM_SHOW_LABELS, OOColor::colorWithDescription:, OOColor::colorWithRed:green:blue:alpha:, OOColor::colorWithWhite:alpha:, PlayerEntity::cursor_coordinates, OOColor::cyanColor, PlayerEntity::dialFuel, distance(), distanceBetweenPlanetPositions(), drawAdvancedNavArrayAtX:y:z:alpha:usingRoute:optimizedBy:zoom:, drawCrossHairsWithSize:x:y:z:, drawSystemMarkers:atX:andY:andZ:withAlpha:andScale:, EXPECT, EXPECT_NOT, PlayerEntity::galaxy_coordinates, PlayerEntity::galaxyNumber, OOSystemDescriptionManager::getCoordinatesForSystem:inGalaxy:, OOSystemDescriptionManager::getPropertiesForSystem:inGalaxy:, OOColor::getRed:green:blue:alpha:, GLDrawFilledOval(), GLDrawOval(), GLScaledLineWidth(), OOColor::greenColor, GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_SHORTEST, GUI_BACKGROUND_SPECIAL_LONG, GUI_BACKGROUND_SPECIAL_LONG_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_LONG_ANA_SHORTEST, GUI_BACKGROUND_SPECIAL_SHORT_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_SHORT_ANA_SHORTEST, GUI_ROW_CHART_SYSTEM, GUI_ROW_CHART_SYSTEM_COMPACT, PlayerEntity::infoSystemID, PlayerEntity::longRangeChartMode, MAIN_GUI_ROW_HEIGHT, PlayerEntity::markedDestinations, MAX_JUMP_RANGE, nil, OO_SYSTEMCONCEALMENT_NODATA, OO_SYSTEMCONCEALMENT_NONAME, OO_SYSTEMCONCEALMENT_NOTHING, OODrawHilightedPlanetInfo(), OODrawHilightedString(), OODrawPlanetInfo(), OODrawString(), OOExpandKey, OOGL, OOGLBEGIN, OOGLEND, OPTIMIZED_BY_JUMPS, OPTIMIZED_BY_NONE, OPTIMIZED_BY_TIME, overrideTabs:from:length:, PLAYER, OOColor::redColor, setArray:forRow:, setGLColorFromSetting:defaultValue:alpha:, setTabStops:, UNIVERSE, x, y, and OOColor::yellowColor.

Referenced by drawGUI:drawCursor:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawSystemMarker:atX:andY:andZ:withAlpha:andScale:

- (void) drawSystemMarker: (NSDictionary*) marker
atX: (GLfloat) x
andY: (GLfloat) y
andZ: (GLfloat) z
withAlpha: (GLfloat) alpha
andScale: (GLfloat) scale 
implementation

Provided by category GuiDisplayGen(Internal).

Definition at line 2081 of file GuiDisplayGen.m.

2081 :(NSDictionary*)marker atX:(GLfloat)x andY:(GLfloat)y andZ:(GLfloat)z withAlpha:(GLfloat)alpha andScale:(GLfloat)scale
2082{
2083 NSString* colorDesc = [marker oo_stringForKey:@"markerColor" defaultValue:@"redColor"];
2084 OORGBAComponents color = [[OOColor colorWithDescription:colorDesc] rgbaComponents];
2085
2086 OOGL(glColor4f(color.r, color.g, color.b, alpha)); // red
2087 GLfloat mark_size = [marker oo_floatForKey:@"markerScale" defaultValue:1.0];
2088 if (mark_size > 2.0) {
2089 mark_size = 2.0;
2090 } else if (mark_size < 0.5) {
2091 mark_size = 0.5;
2092 }
2093 mark_size *= scale;
2094
2095 NSString* shape = [marker oo_stringForKey:@"markerShape" defaultValue:@"MARKER_X"];
2096
2097 OOGLBEGIN(GL_LINES);
2098 if ([shape isEqualToString:@"MARKER_X"]) {
2099 glVertex3f(x - mark_size, y - mark_size, z);
2100 glVertex3f(x + mark_size, y + mark_size, z);
2101 glVertex3f(x - mark_size, y + mark_size, z);
2102 glVertex3f(x + mark_size, y - mark_size, z);
2103 } else if ([shape isEqualToString:@"MARKER_PLUS"]) {
2104 mark_size *= 1.4; // match volumes
2105 glVertex3f(x, y - mark_size, z);
2106 glVertex3f(x, y + mark_size, z);
2107 glVertex3f(x - mark_size, y, z);
2108 glVertex3f(x + mark_size, y, z);
2109 } else if ([shape isEqualToString:@"MARKER_SQUARE"]) {
2110 glVertex3f(x - mark_size, y - mark_size, z);
2111 glVertex3f(x - mark_size, y + mark_size, z);
2112 glVertex3f(x - mark_size, y + mark_size, z);
2113 glVertex3f(x + mark_size, y + mark_size, z);
2114 glVertex3f(x + mark_size, y + mark_size, z);
2115 glVertex3f(x + mark_size, y - mark_size, z);
2116 glVertex3f(x + mark_size, y - mark_size, z);
2117 glVertex3f(x - mark_size, y - mark_size, z);
2118 } else if ([shape isEqualToString:@"MARKER_DIAMOND"]) {
2119 mark_size *= 1.4; // match volumes
2120 glVertex3f(x, y - mark_size, z);
2121 glVertex3f(x - mark_size, y, z);
2122 glVertex3f(x - mark_size, y, z);
2123 glVertex3f(x, y + mark_size, z);
2124 glVertex3f(x, y + mark_size, z);
2125 glVertex3f(x + mark_size, y, z);
2126 glVertex3f(x + mark_size, y, z);
2127 glVertex3f(x, y - mark_size, z);
2128 }
2129 OOGLEND();
2130}
OORGBAComponents rgbaComponents()
Definition OOColor.m:354

References OOColor::colorWithDescription:, OOGL, OOGLBEGIN, OOGLEND, OOColor::rgbaComponents, x, and y.

Referenced by GuiDisplayGen(Internal)::drawSystemMarkers:atX:andY:andZ:withAlpha:andScale:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawSystemMarkers:atX:andY:andZ:withAlpha:andScale:

- (void) drawSystemMarkers: (NSArray*) markers
atX: (GLfloat) x
andY: (GLfloat) y
andZ: (GLfloat) z
withAlpha: (GLfloat) alpha
andScale: (GLfloat) scale 
implementation

Provided by category GuiDisplayGen(Internal).

Definition at line 2073 of file GuiDisplayGen.m.

2073 :(NSArray*)markers atX:(GLfloat)x andY:(GLfloat)y andZ:(GLfloat)z withAlpha:(GLfloat)alpha andScale:(GLfloat)scale
2074{
2075 NSDictionary* marker;
2076 foreach (marker, markers) {
2077 [self drawSystemMarker:marker atX:x andY:y andZ:z withAlpha:alpha andScale:scale];
2078 }
2079}

References drawSystemMarker:atX:andY:andZ:withAlpha:andScale:.

Referenced by GuiDisplayGen(Internal)::drawStarChart:y:z:alpha:compact:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fadeOutFromTime:overDuration:

- (void) fadeOutFromTime: (OOTimeAbsolute) now_time
overDuration: (OOTimeDelta) duration 

Definition at line 299 of file GuiDisplayGen.m.

299 :(OOTimeAbsolute)now_time overDuration:(OOTimeDelta)duration
300{
301 if (fade_alpha <= 0.0f) {
302 return;
303 }
304 if (duration == 0.0)
305 fade_sign = -1000.0f;
306 else
307 fade_sign = (float)(-fade_alpha / duration);
308}
double OOTimeAbsolute
Definition OOTypes.h:192

References fade_alpha, and fade_sign.

Referenced by Universe::showCommsLog:.

Here is the caller graph for this function:

◆ getLastLines

- (NSArray *) getLastLines

Definition at line 710 of file GuiDisplayGen.m.

711{
712 if (n_rows < 1)
713 return nil;
714
715 // we have at least 1 row!
716
717 unsigned i = n_rows - 1;
718 OORGBAComponents col = [(OOColor*)[rowColor objectAtIndex:i] rgbaComponents];
719
720 if (i > 0) {
721 // we have at least 2 rows!
722 OORGBAComponents col0 = [(OOColor*)[rowColor objectAtIndex:i - 1] rgbaComponents];
723 return [NSArray arrayWithObjects:[rowText oo_stringAtIndex:i - 1],
724 [NSString stringWithFormat:@"%.3g %.3g %.3g %.3g", col0.r, col0.g, col0.b, col0.a],
725 [NSNumber numberWithFloat:rowFadeTime[i - 1]],
726 [rowText oo_stringAtIndex:i],
727 [NSString stringWithFormat:@"%.3g %.3g %.3g %.3g", col.r, col.g, col.b, col.a],
728 [NSNumber numberWithFloat:rowFadeTime[i]], nil];
729 } else {
730 return [NSArray arrayWithObjects:[rowText oo_stringAtIndex:i],
731 [NSString stringWithFormat:@"%.3g %.3g %.3g %.3g", col.r, col.g, col.b, col.a],
732 [NSNumber numberWithFloat:rowFadeTime[i]], nil];
733 }
734}

References getLastLines, n_rows, nil, and OOColor::rgbaComponents.

Referenced by getLastLines, HeadUpDisplay::resetGuis:, and selectableRange.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init

- (id) init

Definition at line 65 of file GuiDisplayGen.m.

66{
67 if ((self = [super init])) {
73 pixel_row_start = MAIN_GUI_PIXEL_ROW_START; // first position down the page...
74 max_alpha = 1.0;
75
76 pixel_text_size = NSMakeSize(0.9f * pixel_row_height, pixel_row_height); // main gui has 18x20 characters
77
78 pixel_title_size = NSMakeSize(pixel_row_height * 1.75f, pixel_row_height * 1.5f);
79
80 int stops[6] = { 0, 192, 256, 320, 384, 448 };
81 unsigned i;
82
83 rowRange = NSMakeRange(0, n_rows);
84
85 rowText = [[NSMutableArray alloc] initWithCapacity:n_rows]; // alloc retains
86 rowKey = [[NSMutableArray alloc] initWithCapacity:n_rows]; // alloc retains
87 rowColor = [[NSMutableArray alloc] initWithCapacity:n_rows]; // alloc retains
88
89 for (i = 0; i < n_rows; i++) {
90 [rowText addObject:@"."];
91 [rowKey addObject:[NSString stringWithFormat:@"%d", i]];
92 [rowColor addObject:[OOColor yellowColor]];
93 rowPosition[i].x = 0.0f;
96 }
97
98 for (i = 0; i < n_columns; i++) {
99 tabStops[i] = stops[i];
100 }
101
102 title = @"";
103
104 textColor = [[OOColor yellowColor] retain];
105
106 drawPosition = make_vector(0.0f, 0.0f, 640.0f);
107
109
110 guiUserSettings = [[ResourceManager dictionaryFromFilesNamed:@"gui-settings.plist" inFolder:@"Config" andMerge:YES] retain];
111 }
112 return self;
113}
#define MAIN_GUI_PIXEL_ROW_START
@ GUI_BACKGROUND_SPECIAL_NONE
#define MAIN_GUI_PIXEL_WIDTH
#define MAIN_GUI_PIXEL_HEIGHT
#define GUI_DEFAULT_ROWS
#define GUI_DEFAULT_COLUMNS
OOINLINE Vector make_vector(OOScalar vx, OOScalar vy, OOScalar vz) INLINE_CONST_FUNC
Definition OOVector.h:149
NSMutableArray * rowKey
NSDictionary * guiUserSettings
NSDictionary * dictionaryFromFilesNamed:inFolder:andMerge:(NSString *fileName,[inFolder] NSString *folderName,[andMerge] BOOL mergeFiles)

References backgroundSpecial, ResourceManager::dictionaryFromFilesNamed:inFolder:andMerge:, drawPosition, GUI_ALIGN_LEFT, GUI_BACKGROUND_SPECIAL_NONE, GUI_DEFAULT_COLUMNS, GUI_DEFAULT_ROWS, guiUserSettings, init, MAIN_GUI_PIXEL_HEIGHT, MAIN_GUI_PIXEL_ROW_START, MAIN_GUI_PIXEL_WIDTH, MAIN_GUI_ROW_HEIGHT, make_vector(), max_alpha, n_columns, n_rows, pixel_row_center, pixel_row_height, pixel_row_start, pixel_text_size, pixel_title_size, rowAlignment, rowColor, rowKey, rowPosition, rowRange, rowText, size_in_pixels, tabStops, textColor, title, and OOColor::yellowColor.

Referenced by init.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initWithPixelSize:columns:rows:rowHeight:rowStart:title:

- (id) initWithPixelSize: (NSSize) gui_size
columns: (int) gui_cols
rows: (int) gui_rows
rowHeight: (int) gui_row_height
rowStart: (int) gui_row_start
title: (NSString*) gui_title 

Definition at line 115 of file GuiDisplayGen.m.

115 :(NSSize)gui_size
116 columns:(int)gui_cols
117 rows:(int)gui_rows
118 rowHeight:(int)gui_row_height
119 rowStart:(int)gui_row_start
120 title:(NSString*)gui_title
121{
122 self = [super init];
123
124 size_in_pixels = gui_size;
125 n_columns = gui_cols;
126 n_rows = gui_rows;
128 pixel_row_height = gui_row_height;
129 pixel_row_start = gui_row_start; // first position down the page...
130 max_alpha = 1.0;
131
133
134 pixel_title_size = NSMakeSize(pixel_row_height * 1.75f, pixel_row_height * 1.5f);
135
136 unsigned i;
137
138 rowRange = NSMakeRange(0, n_rows);
139
140 rowText = [[NSMutableArray alloc] initWithCapacity:n_rows]; // alloc retains
141 rowKey = [[NSMutableArray alloc] initWithCapacity:n_rows]; // alloc retains
142 rowColor = [[NSMutableArray alloc] initWithCapacity:n_rows]; // alloc retains
143
144 for (i = 0; i < n_rows; i++) {
145 [rowText addObject:@""];
146 [rowKey addObject:@""];
147 [rowColor addObject:[OOColor greenColor]];
148 rowPosition[i].x = 0.0f;
151 }
152
153 title = [gui_title retain];
154
155 textColor = [[OOColor yellowColor] retain];
156
157 return self;
158}
unsigned columns()
unsigned rowHeight()
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

References OOColor::greenColor, GUI_ALIGN_LEFT, max_alpha, n_columns, n_rows, pixel_row_center, pixel_row_height, pixel_row_start, pixel_text_size, pixel_title_size, rowAlignment, rowColor, rowKey, rowPosition, rowRange, rowText, size_in_pixels, textColor, title, and OOColor::yellowColor.

Here is the call graph for this function:

◆ insertItemsFromArray:withKeys:intoRow:color:

- (void) insertItemsFromArray: (NSArray*) items
withKeys: (NSArray*) item_keys
intoRow: (OOGUIRow) row
color: (OOColor*) text_color 

Definition at line 820 of file GuiDisplayGen.m.

820 :(NSArray*)items
821 withKeys:(NSArray*)item_keys
822 intoRow:(OOGUIRow)row
823 color:(OOColor*)text_color
824{
825 if (!items)
826 return;
827 if ([items count] == 0)
828 return;
829
830 NSUInteger n_items = [items count];
831 if ((item_keys) && ([item_keys count] != n_items)) {
832 // throw exception
833 [NSException raise:@"ArrayLengthMismatchException"
834 format:@"The NSArray sent as 'item_keys' to insertItemsFromArray::: must contain the same number of objects as the NSArray 'items'"];
835 }
836
837 unsigned i;
838 for (i = n_rows; i >= row + n_items; i--) {
839 [self setKey:[self keyForRow:i - n_items] forRow:i];
840 id old_row_info = [self objectForRow:i - n_items];
841 if ([old_row_info isKindOfClass:[NSArray class]])
842 [self setArray:old_row_info forRow:i];
843 if ([old_row_info isKindOfClass:[NSString class]])
844 [self setText:(NSString*)old_row_info forRow:i];
845 }
846 for (i = 0; i < n_items; i++) {
847 id new_row_info = [items objectAtIndex:i];
848 if (text_color)
849 [self setColor:text_color forRow:row + i];
850 else
851 [self setColor:textColor forRow:row + i];
852 if ([new_row_info isKindOfClass:[NSArray class]])
853 [self setArray:new_row_info forRow:row + i];
854 if ([new_row_info isKindOfClass:[NSString class]])
855 [self setText:(NSString*)new_row_info forRow:row + i];
856 if (item_keys)
857 [self setKey:[item_keys objectAtIndex:i] forRow:row + i];
858 else
859 [self setKey:@"" forRow:row + i];
860 }
861}

References count, keyForRow:, n_rows, objectForRow:, setArray:forRow:, setColor:forRow:, setKey:forRow:, and setText:forRow:.

Here is the call graph for this function:

◆ keyForRow:

- (NSString *) keyForRow: (OOGUIRow) row

Definition at line 437 of file GuiDisplayGen.m.

437 :(OOGUIRow)row
438{
439 if (RowInRange(row, rowRange))
440 return [rowKey objectAtIndex:row];
441 else
442 return NULL;
443}

References RowInRange(), and rowRange.

Referenced by PlayerEntity(Contracts)::buySelectedShip, PlayerEntity(KeyMapper)::handleKeyboardLayoutEntryKeys:view:, PlayerEntity(OOControlsPrivate)::handleKeyboardLayoutKeys, PlayerEntity(OOControlsPrivate)::handleKeyMapperScreenKeys, PlayerEntity(OOControlsPrivate)::handleStickMapperScreenKeys, PlayerEntity::highlightEquipShipScreenKey:, insertItemsFromArray:withKeys:intoRow:color:, PlayerEntity(KeyMapper)::keyMapperInputHandler:view:, PlayerEntity(OOControlsPrivate)::pollGuiArrowKeyControls:, reportSelectedRow:, PlayerEntity(Contracts)::showShipyardInfoForSelection, and PlayerEntity(StickMapper)::stickMapperInputHandler:view:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ leaveLastLine

- (void) leaveLastLine

Definition at line 697 of file GuiDisplayGen.m.

698{
699 unsigned i;
700 for (i = 0; i < n_rows - 1; i++) {
701 [rowText replaceObjectAtIndex:i withObject:@""];
702 [rowColor replaceObjectAtIndex:i withObject:textColor];
703 [rowKey replaceObjectAtIndex:i withObject:@""];
705 rowFadeTime[i] = 0.0f;
706 }
707 rowFadeTime[i] = 0.4f; // fade the last line...
708}

References GUI_ALIGN_LEFT, leaveLastLine, n_rows, rowAlignment, and rowFadeTime.

Referenced by leaveLastLine, and selectableRange.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewTextureSpriteWithDescriptor

+ (OOTextureSprite *) NewTextureSpriteWithDescriptor (NSDictionary *) descriptor
(uint32_t) srgbaOption 
implementation

Definition at line 912 of file GuiDisplayGen.m.

913{
914 OOTexture* texture = nil;
915 NSSize size;
916
917 texture = TextureForGUITexture(descriptor, srgbaOption);
918 if (texture == nil)
919 return nil;
920
921 double specifiedWidth = [descriptor oo_doubleForKey:@"width" defaultValue:-INFINITY];
922 double specifiedHeight = [descriptor oo_doubleForKey:@"height" defaultValue:-INFINITY];
923 BOOL haveWidth = isfinite(specifiedWidth);
924 BOOL haveHeight = isfinite(specifiedHeight);
925
926 if (haveWidth && haveHeight) {
927 // Both specified, use directly without calling -originalDimensions (which may block).
928 size.width = specifiedWidth;
929 size.height = specifiedHeight;
930 } else {
931 NSSize originalDimensions = [texture originalDimensions];
932
933 if (haveWidth) {
934 // Width specified, but not height; preserve aspect ratio.
935 CGFloat ratio = originalDimensions.height / originalDimensions.width;
936 size.width = specifiedWidth;
937 size.height = ratio * size.width;
938 } else if (haveHeight) {
939 // Height specified, but not width; preserve aspect ratio.
940 CGFloat ratio = originalDimensions.width / originalDimensions.height;
941 size.height = specifiedHeight;
942 size.width = ratio * size.height;
943 } else {
944 // Neither specified; use backwards-compatible behaviour.
945 size = originalDimensions;
946 }
947 }
948
949 return [[OOTextureSprite alloc] initWithTexture:texture size:size];
950}
static OOTexture * TextureForGUITexture(NSDictionary *descriptor, uint32_t srgbaOption)
NSSize originalDimensions()
Definition OOTexture.m:298

References nil, OOTexture::originalDimensions, size, and TextureForGUITexture.

Referenced by setBackgroundTextureDescriptor:, and setForegroundTextureDescriptor:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ objectForRow:

- (id) objectForRow: (OOGUIRow) row

Definition at line 419 of file GuiDisplayGen.m.

419 :(OOGUIRow)row
420{
421 if (RowInRange(row, rowRange))
422 return [rowText objectAtIndex:row];
423 else
424 return NULL;
425}

References RowInRange(), and rowRange.

Referenced by PlayerEntity(Contracts)::buySelectedShip, insertItemsFromArray:withKeys:intoRow:color:, and PlayerEntity(Contracts)::showShipyardInfoForSelection.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ overrideTabs:from:length:

- (void) overrideTabs: (OOGUITabSettings) stops
from: (NSString*) setting
length: (NSUInteger) len 

Definition at line 570 of file GuiDisplayGen.m.

570 :(OOGUITabSettings)stops from:(NSString*)setting length:(NSUInteger)len
571{
572 NSArray* override = [guiUserSettings oo_arrayForKey:setting defaultValue:nil];
573 NSUInteger i;
574 if (stops != NULL && override != nil) {
575 if (len > GUI_MAX_COLUMNS) {
576 len = GUI_MAX_COLUMNS;
577 }
578 for (i = 0; i < len; i++) {
579 stops[i] = [override oo_unsignedIntegerAtIndex:i defaultValue:stops[i]];
580 }
581 }
582}
#define GUI_MAX_COLUMNS

References GUI_MAX_COLUMNS, and nil.

Referenced by GuiDisplayGen(Internal)::drawStarChart:y:z:alpha:compact:, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToStatusScreen, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, and PlayerEntity(OOPrivate)::showMarketScreenHeaders.

Here is the caller graph for this function:

◆ preloadGUITexture:

- (BOOL) preloadGUITexture: (NSDictionary*) descriptor

Definition at line 1030 of file GuiDisplayGen.m.

1030 :(NSDictionary*)descriptor
1031{
1032 return TextureForGUITexture(descriptor, kOOTextureSRGBA) != nil;
1033}
@ kOOTextureSRGBA
Definition OOTexture.h:63

References kOOTextureSRGBA, nil, and TextureForGUITexture.

Here is the call graph for this function:

◆ printLineNoScroll:align:color:fadeTime:key:addToArray:

- (void) printLineNoScroll: (NSString*) str
align: (OOGUIAlignment) alignment
color: (OOColor*) text_color
fadeTime: (float) text_fade
key: (NSString*) text_key
addToArray: (NSMutableArray*) text_array 

Definition at line 797 of file GuiDisplayGen.m.

797 :(NSString*)str
798 align:(OOGUIAlignment)alignment
799 color:(OOColor*)text_color
800 fadeTime:(float)text_fade
801 key:(NSString*)text_key
802 addToArray:(NSMutableArray*)text_array
803{
804 [self setText:str forRow:currentRow align:alignment];
805 if (text_color)
806 [self setColor:text_color forRow:currentRow];
807 if (text_key)
808 [self setKey:text_key forRow:currentRow];
809 if (text_array)
810 [text_array addObject:str];
811 rowFadeTime[currentRow] = text_fade;
812}

References rowFadeTime, setColor:forRow:, setKey:forRow:, and setText:forRow:align:.

Referenced by Universe::showGUIMessage:withScroll:andColor:overDuration:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printLongText:align:color:fadeTime:key:addToArray:

- (void) printLongText: (NSString*) str
align: (OOGUIAlignment) alignment
color: (OOColor*) text_color
fadeTime: (float) text_fade
key: (NSString*) text_key
addToArray: (NSMutableArray*) text_array 

Definition at line 736 of file GuiDisplayGen.m.

736 :(NSString*)str
737 align:(OOGUIAlignment)alignment
738 color:(OOColor*)text_color
739 fadeTime:(float)text_fade
740 key:(NSString*)text_key
741 addToArray:(NSMutableArray*)text_array
742{
743 // print a multi-line message
744 //
745 if ([str rangeOfString:@"\n"].location != NSNotFound) {
746 NSArray* lines = [str componentsSeparatedByString:@"\n"];
747 unsigned i;
748 for (i = 0; i < [lines count]; i++)
749 [self printLongText:[lines oo_stringAtIndex:i] align:alignment color:text_color fadeTime:text_fade key:text_key addToArray:text_array];
750 return;
751 }
752
753 OOGUIRow row = currentRow;
754 if (row == (OOGUIRow)n_rows - 1)
755 [self scrollUp:1];
756 NSSize chSize = pixel_text_size;
757 NSSize strsize = OORectFromString(str, 0.0f, 0.0f, chSize).size;
758 if (strsize.width < size_in_pixels.width) {
759 [self setText:str forRow:row align:alignment];
760 if (text_color)
761 [self setColor:text_color forRow:row];
762 if (text_key)
763 [self setKey:text_key forRow:row];
764 rowFadeTime[row] = text_fade;
765 if (currentRow < (OOGUIRow)n_rows - 1)
766 currentRow++;
767 if (text_array)
768 [text_array addObject:str];
769 } else {
770 NSMutableArray* words = ScanTokensFromString(str);
771 NSMutableString* string1 = [NSMutableString stringWithCapacity:256];
772 NSMutableString* string2 = [NSMutableString stringWithCapacity:256];
773 strsize.width = 0.0f;
774 while ((strsize.width < size_in_pixels.width) && ([words count] > 0)) {
775 [string1 appendString:(NSString*)[words objectAtIndex:0]];
776 [string1 appendString:@" "];
777 [words removeObjectAtIndex:0];
778 strsize = OORectFromString(string1, 0.0f, 0.0f, chSize).size;
779 if ([words count] > 0)
780 strsize.width += OORectFromString([words oo_stringAtIndex:0], 0.0f, 0.0f, chSize).size.width;
781 }
782
783 [self setText:string1 forRow:row align:alignment];
784
785 [string2 appendString:[words componentsJoinedByString:@" "]];
786 if (text_color)
787 [self setColor:text_color forRow:row];
788 if (text_key)
789 [self setKey:text_key forRow:row];
790 if (text_array)
791 [text_array addObject:string1];
792 rowFadeTime[row] = text_fade;
793 [self printLongText:string2 align:alignment color:text_color fadeTime:text_fade key:text_key addToArray:text_array];
794 }
795}
return self

References count, currentRow, n_rows, OORectFromString(), pixel_text_size, printLongText:align:color:fadeTime:key:addToArray:, rowFadeTime, ScanTokensFromString(), scrollUp:, setColor:forRow:, setKey:forRow:, setText:forRow:align:, and size_in_pixels.

Referenced by Universe::addCommsMessage:forCount:andShowComms:logOnly:, Universe::clearGUIs, printLongText:align:color:fadeTime:key:addToArray:, HeadUpDisplay::resetGuis:, Universe::setUpUniverseFromWitchspace, and Universe::showGUIMessage:withScroll:andColor:overDuration:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reflowTextForMFD:

- (NSString *) reflowTextForMFD: (NSString*) input

Definition at line 666 of file GuiDisplayGen.m.

666 :(NSString*)input
667{
668 NSMutableString* output = [[NSMutableString alloc] initWithCapacity:512];
669 NSArray* lines = [input componentsSeparatedByString:@"\n"];
670 NSSize chSize = pixel_text_size;
671 NSUInteger limit = chSize.width * 15;
672 NSString* line = nil;
673 foreach (line, lines) {
674 NSMutableArray* words = ScanTokensFromString(line);
675 NSMutableString* accum = [NSMutableString stringWithCapacity:64];
676 if ([words count] > 0) {
677 while ([words count] > 1) {
678 [accum appendString:[words oo_stringAtIndex:0]];
679 [accum appendString:@" "];
680 if (OORectFromString(accum, 0.0f, 0.0f, chSize).size.width + OORectFromString([words oo_stringAtIndex:1], 0.0f, 0.0f, chSize).size.width > limit) {
681 // can't fit next word on this line
682 [output appendString:[accum stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];
683 [output appendString:@"\n"];
684 [accum setString:@""];
685 }
686 [words removeObjectAtIndex:0];
687 }
688 [output appendString:accum];
689 [output appendString:[words oo_stringAtIndex:0]];
690 }
691 [output appendString:@"\n"];
692 }
693
694 return [output autorelease];
695}

References count, nil, OORectFromString(), pixel_text_size, ScanTokensFromString(), and size.

Referenced by PlayerShipSetMultiFunctionText(), and PlayerShipSetMultiFunctionText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshStarChart

- (void) refreshStarChart

Definition at line 1233 of file GuiDisplayGen.m.

1234{
1235 _refreshStarChart = YES;
1236}

References _refreshStarChart, and refreshStarChart.

Referenced by refreshStarChart, setBackgroundTextureSpecial:withBackground:, PlayerEntity::setGuiToChartScreenFrom:, Universe::setSystemDataForGalaxy:planet:key:value:fromManifest:forLayer:, and statusPage.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reportSelectedRow:

- (void) reportSelectedRow: (int) row

Definition at line 512 of file GuiDisplayGen.m.

512 :(int)row
513{
514 [PLAYER doScriptEvent:OOJSID("guiSelectedRowChanged") withArguments:[NSArray arrayWithObjects:[self keyForRow:row], [NSNumber numberWithInt:row], [self selectedRowText], nil]];
515}

References keyForRow:, and selectedRowText.

Referenced by setFirstSelectableRow, setLastSelectableRow, setNextRow:, and setSelectedRow:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeTo:characterHeight:title:

- (void) resizeTo: (NSSize) gui_size
characterHeight: (int) csize
title: (NSString*) gui_title 

Definition at line 200 of file GuiDisplayGen.m.

200 :(NSSize)gui_size
201 characterHeight:(int)csize
202 title:(NSString*)gui_title
203{
204 [self clear];
205 //
206 size_in_pixels = gui_size;
207 n_columns = gui_size.width / csize;
208 n_rows = (int)gui_size.height / csize;
209
210 [self setTitle:gui_title];
211
212 pixel_row_center = gui_size.width / 2;
213 pixel_row_height = csize;
214 currentRow = n_rows - 1; // first position down the page...
215
216 if (title != nil)
217 pixel_row_start = 2.75f * csize + 0.5f * (gui_size.height - n_rows * csize);
218 else
219 pixel_row_start = csize + 0.5f * (gui_size.height - n_rows * csize);
220
221 [rowText removeAllObjects];
222 [rowKey removeAllObjects];
223 [rowColor removeAllObjects];
224
225 unsigned i;
226 for (i = 0; i < n_rows; i++) {
227 [rowText addObject:@""];
228 [rowKey addObject:@""];
229 [rowColor addObject:[OOColor greenColor]];
230 rowPosition[i].x = 0.0f;
233 }
234
235 pixel_text_size = NSMakeSize(csize, csize);
236 pixel_title_size = NSMakeSize(csize * 1.75f, csize * 1.5f);
237
238 OOLog(@"gui.reset", @"gui %@ reset to rows:%d columns:%d start:%d", self, n_rows, n_columns, pixel_row_start);
239
240 rowRange = NSMakeRange(0, n_rows);
241 [self clear];
242}
#define OOLog(class, format,...)
Definition OOLogging.h:84

References clear, currentRow, OOColor::greenColor, GUI_ALIGN_LEFT, int(), n_columns, n_rows, nil, OOLog, pixel_row_center, pixel_row_height, pixel_row_start, pixel_text_size, pixel_title_size, rowAlignment, rowPosition, rowRange, setTitle:, size_in_pixels, and title.

Referenced by HeadUpDisplay(Private)::resetGui:withInfo:, and HeadUpDisplay::resetGuis:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeWithPixelSize:columns:rows:rowHeight:rowStart:title:

- (void) resizeWithPixelSize: (NSSize) gui_size
columns: (int) gui_cols
rows: (int) gui_rows
rowHeight: (int) gui_row_height
rowStart: (int) gui_row_start
title: (NSString*) gui_title 

Definition at line 175 of file GuiDisplayGen.m.

175 :(NSSize)gui_size
176 columns:(int)gui_cols
177 rows:(int)gui_rows
178 rowHeight:(int)gui_row_height
179 rowStart:(int)gui_row_start
180 title:(NSString*)gui_title
181{
182 [self clear];
183 //
184 size_in_pixels = gui_size;
185 n_columns = gui_cols;
186 n_rows = gui_rows;
188 pixel_row_height = gui_row_height;
189 pixel_row_start = gui_row_start; // first position down the page...
190
192 pixel_title_size = NSMakeSize(pixel_row_height * 1.75f, pixel_row_height * 1.5f);
193
194 rowRange = NSMakeRange(0, n_rows);
195 [self clear];
196 //
197 [self setTitle:gui_title];
198}

References clear, n_columns, n_rows, pixel_row_center, pixel_row_height, pixel_row_start, pixel_text_size, pixel_title_size, rowRange, setTitle:, and size_in_pixels.

Here is the call graph for this function:

◆ rowForKey:

- (OOGUIRow) rowForKey: (NSString*) key

Definition at line 427 of file GuiDisplayGen.m.

427 :(NSString*)key
428{
429 for (unsigned i = 0; i < [rowKey count]; i++) {
430 if ([key isEqualToString:[rowKey objectAtIndex:i]]) {
431 return (OOGUIRow)i;
432 }
433 }
434 return -1;
435}

References rowKey.

◆ rowHeight

- (unsigned) rowHeight

Definition at line 259 of file GuiDisplayGen.m.

260{
261 return pixel_row_height;
262}

References pixel_row_height, and rowHeight.

Referenced by HeadUpDisplay(Private)::resetGui:withInfo:, and rowHeight.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rows

- (unsigned) rows

Definition at line 254 of file GuiDisplayGen.m.

255{
256 return n_rows;
257}

References n_rows, and rows.

Referenced by rows.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rowStart

- (int) rowStart

Definition at line 264 of file GuiDisplayGen.m.

265{
266 return pixel_row_start;
267}

References int(), pixel_row_start, and rowStart.

Referenced by rowStart.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scrollUp:

- (void) scrollUp: (int) how_much

Definition at line 863 of file GuiDisplayGen.m.

863 :(int)how_much
864{
865 unsigned i;
866 for (i = 0; i + how_much < n_rows; i++) {
867 [rowText replaceObjectAtIndex:i withObject:[rowText objectAtIndex:i + how_much]];
868 [rowColor replaceObjectAtIndex:i withObject:[rowColor objectAtIndex:i + how_much]];
869 [rowKey replaceObjectAtIndex:i withObject:[rowKey objectAtIndex:i + how_much]];
870 rowAlignment[i] = rowAlignment[i + how_much];
871 rowFadeTime[i] = rowFadeTime[i + how_much];
872 }
873 for (; i < n_rows; i++) {
874 [rowText replaceObjectAtIndex:i withObject:@""];
875 [rowColor replaceObjectAtIndex:i withObject:textColor];
876 [rowKey replaceObjectAtIndex:i withObject:@""];
878 rowFadeTime[i] = 0.0f;
879 }
880}

References GUI_ALIGN_LEFT, n_rows, rowAlignment, and rowFadeTime.

Referenced by printLongText:align:color:fadeTime:key:addToArray:.

Here is the caller graph for this function:

◆ selectableRange

- (NSRange) selectableRange

References clear, clearBackground, drawGUIBackground, getLastLines, int(), leaveLastLine, and selectableRange.

Here is the call graph for this function:

◆ selectedRow

References selectedRow, selectedRowKey, selectedRowText, setFirstSelectableRow, setLastSelectableRow, and setNoSelectedRow.

Here is the call graph for this function:

◆ selectedRowKey

- (NSString *) selectedRowKey

Definition at line 531 of file GuiDisplayGen.m.

532{
533 if ((selectedRow < 0) || ((unsigned)selectedRow > [rowKey count]))
534 return nil;
535 else
536 return (NSString*)[rowKey objectAtIndex:selectedRow];
537}

References count, nil, rowKey, selectedRow, and selectedRowKey.

Referenced by PlayerEntity::activateSelectedInterface, PlayerEntity::buySelectedItem, PlayerEntity(OOControlsPrivate)::pollDemoControls:, PlayerEntity(OOControlsPrivate)::pollMarketScreenControls, selectedRow, selectedRowKey, PlayerEntity::showInformationForSelectedInterface, PlayerEntity::showInformationForSelectedUpgradeWithFormatString:, PlayerEntity(LoadSave)::showScenarioDetails, and PlayerEntity(LoadSave)::startScenario.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedRowText

- (NSString *) selectedRowText

Definition at line 522 of file GuiDisplayGen.m.

523{
524 if ([[rowText objectAtIndex:selectedRow] isKindOfClass:[NSString class]])
525 return (NSString*)[rowText objectAtIndex:selectedRow];
526 if ([[rowText objectAtIndex:selectedRow] isKindOfClass:[NSArray class]])
527 return (NSString*)[[rowText objectAtIndex:selectedRow] objectAtIndex:0];
528 return NULL;
529}

References rowText, selectedRow, and selectedRowText.

Referenced by PlayerEntity::buySelectedItem, PlayerEntity(OOControlsPrivate)::pollGuiArrowKeyControls:, reportSelectedRow:, selectedRow, and selectedRowText.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAlpha:

- (void) setAlpha: (GLfloat) an_alpha

Definition at line 320 of file GuiDisplayGen.m.

320 :(GLfloat)an_alpha
321{
322 fade_alpha = an_alpha * max_alpha;
323}

References fade_alpha, and max_alpha.

Referenced by HeadUpDisplay::resetGuis:, Universe::showCommsLog:, and Universe::showGUIMessage:withScroll:andColor:overDuration:.

Here is the caller graph for this function:

◆ setArray:forRow:

- (void) setArray: (NSArray*) arr
forRow: (OOGUIRow) row 

Definition at line 814 of file GuiDisplayGen.m.

814 :(NSArray*)arr forRow:(OOGUIRow)row
815{
816 if (RowInRange(row, rowRange))
817 [rowText replaceObjectAtIndex:row withObject:arr];
818}

References RowInRange(), and rowRange.

Referenced by PlayerEntity(Contracts)::buySelectedShip, PlayerEntity(StickMapperInternal)::displayFunctionList:skip:, PlayerEntity(KeyMapperInternal)::displayKeyboardLayoutList:skip:, PlayerEntity(KeyMapperInternal)::displayKeyFunctionList:skip:, GuiDisplayGen(Internal)::drawEquipmentList:z:, GuiDisplayGen(Internal)::drawStarChart:y:z:alpha:compact:, insertItemsFromArray:withKeys:intoRow:color:, PlayerEntity(OOLoadSavePrivate)::lsCommanders:directory:pageNumber:highlightName:, PlayerEntity(KeyMapper)::outputKeyDefinition:shift:mod1:mod2:skiprows:, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(KeyMapper)::setGuiToKeyboardLayoutScreen:resetCurrentRow:, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToStatusScreen, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, PlayerEntity(Contracts)::setManifestScreenRow:inColor:forRow:ofRows:andOffset:inMultipage:, OOOXZManager::showInstallOptions, PlayerEntity(OOPrivate)::showMarketScreenDataLine:forGood:inMarket:holdQuantity:, PlayerEntity(OOPrivate)::showMarketScreenHeaders, OOOXZManager::showRemoveOptions, StickProfileScreen(StickProfileInternal)::showScreen, PlayerEntity(Contracts)::showShipyardInfoForSelection, and PlayerEntity(StickMapper)::stickMapperInputHandler:view:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBackgroundColor:

- (void) setBackgroundColor: (OOColor*) color

Definition at line 330 of file GuiDisplayGen.m.

330 :(OOColor*)color
331{
332 [backgroundColor release];
333 backgroundColor = [color retain];
334}

References backgroundColor.

Referenced by HeadUpDisplay(Private)::resetGui:withInfo:, HeadUpDisplay::resetGuis:, and Universe::setMessageGuiBackgroundColor:.

Here is the caller graph for this function:

◆ setBackgroundTextureDescriptor:

- (BOOL) setBackgroundTextureDescriptor: (NSDictionary*) descriptor

Definition at line 1003 of file GuiDisplayGen.m.

1003 :(NSDictionary*)descriptor
1004{
1005 [backgroundSprite autorelease];
1008 return backgroundSprite != nil;
1009}
static OOTextureSprite * NewTextureSpriteWithDescriptor(NSDictionary *descriptor, uint32_t srgbaOption)

References backgroundSpecial, backgroundSprite, GUI_BACKGROUND_SPECIAL_NONE, kOOTextureSRGBA, NewTextureSpriteWithDescriptor, and nil.

Referenced by clearBackground, GlobalSetScreenBackground(), GlobalSetScreenBackground(), setBackgroundTextureKey:, setBackgroundTextureSpecial:withBackground:, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(Scripting)::setGuiToMissionScreenWithCallback:, and PlayerEntity::setGuiToStatusScreen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBackgroundTextureKey:

- (BOOL) setBackgroundTextureKey: (NSString*) key

Definition at line 1020 of file GuiDisplayGen.m.

1020 :(NSString*)key
1021{
1022 return [self setBackgroundTextureDescriptor:[UNIVERSE screenTextureDescriptorForKey:key]];
1023}

References setBackgroundTextureDescriptor:.

Referenced by PlayerEntity::setGuiToChartScreenFrom:, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToIntroFirstGo:, PlayerEntity(KeyMapper)::setGuiToKeyboardLayoutScreen:resetCurrentRow:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity(OOLoadSavePrivate)::setGuiToLoadCommanderScreen, PlayerEntity::setGuiToLoadSaveScreen, PlayerEntity::setGuiToLongRangeChartScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(OOLoadSavePrivate)::setGuiToOverwriteScreen:, PlayerEntity(OOLoadSavePrivate)::setGuiToSaveCommanderScreen:, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToShortRangeChartScreen, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, PlayerEntity::setupStartScreenGui, and StickProfileScreen(StickProfileInternal)::showScreen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBackgroundTextureSpecial:withBackground:

- (void) setBackgroundTextureSpecial: (OOGUIBackgroundSpecial) spec
withBackground: (BOOL) withBackground 

Definition at line 952 of file GuiDisplayGen.m.

952 :(OOGUIBackgroundSpecial)spec withBackground:(BOOL)withBackground
953{
954 if (withBackground) {
955 NSDictionary* bgDescriptor = nil;
956 OOGalaxyID galaxy_number = [PLAYER galaxyNumber];
957
958 switch (spec) {
962 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:@"custom_chart_mission"];
963 if (bgDescriptor == nil) {
964 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:@"short_range_chart_mission"];
965 if (bgDescriptor == nil) {
966 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:@"short_range_chart"];
967 }
968 }
969 break;
973 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:@"short_range_chart_mission"];
974 if (bgDescriptor == nil) {
975 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:@"short_range_chart"];
976 }
977 break;
981 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:[NSString stringWithFormat:@"long_range_chart%d_mission", galaxy_number + 1]];
982 if (bgDescriptor == nil) {
983 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:@"long_range_chart_mission"];
984 if (bgDescriptor == nil) {
985 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:[NSString stringWithFormat:@"long_range_chart%d", galaxy_number + 1]];
986 if (bgDescriptor == nil) {
987 bgDescriptor = [UNIVERSE screenTextureDescriptorForKey:@"long_range_chart"];
988 }
989 }
990 }
991 break;
993 break;
994 }
995 if (bgDescriptor != nil) {
996 [self setBackgroundTextureDescriptor:bgDescriptor];
997 }
998 }
999 backgroundSpecial = spec;
1000 [self refreshStarChart];
1001}
OOGUIBackgroundSpecial

References backgroundSpecial, GUI_BACKGROUND_SPECIAL_CUSTOM, GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_CUSTOM_ANA_SHORTEST, GUI_BACKGROUND_SPECIAL_LONG, GUI_BACKGROUND_SPECIAL_LONG_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_LONG_ANA_SHORTEST, GUI_BACKGROUND_SPECIAL_NONE, GUI_BACKGROUND_SPECIAL_SHORT, GUI_BACKGROUND_SPECIAL_SHORT_ANA_QUICKEST, GUI_BACKGROUND_SPECIAL_SHORT_ANA_SHORTEST, nil, refreshStarChart, and setBackgroundTextureDescriptor:.

Referenced by PlayerEntity(Scripting)::setGuiToMissionScreenWithCallback:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCharacterSize:

- (void) setCharacterSize: (NSSize) character_size

Definition at line 403 of file GuiDisplayGen.m.

403 :(NSSize)character_size
404{
405 pixel_text_size = character_size;
406}

References pixel_text_size.

Referenced by HeadUpDisplay::resetGuis:.

Here is the caller graph for this function:

◆ setColor:forRow:

- (void) setColor: (OOColor*) color
forRow: (OOGUIRow) row 

Definition at line 413 of file GuiDisplayGen.m.

413 :(OOColor*)color forRow:(OOGUIRow)row
414{
415 if (RowInRange(row, rowRange))
416 [rowColor replaceObjectAtIndex:row withObject:color];
417}

References RowInRange(), and rowRange.

Referenced by PlayerEntity(Contracts)::buySelectedShip, clearAndKeepBackground:, PlayerEntity(StickMapperInternal)::displayFunctionList:skip:, PlayerEntity(KeyMapperInternal)::displayKeyboardLayoutList:skip:, PlayerEntity(KeyMapperInternal)::displayKeyFunctionList:skip:, GuiDisplayGen(Internal)::drawEquipmentList:z:, OOOXZManager::gui, PlayerEntity(KeyMapper)::handleKeyConfigEntryKeys:view:, insertItemsFromArray:withKeys:intoRow:color:, PlayerEntity(OOLoadSavePrivate)::lsCommanders:directory:pageNumber:highlightName:, printLineNoScroll:align:color:fadeTime:key:addToArray:, printLongText:align:color:fadeTime:key:addToArray:, OOOXZManager::processShowInfoKey, PlayerEntity(Scripting)::refreshMissionScreenTextEntry, OOOXZManager::refreshTextInput:, PlayerEntity(LoadSave)::saveCommanderInputHandler, PlayerEntity::setGuiToChartScreenFrom:, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity::setGuiToIntroFirstGo:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToLoadSaveScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(Scripting)::setGuiToMissionScreenWithCallback:, PlayerEntity(OOLoadSavePrivate)::setGuiToSaveCommanderScreen:, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToStatusScreen, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, PlayerEntity(Contracts)::setManifestScreenRow:inColor:forRow:ofRows:andOffset:inMultipage:, PlayerEntity(Scripting)::setMissionChoicesDictionary:, PlayerEntity::setupStartScreenGui, PlayerEntity(OOLoadSavePrivate)::showCommanderShip:, PlayerEntity::showInformationForSelectedInterface, PlayerEntity::showInformationForSelectedUpgradeWithFormatString:, OOOXZManager::showInstallOptions, PlayerEntity(OOPrivate)::showMarketCashAndLoadLine, PlayerEntity(OOPrivate)::showMarketScreenDataLine:forGood:inMarket:holdQuantity:, PlayerEntity(OOPrivate)::showMarketScreenHeaders, OOOXZManager::showRemoveOptions, StickProfileScreen(StickProfileInternal)::showScreen, PlayerEntity(Contracts)::showShipyardInfoForSelection, and PlayerEntity(Contracts)::showTradeInInformationFooter.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCurrentRow:

- (void) setCurrentRow: (OOGUIRow) value

Definition at line 544 of file GuiDisplayGen.m.

544 :(OOGUIRow)value
545{
546 if ((value < 0) || ((unsigned)value >= n_rows)) {
547 showTextCursor = NO;
548 currentRow = -1;
549 } else {
550 currentRow = value;
551 }
552}

References currentRow, n_rows, and showTextCursor.

Referenced by PlayerEntity(Scripting)::refreshMissionScreenTextEntry, HeadUpDisplay::resetGuis:, PlayerEntity::setGuiToChartScreenFrom:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, and PlayerEntity(OOLoadSavePrivate)::setGuiToSaveCommanderScreen:.

Here is the caller graph for this function:

◆ setDrawPosition:

- (void) setDrawPosition: (Vector) vector

Definition at line 284 of file GuiDisplayGen.m.

284 :(Vector)vector
285{
286 drawPosition = vector;
287}
struct Vector Vector

References drawPosition.

Referenced by HeadUpDisplay(Private)::resetGuiPosition:withInfo:, and HeadUpDisplay::resetGuis:.

Here is the caller graph for this function:

◆ setFirstSelectableRow

- (BOOL) setFirstSelectableRow

Definition at line 482 of file GuiDisplayGen.m.

483{
484 NSUInteger row = selectableRange.location;
485 while (RowInRange(row, selectableRange)) {
486 if (![[rowKey objectAtIndex:row] isEqual:GUI_KEY_SKIP]) {
487 selectedRow = row;
488 [self reportSelectedRow:row];
489 return YES;
490 }
491 row++;
492 }
493 selectedRow = -1;
494 return NO;
495}
#define GUI_KEY_SKIP

References GUI_KEY_SKIP, reportSelectedRow:, RowInRange(), rowKey, selectableRange, selectedRow, and setFirstSelectableRow.

Referenced by selectedRow, setFirstSelectableRow, and PlayerEntity(Contracts)::setGuiToShipyardScreen:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setForegroundTextureDescriptor:

- (BOOL) setForegroundTextureDescriptor: (NSDictionary*) descriptor

Definition at line 1011 of file GuiDisplayGen.m.

1011 :(NSDictionary*)descriptor
1012{
1013 [foregroundSprite autorelease];
1014 // FIXME: for some reason passing kOOTextureSRGBA when in SDR results in double gamma correction
1015 uint32_t srgbaOption = [[UNIVERSE gameView] hdrOutput] ? kOOTextureSRGBA : 0;
1016 foregroundSprite = NewTextureSpriteWithDescriptor(descriptor, srgbaOption);
1017 return foregroundSprite != nil;
1018}

References foregroundSprite, kOOTextureSRGBA, NewTextureSpriteWithDescriptor, and nil.

Referenced by clearBackground, GlobalSetScreenOverlay(), GlobalSetScreenOverlay(), setForegroundTextureKey:, PlayerEntity(Scripting)::setGuiToMissionScreenWithCallback:, and PlayerEntity::setGuiToStatusScreen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setForegroundTextureKey:

- (BOOL) setForegroundTextureKey: (NSString*) key

Definition at line 1025 of file GuiDisplayGen.m.

1025 :(NSString*)key
1026{
1027 return [self setForegroundTextureDescriptor:[UNIVERSE screenTextureDescriptorForKey:key]];
1028}

References setForegroundTextureDescriptor:.

Referenced by PlayerEntity::setGuiToChartScreenFrom:, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(KeyMapper)::setGuiToKeyboardLayoutScreen:resetCurrentRow:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity(OOLoadSavePrivate)::setGuiToLoadCommanderScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(OOLoadSavePrivate)::setGuiToOverwriteScreen:, PlayerEntity(OOLoadSavePrivate)::setGuiToSaveCommanderScreen:, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, and StickProfileScreen(StickProfileInternal)::showScreen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGLColorFromSetting:defaultValue:alpha:

- (void) setGLColorFromSetting: (NSString*) setting
defaultValue: (OOColor*) def
alpha: (GLfloat) alpha 

Definition at line 381 of file GuiDisplayGen.m.

381 :(NSString*)setting defaultValue:(OOColor*)def alpha:(GLfloat)alpha
382{
383 GLfloat r, g, b, a;
384 OOColor* col = [self colorFromSetting:setting defaultValue:def];
385 [col getRed:&r green:&g blue:&b alpha:&a];
386
387 OOGL(glColor4f(r, g, b, a * alpha));
388}

References alpha, colorFromSetting:defaultValue:, OOColor::getRed:green:blue:alpha:, and OOGL.

Referenced by GuiDisplayGen(Internal)::drawAdvancedNavArrayAtX:y:z:alpha:usingRoute:optimizedBy:zoom:, GuiDisplayGen(Internal)::drawEquipmentList:z:, GuiDisplayGen(Internal)::drawGLDisplay:y:z:alpha:, and GuiDisplayGen(Internal)::drawStarChart:y:z:alpha:compact:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGuiColorSettingFromKey:color:

- (void) setGuiColorSettingFromKey: (NSString*) key
color: (OOColor*) col 

Definition at line 390 of file GuiDisplayGen.m.

390 :(NSString*)key color:(OOColor*)col
391{
392 NSMutableDictionary* guiCopy = [guiUserSettings mutableCopy];
393 if (col == nil) {
394 [guiCopy removeObjectForKey:key];
395 } else {
396 [guiCopy setObject:col forKey:key];
397 }
398 [guiUserSettings release];
399 guiUserSettings = [guiCopy copy];
400 [guiCopy release];
401}

References guiUserSettings, and nil.

Referenced by GlobalSetGuiColorSettingForKey(), and GlobalSetGuiColorSettingForKey().

Here is the caller graph for this function:

◆ setKey:forRow:

- (void) setKey: (NSString*) str
forRow: (OOGUIRow) row 

Definition at line 607 of file GuiDisplayGen.m.

607 :(NSString*)str forRow:(OOGUIRow)row
608{
609 if (RowInRange(row, rowRange))
610 [rowKey replaceObjectAtIndex:row withObject:str];
611}

References RowInRange(), and rowRange.

Referenced by clearAndKeepBackground:, PlayerEntity(StickMapperInternal)::displayFunctionList:skip:, PlayerEntity(KeyMapperInternal)::displayKeyboardLayoutList:skip:, PlayerEntity(KeyMapperInternal)::displayKeyFunctionList:skip:, GuiDisplayGen(Internal)::drawEquipmentList:z:, OOOXZManager::gui, PlayerEntity(OOControlsPrivate)::handleGameOptionsScreenKeys, insertItemsFromArray:withKeys:intoRow:color:, PlayerEntity(OOLoadSavePrivate)::lsCommanders:directory:pageNumber:highlightName:, PlayerEntity(KeyMapper)::outputKeyDefinition:shift:mod1:mod2:skiprows:, printLineNoScroll:align:color:fadeTime:key:addToArray:, printLongText:align:color:fadeTime:key:addToArray:, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToLoadSaveScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(Scripting)::setGuiToMissionScreenWithCallback:, PlayerEntity(OOLoadSavePrivate)::setGuiToOverwriteScreen:, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity(Scripting)::setMissionChoicesDictionary:, PlayerEntity::setupStartScreenGui, OOOXZManager::showInstallOptions, PlayerEntity(OOPrivate)::showMarketScreenDataLine:forGood:inMarket:holdQuantity:, OOOXZManager::showRemoveOptions, and StickProfileScreen(StickProfileInternal)::showScreen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLastSelectableRow

- (BOOL) setLastSelectableRow

Definition at line 497 of file GuiDisplayGen.m.

498{
499 NSUInteger row = selectableRange.location + selectableRange.length - 1;
500 while (RowInRange(row, selectableRange)) {
501 if (![[rowKey objectAtIndex:row] isEqual:GUI_KEY_SKIP]) {
502 selectedRow = row;
503 [self reportSelectedRow:row];
504 return YES;
505 }
506 row--;
507 }
508 selectedRow = -1;
509 return NO;
510}

References GUI_KEY_SKIP, reportSelectedRow:, RowInRange(), rowKey, selectableRange, selectedRow, and setLastSelectableRow.

Referenced by selectedRow, and setLastSelectableRow.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxAlpha:

- (void) setMaxAlpha: (GLfloat) an_alpha

Definition at line 325 of file GuiDisplayGen.m.

325 :(GLfloat)an_alpha
326{
327 max_alpha = an_alpha;
328}

References max_alpha.

Referenced by HeadUpDisplay(Private)::resetGui:withInfo:.

Here is the caller graph for this function:

◆ setNextRow:

- (BOOL) setNextRow: (int) direction

Definition at line 468 of file GuiDisplayGen.m.

468 :(int)direction
469{
470 OOGUIRow row = selectedRow + direction;
471 while (RowInRange(row, selectableRange)) {
472 if (![[rowKey objectAtIndex:row] isEqual:GUI_KEY_SKIP]) {
473 selectedRow = row;
474 [self reportSelectedRow:row];
475 return YES;
476 }
477 row += direction;
478 }
479 return NO;
480}

References GUI_KEY_SKIP, reportSelectedRow:, RowInRange(), rowKey, selectableRange, and selectedRow.

Here is the call graph for this function:

◆ setNoSelectedRow

- (void) setNoSelectedRow

Definition at line 517 of file GuiDisplayGen.m.

518{
519 selectedRow = -1;
520}

References selectedRow, and setNoSelectedRow.

Referenced by PlayerEntity(OOControlsPrivate)::pollGuiScreenControlsWithFKeyAlias:, selectedRow, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, and setNoSelectedRow.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSelectableRange:

◆ setSelectedRow:

- (BOOL) setSelectedRow: (OOGUIRow) row

Definition at line 453 of file GuiDisplayGen.m.

453 :(OOGUIRow)row
454{
455 if ((row == selectedRow) && RowInRange(row, selectableRange)) {
456 return YES;
457 }
458 if (RowInRange(row, selectableRange)) {
459 if (![[rowKey objectAtIndex:row] isEqual:GUI_KEY_SKIP]) {
460 selectedRow = row;
461 [self reportSelectedRow:row];
462 return YES;
463 }
464 }
465 return NO;
466}

References GUI_KEY_SKIP, reportSelectedRow:, RowInRange(), rowKey, selectableRange, and selectedRow.

Referenced by PlayerEntity::activateSelectedInterface, PlayerEntity::buySelectedItem, GuiDisplayGen(Internal)::drawEquipmentList:z:, OOOXZManager::gui, PlayerEntity(OOControlsPrivate)::handleGameOptionsScreenKeys, PlayerEntity::highlightEquipShipScreenKey:, PlayerEntity(OOLoadSavePrivate)::lsCommanders:directory:pageNumber:highlightName:, PlayerEntity(OOControlsPrivate)::pollGuiArrowKeyControls:, PlayerEntity(OOControlsPrivate)::pollGuiScreenControlsWithFKeyAlias:, OOOXZManager::processShowInfoKey, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(KeyMapper)::setGuiToKeyboardLayoutScreen:resetCurrentRow:, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToLoadSaveScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(OOLoadSavePrivate)::setGuiToOverwriteScreen:, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity(Scripting)::setMissionChoicesDictionary:, PlayerEntity::setupStartScreenGui, OOOXZManager::showInstallOptions, OOOXZManager::showRemoveOptions, and StickProfileScreen::startGui:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setShowAdvancedNavArray:

- (void) setShowAdvancedNavArray: (BOOL) inFlag

Definition at line 408 of file GuiDisplayGen.m.

408 :(BOOL)inFlag
409{
410 showAdvancedNavArray = inFlag;
411}
BOOL showAdvancedNavArray

References showAdvancedNavArray.

◆ setShowTextCursor:

◆ setStarChartTitle

- (void) setStarChartTitle

Definition at line 1544 of file GuiDisplayGen.m.

1545{
1546 PlayerEntity* player = PLAYER;
1547 OOGalaxyID galaxy_number = [player galaxyNumber];
1548 NSInteger system_id = [UNIVERSE findSystemNumberAtCoords:[player cursor_coordinates] withGalaxy:[player galaxyNumber] includingHidden:NO];
1549
1550 NSString* location_key = [NSString stringWithFormat:@"long-range-chart-title-%d-%ld", galaxy_number, (long)system_id];
1551 if ([[UNIVERSE descriptions] valueForKey:location_key] == nil) {
1552 NSString* gal_key = [NSString stringWithFormat:@"long-range-chart-title-%d", galaxy_number];
1553 if ([[UNIVERSE descriptions] valueForKey:gal_key] == nil) {
1554 [self setTitle:[NSString stringWithFormat:DESC(@"long-range-chart-title-d"), galaxy_number + 1]];
1555 } else {
1556 [self setTitle:[UNIVERSE descriptionForKey:gal_key]];
1557 }
1558 } else {
1559 [self setTitle:[UNIVERSE descriptionForKey:location_key]];
1560 }
1561}

References PlayerEntity::cursor_coordinates, PlayerEntity::galaxyNumber, nil, PLAYER, setStarChartTitle, setTitle:, and UNIVERSE.

Referenced by PlayerEntity::setGuiToChartScreenFrom:, setStarChartTitle, and statusPage.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStatusPage:

- (void) setStatusPage: (NSInteger) pageNum

Definition at line 1089 of file GuiDisplayGen.m.

1089 :(NSInteger)pageNum
1090{
1091 if (pageNum == 0 || (pageNum < 0 && ((NSUInteger)-pageNum) >= statusPage)) {
1092 statusPage = 1;
1093 } else {
1094 statusPage += pageNum;
1095 }
1096}

References statusPage.

Referenced by PlayerEntity(OOControlsPrivate)::pollGuiArrowKeyControls:, PlayerEntity(Contracts)::setGuiToManifestScreen, and PlayerEntity::setGuiToStatusScreen.

Here is the caller graph for this function:

◆ setTabStops:

◆ setText:forRow:

- (void) setText: (NSString*) str
forRow: (OOGUIRow) row 

Definition at line 613 of file GuiDisplayGen.m.

613 :(NSString*)str forRow:(OOGUIRow)row
614{
615 if (RowInRange(row, rowRange)) {
616 [rowText replaceObjectAtIndex:row withObject:str];
617 }
618}

References RowInRange(), and rowRange.

Referenced by PlayerEntity(Contracts)::buySelectedShip, GuiDisplayGen(Internal)::drawEquipmentList:z:, PlayerEntity(KeyMapper)::handleKeyConfigEntryKeys:view:, insertItemsFromArray:withKeys:intoRow:color:, PlayerEntity(LoadSave)::saveCommanderInputHandler, PlayerEntity::setGuiToChartScreenFrom:, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(OOLoadSavePrivate)::setGuiToSaveCommanderScreen:, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity::setGuiToStatusScreen, PlayerEntity(Contracts)::setManifestScreenRow:inColor:forRow:ofRows:andOffset:inMultipage:, PlayerEntity(Scripting)::setMissionChoicesDictionary:, PlayerEntity::showInformationForSelectedInterface, PlayerEntity::showInformationForSelectedUpgradeWithFormatString:, OOOXZManager::showInstallOptions, PlayerEntity(OOPrivate)::showMarketCashAndLoadLine, OOOXZManager::showRemoveOptions, PlayerEntity(LoadSave)::showScenarioDetails, StickProfileScreen(StickProfileInternal)::showScreen, PlayerEntity(Contracts)::showShipyardInfoForSelection, and PlayerEntity(Contracts)::showTradeInInformationFooter.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setText:forRow:align:

- (void) setText: (NSString*) str
forRow: (OOGUIRow) row
align: (OOGUIAlignment) alignment 

Definition at line 620 of file GuiDisplayGen.m.

620 :(NSString*)str forRow:(OOGUIRow)row align:(OOGUIAlignment)alignment
621{
622 if (str != nil && RowInRange(row, rowRange)) {
623 [rowText replaceObjectAtIndex:row withObject:str];
624 rowAlignment[row] = alignment;
625 }
626}

References nil, rowAlignment, RowInRange(), and rowRange.

Referenced by addLongText:startingAtRow:align:, clearAndKeepBackground:, PlayerEntity(LoadSave)::commanderSelector, OOOXZManager::gui, PlayerEntity(OOControlsPrivate)::handleGameOptionsScreenKeys, PlayerEntity(OOLoadSavePrivate)::lsCommanders:directory:pageNumber:highlightName:, printLineNoScroll:align:color:fadeTime:key:addToArray:, printLongText:align:color:fadeTime:key:addToArray:, OOOXZManager::processShowInfoKey, PlayerEntity(Scripting)::refreshMissionScreenTextEntry, OOOXZManager::refreshTextInput:, PlayerEntity(LoadSave)::saveCommanderInputHandler, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity::setGuiToIntroFirstGo:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToLoadSaveScreen, PlayerEntity(Scripting)::setGuiToMissionScreenWithCallback:, PlayerEntity(OOLoadSavePrivate)::setGuiToOverwriteScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToStatusScreen, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity(Scripting)::setMissionChoicesDictionary:, PlayerEntity::setupStartScreenGui, PlayerEntity(OOLoadSavePrivate)::showCommanderShip:, OOOXZManager::showInstallOptions, and OOOXZManager::showRemoveOptions.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTextColor:

- (void) setTextColor: (OOColor*) color

Definition at line 342 of file GuiDisplayGen.m.

342 :(OOColor*)color
343{
344 [textColor release];
345 if (color == nil)
346 color = [[OOColor yellowColor] retain];
347 textColor = [color retain];
348}

References nil, textColor, and OOColor::yellowColor.

Referenced by Universe::resetCommsLogColor, HeadUpDisplay::resetGuis:, and Universe::setUpSettings.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTextCommsColor:

- (void) setTextCommsColor: (OOColor*) color

Definition at line 355 of file GuiDisplayGen.m.

355 :(OOColor*)color
356{
357 [textCommsColor release];
358 if (color == nil)
359 color = [[OOColor yellowColor] retain];
360 textCommsColor = [color retain];
361}
OOColor * textCommsColor

References nil, textCommsColor, and OOColor::yellowColor.

Referenced by HeadUpDisplay::resetGuis:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTitle:

- (void) setTitle: (NSString*) str

Definition at line 274 of file GuiDisplayGen.m.

274 :(NSString*)str
275{
276 if (str != title) {
277 [title release];
278 if ([str length] == 0)
279 str = nil;
280 title = [str copy];
281 }
282}

References nil, and title.

Referenced by clearAndKeepBackground:, OOOXZManager::gui, OOOXZManager::processShowInfoKey, resizeTo:characterHeight:title:, resizeWithPixelSize:columns:rows:rowHeight:rowStart:title:, PlayerEntity(KeyMapper)::setGuiToConfirmClearScreen, PlayerEntity(Contracts)::setGuiToDockingReportScreen, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, PlayerEntity::setGuiToGameOptionsScreen, PlayerEntity::setGuiToInterfacesScreen:, PlayerEntity::setGuiToIntroFirstGo:, PlayerEntity(KeyMapper)::setGuiToKeyboardLayoutScreen:resetCurrentRow:, PlayerEntity(KeyMapper)::setGuiToKeyConfigEntryScreen, PlayerEntity(KeyMapper)::setGuiToKeyConfigScreen:, PlayerEntity(KeyMapper)::setGuiToKeyMapperScreen:resetCurrentRow:, PlayerEntity(OOLoadSavePrivate)::setGuiToLoadCommanderScreen, PlayerEntity::setGuiToLoadSaveScreen, PlayerEntity(Contracts)::setGuiToManifestScreen, PlayerEntity::setGuiToMarketInfoScreen, PlayerEntity::setGuiToMarketScreen, PlayerEntity(Scripting)::setGuiToMissionScreenWithCallback:, PlayerEntity(OOLoadSavePrivate)::setGuiToOverwriteScreen:, PlayerEntity(OOLoadSavePrivate)::setGuiToSaveCommanderScreen:, PlayerEntity(LoadSave)::setGuiToScenarioScreen:, PlayerEntity(Contracts)::setGuiToShipyardScreen:, PlayerEntity::setGuiToStatusScreen, PlayerEntity(StickMapper)::setGuiToStickMapperScreen:resetCurrentRow:, PlayerEntity::setGuiToSystemDataScreenRefreshBackground:, setStarChartTitle, PlayerEntity::setupStartScreenGui, and StickProfileScreen::startGui:.

Here is the caller graph for this function:

◆ size

- (NSSize) size

Definition at line 244 of file GuiDisplayGen.m.

245{
246 return size_in_pixels;
247}

References size, and size_in_pixels.

Referenced by NewTextureSpriteWithDescriptor, reflowTextForMFD:, HeadUpDisplay(Private)::resetGui:withInfo:, and size.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ statusPage

- (NSUInteger) statusPage

References refreshStarChart, setStarChartTitle, and statusPage.

Here is the call graph for this function:

◆ stopFadeOuts

- (void) stopFadeOuts

Definition at line 310 of file GuiDisplayGen.m.

311{
312 fade_sign = 0.0f;
313}

References fade_sign, and stopFadeOuts.

Referenced by drawPosition, HeadUpDisplay::resetGuis:, and stopFadeOuts.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ targetNextFoundSystem:

- (OOSystemID) targetNextFoundSystem: (int) direction

Definition at line 2132 of file GuiDisplayGen.m.

2132 :(int)direction // +1 , 0 , -1
2133{
2134 OOSystemID sys = [PLAYER targetSystemID];
2135 if ([PLAYER guiScreen] != GUI_SCREEN_SHORT_RANGE_CHART && [PLAYER guiScreen] != GUI_SCREEN_LONG_RANGE_CHART)
2136 return sys;
2137
2138 BOOL* systemsFound = [UNIVERSE systemsFound];
2139 unsigned i, first = 0, last = 0, count = 0;
2140 int systemIndex = foundSystem + direction;
2141
2142 if (direction == 0)
2143 systemIndex = 0;
2144
2145 for (i = 0; i <= kOOMaximumSystemID; i++) {
2146 if (systemsFound[i]) {
2147 if (count == 0) {
2148 first = last = i;
2149 } else {
2150 last = i;
2151 }
2152 if (systemIndex == (int)count) {
2153 sys = i;
2154 }
2155 count++;
2156 }
2157 }
2158
2159 if (count == 0)
2160 return sys; // empty systemFound list.
2161
2162 // loop back if needed.
2163 if (systemIndex < 0) {
2164 systemIndex = count - 1;
2165 sys = last;
2166 }
2167 if (systemIndex >= (int)count) {
2168 systemIndex = 0;
2169 sys = first;
2170 }
2171
2172 foundSystem = systemIndex;
2173 return sys;
2174}
@ kOOMaximumSystemID
Definition OOTypes.h:187

References count, foundSystem, kOOMaximumSystemID, and PLAYER.

◆ textColor

References textColor.

◆ textCommsColor

◆ textureDescriptorFromJSValue:inContext:callerDescription:

- (NSDictionary *) textureDescriptorFromJSValue: (jsval) value
inContext: (JSContext*) context
callerDescription: (NSString*) callerDescription 

Definition at line 1035 of file GuiDisplayGen.m.

1035 :(OOJSVal)value
1036 inContext:(JSContext*)context
1037 callerDescription:(NSString*)callerDescription
1038{
1040
1041 NSDictionary* result = nil;
1042
1043#if OOJS_QUICKJS
1044 // Null may be used to indicate no texture.
1045 if (JS_IsNull(value))
1046 return [NSDictionary dictionary];
1047
1048 if (JS_IsObject(value)) {
1049 // String objects are converted to NSStrings; anything else is treated as a dictionary.
1050 if (JS_GetClassID(value) != gOOJSStringClassID) {
1051 result = OOJSDictionaryFromJSObject(context, value);
1052 }
1053 }
1054#else
1055 if (JSVAL_IS_OBJECT(value)) {
1056 // Null may be used to indicate no texture.
1057 if (JSVAL_IS_NULL(value))
1058 return [NSDictionary dictionary];
1059
1060 JSObject* objValue = JSVAL_TO_OBJECT(value);
1061
1062 if (OOJSGetClass(context, objValue) != [[OOJavaScriptEngine sharedEngine] stringClass]) {
1063 result = OOJSDictionaryFromJSObject(context, objValue);
1064 }
1065 }
1066#endif
1067
1068 if (result == nil) {
1069 NSString* name = OOStringFromJSValue(context, value);
1070
1071 if (name != nil) {
1072 result = [NSDictionary dictionaryWithObject:name forKey:@"name"];
1073 if ([name length] == 0)
1074 return result; // Explicit empty string may be used to indicate no texture.
1075 }
1076 }
1077
1078 // Start loading the texture, and return nil if it doesn't exist.
1079 if (result != nil && ![self preloadGUITexture:result]) {
1080 OOJSReportWarning(context, @"%@: texture \"%@\" could not be found.", callerDescription, [result oo_stringForKey:@"name"]);
1081 result = nil;
1082 }
1083
1084 return result;
1085
1087}
#define OOJS_PROFILE_EXIT
#define OOJS_PROFILE_ENTER
void OOJSReportWarning(JSContext *context, NSString *format,...)
jsval OOJSVal
NSDictionary * OOJSDictionaryFromJSObject(JSContext *context, JSObject *object)
NSString * OOStringFromJSValue(JSContext *context, jsval value)
OOINLINE JSClass * OOJSGetClass(JSContext *cx, JSObject *obj) ALWAYS_INLINE_FUNC
JSClassID gOOJSStringClassID

References gOOJSStringClassID, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSDictionaryFromJSObject(), OOJSGetClass(), OOJSReportWarning(), and OOStringFromJSValue().

Referenced by GlobalSetScreenBackground(), GlobalSetScreenBackground(), GlobalSetScreenBackgroundForKey(), GlobalSetScreenBackgroundForKey(), GlobalSetScreenOverlay(), and GlobalSetScreenOverlay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TextureForGUITexture

+ (OOTexture *) TextureForGUITexture (NSDictionary *) descriptor
(uint32_t) srgbaOption 
implementation

Definition at line 888 of file GuiDisplayGen.m.

889{
890 /*
891 GUI textures like backgrounds, foregrounds etc. are not processed in any way after loading. However, they are
892 subject to tone nmapping and gamma correction at the end of the render pass. So we need to declare them as
893 SRGBA textures here so that OpenGL will automatically convert them to linear space upon loading and the
894 subsequent tone mapping and gamma correction shader operations will not result in heavy distortion of their
895 colors.
896
897 Also, remember that if no shaders are in use (as in lower detail levels), then we don't need to declare anything.
898 */
899 if (![UNIVERSE useShaders])
900 srgbaOption = 0;
901 return [OOTexture textureWithName:[descriptor oo_stringForKey:@"name"]
902 inFolder:@"Images"
903 options:kOOTextureDefaultOptions | kOOTextureNoShrink | srgbaOption
904 anisotropy:kOOTextureDefaultAnisotropy
905 lodBias:kOOTextureDefaultLODBias];
906}
id textureWithName:inFolder:options:anisotropy:lodBias:(NSString *name,[inFolder] NSString *directory,[options] OOTextureFlags options,[anisotropy] GLfloat anisotropy,[lodBias] GLfloat lodBias)
Definition OOTexture.m:132

References OOTexture::textureWithName:inFolder:options:anisotropy:lodBias:, and UNIVERSE.

Referenced by NewTextureSpriteWithDescriptor, and preloadGUITexture:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ title

- (NSString *) title

References dealloc, and title.

Here is the call graph for this function:

◆ userSettings

- (NSDictionary *) userSettings

Definition at line 294 of file GuiDisplayGen.m.

295{
296 return guiUserSettings;
297}

References guiUserSettings, and userSettings.

Referenced by drawPosition, PlayerEntity::equipmentList, Universe::setUpSettings, and userSettings.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ backgroundColor

- (OOColor*) backgroundColor
private

Definition at line 178 of file GuiDisplayGen.h.

Referenced by setBackgroundColor:.

◆ backgroundSpecial

◆ backgroundSprite

- (OOTextureSprite*) backgroundSprite
private

Definition at line 182 of file GuiDisplayGen.h.

Referenced by drawGUIBackground, and setBackgroundTextureDescriptor:.

◆ currentRow

◆ drawPosition

- (Vector) drawPosition
private

◆ fade_alpha

- (GLfloat) fade_alpha
private

Definition at line 211 of file GuiDisplayGen.h.

Referenced by alpha, drawGUI:drawCursor:, fadeOutFromTime:overDuration:, and setAlpha:.

◆ fade_sign

- (GLfloat) fade_sign
private

Definition at line 212 of file GuiDisplayGen.h.

Referenced by drawGUI:drawCursor:, fadeOutFromTime:overDuration:, and stopFadeOuts.

◆ foregroundSprite

- (OOTextureSprite*) foregroundSprite
private

Definition at line 183 of file GuiDisplayGen.h.

Referenced by setForegroundTextureDescriptor:.

◆ foundSystem

- (OOSystemID) foundSystem
private

Definition at line 214 of file GuiDisplayGen.h.

Referenced by targetNextFoundSystem:.

◆ guiUserSettings

- (NSDictionary*) guiUserSettings
private

Definition at line 200 of file GuiDisplayGen.h.

Referenced by init, setGuiColorSettingFromKey:color:, and userSettings.

◆ max_alpha

- (GLfloat) max_alpha
private

◆ n_columns

◆ n_rows

◆ pixel_row_center

◆ pixel_row_height

◆ pixel_row_start

◆ pixel_text_size

◆ pixel_title_size

◆ rowAlignment

◆ rowColor

- (NSMutableArray*) rowColor
private

Definition at line 190 of file GuiDisplayGen.h.

Referenced by init, and initWithPixelSize:columns:rows:rowHeight:rowStart:title:.

◆ rowFadeTime

◆ rowKey

◆ rowPosition

- (NSPoint rowPosition[GUI_MAX_ROWS])
private

◆ rowRange

◆ rowText

- (NSMutableArray*) rowText
private

◆ selectableRange

- (NSRange) selectableRange
private

◆ selectedRow

◆ showAdvancedNavArray

- (BOOL) showAdvancedNavArray
private

Definition at line 174 of file GuiDisplayGen.h.

Referenced by setShowAdvancedNavArray:.

◆ showTextCursor

- (BOOL) showTextCursor
private

Definition at line 207 of file GuiDisplayGen.h.

Referenced by setCurrentRow:, and setShowTextCursor:.

◆ size_in_pixels

◆ statusPage

- (NSUInteger) statusPage
private

Definition at line 1098 of file GuiDisplayGen.m.

1099{
1100 return statusPage;
1101}

Referenced by PlayerEntity(Contracts)::setGuiToManifestScreen, setStatusPage:, and statusPage.

◆ tabStops

- (OOGUITabSettings) tabStops
private

Definition at line 198 of file GuiDisplayGen.h.

Referenced by init, and setTabStops:.

◆ textColor

◆ textCommsColor

- (OOColor *) textCommsColor
private

◆ title


The documentation for this class was generated from the following files: