[Command] Add #show zone_variables (#4812)

This commit is contained in:
Chris Miles 2025-03-29 14:22:14 -05:00 committed by GitHub
parent a05d0752f6
commit cd808416c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,7 @@
#include "show/zone_loot.cpp"
#include "show/zone_points.cpp"
#include "show/zone_status.cpp"
#include "show/zone_variables.cpp"
void command_show(Client *c, const Seperator *sep)
{
@ -110,6 +111,7 @@ void command_show(Client *c, const Seperator *sep)
Cmd{.cmd = "zone_loot", .u = "zone_loot", .fn = ShowZoneLoot, .a = {"#viewzoneloot"}},
Cmd{.cmd = "zone_points", .u = "zone_points", .fn = ShowZonePoints, .a = {"#showzonepoints"}},
Cmd{.cmd = "zone_status", .u = "zone_status", .fn = ShowZoneStatus, .a = {"#zonestatus"}},
Cmd{.cmd = "zone_variables", .u = "zone_variables", .fn = ShowZoneVariables},
};
// Check for arguments

View File

@ -0,0 +1,16 @@
#include "../../client.h"
#include "../../zone.h"
extern Zone* zone;
void ShowZoneVariables(Client *c, const Seperator *sep)
{
if (!zone->GetVariables().empty()) {
c->Message(Chat::White, "Zone Variables:");
for (auto &key: zone->GetVariables()) {
c->Message(Chat::White, fmt::format("{}: {}", key, zone->GetVariable(key)).c_str());
}
} else {
c->Message(Chat::White, "No zone variables set.");
}
}