From 773d0a27cb34e7f0eb74399962336b52de263e3e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 12 Dec 2025 09:57:15 +0100 Subject: [PATCH] added a config flag for autojoy in multi --- multi.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/multi.cpp b/multi.cpp index 0839fd0c..05c3d883 100644 --- a/multi.cpp +++ b/multi.cpp @@ -38,6 +38,7 @@ EX namespace multi { EX bool friendly_fire = true; EX bool self_hits; EX bool two_focus; + EX bool multi_autojoy = true; EX int players = 1; EX cellwalker player[MAXPLAYER]; @@ -507,6 +508,8 @@ struct shmup_configurer { add_edit(joy_init); + if(haveconfig && !shmup::on) add_edit(multi::multi_autojoy); + dialog::addBreak(50); dialog::addHelp(); @@ -829,6 +832,8 @@ EX void initConfig() { param_b(multi::two_focus, "two_focus", false) ->editable("auto-adjust dual-focus projections", 'f'); param_b(alwaysuse, "use configured keys"); + param_b(multi::multi_autojoy, "multi_autojoy") + ->editable("joystick moves automatically in configured keys", 'j'); for(int i=0; i<7; i++) paramset(multi::scs[i], "player"+its(i)); @@ -1094,6 +1099,8 @@ EX void handleInput(int delta, config &scfg) { if(multi::whereto[i].d == MD_UNDECIDED) alldecided = false; + if(!multi::multi_autojoy && !accepted[i]) alldecided = false; + if(anypressed) alldecided = false, needinput = false; else multi::mdx[i] = multi::mdy[i] = 0; } @@ -1167,8 +1174,10 @@ EX void handleInput(int delta, config &scfg) { int scdir = cdir; bool isUndecided = cdir == MD_UNDECIDED; if(countplayers_undecided > 0 && ! isUndecided) continue; - if(playerpos(i) == c) + if(playerpos(i) == c) { multi::whereto[i].d = MD_WAIT; + multi::accepted[i] = true; + } else if(!mouseout()) { for(int d=0; dtype; d++) { cdir = d; @@ -1179,6 +1188,7 @@ EX void handleInput(int delta, config &scfg) { auto& sd = multi::whereto[i].subdir; sd = mousedest.subdir; if(sd == 0) sd = 1; + multi::accepted[i] = true; } } }