Create YTCastConfirm.xm

This commit is contained in:
arichornlover 2024-02-08 18:43:36 -06:00 committed by GitHub
parent 02ca804eb9
commit fb4b56c873
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

21
Sources/YTCastConfirm.xm Normal file
View file

@ -0,0 +1,21 @@
#import "../Tweaks/YouTubeHeader/YTAlertView.h"
#import "uYouPlus.h"
extern NSBundle *uYouPlusBundle();
// YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
%hook MDXPlaybackRouteButtonController
- (void)didPressButton:(id)arg1 {
if (IS_ENABLED(@"castConfirm_enabled")) {
NSBundle *tweakBundle = uYouPlusBundle();
YTAlertView *alertView = [%c(YTAlertView) confirmationDialogWithAction:^{
%orig;
} actionTitle:LOC(@"MSG_YES")];
alertView.title = LOC(@"CASTING");
alertView.subtitle = LOC(@"MSG_ARE_YOU_SURE");
[alertView show];
} else {
return %orig;
}
}
%end