Commands (#725)
* feat(Commands): Prototype command system * feat(Commands): Chat commands * refactor(Toxic): convert most options into commands * feat(Protections): block breakup kicks on other players as host * refactor(Kicks): convert most options into commands * refactor(Commands): add labels and descriptions to all commands * feat(Commands): cleanup on unload * refactor(Troll): convert most options into commands * refactor(Misc): convert most options into commands * refactor(Teleport): convert most options into commands * feat(Commands): Variadic commands and toggleable bools * feat(Hotkeys): hotkeys now use commands * fix(Chat): fix the chat window locking up when a message is sent * fix(Commands): properly handle spoofed username * fix(Spam): update filter Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "views/view.hpp"
|
||||
#include "services/player_database/player_database_service.hpp"
|
||||
#include "core/data/command_access_levels.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -118,6 +119,26 @@ namespace big
|
||||
net_player_data->m_external_port).data());
|
||||
}
|
||||
|
||||
if (ImGui::BeginCombo("Chat Command Permissions", COMMAND_ACCESS_LEVELS[g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)]))
|
||||
{
|
||||
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
|
||||
{
|
||||
if (ImGui::Selectable(name, type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)))
|
||||
{
|
||||
g.session.chat_command_default_access_level = type;
|
||||
g_player_database_service->get_or_create_player(g_player_service->get_selected())->command_access_level = type;
|
||||
g_player_database_service->save();
|
||||
}
|
||||
|
||||
if (type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level))
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
if (ImGui::Button("Add To Database"))
|
||||
{
|
||||
g_player_database_service->get_or_create_player(g_player_service->get_selected());
|
||||
|
Reference in New Issue
Block a user