3-choice dialogs make OK/Leave always leftmost"

This commit is contained in:
2025-04-06 09:51:52 -05:00
parent 6666a2753f
commit 80e045cfa3
2 changed files with 7 additions and 5 deletions

View File

@@ -101,7 +101,9 @@ void cThreeChoice::init_buttons(cBasicButtonType btn1, cBasicButtonType btn2, cB
if(btn2) btns[1] = btn2; if(btn2) btns[1] = btn2;
if(btn3) btns[2] = btn3; if(btn3) btns[2] = btn3;
cDialog* me = operator->(); 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; if(!btns[i]) continue;
std::ostringstream sout; std::ostringstream sout;
sout << "btn" << i + 1; sout << "btn" << i + 1;

View File

@@ -2576,8 +2576,8 @@ void oneshot_spec(const runtime_state& ctx) {
buttons[0] = 9; buttons[0] = 9;
} }
if(spec.m3 <= 0) { if(spec.m3 <= 0) {
buttons[0] = spec.ex1a; buttons[1] = spec.ex1a;
buttons[1] = spec.ex2a; buttons[2] = spec.ex2a;
} }
if((buttons[0] < 0) && (buttons[1] < 0)) { if((buttons[0] < 0) && (buttons[1] < 0)) {
showError("Dialog box ended up with no buttons."); 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 == 2) ctx.next_spec = spec.ex1b;
if(dlg_res == 3) ctx.next_spec = spec.ex2b; if(dlg_res == 3) ctx.next_spec = spec.ex2b;
} else { } else {
if(dlg_res == 1) ctx.next_spec = spec.ex1b; if(dlg_res == 2) ctx.next_spec = spec.ex1b;
if(dlg_res == 2) ctx.next_spec = spec.ex2b; if(dlg_res == 3) ctx.next_spec = spec.ex2b;
} }
break; break;
case eSpecType::ONCE_GIVE_ITEM_DIALOG: case eSpecType::ONCE_GIVE_ITEM_DIALOG: