-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_menu.go
49 lines (36 loc) · 1.19 KB
/
main_menu.go
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
package main
type MainMenu struct {
GenericWidgetContainerScreen
}
func (s *MainMenu) LoadResources() {
rm := ResourceManager_GetInstance()
rm.LoadImage("assets/gui/button.png")
rm.LoadImage("assets/gui/gui_frame_herb.png")
rm.LoadSound("sound/bgm_main_menu.ogg")
}
func (s *MainMenu) ProcessKeyEvents() bool {
return s.GenericWidgetContainerScreen.ProcessKeyEvents()
}
func (s *MainMenu) Update() {
s.GenericWidgetContainerScreen.Update()
s.ProcessKeyEvents()
}
func CreateMainMenu(g *Game) *MainMenu {
s := new(MainMenu)
s.IScreen = s
s.game = g
s.title = "Main Menu"
s.widgets = append(s.widgets, CreateCommonButton(g, I18n("string_new_game", "New Game"), func(*Game) {
g.SetScreen(NewGameplayScreen(g))
}))
s.widgets = append(s.widgets, CreateCommonButton(g, I18n("string_load_save", "Load Save"), func(*Game) {
}))
s.widgets = append(s.widgets, CreateCommonButton(g, I18n("string_settings", "Settings"), func(*Game) {
//g.SetScreen(NewSettingsScreen(g))
}))
s.widgets = append(s.widgets, CreateCommonButton(g, I18n("string_exit", "Exit"), func(*Game) {
g.SetScreen(NewFarewellScreen(g))
}))
s.SetInitialFocus()
return s
}