mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-18 07:07:32 +08:00

* 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>
20 lines
787 B
C++
20 lines
787 B
C++
#pragma once
|
|
#include "command.hpp"
|
|
|
|
namespace big
|
|
{
|
|
class bool_command : public command
|
|
{
|
|
protected:
|
|
bool& m_toggle;
|
|
virtual void execute(const std::vector<std::uint64_t>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) override;
|
|
virtual std::optional<std::vector<std::uint64_t>> parse_args(const std::vector<std::string>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) override;
|
|
public:
|
|
bool_command(const std::string& name, const std::string& label, const std::string& description, bool& toggle);
|
|
inline bool& is_enabled() { return m_toggle; }
|
|
|
|
virtual void refresh() {};
|
|
virtual void enable() { m_toggle = true; };
|
|
virtual void disable() { m_toggle = false; };
|
|
};
|
|
} |