Class CodeEditor

java.lang.Object
foundry.veil.api.client.imgui.CodeEditor
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource

public class CodeEditor extends Object implements org.lwjgl.system.NativeResource
Creates a text editor window with saving callback support.
  • Constructor Details

    • CodeEditor

      public CodeEditor(@Nullable @Nullable net.minecraft.network.chat.Component saveText)
  • Method Details

    • hasTextChanged

      public boolean hasTextChanged()
      Returns:
      Whether the text has changed since last save
    • save

      public void save()
      Fires the save callback if the text has changed.
    • show

      public void show(@Nullable @Nullable String fileName, String source)
      Shows the editor with the specified source.
      Parameters:
      source - The source to display
    • hide

      public void hide()
      Attempts to hide and save the editor.
    • renderWindow

      public void renderWindow()
      Renders the editor in a closable window.
    • render

      public void render()
      Renders the editor onto the stack.
    • getEditor

      public imgui.extension.texteditor.TextEditor getEditor()
    • setSaveCallback

      public void setSaveCallback(@Nullable @Nullable CodeEditor.SaveCallback saveCallback)
    • free

      public void free()
      Specified by:
      free in interface org.lwjgl.system.NativeResource