-
Notifications
You must be signed in to change notification settings - Fork 12
/
Extra Event Code++.rb
53 lines (50 loc) · 1.54 KB
/
Extra Event Code++.rb
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
#===============================================================================
# TheoAllen - Extra Event Code Plus Plus
#===============================================================================
# <init>
# ...Script...
# </init>
# Script that will be executed once per event page switch
#
# <parallel: method_name>
# Script that will be execute parallel, using the method name
#===============================================================================
# ** Game_Event
#===============================================================================
class Game_Event
ParallelEXE_Start = /<init>/i
ParallelEXE_End = /<\/init>/i
InitMethod = /<init\s*:\s*(.+)>/i
CreateREGEX = /<create\s*:\s*(.+)>/i
ParallelProc = /<parallel\s*:\s*(.+)>/i
alias theo_parallel_exe_setup_page_settings setup_page_settings
def setup_page_settings
theo_parallel_exe_setup_page_settings
load = false
code = ""
@parallel_method = nil
@list.each do |cmd|
next unless [108, 408].include?(cmd.code)
case cmd.parameters[0]
when InitMethod
method($1.to_s).call
when ParallelProc
@parallel_method = $1.to_s
when ParallelEXE_Start
load = true
code = ""
when ParallelEXE_End
load = false
else
next unless load
code += cmd.parameters[0] + "\n"
end
end if @list
eval(code)
end
alias theo_parallel_exe_update update
def update
theo_parallel_exe_update
method(@parallel_method).call if @parallel_method && !@interpreter
end
end