Get the briefing menu linked up
Yes, that means hypertext is now a clickable.
This commit is contained in:
@@ -3,17 +3,22 @@ package flow
|
||||
func (f *Flow) linkBridge() {
|
||||
// FIXME: sometimes these doors are frozen, depending on game state
|
||||
|
||||
//f.onClick(bridge, "2.1", f.setDriver(briefing)) // TODO: Mission briefing clickable
|
||||
f.onClick(bridge, "2.2", f.setDriver(choices)) // Options door hotspot
|
||||
f.setFreeze(bridge, "2.4", false) // FIXME: Enter combat door hotspot (!!!)
|
||||
f.setFreeze(bridge, "2.6", false) // FIXME: Vehicle configure door hotspot
|
||||
f.onClick(bridge, "2.8", f.setDriver(arrange)) // Squads configure door hotspot
|
||||
f.onClick(bridge, "2.1", f.setDriver(briefing)) // TODO: Mission briefing clickable
|
||||
f.onClick(bridge, "2.2", f.setDriver(choices)) // Options door hotspot
|
||||
f.setFreeze(bridge, "2.4", false) // FIXME: Enter combat door hotspot (!!!)
|
||||
f.setFreeze(bridge, "2.6", false) // FIXME: Vehicle configure door hotspot
|
||||
f.onClick(bridge, "2.8", f.setDriver(arrange)) // Squads configure door hotspot
|
||||
|
||||
// link children
|
||||
f.linkBriefing()
|
||||
f.linkChoices()
|
||||
f.linkArrange()
|
||||
}
|
||||
|
||||
func (f *Flow) linkBriefing() {
|
||||
f.onClick(briefing, "3.1", f.setDriver(bridge))
|
||||
}
|
||||
|
||||
func (f *Flow) linkChoices() {
|
||||
f.onClick(choices, "2.1", f.setDriver(loadGame)) // Load another game button
|
||||
f.onClick(choices, "2.2", f.setDriver(saveGame)) // Save this game button
|
||||
|
@@ -23,12 +23,14 @@ func init() {
|
||||
//
|
||||
// For non-animated non-interactive elements, just give them a single frame.
|
||||
type noninteractive struct {
|
||||
path string
|
||||
frames animation
|
||||
rect image.Rectangle
|
||||
|
||||
// Some non-interactives, e.g., overlays, are an image + text to be shown
|
||||
textImg *ebiten.Image
|
||||
|
||||
clickImpl // Alright, alright, it turns out the bridge mission briefing is clickable
|
||||
hoverImpl
|
||||
}
|
||||
|
||||
@@ -56,6 +58,7 @@ func registerStatic(d *Driver, r *menus.Record) error {
|
||||
}
|
||||
|
||||
ni := &noninteractive{
|
||||
path: r.Path(),
|
||||
frames: animation{sprite.Image},
|
||||
hoverImpl: hoverImpl{text: r.Text},
|
||||
rect: sprite.Rect,
|
||||
@@ -74,10 +77,12 @@ func registerHypertext(d *Driver, r *menus.Record) error {
|
||||
}
|
||||
|
||||
ni := &noninteractive{
|
||||
path: r.Path(),
|
||||
hoverImpl: hoverImpl{text: r.Text},
|
||||
rect: sprite.Rect,
|
||||
}
|
||||
|
||||
d.clickables = append(d.clickables, ni)
|
||||
d.hoverables = append(d.hoverables, ni)
|
||||
|
||||
return nil
|
||||
@@ -91,6 +96,7 @@ func registerOverlay(d *Driver, r *menus.Record) error {
|
||||
}
|
||||
|
||||
ni := &noninteractive{
|
||||
path: r.Path(),
|
||||
frames: animation{sprite.Image},
|
||||
rect: sprite.Rect,
|
||||
}
|
||||
@@ -126,6 +132,7 @@ func registerAnimation(d *Driver, r *menus.Record) error {
|
||||
}
|
||||
|
||||
ani := &noninteractive{
|
||||
path: r.Path(),
|
||||
frames: animation(frames),
|
||||
hoverImpl: hoverImpl{text: r.Text},
|
||||
rect: sprite.Rect,
|
||||
@@ -155,6 +162,7 @@ func registerAnimationHover(d *Driver, r *menus.Record) error {
|
||||
|
||||
ani := &animationHover{
|
||||
noninteractive: noninteractive{
|
||||
path: r.Path(),
|
||||
frames: animation(enterFrames),
|
||||
hoverImpl: hoverImpl{text: r.Text},
|
||||
rect: sprite.Rect,
|
||||
@@ -169,6 +177,10 @@ func registerAnimationHover(d *Driver, r *menus.Record) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *noninteractive) id() string {
|
||||
return n.path
|
||||
}
|
||||
|
||||
func (n *noninteractive) bounds() image.Rectangle {
|
||||
return n.rect
|
||||
}
|
||||
|
Reference in New Issue
Block a user