Temp fix to hide health and mana globe labels on android until appropriate positioning determined

This commit is contained in:
Collin Smith 2019-04-15 18:53:53 -07:00
parent 1ad3349bb3
commit 4bac597e40

View File

@ -241,6 +241,7 @@ public class ControlPanel extends Table implements Disposable {
setTouchable(Touchable.enabled);
label = new Label(Riiablo.fonts.font16);
label.setY(background.getRegionHeight());
label.setVisible(!DEBUG_MOBILE && Gdx.app.getType() == Application.ApplicationType.Desktop);
}
@Override
@ -251,12 +252,14 @@ public class ControlPanel extends Table implements Disposable {
batch.draw(health, x + 30, y + 14);
batch.draw(overlay, x + 28, y + 6);
super.draw(batch, a);
if (label.isVisible()) {
label.setText(Riiablo.string.format("panelhealth",
(int) Riiablo.charData.getStats().get(Stat.hitpoints).toFloat(),
(int) Riiablo.charData.getStats().get(Stat.maxhp).toFloat()));
label.draw(batch, a);
}
}
}
private class ManaWidget extends Actor {
TextureRegion background;
TextureRegion mana;
@ -272,6 +275,7 @@ public class ControlPanel extends Table implements Disposable {
setTouchable(Touchable.enabled);
label = new Label(Riiablo.fonts.font16);
label.setY(background.getRegionHeight());
label.setVisible(!DEBUG_MOBILE && Gdx.app.getType() == Application.ApplicationType.Desktop);
}
@Override
@ -282,6 +286,7 @@ public class ControlPanel extends Table implements Disposable {
batch.draw(mana, x + 8, y + 14);
batch.draw(overlay, x + 8, y + 10);
super.draw(batch, a);
if (label.isVisible()) {
label.setX(getX() - 32);
label.setText(Riiablo.string.format("panelmana",
(int) Riiablo.charData.getStats().get(Stat.mana).toFloat(),
@ -289,6 +294,7 @@ public class ControlPanel extends Table implements Disposable {
label.draw(batch, a);
}
}
}
private class ControlWidget extends WidgetGroup implements Disposable {
final AssetDescriptor<DC6> menubuttonDescriptor = new AssetDescriptor<>("data\\global\\ui\\PANEL\\menubutton.DC6", DC6.class);
Button btnMenu;