Skip to content

Widgets added to IScreen before Hud.openScreen() finishes are lost #26

Description

@Viorettas
const screen = Hud.createScreen("My Input", true);
Hud.openScreen(screen);

Time.sleep(10);

const onSubmit = JavaWrapper.methodToJava((widget) => {});
const button = screen.addButton(20, 20, 100, 20, "Button", onSubmit);

As example code above, if time sleep is too low button sometimes appear sometimes don't. If u add widget before Hud.openScreen(), it doesnt appear. If u add widget after Hud.openScreen(), it doesn't appear if it doesnt waits until screen opens.

Environment

  • JsMacrosCE version: 2.0.0 beta 6 and dev f32f661 tested
  • Minecraft version: 1.21.11
  • Loader: Fabric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions