mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Used IScriptUnit hook stub generation
This commit is contained in:
1 parent
92cd894f39
commit
fbcda09fe2
1 file changed
+8
-1
@@ -332,10 +332,17 @@ public class GuiScriptInterface extends GuiNPCInterface implements GuiYesNoCallb
|
||||
public void customScrollClicked(int i, int j, int k, GuiCustomScroll scroll) {
|
||||
String hook = scroll.getSelected();
|
||||
if (previousHookClicked.equals(hook)) {
|
||||
IScriptUnit container = getCurrentContainer();
|
||||
if (container == null)
|
||||
return;
|
||||
|
||||
String addString = "";
|
||||
if (!this.getTextField(2).getText().isEmpty())
|
||||
addString += "\n";
|
||||
addString += "function " + hook + "(event) {\n \n}\n";
|
||||
|
||||
// Generate the appropriate stub based on language
|
||||
// hook is already the proper method name from EnumScriptType.function
|
||||
addString += container.generateHookStub(hook, null);
|
||||
|
||||
this.getTextField(2).setText(this.getTextField(2).getText() + addString);
|
||||
previousHookClicked = "";
|
||||
|
||||
Reference in new issue
Block a user