Skip to content

Commit

Permalink
Fix nova screen backgrounds when traversing route (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
kanthoney committed May 24, 2017
1 parent 9a7a947 commit 3e3e528
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Core/Entities/PlayerEntity.h
Expand Up @@ -1003,6 +1003,7 @@ typedef enum
- (unsigned) legalStatusOfCargoList;

- (void) setGuiToSystemDataScreen;
- (void) setGuiToSystemDataScreenRefreshBackground: (bool) refreshBackground;
- (NSDictionary *) markedDestinations;
- (void) setGuiToLongRangeChartScreen;
- (void) setGuiToShortRangeChartScreen;
Expand Down
19 changes: 13 additions & 6 deletions src/Core/Entities/PlayerEntity.m
Expand Up @@ -714,7 +714,7 @@ - (void) setInfoSystemID: (OOSystemID) sid moveChart: (BOOL) moveChart
{
if(gui_screen == GUI_SCREEN_SYSTEM_DATA)
{
[self setGuiToSystemDataScreen];
[self setGuiToSystemDataScreenRefreshBackground: YES];
}
if(moveChart)
{
Expand Down Expand Up @@ -8146,8 +8146,12 @@ - (NSArray *) contractListForScripting
return [self contractsListForScriptingFromArray:contracts forCargo:YES];
}


- (void) setGuiToSystemDataScreen
{
[self setGuiToSystemDataScreenRefreshBackground: NO];
}

- (void) setGuiToSystemDataScreenRefreshBackground: (BOOL) refreshBackground
{
NSDictionary *infoSystemData;
NSString *infoSystemName;
Expand Down Expand Up @@ -8210,7 +8214,7 @@ - (void) setGuiToSystemDataScreen
}


[gui clearAndKeepBackground:!guiChanged];
[gui clearAndKeepBackground:!refreshBackground && !guiChanged];
[UNIVERSE removeDemoShips];

if (concealment < OO_SYSTEMCONCEALMENT_NONAME)
Expand Down Expand Up @@ -8362,13 +8366,16 @@ - (void) setGuiToSystemDataScreen
RANROTSetFullSeed(ranrotSavedSeed);
}

if (guiChanged)
if (refreshBackground || guiChanged)
{
[gui setForegroundTextureKey:[self status] == STATUS_DOCKED ? @"docked_overlay" : @"overlay"];
[gui setBackgroundTextureKey:sunGoneNova ? @"system_data_nova" : @"system_data"];

[self noteGUIDidChangeFrom:oldScreen to:gui_screen];
[self checkScript]; // Still needed by some OXPs?
if (guiChanged)
{
[self noteGUIDidChangeFrom:oldScreen to:gui_screen];
[self checkScript]; // Still needed by some OXPs?
}
}
}

Expand Down

0 comments on commit 3e3e528

Please sign in to comment.