summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-04 15:22:58 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-04 15:22:58 +0100
commitfc2ea1292a302417053036b23e433d0c0645e3d3 (patch)
treeac677e5b6ce4ca38b6413e1338633de7e77c91cd /core/src
parent821ec7c94332c29308e7aef671935ac427ecda07 (diff)
downloadRustAndDust-fc2ea1292a302417053036b23e433d0c0645e3d3.zip
RustAndDust-fc2ea1292a302417053036b23e433d0c0645e3d3.tar.gz
UnitDock: replace selected red border with light grey Bg
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Factory.java2
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/UnitDock.java10
2 files changed, 5 insertions, 7 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Factory.java b/core/src/ch/asynk/rustanddust/game/Factory.java
index a2e898b..a16fb49 100644
--- a/core/src/ch/asynk/rustanddust/game/Factory.java
+++ b/core/src/ch/asynk/rustanddust/game/Factory.java
@@ -26,8 +26,8 @@ public class Factory implements Board.TileBuilder, Disposable
public static final String ACT_PROMOTE = "promote";
public static final String ACT_OPTIONS = "options";
public static final String DISABLED = "disabled";
+ public static final String ENABLED = "enabled";
public static final String REINFORCEMENT = "reinforcement";
- public static final String REINFORCEMENT_SELECTED = "reinforcement-selected";
public enum MapType
{
diff --git a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
index 7b9e5f9..d63b66c 100644
--- a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
+++ b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
@@ -3,7 +3,6 @@ package ch.asynk.rustanddust.game.hud;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.Batch;
-import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Matrix4;
@@ -36,7 +35,7 @@ public class UnitDock extends Bg implements Animation
private boolean show;
private boolean mvtDone;
public Unit selectedUnit;
- private Sprite selected;
+ private Bg selected;
private UnitList units;
private Vector3 point;
private Matrix4 saved;
@@ -55,7 +54,7 @@ public class UnitDock extends Bg implements Animation
this.transform = new Matrix4();
this.scaledRect = new Rectangle();
this.scissors = new Rectangle();
- this.selected = new Sprite(game.factory.getHudRegion(game.factory.REINFORCEMENT_SELECTED));
+ this.selected = new Bg(game.factory.getHudRegion(game.factory.ENABLED));
this.visible = false;
this.dx = 0f;
this.dy = 0f;
@@ -122,7 +121,7 @@ public class UnitDock extends Bg implements Animation
{
int i = (int) ((scaledRect.y + scaledRect.height - y) / (scaledRect.height / units.size()));
selectedUnit = units.get(i);
- selected.setCenter((selectedUnit.getX() + (selectedUnit.getWidth() / 2)), (selectedUnit.getY() + (selectedUnit.getHeight() / 2)));
+ selected.setPosition(selectedUnit.getX() - padding, selectedUnit.getY() - padding, selectedUnit.getWidth() + (2 * padding), selectedUnit.getHeight() + (2 * padding));
return selectedUnit;
}
@@ -239,9 +238,8 @@ public class UnitDock extends Bg implements Animation
Gdx.gl.glScissor((int)scissors.x, (int)scissors.y, (int)scissors.width, (int)scissors.height);
super.draw(batch);
- for (Unit unit : units) unit.draw(batch);
-
if (selectedUnit != null) selected.draw(batch);
+ for (Unit unit : units) unit.draw(batch);
batch.setTransformMatrix(saved);