v1.4.0: various further improvements to new tutorial

This commit is contained in:
Evan Debenham
2022-09-12 13:25:28 -04:00
parent 7535758eae
commit 084ee193dd
5 changed files with 48 additions and 9 deletions
@@ -581,9 +581,9 @@ public class GameScene extends PixelScene {
} else { } else {
GLog.p(Messages.get(GameScene.class, "tutorial_move_desktop")); GLog.p(Messages.get(GameScene.class, "tutorial_move_desktop"));
} }
toolbar.visible = false; toolbar.visible = toolbar.active = false;
status.visible = false; status.visible = status.active = false;
if (inventory != null) inventory.visible = false; if (inventory != null) inventory.visible = inventory.active = false;
} }
if (Rankings.INSTANCE.totalNumber > 0 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_DIEING)){ if (Rankings.INSTANCE.totalNumber > 0 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_DIEING)){
@@ -1058,17 +1058,21 @@ public class GameScene extends PixelScene {
protected void updateValues(float progress) { protected void updateValues(float progress) {
if (progress <= 0.5f) { if (progress <= 0.5f) {
scene.status.alpha(2*progress); scene.status.alpha(2*progress);
scene.status.visible = true; scene.status.visible = scene.status.active = true;
scene.toolbar.visible = false; scene.toolbar.visible = scene.toolbar.active = false;
if (scene.inventory != null) scene.inventory.visible = scene.inventory.active = false;
} else { } else {
scene.status.alpha(1f); scene.status.alpha(1f);
scene.status.visible = true; scene.status.visible = scene.status.active = true;
scene.toolbar.alpha((progress - 0.5f)*2); scene.toolbar.alpha((progress - 0.5f)*2);
scene.toolbar.visible = true; scene.toolbar.visible = scene.toolbar.active = true;
if (scene.inventory != null){
scene.inventory.visible = scene.inventory.active = true;
scene.inventory.alpha((progress - 0.5f)*2);
}
} }
} }
}); });
if (scene.inventory != null) scene.inventory.visible = true;
GameLog.wipe(); GameLog.wipe();
if (SPDSettings.interfaceSize() == 0){ if (SPDSettings.interfaceSize() == 0){
GLog.p(Messages.get(GameScene.class, "tutorial_ui_mobile")); GLog.p(Messages.get(GameScene.class, "tutorial_ui_mobile"));
@@ -157,7 +157,8 @@ public class WelcomeScene extends PixelScene {
GamesInProgress.selectedClass = null; GamesInProgress.selectedClass = null;
GamesInProgress.curSlot = GamesInProgress.firstEmpty(); GamesInProgress.curSlot = GamesInProgress.firstEmpty();
if (GamesInProgress.curSlot == -1){ if (GamesInProgress.curSlot == -1){
ShatteredPixelDungeon.switchScene(StartScene.class); SPDSettings.intro(false);
ShatteredPixelDungeon.switchScene(TitleScene.class);
} else { } else {
ShatteredPixelDungeon.switchScene(HeroSelectScene.class); ShatteredPixelDungeon.switchScene(HeroSelectScene.class);
} }
@@ -264,6 +264,27 @@ public class InventoryPane extends Component {
super.layout(); super.layout();
} }
public void alpha( float value ){
bg.alpha( value );
bg2.alpha( value );
for (InventorySlot slot : equipped){
slot.alpha( value );
}
for (InventorySlot slot : bagItems){
slot.alpha( value );
}
gold.alpha(value);
goldTxt.alpha(value);
energy.alpha(value);
energyTxt.alpha(value);
for (BagButton bag : bags){
bag.alpha( value );
}
}
public static void refresh(){ public static void refresh(){
if (instance != null) instance.updateInventory(); if (instance != null) instance.updateInventory();
} }
@@ -615,6 +636,12 @@ public class InventoryPane extends Component {
bgBottom.x = x; bgBottom.x = x;
} }
public void alpha( float value ){
bgTop.alpha(value);
bgBottom.alpha(value);
icon.alpha(value);
}
@Override @Override
protected void onClick() { protected void onClick() {
super.onClick(); super.onClick();
@@ -64,6 +64,12 @@ public class InventorySlot extends ItemSlot {
super.layout(); super.layout();
} }
@Override
public void alpha(float value) {
super.alpha(value);
bg.alpha(value);
}
@Override @Override
public void item( Item item ) { public void item( Item item ) {
@@ -167,6 +167,7 @@ public class ItemSlot extends Button {
} }
public void alpha( float value ){ public void alpha( float value ){
if (!active) value *= 0.3f;
if (sprite != null) sprite.alpha(value); if (sprite != null) sprite.alpha(value);
if (extra != null) extra.alpha(value); if (extra != null) extra.alpha(value);
if (status != null) status.alpha(value); if (status != null) status.alpha(value);