mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 18:57:32 +00:00
Add Script Context and better parsing for d.ts handling
This commit is contained in:
1 parent
a5c02e6c94
commit
78f7fa65f1
13 files changed
+831
-67
No files matched your search
@@ -22,6 +22,7 @@ import noppes.npcs.client.gui.util.script.interpreter.hover.HoverState;
|
||||
import noppes.npcs.client.gui.util.script.interpreter.hover.TokenHoverRenderer;
|
||||
import noppes.npcs.client.gui.util.script.autocomplete.AutocompleteManager;
|
||||
import noppes.npcs.client.key.impl.ScriptEditorKeys;
|
||||
import noppes.npcs.constants.ScriptContext;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
@@ -2629,6 +2630,27 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
return this.container != null ? this.container.getLanguage() : "ECMAScript";
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the script context (NPC, PLAYER, BLOCK, ITEM, etc.).
|
||||
* This determines which hooks and event types are available for autocomplete.
|
||||
*
|
||||
* @param context The script context
|
||||
*/
|
||||
public void setScriptContext(ScriptContext context) {
|
||||
if (this.container != null) {
|
||||
this.container.setScriptContext(context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current script context.
|
||||
*
|
||||
* @return The script context (NPC, PLAYER, BLOCK, ITEM, etc.)
|
||||
*/
|
||||
public ScriptContext getScriptContext() {
|
||||
return this.container != null ? this.container.getScriptContext() : ScriptContext.GLOBAL;
|
||||
}
|
||||
|
||||
public void setListener(ITextChangeListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user