-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptsLoader.lua
More file actions
72 lines (61 loc) · 1.74 KB
/
Copy pathScriptsLoader.lua
File metadata and controls
72 lines (61 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name = "Modulable Script Manager"
author = "Melt"
description = [[Manage loading different scripts.]]
local ScriptManager = require "Lib/ScriptManager"
local scriptManager = nil
function onStart()
scriptManager = ScriptManager:new(scriptManager)
scriptManager:updateScript()
end
function onResume()
if scriptManager.selected then
log("Resume Script ➜ " .. scriptManager.selected:message())
scriptManager.selected:onResume()
end
end
function onPause()
if scriptManager.selected then
log("Pause Script ➜ " .. scriptManager.selected:message())
scriptManager.selected:onPause()
end
end
function onStop()
if scriptManager.selected then
log("Stop Script ➜ " .. scriptManager.selected:message())
scriptManager.selected:onStop()
scriptManager.selected = nil
end
end
function onPathAction()
if scriptManager:updateScript() then
scriptManager.selected:path()
end
if scriptManager.isOver then
fatal("No more script to do. Manager terminated.")
end
end
function onBattleAction()
if scriptManager:updateScript() then
scriptManager.selected:battle()
end
end
function onDialogMessage(message)
if scriptManager.selected then
scriptManager.selected:onDialogMessage(message)
end
end
function onBattleMessage(message)
if scriptManager:updateScript() then
scriptManager.selected:onBattleMessage(message)
end
end
function onSystemMessage(message)
if scriptManager.selected then
scriptManager.selected:onSystemMessage(message)
end
end
function onLearningMove(moveName, pokemonIndex)
if scriptManager:updateScript() then
scriptManager.selected:onLearningMove(moveName, pokemonIndex)
end
end