diff --git a/zone/gm_commands/timers.cpp b/zone/gm_commands/timers.cpp index d8e74a8b3..4e36661e4 100755 --- a/zone/gm_commands/timers.cpp +++ b/zone/gm_commands/timers.cpp @@ -2,21 +2,45 @@ void command_timers(Client *c, const Seperator *sep) { - if (!c->GetTarget() || !c->GetTarget()->IsClient()) { - c->Message(Chat::White, "Need a player target for timers."); - return; + auto target = c; + if (c->GetTarget() && c->GetTarget()->IsClient()) { + target = c->GetTarget()->CastToClient(); } - Client *them = c->GetTarget()->CastToClient(); - std::vector > res; - them->GetPTimers().ToVector(res); + std::vector> timers; + target->GetPTimers().ToVector(timers); - c->Message(Chat::White, "Timers for target:"); + std::string popup_title = fmt::format( + "Recast Timers for {}", + c == target ? + "Yourself" : + fmt::format( + "{} ({})", + target->GetCleanName(), + target->GetID() + ) + ); - int r; - int l = res.size(); - for (r = 0; r < l; r++) { - c->Message(Chat::White, "Timer %d: %d seconds remain.", res[r].first, res[r].second->GetRemainingTime()); + std::string popup_text = ""; + + popup_text += ""; + + for (const auto& timer : timers) { + auto remaining_time = timer.second->GetRemainingTime(); + if (remaining_time) { + popup_text += fmt::format( + "", + timer.first, + ConvertSecondsToTime(remaining_time) + ); + } } + + popup_text += "
Timer IDRemaining
{}{}
"; + + c->SendPopupToClient( + popup_title.c_str(), + popup_text.c_str() + ); }