v0.2.4: moved loot and continue tags to bottom right, much more accessable
This commit is contained in:
parent
89d72e60d1
commit
071403a7aa
|
@ -20,6 +20,8 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.*;
|
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.Camera;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.Group;
|
import com.watabou.noosa.Group;
|
||||||
|
@ -107,6 +109,10 @@ public class GameScene extends PixelScene {
|
||||||
private Toolbar toolbar;
|
private Toolbar toolbar;
|
||||||
private Toast prompt;
|
private Toast prompt;
|
||||||
|
|
||||||
|
private AttackIndicator attack;
|
||||||
|
private LootIndicator loot;
|
||||||
|
private ResumeIndicator resume;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create() {
|
public void create() {
|
||||||
|
|
||||||
|
@ -212,13 +218,23 @@ public class GameScene extends PixelScene {
|
||||||
toolbar.setRect( 0,uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height() );
|
toolbar.setRect( 0,uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height() );
|
||||||
add( toolbar );
|
add( toolbar );
|
||||||
|
|
||||||
AttackIndicator attack = new AttackIndicator();
|
attack = new AttackIndicator();
|
||||||
attack.camera = uiCamera;
|
attack.camera = uiCamera;
|
||||||
attack.setPos(
|
attack.setPos(
|
||||||
uiCamera.width - attack.width(),
|
uiCamera.width - attack.width(),
|
||||||
toolbar.top() - attack.height() );
|
toolbar.top() - attack.height() );
|
||||||
add( attack );
|
add( attack );
|
||||||
|
|
||||||
|
loot = new LootIndicator();
|
||||||
|
loot.camera = uiCamera;
|
||||||
|
add( loot );
|
||||||
|
|
||||||
|
resume = new ResumeIndicator();
|
||||||
|
resume.camera = uiCamera;
|
||||||
|
add( resume );
|
||||||
|
|
||||||
|
layoutTags();
|
||||||
|
|
||||||
log = new GameLog();
|
log = new GameLog();
|
||||||
log.camera = uiCamera;
|
log.camera = uiCamera;
|
||||||
log.setRect( 0, toolbar.top(), attack.left(), 0 );
|
log.setRect( 0, toolbar.top(), attack.left(), 0 );
|
||||||
|
@ -331,9 +347,36 @@ public class GameScene extends PixelScene {
|
||||||
log.newLine();
|
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;
|
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
|
@Override
|
||||||
protected void onBackPressed() {
|
protected void onBackPressed() {
|
||||||
if (!cancel()) {
|
if (!cancel()) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class LootIndicator extends Tag {
|
||||||
public LootIndicator() {
|
public LootIndicator() {
|
||||||
super( 0x1F75CC );
|
super( 0x1F75CC );
|
||||||
|
|
||||||
setSize( 24, 22 );
|
setSize( 24, 24 );
|
||||||
|
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class ResumeIndicator extends Tag {
|
||||||
public ResumeIndicator() {
|
public ResumeIndicator() {
|
||||||
super(0xCDD5C0);
|
super(0xCDD5C0);
|
||||||
|
|
||||||
setSize( 24, 22 );
|
setSize( 24, 24 );
|
||||||
|
|
||||||
visible = false;
|
visible = false;
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,6 @@ public class StatusPane extends Component {
|
||||||
private BitmapText keys;
|
private BitmapText keys;
|
||||||
|
|
||||||
private DangerIndicator danger;
|
private DangerIndicator danger;
|
||||||
private ResumeIndicator resume;
|
|
||||||
private LootIndicator loot;
|
|
||||||
private BuffIndicator buffs;
|
private BuffIndicator buffs;
|
||||||
private Compass compass;
|
private Compass compass;
|
||||||
|
|
||||||
|
@ -120,12 +118,6 @@ public class StatusPane extends Component {
|
||||||
danger = new DangerIndicator();
|
danger = new DangerIndicator();
|
||||||
add( danger );
|
add( danger );
|
||||||
|
|
||||||
loot = new LootIndicator();
|
|
||||||
add( loot );
|
|
||||||
|
|
||||||
resume = new ResumeIndicator();
|
|
||||||
add ( resume );
|
|
||||||
|
|
||||||
buffs = new BuffIndicator( Dungeon.hero );
|
buffs = new BuffIndicator( Dungeon.hero );
|
||||||
add( buffs );
|
add( buffs );
|
||||||
}
|
}
|
||||||
|
@ -151,49 +143,17 @@ public class StatusPane extends Component {
|
||||||
|
|
||||||
keys.y = 6;
|
keys.y = 6;
|
||||||
|
|
||||||
layoutTags();
|
danger.setPos( width - danger.width(), 18 );
|
||||||
|
|
||||||
buffs.setPos( 32, 11 );
|
buffs.setPos( 32, 11 );
|
||||||
|
|
||||||
btnMenu.setPos( width - btnMenu.width(), 1 );
|
btnMenu.setPos( width - btnMenu.width(), 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void layoutTags() {
|
|
||||||
|
|
||||||
float pos = 18;
|
|
||||||
|
|
||||||
if (tagDanger) {
|
|
||||||
danger.setPos( width - danger.width(), pos );
|
|
||||||
pos = danger.bottom() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tagLoot) {
|
|
||||||
loot.setPos( width - loot.width(), pos );
|
|
||||||
pos = loot.bottom() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tagResume) {
|
|
||||||
resume.setPos( width - resume.width(), pos );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean tagDanger = false;
|
|
||||||
private boolean tagLoot = false;
|
|
||||||
private boolean tagResume = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
super.update();
|
super.update();
|
||||||
|
|
||||||
if (tagDanger != danger.visible || tagLoot != loot.visible || tagResume != resume.visible) {
|
|
||||||
|
|
||||||
tagDanger = danger.visible;
|
|
||||||
tagLoot = loot.visible;
|
|
||||||
tagResume = resume.visible;
|
|
||||||
|
|
||||||
layoutTags();
|
|
||||||
}
|
|
||||||
|
|
||||||
float health = (float)Dungeon.hero.HP / Dungeon.hero.HT;
|
float health = (float)Dungeon.hero.HP / Dungeon.hero.HT;
|
||||||
|
|
||||||
if (health == 0) {
|
if (health == 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user