Class CustomUI
java.lang.Object
fr.hytale.loader.api.ui.CustomUI
Simple wrapper for creating custom UIs in Hytale.
Custom UIs require a `.ui` file in `resources/common/UI/custom/pages/`.
Example Usage:
// Create UI file at: resources/common/UI/custom/pages/MyCustomUI.ui
// Then create a CustomUI instance:
CustomUI ui = new CustomUI("common/UI/custom/pages/MyCustomUI.ui", CustomUILifetime.CAN_DISMISS);
player.openCustomUI(ui);
- Since:
- 1.0.5
- Version:
- 1.0.6
- Author:
- HytaleLoader
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new custom UI with CAN_DISMISS lifetime.CustomUI(String uiFilePath, CustomUI.CustomUILifetime lifetime) Creates a new custom UI. -
Method Summary
Modifier and TypeMethodDescriptioncom.hypixel.hytale.server.core.entity.entities.player.pages.BasicCustomUIPagecreateNativePage(com.hypixel.hytale.server.core.universe.PlayerRef playerRef) Creates the native UI page for this custom UI.Gets the UI lifetime.Gets the UI file path.
-
Constructor Details
-
CustomUI
Creates a new custom UI.- Parameters:
uiFilePath- Path to the UI file (e.g., "common/UI/custom/pages/MyUI.ui")lifetime- UI lifetime behavior
-
CustomUI
Creates a new custom UI with CAN_DISMISS lifetime.- Parameters:
uiFilePath- Path to the UI file
-
-
Method Details
-
getUiFilePath
-
getLifetime
-
createNativePage
public com.hypixel.hytale.server.core.entity.entities.player.pages.BasicCustomUIPage createNativePage(@Nonnull com.hypixel.hytale.server.core.universe.PlayerRef playerRef) Creates the native UI page for this custom UI.- Parameters:
playerRef- The player reference- Returns:
- The native UI page
-