mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
Add Script Context and better parsing for d.ts handling
This commit is contained in:
1 parent
cd92c340c7
commit
71dba15270
8 files changed
+253
-96
No files matched your search
@@ -11,6 +11,7 @@ import noppes.npcs.client.gui.util.key.OverlayKeyPresetViewer;
|
||||
import noppes.npcs.client.gui.util.script.*;
|
||||
import noppes.npcs.client.gui.util.script.JavaTextContainer.LineData;
|
||||
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;
|
||||
@@ -2159,6 +2160,27 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
this.container.formatCodeText();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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