From c058f651dcca963ac1d26f4804e5a47b69ac57c7 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Sun, 19 Apr 2020 18:49:14 +0100 Subject: [PATCH] Wire up mission objectives dialogue/menu --- internal/flow/main_game.go | 104 +++++++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 39 deletions(-) diff --git a/internal/flow/main_game.go b/internal/flow/main_game.go index 2b72581..b163320 100644 --- a/internal/flow/main_game.go +++ b/internal/flow/main_game.go @@ -4,6 +4,65 @@ package flow // to duplicate everything for both? func (f *Flow) linkMainGame() { + f.linkMainGameActionMenu() + f.linkMainGameInterfaceOptionsMenu() + + // 5: Holding menu + // 6: View menu + // 7: General character menu + f.onClick(mainGame, "7.4", func() { // More button + f.setActiveNow(mainGame, "7", false) + f.setActiveNow(mainGame, "8", true) + }) + + // 8: Character stats + f.onClick(mainGame, "8.21", func() { // Stat more buttont + f.setActiveNow(mainGame, "7", true) + f.setActiveNow(mainGame, "8", false) + }) + + // 9: Visible enemy menu + // 10: Friendly squad menu + // 11: Psyker spell dialogue + // 12: Inventory dialogue + f.onClick(mainGame, "12.21", f.hideDialogue(mainGame)) // Exit + // 13: exchange menu + + // 14: Map + // FIXME: Map should be right-aligned + // 14.1: MAP_SPRITE + // 14.2: Multiplier button (2x) + f.onClick(mainGame, "14.3", f.setActive(mainGame, "14", false)) + // 14.4: Area + + // 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 + + f.onClick(mainGame, "18.12", f.setActive(mainGame, "18", false)) // Info "dialogue" + + // 19: Turn start dialogue + // 20: Chat menu + + // Chat list menu box - active by default, hide it + f.exit = maybeErr(mainGame, f.setActiveNow(mainGame, "21", false)) + +} + +func (f *Flow) linkMainGameActionMenu() { // 3: Action menu. These are mostly predicated on selected character state // 3.1: Aimed shot // 3.2: Shooting @@ -26,51 +85,18 @@ func (f *Flow) linkMainGame() { // 3.15: Special action techmarine // 3.16: Special action jump pack // 3.17: Special action spell +} +func (f *Flow) linkMainGameInterfaceOptionsMenu() { // 4: Interface options menu f.onClick(mainGame, "4.1", f.setReturningDriver(mainGame, options)) // Options button f.onClick(mainGame, "4.2", f.toggleActive(mainGame, "14")) // Map button - // 4.3: Mission objectives button + + // FIXME: mission objectives should be shown top-left, not centered + f.onClick(mainGame, "4.3", f.toggleActive(mainGame, "18")) // Mission objectives + f.onClick(mainGame, "4.4", f.showDialogue(mainGame, "12")) // Inventory // 4.5: Next man // 4.6: Next enemy // 4.7: Total enemy text - - // 5: Holding menu - // 6: View menu - // 7: General character menu - // 8: Character stats - // 9: Visible enemy menu - // 10: Friendly squad menu - // 11: Psyker spell dialogue - // 12: Inventory dialogue - 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 - - // 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 - // 20: Chat menu - // 21: Chat list menu box }