Nav: Fixed renaming of c09016b12a that were incorrect. ImGuiNavInput_PadLeft -> PadDpadLeft, _PadScrollLeft -> PadLStickLeft. (#787)

This commit is contained in:
omar 2018-01-25 16:17:36 +01:00
parent 3967ff58b2
commit e9070e768e
2 changed files with 15 additions and 15 deletions

View File

@ -2688,11 +2688,11 @@ ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInput
{
ImVec2 delta(0.0f, 0.0f);
if (dir_sources & ImGuiNavDirSourceFlags_Key)
delta += ImVec2(GetNavInputAmount(ImGuiNavInput_KeyRight, mode) - GetNavInputAmount(ImGuiNavInput_KeyLeft, mode), GetNavInputAmount(ImGuiNavInput_KeyDown, mode) - GetNavInputAmount(ImGuiNavInput_KeyUp, mode));
delta += ImVec2(GetNavInputAmount(ImGuiNavInput_KeyRight, mode) - GetNavInputAmount(ImGuiNavInput_KeyLeft, mode), GetNavInputAmount(ImGuiNavInput_KeyDown, mode) - GetNavInputAmount(ImGuiNavInput_KeyUp, mode));
if (dir_sources & ImGuiNavDirSourceFlags_PadLStick)
delta += ImVec2(GetNavInputAmount(ImGuiNavInput_PadLStickRight, mode) - GetNavInputAmount(ImGuiNavInput_PadLStickLeft, mode), GetNavInputAmount(ImGuiNavInput_PadLStickDown, mode) - GetNavInputAmount(ImGuiNavInput_PadLStickUp, mode));
delta += ImVec2(GetNavInputAmount(ImGuiNavInput_PadDpadRight, mode) - GetNavInputAmount(ImGuiNavInput_PadDpadLeft, mode), GetNavInputAmount(ImGuiNavInput_PadDpadDown, mode) - GetNavInputAmount(ImGuiNavInput_PadDpadUp, mode));
if (dir_sources & ImGuiNavDirSourceFlags_PadRStick)
delta += ImVec2(GetNavInputAmount(ImGuiNavInput_PadRStickRight, mode) - GetNavInputAmount(ImGuiNavInput_PadRStickLeft, mode), GetNavInputAmount(ImGuiNavInput_PadRStickDown, mode) - GetNavInputAmount(ImGuiNavInput_PadRStickUp, mode));
delta += ImVec2(GetNavInputAmount(ImGuiNavInput_PadLStickRight, mode) - GetNavInputAmount(ImGuiNavInput_PadLStickLeft, mode), GetNavInputAmount(ImGuiNavInput_PadLStickDown, mode) - GetNavInputAmount(ImGuiNavInput_PadLStickUp, mode));
if (slow_factor != 0.0f && IsNavInputDown(ImGuiNavInput_PadTweakSlow))
delta *= slow_factor;
if (fast_factor != 0.0f && IsNavInputDown(ImGuiNavInput_PadTweakFast))
@ -2966,10 +2966,10 @@ static void ImGui::NavUpdate()
g.NavMoveDir = ImGuiDir_None;
if (g.NavWindow && !g.NavWindowingTarget && allowed_dir_flags && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs))
{
if ((allowed_dir_flags & (1<<ImGuiDir_Left)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadLStickLeft, ImGuiNavInput_KeyLeft, ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Left;
if ((allowed_dir_flags & (1<<ImGuiDir_Right)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadLStickRight,ImGuiNavInput_KeyRight,ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Right;
if ((allowed_dir_flags & (1<<ImGuiDir_Up)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadLStickUp, ImGuiNavInput_KeyUp, ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Up;
if ((allowed_dir_flags & (1<<ImGuiDir_Down)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadLStickDown, ImGuiNavInput_KeyDown, ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Down;
if ((allowed_dir_flags & (1<<ImGuiDir_Left)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadDpadLeft, ImGuiNavInput_KeyLeft, ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Left;
if ((allowed_dir_flags & (1<<ImGuiDir_Right)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadDpadRight,ImGuiNavInput_KeyRight,ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Right;
if ((allowed_dir_flags & (1<<ImGuiDir_Up)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadDpadUp, ImGuiNavInput_KeyUp, ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Up;
if ((allowed_dir_flags & (1<<ImGuiDir_Down)) && IsNavInputPressedAnyOfTwo(ImGuiNavInput_PadDpadDown, ImGuiNavInput_KeyDown, ImGuiInputReadMode_Repeat)) g.NavMoveDir = ImGuiDir_Down;
}
}
else

16
imgui.h
View File

@ -705,14 +705,14 @@ enum ImGuiNavInput_
ImGuiNavInput_PadCancel, // close menu/popup/child, lose selection // e.g. Cross button
ImGuiNavInput_PadInput, // text input // e.g. Triangle button
ImGuiNavInput_PadMenu, // toggle menu, hold to: focus, move, resize // e.g. Square button
ImGuiNavInput_PadLStickLeft, // move left, resize window (with PadMenu) // e.g. D-pad + left stick directions (analog)
ImGuiNavInput_PadLStickRight, // move right
ImGuiNavInput_PadLStickUp, // move up
ImGuiNavInput_PadLStickDown, // move down
ImGuiNavInput_PadRStickLeft, // scroll up, move window (with PadMenu) // e.g. right stick directions (analog)
ImGuiNavInput_PadRStickRight, // scroll right
ImGuiNavInput_PadRStickUp, // scroll up
ImGuiNavInput_PadRStickDown, // scroll down
ImGuiNavInput_PadDpadLeft, // move left, resize window (with PadMenu) // e.g. D-pad directions
ImGuiNavInput_PadDpadRight, // move right
ImGuiNavInput_PadDpadUp, // move up
ImGuiNavInput_PadDpadDown, // move down
ImGuiNavInput_PadLStickLeft, // scroll up, move window (with PadMenu) // e.g. left stick directions (analog)
ImGuiNavInput_PadLStickRight, // scroll right
ImGuiNavInput_PadLStickUp, // scroll up
ImGuiNavInput_PadLStickDown, // scroll down
ImGuiNavInput_PadFocusPrev, // next window (with PadMenu) // e.g. L-trigger
ImGuiNavInput_PadFocusNext, // prev window (with PadMenu) // e.g. R-trigger
ImGuiNavInput_PadTweakSlow, // slower tweaks // e.g. L-trigger, analog