Skip to content

Commit

Permalink
prepare for uYou v3.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
qnblackcat committed Feb 20, 2024
1 parent 707c846 commit 5df3bfb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
45 changes: 24 additions & 21 deletions Sources/uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ NSBundle *tweakBundle = uYouPlusBundle();
%end

// Disable double tap to seek
%hook YTDoubleTapToSeekController
- (void)enableDoubleTapToSeek:(BOOL)arg1 {
return IS_ENABLED(@"doubleTapToSeek_disabled") ? %orig(NO) : %orig;
}
%end
// Not needed anymore because uYou v3.0.3+ added this feature
// %hook YTDoubleTapToSeekController
// - (void)enableDoubleTapToSeek:(BOOL)arg1 {
// return IS_ENABLED(@"doubleTapToSeek_disabled") ? %orig(NO) : %orig;
// }
// %end

// Disable snap to chapter
%hook YTSegmentableInlinePlayerBarView
Expand Down Expand Up @@ -99,15 +100,16 @@ NSBundle *tweakBundle = uYouPlusBundle();
%end

// Hide next and previous buttons
%group gHidePreviousAndNextButton
%hook YTColdConfig
- (BOOL)removeNextPaddleForSingletonVideos { return YES; }
- (BOOL)removePreviousPaddleForSingletonVideos { return YES; }
%end
%end
// Not needed anymore because uYou v3.0.3+ added this feature
// %group gHidePreviousAndNextButton
// %hook YTColdConfig
// - (BOOL)removeNextPaddleForSingletonVideos { return YES; }
// - (BOOL)removePreviousPaddleForSingletonVideos { return YES; }
// %end
// %end

// Replace next and previous buttons with fast forward and rewind
// Not needed anymore because uYou v3.0.2+ added this features
// Not needed anymore because uYou v3.0.2+ added this feature
// %group gReplacePreviousAndNextButton
// %hook YTColdConfig
// - (BOOL)replaceNextPaddleWithFastForwardButtonForSingletonVods { return YES; }
Expand Down Expand Up @@ -158,11 +160,12 @@ NSBundle *tweakBundle = uYouPlusBundle();
%end

// Disable resume to Shorts
%hook YTShortsStartupCoordinator
- (id)evaluateResumeToShorts {
return IS_ENABLED(@"disableResumeToShorts") ? nil : %orig;
}
%end
// Not needed anymore because uYou v3.0.3+ added this feature
// %hook YTShortsStartupCoordinator
// - (id)evaluateResumeToShorts {
// return IS_ENABLED(@"disableResumeToShorts") ? nil : %orig;
// }
// %end

# pragma mark - Miscellaneous

Expand All @@ -177,7 +180,7 @@ NSBundle *tweakBundle = uYouPlusBundle();

// YTCastConfirm
// See YTCastConfirm.xm
// Not needed anymore because uYou v3.0.2+ added this features
// Not needed anymore because uYou v3.0.2+ added this feature

// Disable hints - https://github.com/LillieH001/YouTube-Reborn/blob/v4/
%group gDisableHints
Expand Down Expand Up @@ -329,9 +332,9 @@ NSBundle *tweakBundle = uYouPlusBundle();
// dlopen([[NSString stringWithFormat:@"%@/Frameworks/uYou.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY);

%init;
if (IS_ENABLED(@"hidePreviousAndNextButton_enabled")) {
%init(gHidePreviousAndNextButton);
}
// if (IS_ENABLED(@"hidePreviousAndNextButton_enabled")) {
// %init(gHidePreviousAndNextButton);
// }
// if (IS_ENABLED(@"replacePreviousAndNextButton_enabled")) {
// %init(gReplacePreviousAndNextButton);
// }
Expand Down
6 changes: 3 additions & 3 deletions Sources/uYouPlusSettings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ extern NSBundle *uYouPlusBundle();
SECTION_HEADER(LOC(@"VIDEO_PLAYER_OPTIONS"));

SWITCH_ITEM2(LOC(@"SLIDE_TO_SEEK"), LOC(@"SLIDE_TO_SEEK_DESC"), @"slideToSeek_enabled");
SWITCH_ITEM(LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK"), LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK_DESC"), @"doubleTapToSeek_disabled");
// SWITCH_ITEM(LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK"), LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK_DESC"), @"doubleTapToSeek_disabled");
SWITCH_ITEM2(LOC(@"SNAP_TO_CHAPTER"), LOC(@"SNAP_TO_CHAPTER_DESC"), @"snapToChapter_enabled");
SWITCH_ITEM2(LOC(@"PINCH_TO_ZOOM"), LOC(@"PINCH_TO_ZOOM_DESC"), @"pinchToZoom_enabled");
SWITCH_ITEM(LOC(@"YT_MINIPLAYER"), LOC(@"YT_MINIPLAYER_DESC"), @"ytMiniPlayer_enabled");
Expand All @@ -178,7 +178,7 @@ extern NSBundle *uYouPlusBundle();
SWITCH_ITEM(LOC(@"HIDE_HUD_MESSAGES"), LOC(@"HIDE_HUD_MESSAGES_DESC"), @"hideHUD_enabled");
SWITCH_ITEM(LOC(@"HIDE_PAID_PROMOTION_CARDS"), LOC(@"HIDE_PAID_PROMOTION_CARDS_DESC"), @"hidePaidPromotionCard_enabled");
SWITCH_ITEM2(LOC(@"HIDE_CHANNEL_WATERMARK"), LOC(@"HIDE_CHANNEL_WATERMARK_DESC"), @"hideChannelWatermark_enabled");
SWITCH_ITEM(LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON"), LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON_DESC"), @"hidePreviousAndNextButton_enabled");
// SWITCH_ITEM(LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON"), LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON_DESC"), @"hidePreviousAndNextButton_enabled");
SWITCH_ITEM2(LOC(@"RED_PROGRESS_BAR"), LOC(@"RED_PROGRESS_BAR_DESC"), @"redProgressBar_enabled");
SWITCH_ITEM(LOC(@"HIDE_HOVER_CARD"), LOC(@"HIDE_HOVER_CARD_DESC"), @"hideHoverCards_enabled");
SWITCH_ITEM2(LOC(@"HIDE_RIGHT_PANEL"), LOC(@"HIDE_RIGHT_PANEL_DESC"), @"hideRightPanel_enabled");
Expand All @@ -188,7 +188,7 @@ extern NSBundle *uYouPlusBundle();

SWITCH_ITEM(LOC(@"HIDE_SUPER_THANKS"), LOC(@"HIDE_SUPER_THANKS_DESC"), @"hideBuySuperThanks_enabled");
SWITCH_ITEM(LOC(@"HIDE_SUBCRIPTIONS"), LOC(@"HIDE_SUBCRIPTIONS_DESC"), @"hideSubcriptions_enabled");
SWITCH_ITEM(LOC(@"DISABLE_RESUME_TO_SHORTS"), LOC(@"DISABLE_RESUME_TO_SHORTS_DESC"), @"disableResumeToShorts");
// SWITCH_ITEM(LOC(@"DISABLE_RESUME_TO_SHORTS"), LOC(@"DISABLE_RESUME_TO_SHORTS_DESC"), @"disableResumeToShorts");

# pragma mark - Miscellaneous
SECTION_HEADER(LOC(@"MISCELLANEOUS"));
Expand Down

0 comments on commit 5df3bfb

Please sign in to comment.