Class GuiEditors
java.lang.Object
dev.boze.api.gui.editor.GuiEditors
Built-in editors (popups) for addons, drawn by the active theme like Boze's own. Open them with
Ids name what is edited, for example
Guis.openEditor(GuiEditor).
Ids name what is edited, for example
myaddon:waypoints; themes can use them to give an
editor a view of its own. Callbacks run on the render thread.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic BindCaptureEditorWaits for the next key or mouse button, then closes.static ChoiceEditorchoice(String id, String title, List<EditorButton> options) A column of buttons.static StaticColorEditorcolor(String id, String name, int rgb, IntConsumer onSave) A color picker.static ConfirmEditorA message with Cancel and Confirm.static GuiEditors.FormBuilderText fields and buttons.static GuiEditors.ListBuilderA list of rows with an optional text field and buttons below it.static NoticeEditorA message card.static NumberEditornumber(String id, String label, double value, double min, double max, boolean integer, DoubleConsumer onSet) Typed entry for one number, with Cancel, Reset and Set.
-
Method Details
-
confirm
-
choice
A column of buttons. Pressing one closes the editor and then runs it. -
number
public static NumberEditor number(String id, String label, double value, double min, double max, boolean integer, DoubleConsumer onSet) Typed entry for one number, with Cancel, Reset and Set. Set passes the typed value, clamped tomin..max; Reset passesvalue.- Parameters:
label- What the number is, shown as the titleinteger- Whether only whole numbers can be typed
-
color
A color picker. Save closes it and passes the color as RGB, without alpha.- Parameters:
name- What the color is, shown in the titlergb- Starting color
-
bind
Waits for the next key or mouse button, then closes. Escape gives a cleared bind (new Bind(false, -1)). Always shown on a screen of its own. -
notice
-
form
Text fields and buttons.- Parameters:
prompt- Line shown above the fields
-
list
-