mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-13 16:31:34 +00:00
Added YouGroupSettings (PoomSmart)
Whenever I updated the Submodules, I saw this when I was looking through the changes. And the weirder thing is that my settings changed and I’m certain and hope that this fixes the problems I’ve been having in the Settings. If it doesn’t then I don’t know.
This commit is contained in:
parent
54cd18c4be
commit
eee57234eb
1 changed files with 51 additions and 0 deletions
|
|
@ -1,10 +1,12 @@
|
|||
// Settings.xm made by the @therealFoxster
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsGroupData.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsViewController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSearchableSettingsViewController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsSectionItemManager.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTUIUtils.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTSettingsPickerViewController.h"
|
||||
#import "../Tweaks/YouTubeHeader/YTIIcon.h"
|
||||
#import "ColourOptionsController.h"
|
||||
#import "ColourOptionsController2.h"
|
||||
#import "uYouPlus.h"
|
||||
|
|
@ -37,6 +39,11 @@ static int appVersionSpoofer() {
|
|||
return [[NSUserDefaults standardUserDefaults] integerForKey:@"versionSpoofer"];
|
||||
}
|
||||
static const NSInteger uYouPlusSection = 500;
|
||||
static const NSUInteger GROUP_TYPE = 'psyt'; // PoomSmart/YouGroupSettings
|
||||
|
||||
@interface YTSettingsGroupData (YouGroupSettings) // PoomSmart/YouGroupSettings
|
||||
+ (NSMutableArray <NSNumber *> *)tweaks;
|
||||
@end
|
||||
|
||||
@interface YTSettingsSectionItemManager (uYouPlus)
|
||||
- (void)updateTweakSectionWithEntry:(id)entry;
|
||||
|
|
@ -74,6 +81,50 @@ extern NSBundle *uYouPlusBundle();
|
|||
}
|
||||
%end
|
||||
|
||||
// PoomSmart/YouGroupSettings
|
||||
%hook YTSettingsGroupData
|
||||
%new(@@:)
|
||||
+ (NSMutableArray <NSNumber *> *)tweaks {
|
||||
static NSMutableArray <NSNumber *> *tweaks = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
tweaks = [NSMutableArray new];
|
||||
[tweaks addObjectsFromArray:@[
|
||||
@(404), // YTABConfig
|
||||
@(500), // uYouEnhanced / uYouPlus
|
||||
@(517), // DontEatMyContent
|
||||
@(1080), // Return YouTube Dislike
|
||||
@(200), // YouPiP
|
||||
@(2168), // YTHoldForSpeed
|
||||
@(1222), // YTVideoOverlay
|
||||
]];
|
||||
});
|
||||
return tweaks;
|
||||
}
|
||||
- (NSString *)titleForSettingGroupType:(NSUInteger)type {
|
||||
if (type == GROUP_TYPE) {
|
||||
return @"Tweaks";
|
||||
}
|
||||
return %orig;
|
||||
}
|
||||
- (NSArray <NSNumber *> *)orderedCategoriesForGroupType:(NSUInteger)type {
|
||||
if (type == GROUP_TYPE)
|
||||
return [[self class] tweaks];
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSettingsViewController
|
||||
- (void)setSectionItems:(NSMutableArray *)sectionItems forCategory:(NSInteger)category title:(NSString *)title icon:(YTIIcon *)icon titleDescription:(NSString *)titleDescription headerHidden:(BOOL)headerHidden {
|
||||
if (icon == nil && [[%c(YTSettingsGroupData) tweaks] containsObject:@(category)]) {
|
||||
icon = [%c(YTIIcon) new];
|
||||
icon.iconType = 44;
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
//
|
||||
|
||||
%hook YTSettingsSectionController
|
||||
- (void)setSelectedItem:(NSUInteger)selectedItem {
|
||||
if (selectedItem != NSNotFound) %orig;
|
||||
|
|
|
|||
Loading…
Reference in a new issue