From cd5c7ef652cd369fc0382ab52eea1ae81e3ae7a2 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 22 Sep 2024 16:17:27 -0400 Subject: [PATCH] v2.5.3: fixed spacing issues in hero select on landscape --- .../shatteredpixeldungeon/scenes/HeroSelectScene.java | 6 ++++++ .../shatteredpixeldungeon/windows/WndInfoArmorAbility.java | 4 ++++ .../shatteredpixeldungeon/windows/WndInfoSubclass.java | 5 +++++ .../shatteredpixeldungeon/windows/WndTitledMessage.java | 6 +++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java index 53e71bdc9..eb1611961 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java @@ -410,6 +410,12 @@ public class HeroSelectScene extends PixelScene { heroDesc.setPos((leftPortion - heroDesc.width())/2f, heroName.bottom() + 5); align(heroDesc); + while(startBtn.top() < heroDesc.bottom()){ + heroDesc.maxWidth(heroDesc.maxWidth()+10); + heroDesc.setPos(Math.max(0, (leftPortion - heroDesc.width())/2f), heroName.bottom() + 5); + align(heroDesc); + } + btnFade.visible = btnFade.active = true; startBtn.visible = startBtn.active = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoArmorAbility.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoArmorAbility.java index 44e4a2430..c632949c1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoArmorAbility.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoArmorAbility.java @@ -50,4 +50,8 @@ public class WndInfoArmorAbility extends WndTitledMessage { } + @Override + protected float targetHeight() { + return super.targetHeight()-40; + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoSubclass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoSubclass.java index 3ff704fd2..a75d8b35b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoSubclass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoSubclass.java @@ -49,4 +49,9 @@ public class WndInfoSubclass extends WndTitledMessage { } + @Override + protected float targetHeight() { + return super.targetHeight()-40; + } + } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java index 49444257a..2ff294892 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndTitledMessage.java @@ -55,7 +55,7 @@ public class WndTitledMessage extends Window { add( text ); while (PixelScene.landscape() - && text.bottom() > (PixelScene.MIN_HEIGHT_L - 10) + && text.bottom() > targetHeight() && width < WIDTH_MAX){ width += 20; titlebar.setRect(0, 0, width, 0); @@ -71,4 +71,8 @@ public class WndTitledMessage extends Window { protected boolean useHighlighting(){ return true; } + + protected float targetHeight() { + return PixelScene.MIN_HEIGHT_L - 10; + } }