v1.3.2: enhanced changes scene on large enough displays
This commit is contained in:
@@ -11,7 +11,7 @@ scenes.amuletscene.text=You finally hold it in your hands, the Amulet of Yendor!
|
|||||||
|
|
||||||
scenes.badgesscene.title=Your Badges
|
scenes.badgesscene.title=Your Badges
|
||||||
|
|
||||||
scenes.changesscene.title=Recent Changes
|
scenes.changesscene.title=Change History
|
||||||
scenes.changesscene.new=New Content
|
scenes.changesscene.new=New Content
|
||||||
scenes.changesscene.changes=Changes
|
scenes.changesscene.changes=Changes
|
||||||
scenes.changesscene.buffs=Buffs
|
scenes.changesscene.buffs=Buffs
|
||||||
@@ -19,6 +19,9 @@ scenes.changesscene.nerfs=Nerfs
|
|||||||
scenes.changesscene.bugfixes=Bug Fixes
|
scenes.changesscene.bugfixes=Bug Fixes
|
||||||
scenes.changesscene.misc=Miscellaneous Changes
|
scenes.changesscene.misc=Miscellaneous Changes
|
||||||
scenes.changesscene.language=Language Improvements
|
scenes.changesscene.language=Language Improvements
|
||||||
|
scenes.changesscene.right_title=Change Details
|
||||||
|
scenes.changesscene.right_body=Select an icon on the left to read about changes from that update.
|
||||||
|
scenes.changesscene.lang_warn=Change details are written by the developer and are only available in English.
|
||||||
|
|
||||||
scenes.gamescene.descend=You descend to floor %d of the dungeon.
|
scenes.gamescene.descend=You descend to floor %d of the dungeon.
|
||||||
scenes.gamescene.spawner_warn=You feel that there's a source of demonic energy above you...
|
scenes.gamescene.spawner_warn=You feel that there's a source of demonic energy above you...
|
||||||
|
|||||||
+70
-3
@@ -24,14 +24,17 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.ChangeInfo;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.ChangeInfo;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.ChangesWindow;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_1_X_Changes;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_1_X_Changes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_2_X_Changes;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_2_X_Changes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_3_X_Changes;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_3_X_Changes;
|
||||||
@@ -42,8 +45,11 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_7_X_Changes;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_8_X_Changes;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_8_X_Changes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_9_X_Changes;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_9_X_Changes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v1_X_Changes;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v1_X_Changes;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.windows.IconTitle;
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.NinePatch;
|
import com.watabou.noosa.NinePatch;
|
||||||
|
import com.watabou.noosa.Scene;
|
||||||
import com.watabou.noosa.audio.Music;
|
import com.watabou.noosa.audio.Music;
|
||||||
import com.watabou.noosa.ui.Component;
|
import com.watabou.noosa.ui.Component;
|
||||||
|
|
||||||
@@ -53,6 +59,10 @@ public class ChangesScene extends PixelScene {
|
|||||||
|
|
||||||
public static int changesSelected = 0;
|
public static int changesSelected = 0;
|
||||||
|
|
||||||
|
private NinePatch rightPanel;
|
||||||
|
private IconTitle changeTitle;
|
||||||
|
private RenderedTextBlock changeBody;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create() {
|
public void create() {
|
||||||
super.create();
|
super.create();
|
||||||
@@ -83,9 +93,36 @@ public class ChangesScene extends PixelScene {
|
|||||||
int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
|
int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
|
||||||
int ph = h - 36;
|
int ph = h - 36;
|
||||||
|
|
||||||
panel.size( pw, ph );
|
if (h >= PixelScene.MIN_HEIGHT_FULL && w >= PixelScene.MIN_WIDTH_FULL) {
|
||||||
panel.x = (w - pw) / 2f;
|
panel.size( pw, ph );
|
||||||
panel.y = title.bottom() + 5;
|
panel.x = (w - pw) / 2f - pw/2 - 1;
|
||||||
|
panel.y = title.bottom() + 5;
|
||||||
|
|
||||||
|
rightPanel = Chrome.get(Chrome.Type.TOAST);
|
||||||
|
rightPanel.size( pw, ph );
|
||||||
|
rightPanel.x = (w - pw) / 2f + pw/2 + 1;
|
||||||
|
rightPanel.y = title.bottom() + 5;
|
||||||
|
add(rightPanel);
|
||||||
|
|
||||||
|
changeTitle = new IconTitle(Icons.get(Icons.CHANGES), Messages.get(this, "right_title"));
|
||||||
|
changeTitle.setPos(rightPanel.x + rightPanel.marginLeft(), rightPanel.y + rightPanel.marginTop());
|
||||||
|
changeTitle.setSize(pw, 20);
|
||||||
|
add(changeTitle);
|
||||||
|
|
||||||
|
String body = Messages.get(this, "right_body");
|
||||||
|
if (Messages.lang() != Languages.ENGLISH){
|
||||||
|
body += "\n\n_" + Messages.get(this, "lang_warn") + "_";
|
||||||
|
}
|
||||||
|
changeBody = PixelScene.renderTextBlock(body, 6);
|
||||||
|
changeBody.maxWidth(pw - panel.marginHor());
|
||||||
|
changeBody.setPos(rightPanel.x + rightPanel.marginLeft(), changeTitle.bottom()+2);
|
||||||
|
add(changeBody);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
panel.size( pw, ph );
|
||||||
|
panel.x = (w - pw) / 2f;
|
||||||
|
panel.y = title.bottom() + 5;
|
||||||
|
}
|
||||||
align( panel );
|
align( panel );
|
||||||
add( panel );
|
add( panel );
|
||||||
|
|
||||||
@@ -259,6 +296,36 @@ public class ChangesScene extends PixelScene {
|
|||||||
fadeIn();
|
fadeIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateChangesText(Image icon, String title, String message){
|
||||||
|
if (changeTitle != null){
|
||||||
|
changeTitle.icon(icon);
|
||||||
|
changeTitle.label(title);
|
||||||
|
changeTitle.setPos(changeTitle.left(), changeTitle.top());
|
||||||
|
|
||||||
|
int pw = 135 + rightPanel.marginHor() - 2;
|
||||||
|
changeBody.text(message, pw - rightPanel.marginHor());
|
||||||
|
while (changeBody.height() > rightPanel.height()-25
|
||||||
|
&& changeBody.right() + 5 < Camera.main.width){
|
||||||
|
changeBody.maxWidth(changeBody.maxWidth()+5);
|
||||||
|
}
|
||||||
|
int ph = Camera.main.height - 36;
|
||||||
|
rightPanel.size(changeBody.maxWidth() + rightPanel.marginHor(), Math.max(ph, changeBody.height()+18+rightPanel.marginVer()));
|
||||||
|
changeBody.setPos(changeBody.left(), changeTitle.bottom()+2);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
addToFront(new ChangesWindow(icon, title, message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showChangeInfo(Image icon, String title, String message){
|
||||||
|
Scene s = ShatteredPixelDungeon.scene();
|
||||||
|
if (s instanceof ChangesScene){
|
||||||
|
((ChangesScene) s).updateChangesText(icon, title, message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s.addToFront(new ChangesWindow(icon, title, message));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onBackPressed() {
|
protected void onBackPressed() {
|
||||||
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
|
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
|
||||||
|
|||||||
+2
-1
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui.changelist;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.ChangesScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
@@ -53,7 +54,7 @@ public class ChangeButton extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
ShatteredPixelDungeon.scene().add(new ChangesWindow(new Image(icon), title, message));
|
ChangesScene.showChangeInfo(new Image(icon), title, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user