mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 14:38:50 +00:00
Fix incorrect widget layout due to mods updating renderables after initialization
This commit is contained in:
1 parent
f5606c1b80
commit
ea05e90a20
1 file changed
+8
@@ -66,6 +66,14 @@ public class MixinTitleScreen extends Screen {
|
||||
for (int offsetX = 0; offsetX < 5; offsetX++) {
|
||||
for (int i = this.normalMenuWidgets.size()-1; i >= 0; i--) {
|
||||
AbstractWidget widget = this.normalMenuWidgets.get(i);
|
||||
|
||||
// Some mods which add custom menu functionality will run TitleScreen#createNormalMenuOptions
|
||||
// but then later clear all the renderables. Simple fix is to scan the renderables list to
|
||||
// ensure that the normal menu widget is still actually present
|
||||
if (!this.renderables.contains(widget)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int size = widget.getHeight();
|
||||
int x = widget.getRight() + 4 + size * offsetX;
|
||||
int y = widget.getY();
|
||||
|
||||
Reference in new issue
Block a user