Class CodeEditor
java.lang.Object
de.luckymcdev.foundryengine.client.editor.panel.Panel
de.luckymcdev.foundryengine.client.editor.panel.editor.EditorPanel
de.luckymcdev.foundryengine.client.editor.panel.files.CodeEditor
InGame Code editor. May be replaced with MonacoFx at some point IDK yet.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface for delegating save operations to the caller.Nested classes/interfaces inherited from class Panel
Panel.Builder -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCodeEditor(net.minecraft.resources.Identifier id, String fileName, String source) Creates a new CodeEditor panel. -
Method Summary
Modifier and TypeMethodDescriptionvoidcontent()floatReturns the current font-scale multiplier (default1.0f).imgui.extension.texteditor.TextEditorReturns the underlyingTextEditorfor advanced configuration.booleanisDirty()Returnstrueif the editor content differs from the last saved state.voidReplaces the current file content with new data and resets editor state.voidonClosed()voidsetFontScale(float fontScale) Directly sets the font-scale multiplier.voidsetSaveCallback(CodeEditor.SaveCallback saveCallback) Registers a new save callback, replacing any previously set one.Methods inherited from class EditorPanel
beginContent, endContent, setStatusMethods inherited from class Panel
close, customFlags, getFormattedLabel, getId, getLabel, getShortcut, handleRender, handleTick, isFocused, isOpen, menuBar, onOpened, open, requireLevel, requireLevel, requireLevelOnServer, requireLocal, requireWorld, requireWorld, setDefaultRequirements, tick
-
Field Details
-
customLangOverride
public boolean customLangOverride -
forceReadOnly
public boolean forceReadOnly
-
-
Constructor Details
-
CodeEditor
-
-
Method Details
-
load
-
isDirty
public boolean isDirty()Returnstrueif the editor content differs from the last saved state. -
content
-
onClosed
-
setSaveCallback
Registers a new save callback, replacing any previously set one. -
getTextEditor
public imgui.extension.texteditor.TextEditor getTextEditor()Returns the underlyingTextEditorfor advanced configuration. -
getFontScale
public float getFontScale()Returns the current font-scale multiplier (default1.0f). -
setFontScale
public void setFontScale(float fontScale) Directly sets the font-scale multiplier.- Parameters:
fontScale- Value clamped to [FONT_SCALE_MIN,FONT_SCALE_MAX].
-