MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DrawGameTab

Function DrawGameTab

engine/Poseidon/Dev/Debug/DebugOverlay.cpp:664–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662}
663} // namespace
664
665void DrawGameTab()
666{
667 ImGui::TextUnformatted("Language");
668 ImGui::Separator();
669
670 // Text language — drives stringtables, mission briefings, UI.
671 const char* currentText = GLanguage;
672 int textIdx = FindLangIndex(currentText);
673 if (ImGui::Combo("Text", &textIdx, kGameLangs, kGameLangsCount))
674 Defer([picked = std::string(kGameLangs[textIdx])] { SetLanguage(RString(picked.c_str())); });
675 if (ImGui::IsItemHovered())
676 ImGui::SetTooltip("Stringtables, mission briefings, UI labels.\nSame as the F12 dev-only hotkey.");
677
678 // Voice language — drives <base>.<voiceLang>.<ext> sound lookups.
679 const std::string voiceLang = GetSelectedVoiceLanguage();
680 int voiceIdx = FindLangIndex(voiceLang.c_str());
681 if (ImGui::Combo("Voice", &voiceIdx, kGameLangs, kGameLangsCount))
682 Defer([picked = std::string(kGameLangs[voiceIdx])] { SetSelectedVoiceLanguage(picked); });
683 if (ImGui::IsItemHovered())
684 ImGui::SetTooltip("Voice-over track for say / playSound / radio.\nSame as the F11 dev-only hotkey.\nIn-flight "
685 "audio is unaffected; lookup applies on the next play.");
686
687 ImGui::Spacing();
688 ImGui::TextUnformatted("View distance");
689 ImGui::Separator();
690
691 // VD slider — clamped to the same range as the Options UI. Engine
692 // saturates internally too; we mirror so the slider can't request
693 // a value that just gets clipped silently.
694 static float s_vd = ENGINE_CONFIG.tacticalZ;
695 s_vd = ENGINE_CONFIG.tacticalZ; // sync with whatever else set it
696 if (ImGui::SliderFloat("VD (m)", &s_vd, GameSettingsConfig::kMinViewDistance, GameSettingsConfig::kMaxViewDistance,
697 "%.0f m"))
698 {
699 const float v = s_vd;
700 Defer([v] { SetVisibility(v); });
701 }
702 if (ImGui::IsItemHovered())
703 ImGui::SetTooltip("Terrain / horizon distance (the master).\nRange %.0f..%.0f m. Bypasses the "
704 "per-tier graphics preset.",
705 GameSettingsConfig::kMinViewDistance, GameSettingsConfig::kMaxViewDistance);
706 // Object and shadow distances are derived from VD (ViewDistanceResolver), so
707 // there are no separate sliders — moving VD moves all three.
708
709 ImGui::Spacing();
710 ImGui::TextUnformatted("Diagnostics");
711 ImGui::Separator();
712
713 DrawInputContextDiagnostics();
714 ImGui::Spacing();
715
716 // The TXT / VO / VD localization-status block in the mission preview is a
717 // diagnostic overlay, hidden from players by default. Off shows the plain
718 // mission overview; on prepends the per-language text/voice/view-distance table.
719 bool showLoc = MissionLanguageDetector::ShowLocalizationDebugInfo();
720 if (ImGui::Checkbox("Mission localization info (TXT/VO/VD)", &showLoc))
721 MissionLanguageDetector::SetShowLocalizationDebugInfo(showLoc);

Callers 1

DrawMainWindowFunction · 0.85

Calls 9

FindLangIndexFunction · 0.85
DeferFunction · 0.85
SetLanguageFunction · 0.85
SetSelectedVoiceLanguageFunction · 0.85
SetVisibilityFunction · 0.85
RStringClass · 0.50

Tested by

no test coverage detected