custom choice dialogs Stay/Leave can't both use Enter Key.

And since depending on context they could both mean 'Cancel' but 'Leave' could be a positive action in some contexts, I've just given them no keys.
This commit is contained in:
2025-04-06 09:51:30 -05:00
parent 6a74270d79
commit 6666a2753f
2 changed files with 4 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ bbtt basic_buttons[71] = {
{BTN_REG, "Cancel", {true,key_esc,mod_none}}, {BTN_REG, "Cancel", {true,key_esc,mod_none}},
{BTN_REG, "Buy", {false,0,mod_none}}, {BTN_REG, "Buy", {false,0,mod_none}},
{BTN_REG, "Enter", {false,0,mod_none}}, {BTN_REG, "Enter", {false,0,mod_none}},
{BTN_REG, "Leave", {true,key_enter,mod_none}}, {BTN_REG, "Leave", {false,0,mod_none}},
{BTN_REG, "Get", {false,'g',mod_none}}, {BTN_REG, "Get", {false,'g',mod_none}},
{BTN_REG, "1", {false,'1',mod_none}}, {BTN_REG, "1", {false,'1',mod_none}},
{BTN_REG, "2", {false,'2',mod_none}}, {BTN_REG, "2", {false,'2',mod_none}},
@@ -34,7 +34,7 @@ bbtt basic_buttons[71] = {
{BTN_REG, "Cast", {false,0,mod_none}}, {BTN_REG, "Cast", {false,0,mod_none}},
{BTN_REG, "Save", {false,0,mod_none}}, {BTN_REG, "Save", {false,0,mod_none}},
{BTN_REG, "Take", {false,0,mod_none}}, {BTN_REG, "Take", {false,0,mod_none}},
{BTN_REG, "Stay", {true,key_enter,mod_none}}, {BTN_REG, "Stay", {false,0,mod_none}},
{BTN_REG, "Steal", {false,0,mod_none}}, {BTN_REG, "Steal", {false,0,mod_none}},
{BTN_REG, "Attack", {false,0,mod_none}}, {BTN_REG, "Attack", {false,0,mod_none}},
{BTN_LG, "Step In", {false,0,mod_none}}, {BTN_LG, "Step In", {false,0,mod_none}},

View File

@@ -2567,9 +2567,11 @@ void oneshot_spec(const runtime_state& ctx) {
break; break;
get_strs(strs, ctx.cur_spec_type, spec.m1); get_strs(strs, ctx.cur_spec_type, spec.m1);
if(spec.m3 > 0) { if(spec.m3 > 0) {
// The first button defaults to OK if toggle is on
buttons[0] = 1; buttons[0] = 1;
buttons[1] = spec.ex1a; buttons[1] = spec.ex1a;
buttons[2] = spec.ex2a; buttons[2] = spec.ex2a;
// If button 2 and/or button 3 are provided, the first button becomes a Leave button!
if((spec.ex1a >= 0) || (spec.ex2a >= 0)) if((spec.ex1a >= 0) || (spec.ex2a >= 0))
buttons[0] = 9; buttons[0] = 9;
} }