Skip to content

Commit

Permalink
Improved spacing between a few UI elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Spikatrix committed Jul 18, 2021
1 parent affa79a commit 4a6fa38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
23 changes: 12 additions & 11 deletions core/src/com/cg/zoned/MapSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,21 @@ private void showExtraParamDialog(final MapExtraParams prompts, final MapEntity
} else {
/* Params */

int lowValue = prompts.spinnerVars.get(i - 1).lowValue;
int highValue = prompts.spinnerVars.get(i - 1).highValue;
int snapValue = prompts.spinnerVars.get(i - 1).snapValue;
int index = i - 1;
int lowValue = prompts.spinnerVars.get(index).lowValue;
int highValue = prompts.spinnerVars.get(index).highValue;
int snapValue = prompts.spinnerVars.get(index).snapValue;

label = new Label(prompts.spinnerVars.get(i - 1).prompt, skin);
spinners[i - 1] = new Spinner(skin, skin.getFont(Assets.FontManager.REGULAR.getFontName()).getLineHeight(),
label = new Label(prompts.spinnerVars.get(index).prompt, skin);
spinners[index] = new Spinner(skin, skin.getFont(Assets.FontManager.REGULAR.getFontName()).getLineHeight(),
64f * scaleFactor, true);
spinners[i - 1].generateValueRange(lowValue, highValue, skin);
spinners[i - 1].snapToStep(snapValue - lowValue);
contentTable.add(label).left();
contentTable.add(spinners[i - 1]);
spinners[index].generateValueRange(lowValue, highValue, skin);
spinners[index].snapToStep(snapValue - lowValue);
contentTable.add(label).left().space(8f * scaleFactor);
contentTable.add(spinners[index]).space(8f * scaleFactor);

focusableDialogButtons.add(spinners[i - 1].getLeftButton());
focusableDialogButtons.add(spinners[i - 1].getRightButton());
focusableDialogButtons.add(spinners[index].getLeftButton());
focusableDialogButtons.add(spinners[index].getRightButton());
focusableDialogButtons.add(null);
}
contentTable.row();
Expand Down
7 changes: 3 additions & 4 deletions core/src/com/cg/zoned/screens/PlayerSetUpScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ private void setUpStage() {
colorButtons[i][j].setColor(PlayerColorHelper.getColorFromIndex(j));
colorButtonGroups[i].add(colorButtons[i][j]);

playerItem.add(colorButtons[i][j]).size(promptLabels[i].getPrefHeight() * 1.75f);

playerItem.add(colorButtons[i][j]).size(promptLabels[i].getPrefHeight() * 1.65f).space(8f * game.getScaleFactor());
screenStage.addFocusableActor(colorButtons[i][j]);
}

Expand All @@ -214,7 +213,7 @@ private void setUpStage() {
colorButtons[i][PlayerColorHelper.getIndexFromColor(playerSetUpParams.playerColors[i])].setChecked(true);
}
screenStage.row();
playerList.add(playerItem).right();
playerList.add(playerItem).right().space(10f * game.getScaleFactor());
playerList.row();
}
table.add(playerList).colspan(NO_OF_COLORS + 1).expandX();
Expand All @@ -225,7 +224,7 @@ private void setUpStage() {
mapSelector.getMapManager().enableExternalMapScanLogging(true);
float spinnerHeight = game.skin.getFont(Assets.FontManager.REGULAR.getFontName()).getLineHeight() * 3;
mapSpinner = mapSelector.loadMapSelectorSpinner(spinnerHeight * 1.5f, spinnerHeight);
table.add(mapSpinner).colspan(NO_OF_COLORS + 1).pad(20 * game.getScaleFactor()).expandX();
table.add(mapSpinner).colspan(NO_OF_COLORS + 1).space(20 * game.getScaleFactor()).expandX();
table.row();

screenStage.addFocusableActor(mapSelector.getLeftButton(), 1);
Expand Down

0 comments on commit 4a6fa38

Please sign in to comment.