-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.js
executable file
·107 lines (81 loc) · 2.65 KB
/
menu.js
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
import { GAME_INTRO, GAME_PRE_MENU, GAME_MENU, GAME_INGAME, PT_BR, EN_US } from "modules/global_constants.js"
import { getText } from "lang/lang.js"
import { createVerticalInteractiveDialog } from "modules/interactive_dialog.js"
import { globalVariables } from "modules/savefile.js"
import * as fonts from "modules/fonts.js"
import * as text_utils from "modules/text_utils.js"
let splash = new Image("images/splash.png")
splash.height = 448
let cross = new Image("images/cross.png")
cross.width *= 2
cross.height *= 2
let square = new Image("images/square.png")
square.width *= 2
square.height *= 2
let triangle = new Image("images/triangle.png")
triangle.width *= 2
triangle.height *= 2
let timerValue = 0
export function preMenuScene(pad, timer)
{
pad.update()
timerValue = Timer.getTime(timer)
Screen.clear()
splash.draw(0, 0)
if (timerValue > 1400) {
fonts.dtm_mono.print(200, 350, getText(0, "menuText"))
}
if (pad.justPressed(Pads.CROSS) || pad.justPressed(Pads.START)) {
return GAME_MENU
}
Screen.flip()
}
fonts.dtm_mono_smaller.color = Color.new(75, 75, 75)
fonts.dtm_mono_smaller.scale = 0.5f
let inConfigScreen = false
export function menuScene(pad)
{
pad.update()
Screen.clear()
if (inConfigScreen) {
let interactiveDialog = createVerticalInteractiveDialog(pad, 10, 10, getText(9, "menuText") + "\n" + getText(8, "menuText"))
if (interactiveDialog == 0) {
if (globalVariables.language == EN_US) {
globalVariables.language = PT_BR
} else if (globalVariables.language == PT_BR) {
globalVariables.language = EN_US
}
} else if (interactiveDialog == 1) {
globalVariables.saveFile()
inConfigScreen = false
}
} else {
let interactiveDialog = createVerticalInteractiveDialog(pad, 160, 290, getText(6, "menuText") + "\n" + getText(7, "menuText"))
if (interactiveDialog == 0) {
return GAME_INGAME
} else if (interactiveDialog == 1) {
inConfigScreen = true
}
text_utils.drawText(160, 35, fonts.dtm_mono, getText(1, "menuText"), 35)
cross.draw(160, 80)
text_utils.drawText(195, 80, fonts.dtm_mono, getText(2, "menuText"), 35)
square.draw(160, 115)
text_utils.drawText(195, 115, fonts.dtm_mono, getText(3, "menuText"), 35)
triangle.draw(160, 150)
text_utils.drawText(195, 150, fonts.dtm_mono, getText(4, "menuText"), 35)
text_utils.drawText(160, 200, fonts.dtm_mono, getText(5, "menuText"), 35)
text_utils.drawText(0, 420, fonts.dtm_mono_smaller, "UNDERTALE V1.08 (C) TOBY FOX 2015-2017, PS2 REMAKE BY PABLO, ATHENAENV BY DANIEL.", 35)
}
Screen.flip()
}
export function menu_gc()
{
preMenuScene = null
menuScene = null
splash = null
cross = null
square = null
triangle = null
timerValue = null
std.gc()
}