corregida la llista de inicialització en clang-format
creat Balloon::Config per a inicialitzar globos
This commit is contained in:
@@ -23,7 +23,9 @@ class MenuOption {
|
||||
|
||||
// --- Constructor y destructor ---
|
||||
MenuOption(std::string caption, ServiceMenu::SettingsGroup group, bool hidden = false)
|
||||
: caption_(std::move(caption)), group_(group), hidden_(hidden) {}
|
||||
: caption_(std::move(caption)),
|
||||
group_(group),
|
||||
hidden_(hidden) {}
|
||||
virtual ~MenuOption() = default;
|
||||
|
||||
// --- Getters ---
|
||||
@@ -52,7 +54,8 @@ class MenuOption {
|
||||
class BoolOption : public MenuOption {
|
||||
public:
|
||||
BoolOption(const std::string &cap, ServiceMenu::SettingsGroup grp, bool *var)
|
||||
: MenuOption(cap, grp), linked_variable_(var) {}
|
||||
: MenuOption(cap, grp),
|
||||
linked_variable_(var) {}
|
||||
|
||||
[[nodiscard]] auto getBehavior() const -> Behavior override { return Behavior::ADJUST; }
|
||||
[[nodiscard]] auto getValueAsString() const -> std::string override {
|
||||
@@ -74,7 +77,11 @@ class BoolOption : public MenuOption {
|
||||
class IntOption : public MenuOption {
|
||||
public:
|
||||
IntOption(const std::string &cap, ServiceMenu::SettingsGroup grp, int *var, int min, int max, int step)
|
||||
: MenuOption(cap, grp), linked_variable_(var), min_value_(min), max_value_(max), step_value_(step) {}
|
||||
: MenuOption(cap, grp),
|
||||
linked_variable_(var),
|
||||
min_value_(min),
|
||||
max_value_(max),
|
||||
step_value_(step) {}
|
||||
|
||||
[[nodiscard]] auto getBehavior() const -> Behavior override { return Behavior::ADJUST; }
|
||||
[[nodiscard]] auto getValueAsString() const -> std::string override { return std::to_string(*linked_variable_); }
|
||||
@@ -150,7 +157,8 @@ class ListOption : public MenuOption {
|
||||
class FolderOption : public MenuOption {
|
||||
public:
|
||||
FolderOption(const std::string &cap, ServiceMenu::SettingsGroup grp, ServiceMenu::SettingsGroup target)
|
||||
: MenuOption(cap, grp), target_group_(target) {}
|
||||
: MenuOption(cap, grp),
|
||||
target_group_(target) {}
|
||||
|
||||
[[nodiscard]] auto getBehavior() const -> Behavior override { return Behavior::SELECT; }
|
||||
[[nodiscard]] auto getTargetGroup() const -> ServiceMenu::SettingsGroup override { return target_group_; }
|
||||
@@ -162,7 +170,8 @@ class FolderOption : public MenuOption {
|
||||
class ActionOption : public MenuOption {
|
||||
public:
|
||||
ActionOption(const std::string &cap, ServiceMenu::SettingsGroup grp, std::function<void()> action, bool hidden = false)
|
||||
: MenuOption(cap, grp, hidden), action_(std::move(action)) {}
|
||||
: MenuOption(cap, grp, hidden),
|
||||
action_(std::move(action)) {}
|
||||
|
||||
[[nodiscard]] auto getBehavior() const -> Behavior override { return Behavior::SELECT; }
|
||||
void executeAction() override {
|
||||
@@ -183,7 +192,11 @@ class ActionListOption : public MenuOption {
|
||||
using ActionExecutor = std::function<void()>;
|
||||
|
||||
ActionListOption(const std::string &caption, ServiceMenu::SettingsGroup group, std::vector<std::string> options, ValueGetter getter, ValueSetter setter, ActionExecutor action_executor, bool hidden = false)
|
||||
: MenuOption(caption, group, hidden), options_(std::move(options)), value_getter_(std::move(getter)), value_setter_(std::move(setter)), action_executor_(std::move(action_executor)) {
|
||||
: MenuOption(caption, group, hidden),
|
||||
options_(std::move(options)),
|
||||
value_getter_(std::move(getter)),
|
||||
value_setter_(std::move(setter)),
|
||||
action_executor_(std::move(action_executor)) {
|
||||
updateCurrentIndex();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ void MenuRenderer::ShowHideAnimation::stop() {
|
||||
}
|
||||
|
||||
MenuRenderer::MenuRenderer(const ServiceMenu *menu_state, std::shared_ptr<Text> element_text, std::shared_ptr<Text> title_text)
|
||||
: element_text_(std::move(element_text)), title_text_(std::move(title_text)) {
|
||||
: element_text_(std::move(element_text)),
|
||||
title_text_(std::move(title_text)) {
|
||||
initializeMaxSizes();
|
||||
setPosition(param.game.game_area.center_x, param.game.game_area.center_y, PositionMode::CENTERED);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,9 @@ class Notifier {
|
||||
|
||||
// Constructor
|
||||
explicit Notification()
|
||||
: texture(nullptr), sprite(nullptr), rect{0, 0, 0, 0} {}
|
||||
: texture(nullptr),
|
||||
sprite(nullptr),
|
||||
rect{0, 0, 0, 0} {}
|
||||
};
|
||||
|
||||
// --- Objetos y punteros ---
|
||||
|
||||
@@ -49,7 +49,6 @@ void ServiceMenu::toggle() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!enabled_) { // Si está cerrado, abrir
|
||||
reset();
|
||||
Options::gamepad_manager.assignAndLinkGamepads();
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
|
||||
// Constructor: inicializa el renderizador, el texto y el color del mensaje
|
||||
UIMessage::UIMessage(std::shared_ptr<Text> text_renderer, std::string message_text, const Color &color)
|
||||
: text_renderer_(std::move(text_renderer)), text_(std::move(message_text)), color_(color) {}
|
||||
: text_renderer_(std::move(text_renderer)),
|
||||
text_(std::move(message_text)),
|
||||
color_(color) {}
|
||||
|
||||
// Muestra el mensaje en la posición base_x, base_y con animación de entrada desde arriba
|
||||
void UIMessage::show() {
|
||||
|
||||
Reference in New Issue
Block a user