-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawli-tts-options.rb
More file actions
97 lines (90 loc) · 2.46 KB
/
crawli-tts-options.rb
File metadata and controls
97 lines (90 loc) · 2.46 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class PokemonOptionScene
def pbOptions
pbActivateWindow(@sprites,"option"){
### MODDED/
lastread = nil
if @sprites["option"].options
opt = @sprites["option"].options[0]
tts(opt.name)
opt.current(@sprites["option"][0])
lastread = opt.name
end
### /MODDED
loop do
Graphics.update
Input.update
pbUpdate
if @sprites["option"].mustUpdateOptions
# Set the values of each option
for i in 0...OptionList.length
OptionList[i].set(@sprites["option"][i])
end
@sprites["textbox"].setSkin(MessageConfig.pbGetSpeechFrame())
@sprites["textbox"].width=@sprites["textbox"].width # Necessary evil
pbSetSystemFont(@sprites["textbox"].contents)
if @sprites["option"].options[@sprites["option"].index].description.is_a?(Proc)
@sprites["textbox"].text=@sprites["option"].options[@sprites["option"].index].description.call
else
@sprites["textbox"].text=@sprites["option"].options[@sprites["option"].index].description
end
### MODDED/
opt = @sprites["option"].options[@sprites["option"].index]
if opt.name != lastread
tts(opt.name)
opt.current(@sprites["option"][@sprites["option"].index])
tts(@sprites["textbox"].text)
lastread = opt.name
end
### /MODDED
end
if Input.trigger?(Input::B)
saveClientData
break
end
if Input.trigger?(Input::C) && @sprites["option"].index==OptionList.length
break
end
end
}
end
end
class EnumOption
def next(current)
index=current+1
index=@values.length-1 if index>@values.length-1
tts(@values[index]) ### MODDED
return index
end
def prev(current)
index=current-1
index=0 if index<0
tts(@values[index]) ### MODDED
return index
end
def current(index)
tts(@values[index])
end
end
class NumberOption
def next(current)
index=current+@optstart
index+=1
if index>@optend
index=@optstart
end
tts(index.to_s) ### MODDED
return index-@optstart
end
def prev(current)
index=current+@optstart
index-=1
if index<@optstart
index=@optend
end
tts(index.to_s) ### MODDED
return index-@optstart
end
def current(index)
tts((index + @optstart).to_s)
end
end