Workaround[controls]: disable view clipping in game

This is only for the joystick, no other view should be affected
This commit is contained in:
Mathias-Boulay 2023-05-15 22:26:23 +02:00 committed by ArtDev
parent 58a29ee2ca
commit 9829dc436b
2 changed files with 7 additions and 2 deletions

View File

@ -186,8 +186,8 @@ dependencies {
implementation 'com.github.PojavLauncherTeam:portrait-sdp:ed33e89cbc'
implementation 'com.github.PojavLauncherTeam:portrait-ssp:6c02fd739b'
implementation 'com.github.Mathias-Boulay:ExtendedView:1.0.0'
implementation 'com.github.Mathias-Boulay:android_gamepad_remapper:eb92e3a5bb'
implementation 'com.github.Mathias-Boulay:virtual-joystick-android:3832b4f94a'
implementation 'com.github.Mathias-Boulay:android_gamepad_remapper:9c4e285ce8'
implementation 'com.github.Mathias-Boulay:virtual-joystick-android:4fee901b58'
// implementation 'com.intuit.sdp:sdp-android:1.0.5'

View File

@ -60,10 +60,12 @@ public class ControlLayout extends FrameLayout {
public ControlLayout(Context ctx) {
super(ctx);
setClipChildren(false);
}
public ControlLayout(Context ctx, AttributeSet attrs) {
super(ctx, attrs);
setClipChildren(false);
}
@ -243,6 +245,9 @@ public class ControlLayout extends FrameLayout {
}
public void setModifiable(boolean isModifiable) {
// Hack to allow joystick free placement and resize while seeing the forward lock
setClipChildren(isModifiable);
if(!isModifiable && mModifiable){
removeEditWindow();
}