From eab000266f37a6934c90f9b00ebce32e1a12c356 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 13 Oct 2019 01:05:23 -0400 Subject: [PATCH] v0.7.5b: fixed additional cases where text was being rendered from the actor thread --- .../actors/mobs/npcs/Blacksmith.java | 7 ++++++- .../shatteredpixeldungeon/items/artifacts/DriedRose.java | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java index 2af200ec8..156232bfb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java @@ -157,7 +157,12 @@ public class Blacksmith extends NPC { } private void tell( String text ) { - GameScene.show( new WndQuest( this, text ) ); + Game.runOnRenderThread(new Callback() { + @Override + public void call() { + GameScene.show( new WndQuest( Blacksmith.this, text ) ); + } + }); } public static String verify( Item item1, Item item2 ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 43473593b..dd3896dd9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -63,8 +63,10 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBlacksmith; import com.shatteredpixel.shatteredpixeldungeon.windows.WndItem; import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest; +import com.watabou.noosa.Game; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; +import com.watabou.utils.Callback; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -697,7 +699,12 @@ public class DriedRose extends Artifact { updateRose(); if (rose != null && !rose.talkedTo){ rose.talkedTo = true; - GameScene.show(new WndQuest(this, Messages.get(this, "introduce") )); + Game.runOnRenderThread(new Callback() { + @Override + public void call() { + GameScene.show(new WndQuest(GhostHero.this, Messages.get(GhostHero.this, "introduce") )); + } + }); return false; } else { return super.interact();