-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathTemplate.x.example
More file actions
73 lines (54 loc) · 1.85 KB
/
Template.x.example
File metadata and controls
73 lines (54 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#import "../YTVideoOverlay/Header.h"
#import "../YTVideoOverlay/Init.x"
#define TweakKey @"TweakKey"
@interface YTInlinePlayerBarContainerView (Tweak)
- (void)didPressTweak:(id)arg;
@end
@interface YTMainAppControlsOverlayView (Tweak)
- (void)didPressTweak:(id)arg;
@end
%group Top
%hook YTMainAppControlsOverlayView
// Remove this method if your button is a text button
- (UIImage *)buttonImage:(NSString *)tweakId {
return [tweakId isEqualToString:TweakKey] ? <Your Tweak Button Image> : %orig;
}
%new(v@:@)
- (void)didPressTweak:(id)arg {
// Do stuff
[self.overlayButtons[TweakKey] setImage:<Another Tweak Button Image> forState:UIControlStateNormal];
}
%end
%end
%group Bottom
%hook YTInlinePlayerBarContainerView
// Remove this method if your button is a text button
- (UIImage *)buttonImage:(NSString *)tweakId {
return [tweakId isEqualToString:TweakKey] ? <Your Tweak Button Image> : %orig;
}
%new(v@:@)
- (void)didPressTweak:(id)arg {
// Do stuff
[self.overlayButtons[TweakKey] setImage:<Another Tweak Button Image> forState:UIControlStateNormal];
}
%end
%end
%ctor {
initYTVideoOverlay(TweakKey, @{
AccessibilityLabelKey: @"Tweak",
SelectorKey: @"didPressTweak:",
/* If yes, the button is rendered as a text button */
// AsTextKey: @YES,
/* If yes, the toggle setting is hidden from YTVideoOverlay settings */
// ToggleKey: @YES,
/* If yes, the button image is assigned again when the button is visible */
// UpdateImageOnVisibleKey: @YES,
/**
* Provide the keys of extra boolean settings for this tweak
* For localization, the setting title is in "{SETTING}_KEY" format and the setting description is in "{SETTING}_KEY_DESC" format
*/
// ExtraBooleanKeys: @[SettingKey1, SettingKey2, ...],
});
%init(Top);
%init(Bottom);
}