v0.7.4: adjusted welcome scene to use new buttons

This commit is contained in:
Evan Debenham 2019-07-11 19:42:21 -04:00
parent 79eb1b11df
commit 1f604d7b13

View File

@ -21,9 +21,8 @@
package com.shatteredpixel.shatteredpixeldungeon.scenes; package com.shatteredpixel.shatteredpixeldungeon.scenes;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress; import com.shatteredpixel.shatteredpixeldungeon.Chrome;
import com.shatteredpixel.shatteredpixeldungeon.Rankings; import com.shatteredpixel.shatteredpixeldungeon.Rankings;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
@ -32,8 +31,9 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
import com.shatteredpixel.shatteredpixeldungeon.journal.Document; import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
import com.shatteredpixel.shatteredpixeldungeon.journal.Journal; import com.shatteredpixel.shatteredpixeldungeon.journal.Journal;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStartGame; import com.shatteredpixel.shatteredpixeldungeon.windows.WndStartGame;
import com.watabou.glwrap.Blending; import com.watabou.glwrap.Blending;
import com.watabou.noosa.Camera; import com.watabou.noosa.Camera;
@ -97,7 +97,7 @@ public class WelcomeScene extends PixelScene {
signs.y = title.y; signs.y = title.y;
add( signs ); add( signs );
DarkRedButton okay = new DarkRedButton(Messages.get(this, "continue")){ StyledButton okay = new StyledButton(Chrome.Type.GREY_BUTTON_TR, Messages.get(this, "continue")){
@Override @Override
protected void onClick() { protected void onClick() {
super.onClick(); super.onClick();
@ -111,8 +111,9 @@ public class WelcomeScene extends PixelScene {
} }
}; };
//FIXME these buttons are very low on 18:9 devices
if (previousVersion != 0){ if (previousVersion != 0){
DarkRedButton changes = new DarkRedButton(Messages.get(this, "changelist")){ StyledButton changes = new StyledButton(Chrome.Type.GREY_BUTTON_TR, Messages.get(TitleScene.class, "changes")){
@Override @Override
protected void onClick() { protected void onClick() {
super.onClick(); super.onClick();
@ -120,16 +121,16 @@ public class WelcomeScene extends PixelScene {
ShatteredPixelDungeon.switchScene(ChangesScene.class); ShatteredPixelDungeon.switchScene(ChangesScene.class);
} }
}; };
okay.setRect(title.x, h-20, (title.width()/2)-2, 16); okay.setRect(title.x, h-25, (title.width()/2)-2, 21);
okay.textColor(0xBBBB33);
add(okay); add(okay);
changes.setRect(okay.right()+2, h-20, (title.width()/2)-2, 16); changes.setRect(okay.right()+2, h-25, (title.width()/2)-2, 21);
changes.textColor(0xBBBB33); changes.icon(Icons.get(Icons.CHANGES));
add(changes); add(changes);
} else { } else {
okay.setRect(title.x, h-20, title.width(), 16); okay.text(Messages.get(TitleScene.class, "enter"));
okay.textColor(0xBBBB33); okay.setRect(title.x, h-25, title.width(), 21);
okay.icon(Icons.get(Icons.ENTER));
add(okay); add(okay);
} }
@ -201,25 +202,4 @@ public class WelcomeScene extends PixelScene {
add( fb ); add( fb );
} }
private class DarkRedButton extends RedButton{
{
bg.brightness(0.4f);
}
DarkRedButton(String text){
super(text);
}
@Override
protected void onTouchDown() {
bg.brightness(0.5f);
Sample.INSTANCE.play( Assets.SND_CLICK );
}
@Override
protected void onTouchUp() {
super.onTouchUp();
bg.brightness(0.4f);
}
}
} }