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

View File

@@ -581,9 +581,9 @@ public class GameScene extends PixelScene {
} else {
GLog.p(Messages.get(GameScene.class, "tutorial_move_desktop"));
}
toolbar.visible = false;
status.visible = false;
if (inventory != null) inventory.visible = false;
toolbar.visible = toolbar.active = false;
status.visible = status.active = false;
if (inventory != null) inventory.visible = inventory.active = false;
}
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) {
if (progress <= 0.5f) {
scene.status.alpha(2*progress);
scene.status.visible = true;
scene.toolbar.visible = false;
scene.status.visible = scene.status.active = true;
scene.toolbar.visible = scene.toolbar.active = false;
if (scene.inventory != null) scene.inventory.visible = scene.inventory.active = false;
} else {
scene.status.alpha(1f);
scene.status.visible = true;
scene.status.visible = scene.status.active = true;
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();
if (SPDSettings.interfaceSize() == 0){
GLog.p(Messages.get(GameScene.class, "tutorial_ui_mobile"));

View File

@@ -157,7 +157,8 @@ public class WelcomeScene extends PixelScene {
GamesInProgress.selectedClass = null;
GamesInProgress.curSlot = GamesInProgress.firstEmpty();
if (GamesInProgress.curSlot == -1){
ShatteredPixelDungeon.switchScene(StartScene.class);
SPDSettings.intro(false);
ShatteredPixelDungeon.switchScene(TitleScene.class);
} else {
ShatteredPixelDungeon.switchScene(HeroSelectScene.class);
}

View File

@@ -263,6 +263,27 @@ public class InventoryPane extends Component {
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(){
if (instance != null) instance.updateInventory();
@@ -614,6 +635,12 @@ public class InventoryPane extends Component {
bgBottom.y = y+1;
bgBottom.x = x;
}
public void alpha( float value ){
bgTop.alpha(value);
bgBottom.alpha(value);
icon.alpha(value);
}
@Override
protected void onClick() {

View File

@@ -64,6 +64,12 @@ public class InventorySlot extends ItemSlot {
super.layout();
}
@Override
public void alpha(float value) {
super.alpha(value);
bg.alpha(value);
}
@Override
public void item( Item item ) {

View File

@@ -167,6 +167,7 @@ public class ItemSlot extends Button {
}
public void alpha( float value ){
if (!active) value *= 0.3f;
if (sprite != null) sprite.alpha(value);
if (extra != null) extra.alpha(value);
if (status != null) status.alpha(value);