forked from libretro/ludo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scene_quick.go
110 lines (92 loc) · 2.08 KB
/
scene_quick.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
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
package menu
import (
ntf "github.com/libretro/ludo/notifications"
"github.com/libretro/ludo/savestates"
"github.com/libretro/ludo/state"
)
type screenQuick struct {
entry
}
func buildQuickMenu() Scene {
var list screenQuick
list.label = "Quick Menu"
list.children = append(list.children, entry{
label: "Resume",
icon: "resume",
callbackOK: func() {
state.Global.MenuActive = false
},
})
list.children = append(list.children, entry{
label: "Reset",
icon: "reset",
callbackOK: func() {
state.Global.Core.Reset()
state.Global.MenuActive = false
},
})
list.children = append(list.children, entry{
label: "Save State",
icon: "savestate",
callbackOK: func() {
err := savestates.Save()
if err != nil {
ntf.DisplayAndLog(ntf.Error, "Menu", err.Error())
} else {
ntf.DisplayAndLog(ntf.Success, "Menu", "State saved.")
}
},
})
list.children = append(list.children, entry{
label: "Load State",
icon: "loadstate",
callbackOK: func() {
err := savestates.Load()
if err != nil {
ntf.DisplayAndLog(ntf.Error, "Menu", err.Error())
} else {
state.Global.MenuActive = false
ntf.DisplayAndLog(ntf.Success, "Menu", "State loaded.")
}
},
})
list.children = append(list.children, entry{
label: "Take Screenshot",
icon: "screenshot",
callbackOK: func() {
vid.TakeScreenshot()
ntf.DisplayAndLog(ntf.Success, "Menu", "Took a screenshot.")
},
})
list.children = append(list.children, entry{
label: "Options",
icon: "subsetting",
callbackOK: func() {
list.segueNext()
menu.stack = append(menu.stack, buildCoreOptions())
},
})
list.segueMount()
return &list
}
func (s *screenQuick) Entry() *entry {
return &s.entry
}
func (s *screenQuick) segueMount() {
genericSegueMount(&s.entry)
}
func (s *screenQuick) segueNext() {
genericSegueNext(&s.entry)
}
func (s *screenQuick) segueBack() {
genericAnimate(&s.entry)
}
func (s *screenQuick) update() {
genericInput(&s.entry)
}
func (s *screenQuick) render() {
genericRender(&s.entry)
}
func (s *screenQuick) drawHintBar() {
genericDrawHintBar()
}