Wire up inventory select to ship state
Also mixed into this commit: * Use returning drivers where possible * Make the credits screen returnable via click
This commit is contained in:
20
internal/flow/choices.go
Normal file
20
internal/flow/choices.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package flow
|
||||
|
||||
func (f *Flow) linkChoices() {
|
||||
f.onClick(choices, "2.1", f.setReturningDriver(choices, loadGame)) // Load another game button
|
||||
f.onClick(choices, "2.2", f.setReturningDriver(choices, saveGame)) // Save this game button
|
||||
f.onClick(choices, "2.3", f.setReturningDriver(choices, options)) // More options button
|
||||
f.onClick(choices, "2.4", func() { // New Game button. FIXME: should ask about the emperor
|
||||
f.ship.Reset() // Throws away in-progress game
|
||||
f.reset()
|
||||
})
|
||||
|
||||
f.onClick(choices, "2.5", f.setReturningDriver(choices, credits)) // Credits button
|
||||
f.onClick(choices, "2.6", f.setExit) // Quit button. FIXME: should ask about the emperor
|
||||
f.onClick(choices, "2.7", f.returnToLastDriver(choices)) // Back button
|
||||
|
||||
// loadGame is linked by main
|
||||
f.linkSaveGame()
|
||||
// options is linked by main
|
||||
f.linkCredits()
|
||||
}
|
Reference in New Issue
Block a user