v0.2.4: moved loot and continue tags to bottom right, much more accessable

This commit is contained in:
Evan Debenham
2015-02-08 02:45:05 -05:00
parent 89d72e60d1
commit 071403a7aa
4 changed files with 50 additions and 47 deletions
@@ -20,6 +20,8 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
import java.io.IOException;
import com.shatteredpixel.shatteredpixeldungeon.*;
import com.shatteredpixel.shatteredpixeldungeon.ui.LootIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.ResumeIndicator;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Game;
import com.watabou.noosa.Group;
@@ -106,6 +108,10 @@ public class GameScene extends PixelScene {
private Toolbar toolbar;
private Toast prompt;
private AttackIndicator attack;
private LootIndicator loot;
private ResumeIndicator resume;
@Override
public void create() {
@@ -212,13 +218,23 @@ public class GameScene extends PixelScene {
toolbar.setRect( 0,uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height() );
add( toolbar );
AttackIndicator attack = new AttackIndicator();
attack = new AttackIndicator();
attack.camera = uiCamera;
attack.setPos(
uiCamera.width - attack.width(),
attack.setPos(
uiCamera.width - attack.width(),
toolbar.top() - attack.height() );
add( attack );
loot = new LootIndicator();
loot.camera = uiCamera;
add( loot );
resume = new ResumeIndicator();
resume.camera = uiCamera;
add( resume );
layoutTags();
log = new GameLog();
log.camera = uiCamera;
log.setRect( 0, toolbar.top(), attack.left(), 0 );
@@ -330,9 +346,36 @@ public class GameScene extends PixelScene {
if (Dungeon.hero.ready && !Dungeon.hero.paralysed) {
log.newLine();
}
if (tagAttack != attack.active || tagLoot != loot.visible || tagResume != resume.visible) {
tagAttack = attack.active;
tagLoot = loot.visible;
tagResume = resume.visible;
layoutTags();
}
cellSelector.enabled = Dungeon.hero.ready;
}
private boolean tagAttack = false;
private boolean tagLoot = false;
private boolean tagResume = false;
private void layoutTags() {
float pos = tagAttack ? attack.top() : toolbar.top();
if (tagLoot) {
loot.setPos( uiCamera.width - loot.width(), pos - loot.height() );
pos = loot.top();
}
if (tagResume) {
resume.setPos( uiCamera.width - resume.width(), pos - resume.height() );
}
}
@Override
protected void onBackPressed() {