Compare commits
No commits in common. "bd1d685c20634316881a276a6ac2b82728df764e" and "62cbe14170ea2312af5492a6a14980cb4dc62bfc" have entirely different histories.
bd1d685c20
...
62cbe14170
@ -5,13 +5,15 @@ import (
|
|||||||
"image/color"
|
"image/color"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"opslag.de/schobers/fs/ricefs"
|
||||||
"opslag.de/schobers/geom"
|
"opslag.de/schobers/geom"
|
||||||
"opslag.de/schobers/zntg"
|
"opslag.de/schobers/zntg"
|
||||||
"opslag.de/schobers/zntg/addons/riceres"
|
"opslag.de/schobers/zntg/addons/res"
|
||||||
"opslag.de/schobers/zntg/play"
|
"opslag.de/schobers/zntg/play"
|
||||||
"opslag.de/schobers/zntg/ui"
|
"opslag.de/schobers/zntg/ui"
|
||||||
|
|
||||||
rice "github.com/GeertJohan/go.rice"
|
rice "github.com/GeertJohan/go.rice"
|
||||||
|
"github.com/veandco/go-sdl2/sdl"
|
||||||
"opslag.de/schobers/tins2020"
|
"opslag.de/schobers/tins2020"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -26,8 +28,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func openResources(box *rice.Box) ui.Resources {
|
func openResources(box *rice.Box) ui.Resources {
|
||||||
embedded := riceres.New(box)
|
fs := ricefs.NewFs(box)
|
||||||
return ui.NewFallbackResources(ui.NewPathResources(nil, box.Name()), embedded)
|
resources, _ := res.NewAferoFallbackResources(`res`, fs, `botanim`)
|
||||||
|
return resources
|
||||||
}
|
}
|
||||||
|
|
||||||
type app struct {
|
type app struct {
|
||||||
@ -134,9 +137,8 @@ func run() error {
|
|||||||
}
|
}
|
||||||
defer settings.Store()
|
defer settings.Store()
|
||||||
|
|
||||||
var location *geom.PointF32
|
if settings.Window.Location == nil {
|
||||||
if settings.Window.Location != nil {
|
settings.Window.Location = ptPtr(sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED)
|
||||||
location = &geom.PointF32{X: float32(settings.Window.Location.X), Y: float32(settings.Window.Location.Y)}
|
|
||||||
}
|
}
|
||||||
if settings.Window.Size == nil {
|
if settings.Window.Size == nil {
|
||||||
settings.Window.Size = ptPtr(800, 600)
|
settings.Window.Size = ptPtr(800, 600)
|
||||||
@ -146,7 +148,7 @@ func run() error {
|
|||||||
settings.Window.VSync = &vsync
|
settings.Window.VSync = &vsync
|
||||||
}
|
}
|
||||||
renderer, err := ui.NewRenderer("Botanim - TINS 2020", settings.Window.Size.X, settings.Window.Size.Y, ui.NewRendererOptions{
|
renderer, err := ui.NewRenderer("Botanim - TINS 2020", settings.Window.Size.X, settings.Window.Size.Y, ui.NewRendererOptions{
|
||||||
Location: location,
|
Location: &geom.PointF32{X: float32(settings.Window.Location.X), Y: float32(settings.Window.Location.Y)},
|
||||||
Resizable: true,
|
Resizable: true,
|
||||||
VSync: *settings.Window.VSync,
|
VSync: *settings.Window.VSync,
|
||||||
})
|
})
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
// +build windows,allegro
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
// #cgo LDFLAGS: -Wl,-subsystem,windows
|
|
||||||
import "C"
|
|
@ -107,16 +107,16 @@ func (c *GameControls) Init(ctx ui.Context) {
|
|||||||
b.DisabledColor = zntg.MustHexColor("#AFAFAF")
|
b.DisabledColor = zntg.MustHexColor("#AFAFAF")
|
||||||
}),
|
}),
|
||||||
NewIconButtonConfigure("control-save", c.askUserBeforeSave, func(b *IconButton) {
|
NewIconButtonConfigure("control-save", c.askUserBeforeSave, func(b *IconButton) {
|
||||||
b.Tooltip = "Save game (key: Ctrl+S)"
|
b.Tooltip = "Save game"
|
||||||
}),
|
}),
|
||||||
NewIconButtonConfigure("control-load", c.askUserBeforeLoad, func(b *IconButton) {
|
NewIconButtonConfigure("control-load", c.askUserBeforeLoad, func(b *IconButton) {
|
||||||
b.Tooltip = "Load last saved game (key: Ctrl+L)"
|
b.Tooltip = "Load last saved game"
|
||||||
}),
|
}),
|
||||||
NewIconButtonConfigure("control-new", c.askUserBeforeNew, func(b *IconButton) {
|
NewIconButtonConfigure("control-new", c.askUserBeforeNew, func(b *IconButton) {
|
||||||
b.Tooltip = "Start new game (key: Ctrl+N)"
|
b.Tooltip = "Start new game"
|
||||||
}),
|
}),
|
||||||
NewIconButtonConfigure("control-information", c.dialogs.ShowIntro, func(b *IconButton) {
|
NewIconButtonConfigure("control-information", c.dialogs.ShowIntro, func(b *IconButton) {
|
||||||
b.Tooltip = "Show information/intro (key: Escape)"
|
b.Tooltip = "Show information/intro"
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
for i, child := range c.menu.Children {
|
for i, child := range c.menu.Children {
|
||||||
|
Loading…
Reference in New Issue
Block a user