From 4a6fa386907282394d1f0d5fb42f0ae5b46ae4ae Mon Sep 17 00:00:00 2001 From: Spikatrix <12792882+Spikatrix@users.noreply.github.com> Date: Sun, 18 Jul 2021 12:19:06 +0530 Subject: [PATCH] Improved spacing between a few UI elements --- core/src/com/cg/zoned/MapSelector.java | 23 ++++++++++--------- .../cg/zoned/screens/PlayerSetUpScreen.java | 7 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/src/com/cg/zoned/MapSelector.java b/core/src/com/cg/zoned/MapSelector.java index 1d8c250..e9be2af 100644 --- a/core/src/com/cg/zoned/MapSelector.java +++ b/core/src/com/cg/zoned/MapSelector.java @@ -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(); diff --git a/core/src/com/cg/zoned/screens/PlayerSetUpScreen.java b/core/src/com/cg/zoned/screens/PlayerSetUpScreen.java index e939402..d579264 100644 --- a/core/src/com/cg/zoned/screens/PlayerSetUpScreen.java +++ b/core/src/com/cg/zoned/screens/PlayerSetUpScreen.java @@ -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]); } @@ -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(); @@ -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);