-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathglossary.script
184 lines (152 loc) · 8.95 KB
/
glossary.script
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
;Glossary
*EN_glossary
E_A ;Stop currently playing song
setwindow 31,16,22,16,22,22,0,2,20,1,1,#ffffff,0,0,639,479
textclear
rmode 0 ;Setting right click's action
erasetextwindow 0
csp -1 ;Clear sprite memory
btndef "" ;Clear buttons from memory
;Sound effects and stuff upon entering
seplay 9,82
seplay 10,82
bg black,4
;Dataset
mov %EN_glossary_page_max,2 ;Number of total pages
mov %EN_glossary_page_view,1 ;Page at which the glossary opens at/current page
mov %EN_glossary_current_hint,0 ;Current hint displayed
;Selects a random BGM from these choices and plays it
rnd2 %ran,1,2
if %ran = 1 mov $BGM_Play,"bgm0\d_7.ogg": mov %Set_vol,85 : gosub *BGM_Play_Mord
if %ran = 2 mov $BGM_Play,"bgm0\d_10.ogg": mov %Set_vol,75 : gosub *BGM_Play_Mord
~
*EN_glossary_loop_1
;Basic View button image
mov %Free4,410
lsp 698,":c;bmp\system\hane_glossary.bmp",-0,6,210
lsp 890,":c;bmp\r_click\r_back.bmp",-0,6,80 ;Background image
lsp 850,":c;bmp\r_click\text\txt_def.bmp",315,29,80 ;Notebook image
lsp 101,":a/2,0,3;bmp\r_click\btn\Left.BMP",330,%Free4 -10 ;To the previous image^101
lsp 102,":a/2,0,3;bmp\r_click\btn\Right.BMP",400,%Free4 -10 ;To the next image^102
lsp rmenu_btn_Exit,":a/2,0,3;bmp\r_click\btn\exit.BMP",480,%Free4 + 20,230 ;Exit
gosub *EN_glossary_page_mode ;Set page's buttons to their default state
;Clear the last button in memory
btndef ""
;Define the buttons which will be used globally throughout the glossary
spbtn 101,1 ;back
spbtn 102,2 ;next
spbtn rmenu_btn_Exit,4 ;exit
spbtn EN_hint_button_0,5 ;hint button start
spbtn EN_hint_button_1,6
spbtn EN_hint_button_2,7
spbtn EN_hint_button_3,8
spbtn EN_hint_button_4,9
spbtn EN_hint_button_5,10
spbtn EN_hint_button_6,11
spbtn EN_hint_button_7,12 ;hint button end
btnwait2 %BtnRes
if %BtnRes = -1 : goto *EN_glossary_mode_end ;Right click?
if %BtnRes = 0 : goto *EN_glossary_loop_1 ;Left click?
if %BtnRes = 1 se1v 1010,40 : gosub *EN_glossary_back : gosub *EN_glossary_page_mode ;Back
if %BtnRes = 2 se1v 1010,40 : gosub *EN_glossary_next : gosub *EN_glossary_page_mode ;Next
if %BtnRes = 4 goto *EN_glossary_mode_end ;exit
if %BtnRes = 5 mov %EN_glossary_current_hint, 0 : gosub *EN_glossary_button_mode
if %BtnRes = 6 mov %EN_glossary_current_hint, 1 : gosub *EN_glossary_button_mode
if %BtnRes = 7 mov %EN_glossary_current_hint, 2 : gosub *EN_glossary_button_mode
if %BtnRes = 8 mov %EN_glossary_current_hint, 3 : gosub *EN_glossary_button_mode
if %BtnRes = 9 mov %EN_glossary_current_hint, 4 : gosub *EN_glossary_button_mode
if %BtnRes = 10 mov %EN_glossary_current_hint, 5 : gosub *EN_glossary_button_mode
if %BtnRes = 11 mov %EN_glossary_current_hint, 6 : gosub *EN_glossary_button_mode
if %BtnRes = 12 mov %EN_glossary_current_hint, 7 : gosub *EN_glossary_button_mode
goto *EN_glossary_loop_1 ;Return to Loop Point
reset
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
;Subroutine for processing a back button push (going -1 page)
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*EN_glossary_back
dec %EN_glossary_page_view ;Decrement current page by 1
; If we go past the beginning of the list, we go back to the last element.
if %EN_glossary_page_view = 0 : mov %EN_glossary_page_view,%EN_glossary_page_max
return
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
;Subroutine for processing a next button push (going +1 page)
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*EN_glossary_next
inc %EN_glossary_page_view ;Increment current page by 1
;If we go further than the end of the list, we go back to the beginning.
if %EN_glossary_page_view = %EN_glossary_page_max + 1 : mov %EN_glossary_page_view,1
return
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*EN_glossary_page_mode ;Page switch routine
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
;Will update what the buttons look like depending on the page
;Note that each buttton has different text on it.
;Coordinate setting
mov %Free4,24 ;X coordinate of top left button
mov %Free5,129 ;Y coordinate of top left button
mov %Free6,42 ;dY between two buttons
;Clean up all button sprites to reload them
csp EN_hint_button_0
csp EN_hint_button_1
csp EN_hint_button_2
csp EN_hint_button_3
csp EN_hint_button_4
csp EN_hint_button_5
csp EN_hint_button_6
csp EN_hint_button_7
if %EN_glossary_page_view==1 && %EN_glossary_progress>0 lsp EN_hint_button_0,":a/2,0,3;bmp\glos_btn\output0.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==1 && %EN_glossary_progress>1 lsp EN_hint_button_1,":a/2,0,3;bmp\glos_btn\output1.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==1 && %EN_glossary_progress>2 lsp EN_hint_button_2,":a/2,0,3;bmp\glos_btn\output2.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==1 && %EN_glossary_progress>3 lsp EN_hint_button_3,":a/2,0,3;bmp\glos_btn\output3.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==1 && %EN_glossary_progress>4 lsp EN_hint_button_4,":a/2,0,3;bmp\glos_btn\output4.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==1 && %EN_glossary_progress>5 lsp EN_hint_button_5,":a/2,0,3;bmp\glos_btn\output5.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==1 && %EN_glossary_progress>6 lsp EN_hint_button_6,":a/2,0,3;bmp\glos_btn\output6.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==1 && %EN_glossary_progress>7 lsp EN_hint_button_7,":a/2,0,3;bmp\glos_btn\output7.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>8 lsp EN_hint_button_0,":a/2,0,3;bmp\glos_btn\output8.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>9 lsp EN_hint_button_1,":a/2,0,3;bmp\glos_btn\output9.bmp", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>10 lsp EN_hint_button_2,":a/2,0,3;", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>11 lsp EN_hint_button_3,":a/2,0,3;", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>12 lsp EN_hint_button_4,":a/2,0,3;", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>13 lsp EN_hint_button_5,":a/2,0,3;", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>14 lsp EN_hint_button_6,":a/2,0,3;", %Free4, %Free5 : add %Free5, %Free6
if %EN_glossary_page_view==2 && %EN_glossary_progress>15 lsp EN_hint_button_7,":a/2,0,3;", %Free4, %Free5 : add %Free5, %Free6
return
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*EN_glossary_button_mode ;Button press handling routine
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
; Depending on the current page and the last button pressed, will display the appropriate glossary term.
;Coordinate setting
mov %Free2,345 ;X coordinate of text
mov %Free3,0 ;Y coordinate of text
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==0 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_1.bmp",%Free2,%Free3
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==1 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_2.bmp",%Free2,%Free3
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==2 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_3.bmp",%Free2,%Free3
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==3 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_4.bmp",%Free2,%Free3
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==4 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_5.bmp",%Free2,%Free3
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==5 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_6.bmp",%Free2,%Free3
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==6 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_7.bmp",%Free2,%Free3
if %EN_glossary_page_view==1 && %EN_glossary_current_hint==7 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_8.bmp",%Free2,%Free3
if %EN_glossary_page_view==2 && %EN_glossary_current_hint==0 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_9.bmp",%Free2,%Free3
if %EN_glossary_page_view==2 && %EN_glossary_current_hint==1 lsp rmenu_back, ":a;bmp\r_click\text\glos\gls_10.bmp",%Free2,%Free3
return
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*EN_glossary_mode_end ;Post-processing
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
;Let's clean up after ourselves
csp -1 ;Clear sprite memory
btndef "" ;CLear button memory
setwindow 31,16,22,16,26,26,0,2,20,1,1,#999999,0,0,639,479
erasetextwindow 1
rmode 1
mono 0
E_A
seplay 9,82
print 1
cl a,1
texton
if %monoflg = 1 mono 1
if %monoflg = 2 mono 2
wait 1000
mov %title_skip,1
reset
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-