From eafd80eafe8c8816cbe5816d5cb4111336c243ab Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:11:51 +0530 Subject: [PATCH] fix mp level select rendering --- src/gui/GuiMLTextListCtrl.hx | 2 ++ src/gui/GuiTextListCtrl.hx | 5 +++++ src/gui/PlayGui.hx | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/GuiMLTextListCtrl.hx b/src/gui/GuiMLTextListCtrl.hx index be501556..fd8d36ad 100644 --- a/src/gui/GuiMLTextListCtrl.hx +++ b/src/gui/GuiMLTextListCtrl.hx @@ -177,6 +177,8 @@ class GuiMLTextListCtrl extends GuiControl { } if (MarbleGame.canvas.scene2d.contains(g)) MarbleGame.canvas.scene2d.removeChild(g); + if (MarbleGame.canvas.scene2d.contains(this.flow)) + MarbleGame.canvas.scene2d.removeChild(this.flow); } public override function onMouseMove(mouseState:MouseState) { diff --git a/src/gui/GuiTextListCtrl.hx b/src/gui/GuiTextListCtrl.hx index c00d0052..b1373f02 100644 --- a/src/gui/GuiTextListCtrl.hx +++ b/src/gui/GuiTextListCtrl.hx @@ -164,6 +164,11 @@ class GuiTextListCtrl extends GuiControl { } if (MarbleGame.canvas.scene2d.contains(g)) MarbleGame.canvas.scene2d.removeChild(g); + + if (this.scrollable) { + if (MarbleGame.canvas.scene2d.contains(this.flow)) + MarbleGame.canvas.scene2d.removeChild(this.flow); + } } public override function onMouseMove(mouseState:MouseState) { diff --git a/src/gui/PlayGui.hx b/src/gui/PlayGui.hx index 5cd68c26..23b439a5 100644 --- a/src/gui/PlayGui.hx +++ b/src/gui/PlayGui.hx @@ -1094,7 +1094,7 @@ class PlayGui { middleMsg2.text.textColor = color; // middleMsg.text.filter = new h2d.filter.DropShadow(1.414, 0.785, 0x000000, 1, 0, 0.4, 1, true); this.playGuiCtrl.addChild(middleMsg2); - middleMsg2.render(scene2d, @:privateAccess this.playGuiCtrl._flow); + middleMsg2.render(scene2d); middleMsg2.text.y -= (25 / playGuiCtrl.extent.y) * scene2d.height; this.middleMessages.push({