From 60110f186e265648c9ac419a1104a5e1cec8e800 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 6 Oct 2018 16:34:30 -0400 Subject: [PATCH] v0.7.0: fixed an alchemy scene crash and standardized window size vars --- .../shatteredpixeldungeon/scenes/AlchemyScene.java | 9 +++++---- .../shatteredpixeldungeon/windows/WndJournal.java | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java index 51e0eb41b..c3e7d53dd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java @@ -256,14 +256,15 @@ public class AlchemyScene extends PixelScene { { WndJournal.AlchemyTab t = new WndJournal.AlchemyTab(); + int w, h; if (SPDSettings.landscape()) { - resize(200, 130); - t.setRect(0, 0, 200, 130); + w = WndJournal.WIDTH_L; h = WndJournal.HEIGHT_L; } else { - resize(126, 180); - t.setRect(0, 0, 126, 180); + w = WndJournal.WIDTH_P; h = WndJournal.HEIGHT_P; } + resize(w, h); add(t); + t.setRect(0, 0, w, h); } }); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java index 538e02925..125ddae9b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java @@ -53,11 +53,11 @@ import java.util.HashMap; public class WndJournal extends WndTabbed { - private static final int WIDTH_P = 126; - private static final int HEIGHT_P = 180; + public static final int WIDTH_P = 126; + public static final int HEIGHT_P = 180; - private static final int WIDTH_L = 200; - private static final int HEIGHT_L = 130; + public static final int WIDTH_L = 200; + public static final int HEIGHT_L = 130; private static final int ITEM_HEIGHT = 18;