mirror of https://github.com/PCSX2/pcsx2.git
ImGuiOverlays: Display inputs as integer, ignoring deadzone
This commit is contained in:
parent
6f34b7ba99
commit
97abd3e1f9
|
@ -509,22 +509,14 @@ void ImGuiManager::DrawInputsOverlay()
|
||||||
{
|
{
|
||||||
case InputBindingInfo::Type::Axis:
|
case InputBindingInfo::Type::Axis:
|
||||||
case InputBindingInfo::Type::HalfAxis:
|
case InputBindingInfo::Type::HalfAxis:
|
||||||
{
|
|
||||||
// axes are always shown
|
|
||||||
const float value = static_cast<float>(pad->GetRawInput(bind)) * (1.0f / 255.0f);
|
|
||||||
if (value >= (254.0f / 255.0f))
|
|
||||||
text.append_fmt(" {}", bi.icon_name ? bi.icon_name : bi.name);
|
|
||||||
else if (value > (1.0f / 255.0f))
|
|
||||||
text.append_fmt(" {}: {:.2f}", bi.icon_name ? bi.icon_name : bi.name, value);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case InputBindingInfo::Type::Button:
|
case InputBindingInfo::Type::Button:
|
||||||
{
|
{
|
||||||
// buttons only shown when active
|
// axes are only shown if not resting/past deadzone
|
||||||
const float value = static_cast<float>(pad->GetRawInput(bind)) * (1.0f / 255.0f);
|
const u8 value = pad->GetEffectiveInput(bind);
|
||||||
if (value >= 0.5f)
|
if (value >= 254)
|
||||||
text.append_fmt(" {}", bi.icon_name ? bi.icon_name : bi.name);
|
text.append_fmt(" {}", bi.icon_name ? bi.icon_name : bi.name);
|
||||||
|
else if (value >= 1)
|
||||||
|
text.append_fmt(" {}: {}", bi.icon_name ? bi.icon_name : bi.name, value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue