mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-20 06:42:10 +00:00
Create YTCastConfirm.xm
This commit is contained in:
parent
02ca804eb9
commit
fb4b56c873
1 changed files with 21 additions and 0 deletions
21
Sources/YTCastConfirm.xm
Normal file
21
Sources/YTCastConfirm.xm
Normal 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
|
||||
Loading…
Reference in a new issue