Skip to content

Commit

Permalink
Fix the Pink Pop theme, it had mismatching colors and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
LIJI32 committed Dec 13, 2024
1 parent 4dd2683 commit a10e1fc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Cocoa/GBApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ - (void) applicationDidFinishLaunching:(NSNotification *)notification
@"Colors": @[@0xff28140a, @0xff7c42cb, @0xffaa83de, @0xffd1ceeb, @0xffd5d8ec],
@"DisabledLCDColor": @YES,
@"HueBias": @0.9477411056868732,
@"HueBiasStrength": @0.3433764940239044,
@"HueBiasStrength": @0.80024421215057373,
@"Manual": @NO,
},
@"Radioactive Pea": @{
Expand Down Expand Up @@ -237,8 +237,8 @@ - (void) applicationDidFinishLaunching:(NSNotification *)notification
}

if (![[[NSUserDefaults standardUserDefaults] stringForKey:@"GBThemesVersion"] isEqualToString:@(GB_VERSION)]) {
[[NSUserDefaults standardUserDefaults] setObject:@(GB_VERSION) forKey:@"GBThemesVersion"];
[self updateThemesDefault:false];
[[NSUserDefaults standardUserDefaults] setObject:@(GB_VERSION) forKey:@"GBThemesVersion"];
}
}

Expand All @@ -248,6 +248,10 @@ - (void)updateThemesDefault:(bool)overwrite
NSMutableDictionary *currentThemes = [defaults dictionaryForKey:@"GBThemes"].mutableCopy;
[defaults removeObjectForKey:@"GBThemes"];
NSMutableDictionary *defaultThemes = [defaults dictionaryForKey:@"GBThemes"].mutableCopy;
if (![[NSUserDefaults standardUserDefaults] stringForKey:@"GBThemesVersion"]) {
// Force update the Pink Pop theme, it was glitchy in 1.0
[currentThemes removeObjectForKey:@"Pink Pop"];
}
if (overwrite) {
[currentThemes addEntriesFromDictionary:defaultThemes];
[defaults setObject:currentThemes forKey:@"GBThemes"];
Expand Down
18 changes: 16 additions & 2 deletions iOS/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
int main(int argc, char * argv[])
{
@autoreleasepool {
[[NSUserDefaults standardUserDefaults] registerDefaults:@{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults:@{
@"GBFilter": @"NearestNeighbor",
@"GBColorCorrection": @(GB_COLOR_CORRECTION_MODERN_BALANCED),
@"GBAudioMode": @"switch",
Expand Down Expand Up @@ -108,7 +109,7 @@ int main(int argc, char * argv[])
@"Colors": @[@0xff28140a, @0xff7c42cb, @0xffaa83de, @0xffd1ceeb, @0xffd5d8ec],
@"DisabledLCDColor": @YES,
@"HueBias": @0.9477411056868732,
@"HueBiasStrength": @0.3433764940239044,
@"HueBiasStrength": @0.80024421215057373,
@"Manual": @NO,
},
@"Radioactive Pea": @{
Expand Down Expand Up @@ -145,6 +146,19 @@ int main(int argc, char * argv[])
},
},
}];

if (![[defaults stringForKey:@"GBThemesVersion"] isEqualToString:@(GB_VERSION)]) {
NSMutableDictionary *currentThemes = [defaults dictionaryForKey:@"GBThemes"].mutableCopy;
[defaults removeObjectForKey:@"GBThemes"];
NSMutableDictionary *defaultThemes = [defaults dictionaryForKey:@"GBThemes"].mutableCopy;
if (![[NSUserDefaults standardUserDefaults] stringForKey:@"GBThemesVersion"]) {
// Force update the Pink Pop theme, it was glitchy in 1.0
[currentThemes removeObjectForKey:@"Pink Pop"];
}
[defaultThemes addEntriesFromDictionary:currentThemes];
[defaults setObject:defaultThemes forKey:@"GBThemes"];
[[NSUserDefaults standardUserDefaults] setObject:@(GB_VERSION) forKey:@"GBThemesVersion"];
}
}
return UIApplicationMain(argc, argv, nil, NSStringFromClass([GBViewController class]));
}

0 comments on commit a10e1fc

Please sign in to comment.