From 240a7a4e7d5b9af9e83e99bcb08cf37e95f53922 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 25 Nov 2014 17:13:20 -0800 Subject: [PATCH] Commit @3x logic (as it is getting in my way :/). --- Library.mm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Library.mm b/Library.mm index e30a4dd..969c03e 100644 --- a/Library.mm +++ b/Library.mm @@ -243,7 +243,11 @@ static unsigned $getScale$(NSString *path) { StripName("~iphone"); StripName("~ipad"); - return [name hasSuffix:@"@2x"] ? 2 : 1; + if ([name hasSuffix:@"@3x"]) + return 3; + if ([name hasSuffix:@"@2x"]) + return 2; + return 1; } static NSArray *$useScale$(NSArray *files, bool use = true) { @@ -264,16 +268,16 @@ static NSArray *$useScale$(NSArray *files, bool use = true) { NSString *extension([file pathExtension]); if (use) { - if (Scale_ == 2) { - [scaled addObject:[NSString stringWithFormat:@"%@@2x~%@.%@", base, idiom, extension]]; - [scaled addObject:[NSString stringWithFormat:@"%@@2x.%@", base, extension]]; + for (unsigned scale(2); scale <= Scale_; ++scale) { + [scaled addObject:[NSString stringWithFormat:@"%@@%ux~%@.%@", base, scale, idiom, extension]]; + [scaled addObject:[NSString stringWithFormat:@"%@@%ux.%@", base, scale, extension]]; } [scaled addObject:[NSString stringWithFormat:@"%@~%@.%@", base, idiom, extension]]; // if (!IsWild_) <- support old themes [scaled addObject:file]; - } else if ([base hasSuffix: @"@2x"]) { + } else if ([base hasSuffix: @"@2x"] || [base hasSuffix:@"@3x"]) { [scaled addObject:[NSString stringWithFormat:@"%@~%@.%@", base, idiom, extension]]; [scaled addObject:file]; @@ -2436,7 +2440,7 @@ MSInitialize { // }}} // SpringBoard {{{ if (SpringBoard_) { - Wallpapers_ = [[NSArray arrayWithObjects:@"Wallpaper.mp4", @"Wallpaper@2x.png", @"Wallpaper@2x.jpg", @"Wallpaper.png", @"Wallpaper.jpg", @"Wallpaper.html", nil] retain]; + Wallpapers_ = [[NSArray arrayWithObjects:@"Wallpaper.mp4", @"Wallpaper@3x.png", @"Wallpaper@3x.jpg", @"Wallpaper@2x.png", @"Wallpaper@2x.jpg", @"Wallpaper.png", @"Wallpaper.jpg", @"Wallpaper.html", nil] retain]; Papered_ = $getTheme$(Wallpapers_) != nil; Docked_ = $getTheme$([NSArray arrayWithObjects:@"Dock.png", nil]) != nil; -- 2.45.2