nope, it's a hopeless mess
BIN
src/assets/sprites/backward.png
Normal file
|
After Width: | Height: | Size: 847 B |
BIN
src/assets/sprites/empty.png
Normal file
|
After Width: | Height: | Size: 593 B |
BIN
src/assets/sprites/forward.png
Normal file
|
After Width: | Height: | Size: 833 B |
BIN
src/assets/sprites/grid.png
Normal file
|
After Width: | Height: | Size: 602 B |
BIN
src/assets/sprites/help.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/sprites/insert.png
Normal file
|
After Width: | Height: | Size: 969 B |
BIN
src/assets/sprites/mark.png
Normal file
|
After Width: | Height: | Size: 635 B |
BIN
src/assets/sprites/media-playback-start.png
Normal file
|
After Width: | Height: | Size: 674 B |
BIN
src/assets/sprites/menu.png
Normal file
|
After Width: | Height: | Size: 574 B |
BIN
src/assets/sprites/nogrid.png
Normal file
|
After Width: | Height: | Size: 579 B |
BIN
src/assets/sprites/options.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/sprites/paste-rle.png
Normal file
|
After Width: | Height: | Size: 880 B |
BIN
src/assets/sprites/pause.png
Normal file
|
After Width: | Height: | Size: 580 B |
BIN
src/assets/sprites/save.png
Normal file
|
After Width: | Height: | Size: 728 B |
BIN
src/assets/sprites/zoom-fit-best.png
Normal file
|
After Width: | Height: | Size: 769 B |
BIN
src/assets/sprites/zoom-in.png
Normal file
|
After Width: | Height: | Size: 738 B |
BIN
src/assets/sprites/zoom-original.png
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
src/assets/sprites/zoom-out.png
Normal file
|
After Width: | Height: | Size: 748 B |
@@ -48,8 +48,10 @@ func (game *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
}
|
||||
|
||||
func (game *Game) Update() error {
|
||||
currentscene := game.GetCurrentScene()
|
||||
|
||||
for _, scene := range game.Scenes {
|
||||
if scene.IsPrimary() {
|
||||
if scene.IsPrimary() || scene == currentscene {
|
||||
if quit := scene.Update(); quit != nil {
|
||||
return quit
|
||||
}
|
||||
@@ -57,12 +59,11 @@ func (game *Game) Update() error {
|
||||
}
|
||||
}
|
||||
|
||||
scene := game.GetCurrentScene()
|
||||
next := scene.GetNext()
|
||||
next := currentscene.GetNext()
|
||||
|
||||
if next != game.CurrentScene {
|
||||
game.Scenes[next].SetPrevious(game.CurrentScene)
|
||||
scene.ResetNext()
|
||||
currentscene.ResetNext()
|
||||
game.CurrentScene = next
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"image/color"
|
||||
"os"
|
||||
|
||||
@@ -101,6 +102,7 @@ func (scene *SceneMenu) Init() {
|
||||
|
||||
options := NewMenuButton("Options",
|
||||
func(args *widget.ButtonClickedEventArgs) {
|
||||
fmt.Println("menu => options")
|
||||
scene.SetNext(Options)
|
||||
})
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"image/color"
|
||||
"os"
|
||||
|
||||
"github.com/ebitenui/ebitenui"
|
||||
"github.com/ebitenui/ebitenui/widget"
|
||||
@@ -80,12 +80,13 @@ func (scene *SceneToolbar) SetInitialValue(w *widget.LabeledCheckbox, value bool
|
||||
func (scene *SceneToolbar) Init() {
|
||||
rowContainer := NewTopRowContainer("Toolbar")
|
||||
|
||||
cancel := NewMenuButton("Close",
|
||||
options := NewToolbarButton(Assets["options"],
|
||||
func(args *widget.ButtonClickedEventArgs) {
|
||||
os.Exit(0)
|
||||
fmt.Println("options")
|
||||
scene.SetNext(Options)
|
||||
})
|
||||
|
||||
rowContainer.AddChild(cancel)
|
||||
rowContainer.AddChild(options)
|
||||
|
||||
scene.Ui = &ebitenui.UI{
|
||||
Container: rowContainer.Container(),
|
||||
|
||||