Skip to content

Commit ad63c02

Browse files
committed
JASS native BlzLoadTOCFile
1 parent 3eb0d21 commit ad63c02

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • core/src/com/etheller/warsmash/parsers/jass

core/src/com/etheller/warsmash/parsers/jass/Jass2.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,18 @@ public JUIEnvironment(final JassProgram jassProgramVisitor, final DataSource dat
447447
rootFrameListener.onCreate(gameUI);
448448
return new HandleJassValue(frameHandleType, gameUI);
449449
});
450+
jassProgramVisitor.getJassNativeManager().createNative("BlzLoadTOCFile",
451+
(arguments, globalScope, triggerScope) -> {
452+
final String tocFileName = nullableWithWarning(arguments, 0, StringJassValueVisitor.getInstance(), globalScope, triggerScope);
453+
if (tocFileName != null) {
454+
try {
455+
JUIEnvironment.this.gameUI.loadTOCFile(tocFileName);
456+
} catch (final IOException e) {
457+
throw new RuntimeException(e);
458+
}
459+
}
460+
return BooleanJassValue.TRUE;
461+
});
450462
jassProgramVisitor.getJassNativeManager().createNative("LoadTOCFile",
451463
(arguments, globalScope, triggerScope) -> {
452464
final String tocFileName = arguments.get(0).visit(StringJassValueVisitor.getInstance());

0 commit comments

Comments
 (0)