| 1483 | ImGui::Text("target scale %.2fx, %dx MSAA", GEngine->GetRenderScale(), GEngine->GetMsaaSamples()); |
| 1484 | ImGui::TextDisabled("settings are session-only; persist via graphics.cfg"); |
| 1485 | } |
| 1486 | void DrawMouseTab() |
| 1487 | { |
| 1488 | // Plain field writes into live GInput.mouse — no Defer needed (cf. DrawCheatsTab). |
| 1489 | auto& sub = InputSubsystem::Instance(); |
| 1490 | MouseTuning& t = sub.GetMouseTuning(); |
| 1491 | |
| 1492 | ImGui::TextUnformatted("Player settings (final)"); |
| 1493 | ImGui::Separator(); |
| 1494 | |
| 1495 | int dpiIdx = 0; // Off |
| 1496 | if (t.dpiNormalize) |
| 1497 | { |
| 1498 | int bestDiff = 1 << 30; |
| 1499 | for (int i = 1; i < kMouseDpiPresetCount; ++i) |
| 1500 | { |
| 1501 | int d = t.mouseDpi - kMouseDpiPresets[i]; |
| 1502 | if (d < 0) |
| 1503 | d = -d; |
| 1504 | if (d < bestDiff) |
| 1505 | { |
| 1506 | bestDiff = d; |
| 1507 | dpiIdx = i; |
| 1508 | } |
| 1509 | } |
| 1510 | } |
| 1511 | if (ImGui::Combo("Mouse DPI", &dpiIdx, kMouseDpiLabels, kMouseDpiPresetCount)) |
| 1512 | { |
| 1513 | t.dpiNormalize = dpiIdx > 0; |
| 1514 | if (dpiIdx > 0) |
| 1515 | t.mouseDpi = kMouseDpiPresets[dpiIdx]; |
| 1516 | } |
| 1517 | if (ImGui::IsItemHovered()) |
| 1518 | ImGui::SetTooltip("Set this to your mouse's DPI. The game then feels like %d DPI at any hardware.\n" |
| 1519 | "Off = classic (no compensation).", |
| 1520 | t.referenceDpi); |
| 1521 | |
| 1522 | float sx = sub.GetMouseSensitivityX(); |
| 1523 | if (ImGui::SliderFloat("Sensitivity X", &sx, t.SensMin(), t.SensMax(), "%.3f")) |
| 1524 | sub.SetMouseSensitivityX(sx); |
| 1525 | float sy = sub.GetMouseSensitivityY(); |
| 1526 | if (ImGui::SliderFloat("Sensitivity Y", &sy, t.SensMin(), t.SensMax(), "%.3f")) |
| 1527 | sub.SetMouseSensitivityY(sy); |
| 1528 | |
| 1529 | bool rev = sub.IsReverseMouse(); |
| 1530 | if (ImGui::Checkbox("Invert Y axis", &rev)) |
| 1531 | sub.SetReverseMouse(rev); |
| 1532 | bool swap = sub.IsMouseButtonsReversed(); |
| 1533 | if (ImGui::Checkbox("Swap mouse buttons", &swap)) |
| 1534 | sub.SetMouseButtonsReversed(swap); |
| 1535 | |
| 1536 | ImGui::Spacing(); |
| 1537 | ImGui::TextUnformatted("Final values (live)"); |
| 1538 | ImGui::Separator(); |
| 1539 | |
| 1540 | // Cursor math mirrors MouseState::Update (kCursorScaleX = 1/200; screen = 2 NDC). |
| 1541 | const float dpiF = t.DpiFactor(); |
| 1542 | const float perCountX = sx * t.baseScale * dpiF / 200.0f; |
no test coverage detected