Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.85k stars 2.99k forks source link

BaseDialog breaks when adding a button #2339

Closed deltanedas closed 4 years ago

deltanedas commented 4 years ago

Platform: Android 9

Build: 9226

Issue: BaseDialog breaks and everything is put in the top left corner when adding a button. See screenshot

Steps to reproduce: Script:

const dialog = new BaseDialog("$block.router.name");
dialog.addCloseButton();
dialog.buttons.button(Icon.warning, "egg", () => print("click"))
dialog.show()

Link to mod(s) used, if applicable: git clone https://github.com/deltanedas/modding-toolbox -b 6.0 (Also occurs in the UI editor if the export button is uncommented, and on another mod)


Place an X (no spaces) between the brackets to confirm that you have read the line below.

Anuken commented 4 years ago

This works fine throughout the Mindustry codebase; your mod is probably at fault here.

deltanedas commented 4 years ago

But why is it wrong? Shouldn't it be small label, line, close and egg button? Instead it has a stroke probably for some rhino related reason.

Anuken commented 4 years ago

But why is it wrong?

Just tried running the code, and your parameters are in the wrong order. Fix your button call.

I imagine rhino coerces the arguments to something invalid.