mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
* Initial commit checkpoint * More functions converted * Commify * More functions * Fin * Sort declarations * Split functions between files * Bots * Update strings.h * Split * Revert find replaces * Repository template * Money * Misc function * Update CMakeLists.txt * Saylink * Update strings.cpp * Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database * API casings
41 lines
902 B
C++
Executable File
41 lines
902 B
C++
Executable File
#include "../client.h"
|
|
|
|
void command_timers(Client *c, const Seperator *sep)
|
|
{
|
|
auto target = c;
|
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
|
target = c->GetTarget()->CastToClient();
|
|
}
|
|
|
|
std::vector<std::pair<pTimerType, PersistentTimer *>> timers;
|
|
target->GetPTimers().ToVector(timers);
|
|
|
|
std::string popup_title = fmt::format(
|
|
"Recast Timers for {}",
|
|
c->GetTargetDescription(target, TargetDescriptionType::UCSelf)
|
|
);
|
|
|
|
std::string popup_text = "<table>";
|
|
|
|
popup_text += "<tr><td>Timer ID</td><td>Remaining</td></tr>";
|
|
|
|
for (const auto& timer : timers) {
|
|
auto remaining_time = timer.second->GetRemainingTime();
|
|
if (remaining_time) {
|
|
popup_text += fmt::format(
|
|
"<tr><td>{}</td><td>{}</td></tr>",
|
|
timer.first,
|
|
Strings::SecondsToTime(remaining_time)
|
|
);
|
|
}
|
|
}
|
|
|
|
popup_text += "</table>";
|
|
|
|
c->SendPopupToClient(
|
|
popup_title.c_str(),
|
|
popup_text.c_str()
|
|
);
|
|
}
|
|
|