mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: add pulsing yellow flash to chat tabs with unread messages
Chat tabs with unread messages now pulse yellow to attract attention. The existing unread count "(N)" suffix was text-only and easy to miss, especially for whisper and guild tabs. The pulsing color clears when the tab is clicked, matching standard WoW chat tab behavior.
This commit is contained in:
parent
22742fedb8
commit
72993121ab
1 changed files with 7 additions and 1 deletions
|
|
@ -1315,7 +1315,12 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
|
|||
if (i > 0 && i < static_cast<int>(chatTabUnread_.size()) && chatTabUnread_[i] > 0) {
|
||||
tabLabel += " (" + std::to_string(chatTabUnread_[i]) + ")";
|
||||
}
|
||||
// Use ImGuiTabItemFlags_NoPushId so label changes don't break tab identity
|
||||
// Flash tab text color when unread messages exist
|
||||
bool hasUnread = (i > 0 && i < static_cast<int>(chatTabUnread_.size()) && chatTabUnread_[i] > 0);
|
||||
if (hasUnread) {
|
||||
float pulse = 0.6f + 0.4f * std::sin(static_cast<float>(ImGui::GetTime()) * 4.0f);
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.85f * pulse, 0.2f * pulse, 1.0f));
|
||||
}
|
||||
if (ImGui::BeginTabItem(tabLabel.c_str())) {
|
||||
if (activeChatTab_ != i) {
|
||||
activeChatTab_ = i;
|
||||
|
|
@ -1325,6 +1330,7 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
|
|||
}
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
if (hasUnread) ImGui::PopStyleColor();
|
||||
}
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue