diff --git a/Aquaria/AquariaMenuItem.cpp b/Aquaria/AquariaMenuItem.cpp index 53eb603..c6b0968 100644 --- a/Aquaria/AquariaMenuItem.cpp +++ b/Aquaria/AquariaMenuItem.cpp @@ -382,7 +382,9 @@ bool AquariaSlider::doSliderInput(float dt) float inputAmount; // How much to adjust by? - Vector jpos; + // disabled the jaxis threshold check; + // ACTION_MENU* should be sent automatically when above the threshold -- fg + /*Vector jpos; for(size_t i = 0; i < core->getNumJoysticks(); ++i) if(Joystick *j = core->getJoystick(i)) if(j->isEnabled()) @@ -390,14 +392,14 @@ bool AquariaSlider::doSliderInput(float dt) jpos = core->getJoystick(i)->position; if(fabsf(jpos.x) > SLIDER_JOY_THRESHOLD) break; - } + }*/ StateObject *obj = dsq->getTopStateObject(); - if (jpos.x <= -SLIDER_JOY_THRESHOLD) + /*if (jpos.x <= -SLIDER_JOY_THRESHOLD) inputAmount = -0.1f; else if (jpos.x >= SLIDER_JOY_THRESHOLD) inputAmount = +0.1f; - else if (obj && obj->isActing(ACTION_MENULEFT, -1)) + else*/ if (obj && obj->isActing(ACTION_MENULEFT, -1)) inputAmount = -0.1f; else if (obj && obj->isActing(ACTION_MENURIGHT, -1)) inputAmount = +0.1f; diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index 0f5725a..b96b497 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -2564,6 +2564,16 @@ void Game::action(int id, int state, int source, InputDevice device) { if (id == ACTION_TOGGLEGRID && !state) toggleGridRender(); } + + // Forward these to Lua scripts (because digital swim movement should be seen as menu movement as well) + if(id == ACTION_SWIMLEFT) + action(ACTION_MENULEFT, state, source, device); + else if(id == ACTION_SWIMRIGHT) + action(ACTION_MENURIGHT, state, source, device); + else if(id == ACTION_SWIMUP) + action(ACTION_MENUUP, state, source, device); + else if(id == ACTION_SWIMDOWN) + action(ACTION_MENUDOWN, state, source, device); } void Game::toggleWorldMap() diff --git a/Aquaria/GameEnums.h b/Aquaria/GameEnums.h index 47423d9..8f671e6 100644 --- a/Aquaria/GameEnums.h +++ b/Aquaria/GameEnums.h @@ -60,6 +60,7 @@ enum AquariaActions ACTION_TOGGLEGRID =5, + // Automatically sent on either ACTION_SWIM* or sufficient analog controller input ACTION_MENULEFT =6, ACTION_MENURIGHT =7, ACTION_MENUUP =8, diff --git a/Aquaria/InGameMenu.cpp b/Aquaria/InGameMenu.cpp index e5d10ca..f6af967 100644 --- a/Aquaria/InGameMenu.cpp +++ b/Aquaria/InGameMenu.cpp @@ -948,7 +948,6 @@ void InGameMenu::bindInput() as.importAction(this, "MenuDown", ACTION_MENUDOWN, sourceID); as.importAction(this, "MenuLeft", ACTION_MENULEFT, sourceID); as.importAction(this, "MenuRight", ACTION_MENURIGHT, sourceID); - } } @@ -2165,10 +2164,6 @@ void InGameMenu::create() addKeyConfigLine(kk, SB(2116), "Escape", offx, y+=yi, true); addKeyConfigLine(kk, SB(2128), "ToggleHelp", offx, y+=yi); - addKeyConfigLine(kk, SB(2135), "MenuUp", offx, y+=yi); - addKeyConfigLine(kk, SB(2136), "MenuDown", offx, y+=yi); - addKeyConfigLine(kk, SB(2137), "MenuLeft", offx, y+=yi); - addKeyConfigLine(kk, SB(2138), "MenuRight", offx, y+=yi); addKeyConfigLine(kk, SB(2121), "PrevPage", offx, y+=yi); addKeyConfigLine(kk, SB(2122), "NextPage", offx, y+=yi); addKeyConfigLine(kk, SB(2123), "CookFood", offx, y+=yi); diff --git a/Aquaria/UserSettings.cpp b/Aquaria/UserSettings.cpp index d3018a6..293500a 100644 --- a/Aquaria/UserSettings.cpp +++ b/Aquaria/UserSettings.cpp @@ -286,10 +286,6 @@ static void ensureDefaultActions(ActionSet& as) as.addActionInput("SwimDown"); as.addActionInput("SwimLeft"); as.addActionInput("SwimRight"); - as.addActionInput("MenuUp"); - as.addActionInput("MenuDown"); - as.addActionInput("MenuLeft"); - as.addActionInput("MenuRight"); as.addActionInput("Roll"); as.addActionInput("Revert"); as.addActionInput("WorldMap");