Files
Duy Tran Khanh 36c3e312f3 Feat[controls]: v3: joystick & conditonal visibility
- Finish joystick view
+ Finish forward lock
+ When in menu, oystick can be used to move the virtual mouse
- Finish conditonal visibility
- Replace Make Default with Load
2023-08-11 20:58:14 +07:00

30 lines
919 B
Objective-C

#import "ControlSubButton.h"
#import "CustomControlsUtils.h"
#import "../LauncherPreferences.h"
#define INSERT_VALUE(KEY, VALUE) \
string = [string stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"${%@}", @(KEY)] withString:VALUE];
@implementation ControlSubButton
// filterProperties
- (void)preProcessProperties {
if (self.parentDrawer && ![self.parentDrawer.drawerData[@"orientation"] isEqualToString:@"FREE"]) {
self.properties[@"width"] = self.parentDrawer.properties[@"width"];
self.properties[@"height"] = self.parentDrawer.properties[@"height"];
}
}
- (void)setParentDrawer:(ControlDrawer *)drawer {
_parentDrawer = drawer;
// Copy visibility properties
self.displayInGame = drawer.displayInGame;
self.displayInMenu = drawer.displayInMenu;
[self preProcessProperties];
//NSLog(@"DEBUG: SubButton properties %@", self.properties);
}
@end