Skip to content

Commit

Permalink
Merge v3_openjdk into lwjgl3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Vera-Firefly authored Aug 4, 2023
1 parent 5cd287f commit 24a9489
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public CustomControls(Context ctx) {
this.mControlDataList.add(new ControlData(ctx, R.string.control_jump, new int[]{LwjglGlfwKeycode.GLFW_KEY_SPACE}, "${right} - ${margin} * 2 - ${width}", "${bottom} - ${margin} * 2 - ${height}", true));

//The default controls are conform to the V2
version = 4;
version = 5;
}


public void save(String path) throws IOException {
//Current version is the V2.5 so the version as to be marked as 4 !
version = 4;
//Current version is the V2.6 so the version as to be marked as 5 !
version = 5;

Tools.write(path, Tools.GLOBAL_GSON.toJson(this));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static CustomControls loadAndConvertIfNecessary(String jsonPath) throws I
CustomControls layout = LayoutConverter.convertV2Layout(layoutJobj);
layout.save(jsonPath);
return layout;
}else if (layoutJobj.getInt("version") == 3 || layoutJobj.getInt("version") == 4) {
}else if (layoutJobj.getInt("version") >= 3 && layoutJobj.getInt("version") <= 5) {
return Tools.GLOBAL_GSON.fromJson(jsonLayoutData, CustomControls.class);
}else{
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void alignButtons(){


private void resizeButtons(){
if (buttons == null) return;
if (buttons == null || drawerData.orientation == ControlDrawerData.Orientation.FREE) return;
for(ControlSubButton subButton : buttons){
subButton.mProperties.setWidth(mProperties.getWidth());
subButton.mProperties.setHeight(mProperties.getHeight());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public ControlSubButton(ControlLayout layout, ControlData properties, ControlDra
}

private void filterProperties(){
mProperties.setHeight(parentDrawer.getProperties().getHeight());
mProperties.setWidth(parentDrawer.getProperties().getWidth());
if (parentDrawer != null && parentDrawer.drawerData.orientation != ControlDrawerData.Orientation.FREE) {
mProperties.setHeight(parentDrawer.getProperties().getHeight());
mProperties.setWidth(parentDrawer.getProperties().getWidth());
}
mProperties.isDynamicBtn = false;

setProperties(mProperties, false);
Expand All @@ -35,7 +37,7 @@ public void setVisible(boolean isVisible) {

@Override
public void setLayoutParams(ViewGroup.LayoutParams params) {
if(parentDrawer != null){
if(parentDrawer != null && parentDrawer.drawerData.orientation != ControlDrawerData.Orientation.FREE){
params.width = (int)parentDrawer.mProperties.getWidth();
params.height = (int)parentDrawer.mProperties.getHeight();
}
Expand Down

0 comments on commit 24a9489

Please sign in to comment.