Skip to content

Commit

Permalink
chore(control): bumb up the version number of control schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Vera-Firefly authored Aug 4, 2023
1 parent 48fe625 commit 2a78d18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 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 @@ -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 2a78d18

Please sign in to comment.