Skip to content

Commit

Permalink
MiniScript: console.log -> console.printLine
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasdr committed Jan 25, 2024
1 parent de99fb5 commit c2578b6
Show file tree
Hide file tree
Showing 33 changed files with 1,333 additions and 1,333 deletions.
106 changes: 53 additions & 53 deletions resources/engine/templates/tscript/gui_script_template.tscript
Original file line number Diff line number Diff line change
@@ -1,109 +1,109 @@
# initialize
function: initialize()
console.log("----------------------------------------------------------")
console.log("initialize(): " + gui.screennode.getId())
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("initialize(): " + gui.screennode.getId())
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on action
function: onAction($actionType, $elementNodeId)
console.log("----------------------------------------------------------")
console.log("onAction(): " + gui.screennode.getId() + ": " + $elementNodeId + "(" + $actionType + ")")
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onAction(): " + gui.screennode.getId() + ": " + $elementNodeId + "(" + $actionType + ")")
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on change
function: onChange($elementNodeId)
console.log("----------------------------------------------------------")
console.log("onChange(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onChange(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on mouse over
function: onMouseOver($elementNodeId)
console.log("----------------------------------------------------------")
console.log("onMouseOver(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onMouseOver(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on context menu request
function: onContextMenuRequest($elementNodeId, $mouseX, $mouseY)
console.log("----------------------------------------------------------")
console.log("onContextMenuRequest(): " + gui.screennode.getId() + ": " + $elementNodeId + "@" + $mouseX + ", " + $mouseY)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onContextMenuRequest(): " + gui.screennode.getId() + ": " + $elementNodeId + "@" + $mouseX + ", " + $mouseY)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on focus
function: onFocus($elementNodeId)
console.log("----------------------------------------------------------")
console.log("onFocus(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onFocus(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on unfocus
function: onUnfocus($elementNodeId)
console.log("----------------------------------------------------------")
console.log("onUnfocus(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onUnfocus(): " + gui.screennode.getId() + ": " + $elementNodeId)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on move
function: onMove($nodeId)
console.log("----------------------------------------------------------")
console.log("onMove(): " + gui.screennode.getId() + ": " + $nodeId)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onMove(): " + gui.screennode.getId() + ": " + $nodeId)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on move release
function: onMoveRelease($nodeId, $mouseX, $mouseY)
console.log("----------------------------------------------------------")
console.log("onMoveRelease(): " + gui.screennode.getId() + ": " + $nodeId + "@" + $mouseX + ", " + $mouseY)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onMoveRelease(): " + gui.screennode.getId() + ": " + $nodeId + "@" + $mouseX + ", " + $mouseY)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on tooltip show request
function: onTooltipShowRequest($nodeId, $mouseX, $mouseY)
console.log("----------------------------------------------------------")
console.log("onTooltipShowRequest(): " + gui.screennode.getId() + ": " + $nodeId + "@" + $mouseX + ", " + $mouseY)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onTooltipShowRequest(): " + gui.screennode.getId() + ": " + $nodeId + "@" + $mouseX + ", " + $mouseY)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on tooltip close request
function: onTooltipCloseRequest()
console.log("----------------------------------------------------------")
console.log("onTooltipCloseRequest(): " + gui.screennode.getId() + ": " + $nodeId + "@" + $mouseX + ", " + $mouseY)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onTooltipCloseRequest(): " + gui.screennode.getId() + ": " + $nodeId + "@" + $mouseX + ", " + $mouseY)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on drag request
function: onDragRequest($elementNodeId, $mouseX, $mouseY)
console.log("----------------------------------------------------------")
console.log("onDragRequest(): " + gui.screennode.getId() + ": " + $elementNodeId + "@" + $mouseX + ", " + $mouseY)
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onDragRequest(): " + gui.screennode.getId() + ": " + $elementNodeId + "@" + $mouseX + ", " + $mouseY)
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on tick
function: onTick()
console.log("----------------------------------------------------------")
console.log("onTick(): " + gui.screennode.getId())
console.log("----------------------------------------------------------")
console.log()
console.printLine("----------------------------------------------------------")
console.printLine("onTick(): " + gui.screennode.getId())
console.printLine("----------------------------------------------------------")
console.printLine()
end

# on error
on: error
console.log("An error occurred")
console.printLine("An error occurred")
script.stop()
end
70 changes: 35 additions & 35 deletions resources/engine/templates/tscript/logic_script_template.tscript
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
# on logic added
function: onLogicAdded()
console.log("-----------------------------")
console.log("onLogicAdded(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("onLogicAdded(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# initialize engine
function: initializeEngine()
console.log("-----------------------------")
console.log("initializeEngine(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("initializeEngine(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# update engine
function: updateEngine()
console.log("-----------------------------")
console.log("updateEngine(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("updateEngine(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# initialize logic
function: initializeLogic()
console.log("-----------------------------")
console.log("initializeLogic(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("initializeLogic(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# update logic
function: updateLogic()
console.log("-----------------------------")
console.log("updateLogic(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("updateLogic(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# on logics processed
function: onLogicsProcessed()
console.log("-----------------------------")
console.log("onLogicsProcessed(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("onLogicsProcessed(): " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# on initialize
on: initialize
console.log("-----------------------------")
console.log("on: initialize: " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("on: initialize: " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# if no condition is met, nothing will be executed, lol :D
on: nothing
console.log("-----------------------------")
console.log("on-nothing: " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.log()
console.printLine("-----------------------------")
console.printLine("on-nothing: " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
console.printLine()
end

# on error
on: error
console.log("-----------------------------")
console.log("on-error: " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.log("-----------------------------")
console.printLine("-----------------------------")
console.printLine("on-error: " + logic.getId() + ", hierarchy id: " + logic.getHierarchyId() + ", hierarchy parent id: " + logic.getHierarchyParentId())
console.printLine("-----------------------------")
script.stop()
end
2 changes: 1 addition & 1 deletion resources/miniscript/templates/cli/statements.tscript
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
on: error
console.log("An error has occurred. Exiting")
console.printLine("An error has occurred. Exiting")
script.stop()
end

Expand Down
Loading

0 comments on commit c2578b6

Please sign in to comment.