feat: add forms

This commit is contained in:
Tsubasa6848
2024-02-28 03:32:04 +08:00
Unverified
parent 8b7bf46ef9
commit bcae58e4da
9 changed files with 289 additions and 42 deletions
+19
View File
@@ -0,0 +1,19 @@
#include "Forms.h"
#include "Global.h"
void RegisterCommand() {
auto& cmd = ll::command::CommandRegistrar::getInstance().getOrCreateCommand(
"inventorycheck",
tr("command.inventorycheck.desc"),
CommandPermissionLevel::GameDirectors
);
ll::service::getCommandRegistry()->registerAlias("inventorycheck", "ic");
cmd.overload().execute<[&](CommandOrigin const& origin, CommandOutput& output) {
auto entity = (GMLIB_Actor*)origin.getEntity();
if (entity && entity->isPlayer()) {
auto pl = (Player*)entity;
return mainForm(*pl);
}
return output.error(tr("command.error.console"));
}>();
}