From 80e045cfa3126cbec5a4d1847d7b8cdbfd24c52e Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 6 Apr 2025 09:51:52 -0500 Subject: [PATCH] 3-choice dialogs make OK/Leave always leftmost" --- src/dialogxml/dialogs/3choice.cpp | 4 +++- src/game/boe.specials.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/dialogxml/dialogs/3choice.cpp b/src/dialogxml/dialogs/3choice.cpp index c257533e..1dbfbcbc 100644 --- a/src/dialogxml/dialogs/3choice.cpp +++ b/src/dialogxml/dialogs/3choice.cpp @@ -101,7 +101,9 @@ void cThreeChoice::init_buttons(cBasicButtonType btn1, cBasicButtonType btn2, cB if(btn2) btns[1] = btn2; if(btn3) btns[2] = btn3; cDialog* me = operator->(); - for(int i = 0; i < 3; i++){ + // NOTE: Buttons used to be added right-to-left, resulting in the Leave button on the right. I've + // reversed it. + for(int i : {1, 2, 0}){ if(!btns[i]) continue; std::ostringstream sout; sout << "btn" << i + 1; diff --git a/src/game/boe.specials.cpp b/src/game/boe.specials.cpp index 20900b70..2cb5eef1 100644 --- a/src/game/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -2576,8 +2576,8 @@ void oneshot_spec(const runtime_state& ctx) { buttons[0] = 9; } if(spec.m3 <= 0) { - buttons[0] = spec.ex1a; - buttons[1] = spec.ex2a; + buttons[1] = spec.ex1a; + buttons[2] = spec.ex2a; } if((buttons[0] < 0) && (buttons[1] < 0)) { showError("Dialog box ended up with no buttons."); @@ -2593,8 +2593,8 @@ void oneshot_spec(const runtime_state& ctx) { if(dlg_res == 2) ctx.next_spec = spec.ex1b; if(dlg_res == 3) ctx.next_spec = spec.ex2b; } else { - if(dlg_res == 1) ctx.next_spec = spec.ex1b; - if(dlg_res == 2) ctx.next_spec = spec.ex2b; + if(dlg_res == 2) ctx.next_spec = spec.ex1b; + if(dlg_res == 3) ctx.next_spec = spec.ex2b; } break; case eSpecType::ONCE_GIVE_ITEM_DIALOG: