More work for MainGame.mnu
This commit is contained in:
@@ -241,9 +241,37 @@ func (f *Flow) playNextScenario(from driverName) func() {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Flow) setActive(driver driverName, id string, value bool) func() {
|
||||
return func() {
|
||||
if f.exit != nil {
|
||||
return
|
||||
}
|
||||
|
||||
f.exit = maybeErr(driver, f.setActiveNow(driver, id, value))
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Flow) setActiveNow(driver driverName, id string, value bool) error {
|
||||
return f.drivers[driver].SetActive(locator(driver, id), value)
|
||||
}
|
||||
|
||||
func (f *Flow) toggleActive(driver driverName, id string) func() {
|
||||
return func() {
|
||||
if f.exit != nil {
|
||||
return
|
||||
}
|
||||
|
||||
f.exit = maybeErr(driver, f.drivers[driver].ToggleActive(locator(driver, id)))
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Flow) showDialogue(driver driverName, id string) func() {
|
||||
return func() {
|
||||
f.drivers[driver].ShowDialogue(locator(driver, id))
|
||||
if f.exit != nil {
|
||||
return
|
||||
}
|
||||
|
||||
f.exit = maybeErr(driver, f.drivers[driver].ShowDialogue(locator(driver, id)))
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,13 +4,34 @@ package flow
|
||||
// to duplicate everything for both?
|
||||
|
||||
func (f *Flow) linkMainGame() {
|
||||
// 3: Action menu
|
||||
// 3: Action menu. These are mostly predicated on selected character state
|
||||
// 3.1: Aimed shot
|
||||
// 3.2: Shooting
|
||||
// 3.3: Walk
|
||||
// 3.4: Run
|
||||
// 3.5: Crouch/Stand
|
||||
// 3.6: Hand to hand (commented out)
|
||||
// 3.7: Retrieve
|
||||
// 3.8: Door
|
||||
// 3.9: Switch
|
||||
// 3.10: Overwatch
|
||||
// 3.11: Rally/Formation
|
||||
// 3.12: Board/Disembark
|
||||
// FIXME: for now, this is "end scenario", for convenience
|
||||
f.onClick(mainGame, "3.13", func() { // End turn button.
|
||||
f.scenario = nil
|
||||
f.returnToLastDriverNow(mainGame)
|
||||
})
|
||||
// 3.14: Special action heal
|
||||
// 3.15: Special action techmarine
|
||||
// 3.16: Special action jump pack
|
||||
// 3.17: Special action spell
|
||||
|
||||
// 4: Interface options menu
|
||||
f.onClick(mainGame, "4.1", f.setReturningDriver(mainGame, options)) // Options button
|
||||
// 4.2: Map button
|
||||
f.onClick(mainGame, "4.2", f.toggleActive(mainGame, "14")) // Map button
|
||||
// 4.3: Mission objectives button
|
||||
// 4.4: Inventory
|
||||
f.onClick(mainGame, "4.4", f.showDialogue(mainGame, "12")) // Inventory
|
||||
// 4.5: Next man
|
||||
// 4.6: Next enemy
|
||||
// 4.7: Total enemy text
|
||||
@@ -22,31 +43,31 @@ func (f *Flow) linkMainGame() {
|
||||
// 9: Visible enemy menu
|
||||
// 10: Friendly squad menu
|
||||
// 11: Psyker spell dialogue
|
||||
|
||||
// FIXME: lots and lots and lots of wiring up to do.
|
||||
// For now, just link all the exit buttons to go back to the bridge
|
||||
f.onClick(mainGame, "11.6", func() {
|
||||
f.scenario = nil
|
||||
f.returnToLastDriverNow(mainGame)
|
||||
})
|
||||
|
||||
// 12: Inventory dialogue
|
||||
f.onClick(mainGame, "12.21", func() {
|
||||
f.scenario = nil
|
||||
f.returnToLastDriverNow(mainGame)
|
||||
})
|
||||
|
||||
// 13: Exchange menu
|
||||
|
||||
f.onClick(mainGame, "13.1", func() {
|
||||
f.scenario = nil
|
||||
f.returnToLastDriverNow(mainGame)
|
||||
})
|
||||
f.onClick(mainGame, "12.21", f.hideDialogue(mainGame)) // Exit
|
||||
// 13: exchange menu
|
||||
|
||||
// 14: Map
|
||||
// 14.1: MAP_SPRITE
|
||||
// 14.2: Multiplier button (2x)
|
||||
f.onClick(mainGame, "14.3", f.setActive(mainGame, "14", false))
|
||||
// 14.4: Area
|
||||
|
||||
// 15: Interface wing left
|
||||
// 16: Interface wing right
|
||||
// FIXME: the display of left and right interface buttons is hidden by these
|
||||
// sprites, because we draw in strict numeric order. Just hide them for now.
|
||||
//
|
||||
// FIXME: The child element is already set to hidden, while the menu itself
|
||||
// is set to active, so maybe this is a hint that menus shouldn't be drawn?
|
||||
//
|
||||
// FIXME: the approach taken by the original binary in resolutions greater
|
||||
// than 640x480 is to draw the menu elements *unscaled*. They are centered,
|
||||
// and the dead space is filled by the "interface wing" sprites in the
|
||||
// background. Should we replicate this, or keep with the current scaling
|
||||
// behaviour? Which is better?
|
||||
//
|
||||
// FIXME: the menu bar should be at the bottom, not top, of the screen
|
||||
f.exit = maybeErr(mainGame, f.setActiveNow(mainGame, "15", false)) // Interface wing left
|
||||
f.exit = maybeErr(mainGame, f.setActiveNow(mainGame, "16", false)) // Interface wing right
|
||||
// 17: Grenade dialogue
|
||||
// 18: Info dialogue
|
||||
// 19: Turn start dialogue
|
||||
|
Reference in New Issue
Block a user