- feat: new on-screen widget lsWheel/rsWheel, direction wheel for RPG games.

- feat: direct walkmode test for lsWheel/rsWheel
- feat: direction minimum offset test for all on-screen widgets, gyro->stick mapping & physical controller.
This commit is contained in:
TrueZhuanjia
2025-12-26 16:17:55 +08:00
parent 2912a3a5cb
commit d8528fdc81
28 changed files with 977 additions and 102 deletions
+3
View File
@@ -157,6 +157,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
// we'll render on-screen controls on the toplayer too:
_onScreenControls = [[OnScreenControls alloc] initWithView:self->streamFrameTopLayerView controllerSup:controllerSupport streamConfig:streamConfig]; // don't delete, this is mandatory
OnScreenControls.shared = _onScreenControls;
/*
// here we pass the tap recognizer to the onscreencontrols obj
if (settings.touchMode.intValue == RelativeTouch){
@@ -557,6 +558,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
widgetView.translatesAutoresizingMaskIntoConstraints = NO; // weird but this is mandatory, or you will find no key views added to the right place
widgetView.widthFactor = buttonState.widthFactor;
widgetView.heightFactor = buttonState.heightFactor;
widgetView.componentSizeFactor = buttonState.componentSizeFactor;
widgetView.borderWidth = buttonState.borderWidth;
widgetView.highlightSizeFactor = buttonState.highlightSizeFactor;
widgetView.autoTapInterval = buttonState.autoTapInterval;
@@ -572,6 +574,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
widgetView.decelerationRateY = buttonState.decelerationRateY;
widgetView.stickIndicatorOffset = buttonState.stickIndicatorOffset;
widgetView.minStickOffset = buttonState.minStickOffset;
widgetView.dWheelWalkModeThreshold = buttonState.walkModeThreshold;
widgetView.buttonMode = buttonState.buttonMode;
// Add the widgetView to the view controller's view
[self->streamFrameTopLayerView addSubview:widgetView]; // add keyboard button to the stream frame view. must add it to the target view before setting location.