From 4b81a9c1381ce7d08f43e393b9c4c337bf34bb54 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 26 Jul 2020 18:16:18 -0400 Subject: [PATCH] v0.8.2: final tweaks to patreon supporter scene --- .../assets/messages/scenes/scenes.properties | 5 ++-- .../scenes/SupporterScene.java | 29 ++++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/core/src/main/assets/messages/scenes/scenes.properties b/core/src/main/assets/messages/scenes/scenes.properties index d78d34e83..310670c51 100644 --- a/core/src/main/assets/messages/scenes/scenes.properties +++ b/core/src/main/assets/messages/scenes/scenes.properties @@ -66,9 +66,10 @@ scenes.startscene.title=Games in Progress scenes.startscene.new=New Game scenes.supporterscene.title=Support the Game -scenes.supporterscene$supportermessage.patreon=I want Shattered Pixel Dungeon to be free of ads and invasive microtransations as they ruin the experience of so many mobile games. Instead, I'd rather ask players to support the game directly!\n\nIf you enjoy Shattered Pixel Dungeon and want to help me keep making it, please consider supporting me on _Patreon!_ Patreon gives me a consistent income source, and lets me give supporters exclusive benefits!:\n_- Weekly mini-blogs_, with info about what I'm working on.\n_- Content Polls_, which directly affect content I'm developing.\n_- A Community Discord_, with a dev log and chat channels.\n_- More benefits to come_, as the Patreon community grows.\n\nYou can visit the Patreon page for more info. Thank you for your consideration! scenes.supporterscene.supporter_link=Go to Patreon Page -scenes.supporterscene$supportermessage.patreon_english=Note that Patreon rewards are only available in English. +scenes.supporterscene$supportermessage.intro=I want Shattered Pixel Dungeon to be free of ads and invasive microtransations, which ruin so many mobile games. Instead, I'd rather ask players to support the game directly! +scenes.supporterscene$supportermessage.patreon_msg=If you enjoy ShatteredPD and want to help me keep making it, please consider supporting me on _Patreon!_ Patreon gives me a steady income source, and lets me give supporters exclusive benefits!:\n_- Weekly mini-blogs_, with info about what I'm working on.\n_- Content Polls_, which directly affect content I'm developing.\n_- A Community Discord_, with a dev log and chat channels.\n_- More benefits to come_, as the Patreon community grows.\n\nYou can visit the Patreon page for more info. Thank you for your support! +scenes.supporterscene$supportermessage.patreon_english=(Note that Patreon rewards are only available in English.) scenes.surfacescene.exit=Game Over diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/SupporterScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/SupporterScene.java index 4af7c6fc0..5356c3355 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/SupporterScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/SupporterScene.java @@ -31,12 +31,16 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock; import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton; import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.watabou.noosa.Camera; +import com.watabou.noosa.Image; import com.watabou.noosa.NinePatch; import com.watabou.noosa.ui.Component; import com.watabou.utils.DeviceCompat; public class SupporterScene extends PixelScene { + private static final int BTN_HEIGHT = 22; + private static final int GAP = 2; + @Override public void create() { super.create(); @@ -46,7 +50,7 @@ public class SupporterScene extends PixelScene { int w = Camera.main.width; int h = Camera.main.height; - int elementWidth = PixelScene.landscape() ? 200 : 120; + int elementWidth = PixelScene.landscape() ? 202 : 120; Archs archs = new Archs(); archs.setSize(w, h); @@ -83,10 +87,10 @@ public class SupporterScene extends PixelScene { }; link.icon(Icons.get(Icons.GOLD)); link.textColor(Window.TITLE_COLOR); - link.setSize(elementWidth, 20); + link.setSize(elementWidth, BTN_HEIGHT); add(link); - float elementHeight = msg.height() + link.height() + 2; + float elementHeight = msg.height() + BTN_HEIGHT + GAP; float top = 16 + (h - 16 - elementHeight)/2f; float left = (w-elementWidth)/2f; @@ -94,7 +98,7 @@ public class SupporterScene extends PixelScene { msg.setPos(left, top); align(msg); - link.setPos(left, msg.bottom()+2); + link.setPos(left, msg.bottom()+GAP); align(link); } @@ -103,20 +107,26 @@ public class SupporterScene extends PixelScene { NinePatch bg; RenderedTextBlock text; + Image icon; @Override protected void createChildren() { bg = Chrome.get(Chrome.Type.GREY_BUTTON_TR); add(bg); - String message = Messages.get(this, "patreon"); - if (Messages.lang() != Languages.ENGLISH){ - message += "\n\n" + Messages.get(this, "patreon_english"); + String message = Messages.get(this, "intro"); + message += "\n\n" + Messages.get(this, "patreon_msg"); + if (Messages.lang() != Languages.ENGLISH) { + message += "\n" + Messages.get(this, "patreon_english"); } + message += "\n\n- Evan"; text = PixelScene.renderTextBlock(message, 6); add(text); + icon = Icons.get(Icons.SHPX); + add(icon); + } @Override @@ -127,7 +137,10 @@ public class SupporterScene extends PixelScene { text.maxWidth((int)width - bg.marginHor()); text.setPos(x + bg.marginLeft(), y + bg.marginTop()); - height = (text.bottom()) - y; + icon.y = text.bottom() - icon.height() + 4; + icon.x = x + 25; + + height = (text.bottom() + 2) - y; height += bg.marginBottom();