mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Add local time clock below minimap indicators
This commit is contained in:
parent
7e271df032
commit
3446fffe86
1 changed files with 29 additions and 0 deletions
|
|
@ -10971,6 +10971,35 @@ void GameScreen::renderMinimapMarkers(game::GameHandler& gameHandler) {
|
|||
ImGui::TextColored(latColor, "%u ms", latMs);
|
||||
}
|
||||
ImGui::End();
|
||||
nextIndicatorY += kIndicatorH;
|
||||
}
|
||||
|
||||
// Local time clock — always visible below minimap indicators
|
||||
{
|
||||
auto now = std::chrono::system_clock::now();
|
||||
std::time_t tt = std::chrono::system_clock::to_time_t(now);
|
||||
struct tm tmBuf;
|
||||
#ifdef _WIN32
|
||||
localtime_s(&tmBuf, &tt);
|
||||
#else
|
||||
localtime_r(&tt, &tmBuf);
|
||||
#endif
|
||||
char clockStr[16];
|
||||
snprintf(clockStr, sizeof(clockStr), "%02d:%02d", tmBuf.tm_hour, tmBuf.tm_min);
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2(indicatorX, nextIndicatorY), ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize(ImVec2(indicatorW, kIndicatorH), ImGuiCond_Always);
|
||||
ImGuiWindowFlags clockFlags = indicatorFlags & ~ImGuiWindowFlags_NoInputs;
|
||||
if (ImGui::Begin("##ClockIndicator", nullptr, clockFlags)) {
|
||||
ImGui::TextColored(ImVec4(0.85f, 0.85f, 0.85f, 0.75f), "%s", clockStr);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
char fullTime[32];
|
||||
snprintf(fullTime, sizeof(fullTime), "%02d:%02d:%02d (local)",
|
||||
tmBuf.tm_hour, tmBuf.tm_min, tmBuf.tm_sec);
|
||||
ImGui::SetTooltip("%s", fullTime);
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue