Skip to content

Adding new UI elements

Julian Weinelt edited this page Jan 14, 2026 · 1 revision

Adding a new settings page

@Subscribe(value = "UIServiceEnabledEvent")
public void onUIReady(Event event) {
    getLogger().info("Registering settings dialogs...");
    UIService service = event.get("service").asValue(UIService.class);
    SettingsPanel examplePage = new SettingsPanel("Example");
    examplePage.add(new ComponentCheckbox().label("Test"));
    examplePage.add(new ComponentComboBox().option("Test", () -> getLogger().info("Test2")).option("Test2", () -> getLogger().info("Test3")));
    service.addSettingsPanel(examplePage);
}

Clone this wiki locally