- button-touchPad hybrid widgets

- minimum stick offset for stick widgets
- expand controller cmd strings to playStation style
This commit is contained in:
TrueZhuangjia
2025-03-24 00:36:24 +08:00
committed by TrueZhuanjia
parent 471325a358
commit 9aa84c03d7
8 changed files with 258 additions and 195 deletions
@@ -291,8 +291,8 @@ static NSMutableSet *OnScreenWidgetViews;
// save on-screen widget views (keyboard & mouse command) as buttonstate:
for(OnScreenWidgetView* widgetView in OnScreenWidgetViews){
OnScreenButtonState *buttonState = [[OnScreenButtonState alloc] initWithButtonName:widgetView.keyString buttonType:CustomOnScreenWidget andPosition:widgetView.center];
buttonState.alias = widgetView.keyLabel;
OnScreenButtonState *buttonState = [[OnScreenButtonState alloc] initWithButtonName:widgetView.cmdString buttonType:CustomOnScreenWidget andPosition:widgetView.center];
buttonState.alias = widgetView.buttonLabel;
buttonState.widthFactor = widgetView.widthFactor;
buttonState.heightFactor = widgetView.heightFactor;
buttonState.backgroundAlpha = widgetView.backgroundAlpha;
@@ -300,6 +300,7 @@ static NSMutableSet *OnScreenWidgetViews;
buttonState.sensitivityFactor = widgetView.sensitivityFactor;
buttonState.stickIndicatorOffset = widgetView.stickIndicatorOffset;
buttonState.widgetShape = widgetView.shape;
buttonState.minStickOffset = widgetView.minStickOffset;
NSData *buttonStateEncoded = [NSKeyedArchiver archivedDataWithRootObject:buttonState requiringSecureCoding:YES error:nil];
[buttonStatesEncoded addObject: buttonStateEncoded];