diff --git a/extern/aurora b/extern/aurora index f5c5917832..b1bf531884 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit f5c59178322c31b42676f49dd24e760e3b014f24 +Subproject commit b1bf531884172075dd97403edddc7d3301f4ca46 diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index 93b5b4a787..fa47e53da3 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -158,10 +158,13 @@ namespace dusk { auto itemMin = ImGui::GetItemRectMin(); auto itemMax = ImGui::GetItemRectMax(); + float frameSpacingY = 8.0f; + float frameBottomPadding = 10.0f; + ImVec2 halfFrame = ImVec2((frameHeight * 0.25f) * 0.5f, frameHeight * 0.5f); ImGui::GetWindowDrawList()->AddRect( - ImVec2(itemMin.x + halfFrame.x, itemMin.y + halfFrame.y), - ImVec2(itemMax.x - halfFrame.x, itemMax.y), + ImVec2(itemMin.x + halfFrame.x, itemMin.y + halfFrame.y + frameSpacingY), + ImVec2(itemMax.x - halfFrame.x, itemMax.y + frameBottomPadding), ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Border)), halfFrame.x); diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index cbe26ba81c..8125583c8b 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -116,9 +116,9 @@ namespace dusk { static void drawVirtualStick(const char* id, const ImVec2& stick) { float scale = ImGuiScale(); - ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x + 5 * scale, ImGui::GetCursorPos().y)); + ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x + 45 * scale, ImGui::GetCursorPos().y + 10)); - ImGui::BeginChild(id, ImVec2(80 * scale, 80 * scale)); + ImGui::BeginChild(id, ImVec2(80 * scale, 80 * scale), 0, ImGuiWindowFlags_NoBackground); ImDrawList* dl = ImGui::GetWindowDrawList(); ImVec2 p = ImGui::GetCursorScreenPos(); @@ -222,6 +222,7 @@ namespace dusk { // controller selection combo box bool changedController = false; int changedControllerIndex = 0; + ImGui::SetNextItemWidth(400.0f * scale); if (ImGui::BeginCombo("##ControllerDeviceList", currentName.c_str())) { for (int i = 0; const auto& name : controllerList) { if (ImGui::Selectable(name.c_str(), currentName == name)) { @@ -300,7 +301,7 @@ namespace dusk { uint32_t axisCount; PADAxisMapping* axisMappingList = PADGetAxisMappings(m_controllerConfig.m_selectedPort, &axisCount); - ImGuiBeginGroupPanel("Triggers", ImVec2(150 * scale, 20 * scale)); + ImGuiBeginGroupPanel("Analog Triggers", ImVec2(150 * scale, 20 * scale)); PADAxis triggers[] = {PAD_AXIS_TRIGGER_L, PAD_AXIS_TRIGGER_R}; if (axisMappingList != nullptr) { @@ -334,11 +335,34 @@ namespace dusk { } } + int port = m_controllerConfig.m_selectedPort; + PADDeadZones* deadZones = PADGetDeadZones(port); + + if (deadZones != nullptr) { + ImGui::Text("L Threshold"); + ImGui::SameLine(); + { + float tmp = static_cast(deadZones->leftTriggerActivationZone * 100.f) / 32767.f; + if (ImGui::DragFloat("##LThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { + deadZones->leftTriggerActivationZone = static_cast((tmp / 100.f) * 32767); + } + } + } + + if (deadZones != nullptr) { + ImGui::Text("R Threshold"); + ImGui::SameLine(); + { + float tmp = static_cast(deadZones->rightTriggerActivationZone * 100.f) / 32767.f; + if (ImGui::DragFloat("##RThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { + deadZones->rightTriggerActivationZone = static_cast((tmp / 100.f) * 32767); + } + } + } + ImGuiEndGroupPanel(); ImGui::SameLine(); - int port = m_controllerConfig.m_selectedPort; - // main stick panel ImGuiBeginGroupPanel("Control Stick", ImVec2(150 * scale, 20 * scale)); @@ -388,8 +412,6 @@ namespace dusk { } } - PADDeadZones* deadZones = PADGetDeadZones(port); - if (deadZones != nullptr) { ImGui::Text("Dead Zone"); { @@ -465,32 +487,6 @@ namespace dusk { ImGuiEndGroupPanel(); ImGui::SameLine(); - // Triggers Panel - ImGuiBeginGroupPanel("Triggers", ImVec2(150 * scale, 20 * scale)); - - if (deadZones != nullptr) { - ImGui::Text("L Threshold"); - { - float tmp = static_cast(deadZones->leftTriggerActivationZone * 100.f) / 32767.f; - if (ImGui::DragFloat("##LThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { - deadZones->leftTriggerActivationZone = static_cast((tmp / 100.f) * 32767); - } - } - } - - if (deadZones != nullptr) { - ImGui::Text("R Threshold"); - { - float tmp = static_cast(deadZones->rightTriggerActivationZone * 100.f) / 32767.f; - if (ImGui::DragFloat("##RThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) { - deadZones->rightTriggerActivationZone = static_cast((tmp / 100.f) * 32767); - } - } - } - - ImGuiEndGroupPanel(); - ImGui::SameLine(); - // Options panel ImGuiBeginGroupPanel("Options", ImVec2(150 * scale, 20 * scale));