Klasse PopUp
java.lang.Object
de.luckymcdev.foundryengine.client.editor.popup.PopUp
A base class for creating and managing ImGui popups in the Foundry Engine.
This class provides functionality to create, open, close, and render both modal and non-modal popups.
It serves as a foundation for custom popups by allowing subclasses to override the content() method.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifikator und TypMethodeBeschreibungvoidclose()Closes this popup if it is currently open.voidcontent()Renders the content of this popup.net.minecraft.resources.IdentifiergetId()Returns the unique identifier of this popup.getStrId()Returns the string identifier used by ImGui to manage this popup.voidHandles the rendering of this popup.booleanisOpen()Checks if this popup is currently open.voidopen()Opens this popup.
-
Konstruktordetails
-
PopUp
Constructs a non-modal popup with default flags.- Parameter:
id- The unique identifier for this popup.strId- The string identifier used by ImGui to manage the popup.
-
PopUp
Constructs a popup with customizable modal behavior and flags.- Parameter:
id- The unique identifier for this popup.strId- The string identifier used by ImGui to manage the popup.modal- Iftrue, the popup will be modal (blocks interaction with other windows).popUpFlags- Flags to control the popup's behavior. SeeImGuiPopupFlagsfor available options.
-
-
Methodendetails
-
getId
public net.minecraft.resources.Identifier getId()Returns the unique identifier of this popup.- Gibt zurück:
- The popup's
Identifier.
-
getStrId
Returns the string identifier used by ImGui to manage this popup.- Gibt zurück:
- The ImGui string identifier.
-
isOpen
public boolean isOpen()Checks if this popup is currently open.- Gibt zurück:
trueif the popup is open,falseotherwise.
-
open
public void open()Opens this popup.This method triggers the popup to appear in the next ImGui frame.
-
close
public void close()Closes this popup if it is currently open.This method ensures the popup is closed gracefully by checking its state first.
-
handleRender
public void handleRender()Handles the rendering of this popup.This method begins the popup context, renders its content, and ensures proper cleanup afterward. The actual content is delegated to the
content()method, which can be overridden by subclasses. -
content
public void content()Renders the content of this popup.Subclasses should override this method to define custom content for the popup. The default implementation does nothing.
-