Make animations work in the options screen
This commit is contained in:
@@ -30,7 +30,7 @@ type Widget struct {
|
||||
disabledImage *ebiten.Image
|
||||
|
||||
// These are expected to have the same dimensions as the Bounds
|
||||
hoverAnimation []*ebiten.Image
|
||||
hoverAnimation animation
|
||||
hoverState bool
|
||||
|
||||
// FIXME: We assume right mouse button isn't needed here
|
||||
@@ -38,7 +38,7 @@ type Widget struct {
|
||||
mouseButtonDownImage *ebiten.Image
|
||||
mouseButtonState bool
|
||||
|
||||
path []int
|
||||
path string
|
||||
record *menus.Record
|
||||
sprite *assetstore.Sprite
|
||||
|
||||
@@ -97,8 +97,8 @@ func (w *Widget) Image(aniStep int) (*ebiten.Image, error) {
|
||||
return w.mouseButtonDownImage, nil
|
||||
}
|
||||
|
||||
if w.hoverState && len(w.hoverAnimation) > 0 {
|
||||
return w.hoverAnimation[(aniStep)%len(w.hoverAnimation)], nil
|
||||
if w.hoverState && w.hoverAnimation != nil {
|
||||
return w.hoverAnimation.image(aniStep), nil
|
||||
}
|
||||
|
||||
if w.valueToImage != nil {
|
||||
|
Reference in New Issue
Block a user