diff --git a/src/data/dynamic.cpp b/src/data/dynamic.cpp index ef29ce6a..206d731b 100644 --- a/src/data/dynamic.cpp +++ b/src/data/dynamic.cpp @@ -325,6 +325,11 @@ Map& Map::put(std::string key, bool value){ return *this; } +Map& Map::put(std::string key, std::unique_ptr value) { + values.emplace(key, value.release()); + return *this; +} + List& Map::putList(std::string key) { List* arr = new List(); put(key, arr); diff --git a/src/data/dynamic.h b/src/data/dynamic.h index e05875ee..39f8e664 100644 --- a/src/data/dynamic.h +++ b/src/data/dynamic.h @@ -115,6 +115,7 @@ namespace dynamic { Map& put(std::string key, Map* value); Map& put(std::string key, List* value); Map& put(std::string key, bool value); + Map& put(std::string key, std::unique_ptr value); List& putList(std::string key); Map& putMap(std::string key); diff --git a/src/frontend/InventoryView.h b/src/frontend/InventoryView.h index da953a12..83eaeae0 100644 --- a/src/frontend/InventoryView.h +++ b/src/frontend/InventoryView.h @@ -6,7 +6,7 @@ #include #include "../graphics/ui/elements/UINode.hpp" -#include "../graphics/ui/elements/layout/Container.hpp" +#include "../graphics/ui/elements/Container.hpp" #include "../items/ItemStack.h" #include "../typedefs.h" diff --git a/src/frontend/debug_panel.cpp b/src/frontend/debug_panel.cpp index 7f5c7ecd..c56a36ae 100644 --- a/src/frontend/debug_panel.cpp +++ b/src/frontend/debug_panel.cpp @@ -6,10 +6,10 @@ #include "../delegates.h" #include "../engine.h" #include "../graphics/core/Mesh.h" -#include "../graphics/ui/elements/control/CheckBox.hpp" -#include "../graphics/ui/elements/control/TextBox.hpp" -#include "../graphics/ui/elements/control/TrackBar.hpp" -#include "../graphics/ui/elements/control/InputBindBox.hpp" +#include "../graphics/ui/elements/CheckBox.hpp" +#include "../graphics/ui/elements/TextBox.hpp" +#include "../graphics/ui/elements/TrackBar.hpp" +#include "../graphics/ui/elements/InputBindBox.hpp" #include "../graphics/render/WorldRenderer.h" #include "../objects/Player.h" #include "../physics/Hitbox.h" diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp index 676249c0..446decd9 100644 --- a/src/frontend/hud.cpp +++ b/src/frontend/hud.cpp @@ -16,9 +16,9 @@ #include "../graphics/render/BlocksPreview.h" #include "../graphics/render/WorldRenderer.h" #include "../graphics/ui/elements/UINode.hpp" -#include "../graphics/ui/elements/layout/Menu.hpp" -#include "../graphics/ui/elements/layout/Panel.hpp" -#include "../graphics/ui/elements/display/Plotter.hpp" +#include "../graphics/ui/elements/Menu.hpp" +#include "../graphics/ui/elements/Panel.hpp" +#include "../graphics/ui/elements/Plotter.hpp" #include "../graphics/ui/GUI.h" #include "../items/Inventories.h" #include "../items/Inventory.h" diff --git a/src/frontend/menu.cpp b/src/frontend/menu.cpp index edd81a63..639a610b 100644 --- a/src/frontend/menu.cpp +++ b/src/frontend/menu.cpp @@ -7,9 +7,9 @@ #include "../engine.h" #include "../interfaces/Task.h" #include "../files/engine_paths.h" -#include "../graphics/ui/elements/display/Label.hpp" -#include "../graphics/ui/elements/layout/Panel.hpp" -#include "../graphics/ui/elements/layout/Menu.hpp" +#include "../graphics/ui/elements/Label.hpp" +#include "../graphics/ui/elements/Panel.hpp" +#include "../graphics/ui/elements/Menu.hpp" #include "../graphics/ui/gui_util.h" #include "../graphics/ui/GUI.h" #include "../logic/scripting/scripting.h" diff --git a/src/frontend/screens.cpp b/src/frontend/screens.cpp index 5e13a65e..bd6b9dc9 100644 --- a/src/frontend/screens.cpp +++ b/src/frontend/screens.cpp @@ -10,7 +10,7 @@ #include "../graphics/core/Shader.h" #include "../graphics/core/TextureAnimation.h" #include "../graphics/render/WorldRenderer.h" -#include "../graphics/ui/elements/layout/Menu.hpp" +#include "../graphics/ui/elements/Menu.hpp" #include "../graphics/ui/GUI.h" #include "../logic/ChunksController.h" #include "../logic/LevelController.h" diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index ec64c005..50945bed 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -1,6 +1,6 @@ #include "GUI.h" #include "elements/UINode.hpp" -#include "elements/layout/Menu.hpp" +#include "elements/Menu.hpp" #include #include diff --git a/src/graphics/ui/elements/control/Button.cpp b/src/graphics/ui/elements/Button.cpp similarity index 95% rename from src/graphics/ui/elements/control/Button.cpp rename to src/graphics/ui/elements/Button.cpp index a0ea5439..92c04970 100644 --- a/src/graphics/ui/elements/control/Button.cpp +++ b/src/graphics/ui/elements/Button.cpp @@ -1,8 +1,8 @@ #include "Button.hpp" -#include "../display/Label.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" +#include "Label.hpp" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" using namespace gui; diff --git a/src/graphics/ui/elements/control/Button.hpp b/src/graphics/ui/elements/Button.hpp similarity index 96% rename from src/graphics/ui/elements/control/Button.hpp rename to src/graphics/ui/elements/Button.hpp index 9fa559dd..2c27f3e2 100644 --- a/src/graphics/ui/elements/control/Button.hpp +++ b/src/graphics/ui/elements/Button.hpp @@ -1,7 +1,7 @@ #ifndef GRAPHICS_UI_ELEMENTS_BUTTON_HPP_ #define GRAPHICS_UI_ELEMENTS_BUTTON_HPP_ -#include "../layout/Panel.hpp" +#include "Panel.hpp" namespace gui { class Label; diff --git a/src/graphics/ui/elements/control/CheckBox.cpp b/src/graphics/ui/elements/CheckBox.cpp similarity index 92% rename from src/graphics/ui/elements/control/CheckBox.cpp rename to src/graphics/ui/elements/CheckBox.cpp index 31eb7f9f..2c2490d7 100644 --- a/src/graphics/ui/elements/control/CheckBox.cpp +++ b/src/graphics/ui/elements/CheckBox.cpp @@ -1,8 +1,8 @@ #include "CheckBox.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" -#include "../display/Label.hpp" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" +#include "Label.hpp" using namespace gui; diff --git a/src/graphics/ui/elements/control/CheckBox.hpp b/src/graphics/ui/elements/CheckBox.hpp similarity index 98% rename from src/graphics/ui/elements/control/CheckBox.hpp rename to src/graphics/ui/elements/CheckBox.hpp index 577677fd..6131e92b 100644 --- a/src/graphics/ui/elements/control/CheckBox.hpp +++ b/src/graphics/ui/elements/CheckBox.hpp @@ -1,7 +1,7 @@ #ifndef GRAPHICS_UI_ELEMENTS_CHECKBOX_HPP_ #define GRAPHICS_UI_ELEMENTS_CHECKBOX_HPP_ -#include "../layout/Panel.hpp" +#include "Panel.hpp" namespace gui { class CheckBox : public UINode { diff --git a/src/graphics/ui/elements/layout/Container.cpp b/src/graphics/ui/elements/Container.cpp similarity index 98% rename from src/graphics/ui/elements/layout/Container.cpp rename to src/graphics/ui/elements/Container.cpp index bebc31e2..3eb5fd60 100644 --- a/src/graphics/ui/elements/layout/Container.cpp +++ b/src/graphics/ui/elements/Container.cpp @@ -1,7 +1,7 @@ #include "Container.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" using namespace gui; diff --git a/src/graphics/ui/elements/layout/Container.hpp b/src/graphics/ui/elements/Container.hpp similarity index 96% rename from src/graphics/ui/elements/layout/Container.hpp rename to src/graphics/ui/elements/Container.hpp index d8f4a82e..0301c37f 100644 --- a/src/graphics/ui/elements/layout/Container.hpp +++ b/src/graphics/ui/elements/Container.hpp @@ -1,8 +1,8 @@ #ifndef GRAPHICS_UI_ELEMENTS_CONTAINER_HPP_ #define GRAPHICS_UI_ELEMENTS_CONTAINER_HPP_ -#include "../UINode.hpp" -#include "../commons.hpp" +#include "UINode.hpp" +#include "commons.hpp" #include diff --git a/src/graphics/ui/elements/display/Image.cpp b/src/graphics/ui/elements/Image.cpp similarity index 80% rename from src/graphics/ui/elements/display/Image.cpp rename to src/graphics/ui/elements/Image.cpp index b208b1b0..5e3831ec 100644 --- a/src/graphics/ui/elements/display/Image.cpp +++ b/src/graphics/ui/elements/Image.cpp @@ -1,10 +1,10 @@ #include "Image.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" -#include "../../../core/Texture.h" -#include "../../../../assets/Assets.h" -#include "../../../../maths/UVRegion.h" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" +#include "../../core/Texture.h" +#include "../../../assets/Assets.h" +#include "../../../maths/UVRegion.h" using namespace gui; diff --git a/src/graphics/ui/elements/display/Image.hpp b/src/graphics/ui/elements/Image.hpp similarity index 95% rename from src/graphics/ui/elements/display/Image.hpp rename to src/graphics/ui/elements/Image.hpp index 2416e200..d3f15c5e 100644 --- a/src/graphics/ui/elements/display/Image.hpp +++ b/src/graphics/ui/elements/Image.hpp @@ -1,7 +1,7 @@ #ifndef GRAPHICS_UI_ELEMENTS_IMAGE_HPP_ #define GRAPHICS_UI_ELEMENTS_IMAGE_HPP_ -#include "../UINode.hpp" +#include "UINode.hpp" namespace gui { class Image : public UINode { diff --git a/src/graphics/ui/elements/control/InputBindBox.cpp b/src/graphics/ui/elements/InputBindBox.cpp similarity index 85% rename from src/graphics/ui/elements/control/InputBindBox.cpp rename to src/graphics/ui/elements/InputBindBox.cpp index e1f0d7cb..15256cda 100644 --- a/src/graphics/ui/elements/control/InputBindBox.cpp +++ b/src/graphics/ui/elements/InputBindBox.cpp @@ -1,9 +1,9 @@ #include "InputBindBox.hpp" -#include "../display/Label.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" -#include "../../../../util/stringutil.h" +#include "Label.hpp" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" +#include "../../../util/stringutil.h" using namespace gui; diff --git a/src/graphics/ui/elements/control/InputBindBox.hpp b/src/graphics/ui/elements/InputBindBox.hpp similarity index 96% rename from src/graphics/ui/elements/control/InputBindBox.hpp rename to src/graphics/ui/elements/InputBindBox.hpp index faf3ae7f..808dcd6b 100644 --- a/src/graphics/ui/elements/control/InputBindBox.hpp +++ b/src/graphics/ui/elements/InputBindBox.hpp @@ -1,7 +1,7 @@ #ifndef GRAPHICS_UI_ELEMENTS_INPUTBINDBOX_HPP_ #define GRAPHICS_UI_ELEMENTS_INPUTBINDBOX_HPP_ -#include "../layout/Panel.hpp" +#include "Panel.hpp" namespace gui { class Label; diff --git a/src/graphics/ui/elements/display/Label.cpp b/src/graphics/ui/elements/Label.cpp similarity index 95% rename from src/graphics/ui/elements/display/Label.cpp rename to src/graphics/ui/elements/Label.cpp index c2cb3031..73f1079f 100644 --- a/src/graphics/ui/elements/display/Label.cpp +++ b/src/graphics/ui/elements/Label.cpp @@ -1,10 +1,10 @@ #include "Label.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" -#include "../../../core/Font.h" -#include "../../../../assets/Assets.h" -#include "../../../../util/stringutil.h" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" +#include "../../core/Font.h" +#include "../../../assets/Assets.h" +#include "../../../util/stringutil.h" using namespace gui; diff --git a/src/graphics/ui/elements/display/Label.hpp b/src/graphics/ui/elements/Label.hpp similarity index 99% rename from src/graphics/ui/elements/display/Label.hpp rename to src/graphics/ui/elements/Label.hpp index ea7aa855..17d24bd9 100644 --- a/src/graphics/ui/elements/display/Label.hpp +++ b/src/graphics/ui/elements/Label.hpp @@ -1,7 +1,7 @@ #ifndef GRAPHICS_UI_ELEMENTS_LABEL_HPP_ #define GRAPHICS_UI_ELEMENTS_LABEL_HPP_ -#include "../UINode.hpp" +#include "UINode.hpp" namespace gui { class Label : public UINode { diff --git a/src/graphics/ui/elements/layout/Menu.cpp b/src/graphics/ui/elements/Menu.cpp similarity index 100% rename from src/graphics/ui/elements/layout/Menu.cpp rename to src/graphics/ui/elements/Menu.cpp diff --git a/src/graphics/ui/elements/layout/Menu.hpp b/src/graphics/ui/elements/Menu.hpp similarity index 100% rename from src/graphics/ui/elements/layout/Menu.hpp rename to src/graphics/ui/elements/Menu.hpp diff --git a/src/graphics/ui/elements/layout/Panel.cpp b/src/graphics/ui/elements/Panel.cpp similarity index 100% rename from src/graphics/ui/elements/layout/Panel.cpp rename to src/graphics/ui/elements/Panel.cpp diff --git a/src/graphics/ui/elements/layout/Panel.hpp b/src/graphics/ui/elements/Panel.hpp similarity index 97% rename from src/graphics/ui/elements/layout/Panel.hpp rename to src/graphics/ui/elements/Panel.hpp index a4ba5f0b..cde3b12a 100644 --- a/src/graphics/ui/elements/layout/Panel.hpp +++ b/src/graphics/ui/elements/Panel.hpp @@ -1,7 +1,7 @@ #ifndef GRAPHICS_UI_ELEMENTS_PANEL_HPP_ #define GRAPHICS_UI_ELEMENTS_PANEL_HPP_ -#include "../commons.hpp" +#include "commons.hpp" #include "Container.hpp" namespace gui { diff --git a/src/graphics/ui/elements/display/Plotter.cpp b/src/graphics/ui/elements/Plotter.cpp similarity index 89% rename from src/graphics/ui/elements/display/Plotter.cpp rename to src/graphics/ui/elements/Plotter.cpp index 6f2df04b..6c20caa7 100644 --- a/src/graphics/ui/elements/display/Plotter.cpp +++ b/src/graphics/ui/elements/Plotter.cpp @@ -1,10 +1,10 @@ #include "Plotter.hpp" -#include "../../../core/Batch2D.h" -#include "../../../core/Font.h" -#include "../../../core/GfxContext.h" -#include "../../../../assets/Assets.h" -#include "../../../../util/stringutil.h" +#include "../../core/Batch2D.h" +#include "../../core/Font.h" +#include "../../core/GfxContext.h" +#include "../../../assets/Assets.h" +#include "../../../util/stringutil.h" using namespace gui; diff --git a/src/graphics/ui/elements/display/Plotter.hpp b/src/graphics/ui/elements/Plotter.hpp similarity index 93% rename from src/graphics/ui/elements/display/Plotter.hpp rename to src/graphics/ui/elements/Plotter.hpp index 0ab3336e..51788534 100644 --- a/src/graphics/ui/elements/display/Plotter.hpp +++ b/src/graphics/ui/elements/Plotter.hpp @@ -1,8 +1,8 @@ #ifndef GRAPHICS_UI_ELEMENTS_PLOTTER_HPP_ #define GRAPHICS_UI_ELEMENTS_PLOTTER_HPP_ -#include "../UINode.hpp" -#include "../../../../typedefs.h" +#include "UINode.hpp" +#include "../../../typedefs.h" #include #include diff --git a/src/graphics/ui/elements/control/TextBox.cpp b/src/graphics/ui/elements/TextBox.cpp similarity index 98% rename from src/graphics/ui/elements/control/TextBox.cpp rename to src/graphics/ui/elements/TextBox.cpp index d7dbbc91..8791b4eb 100644 --- a/src/graphics/ui/elements/control/TextBox.cpp +++ b/src/graphics/ui/elements/TextBox.cpp @@ -1,12 +1,12 @@ #include "TextBox.hpp" -#include "../display/Label.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" -#include "../../../core/Font.h" -#include "../../../../assets/Assets.h" -#include "../../../../util/stringutil.h" -#include "../../../../window/Events.h" +#include "Label.hpp" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" +#include "../../core/Font.h" +#include "../../../assets/Assets.h" +#include "../../../util/stringutil.h" +#include "../../../window/Events.h" using namespace gui; diff --git a/src/graphics/ui/elements/control/TextBox.hpp b/src/graphics/ui/elements/TextBox.hpp similarity index 98% rename from src/graphics/ui/elements/control/TextBox.hpp rename to src/graphics/ui/elements/TextBox.hpp index 548bcb84..6dfe61e9 100644 --- a/src/graphics/ui/elements/control/TextBox.hpp +++ b/src/graphics/ui/elements/TextBox.hpp @@ -1,8 +1,8 @@ #ifndef GRAPHICS_UI_ELEMENTS_TEXTBOX_HPP_ #define GRAPHICS_UI_ELEMENTS_TEXTBOX_HPP_ -#include "../layout/Panel.hpp" -#include "../display/Label.hpp" +#include "Panel.hpp" +#include "Label.hpp" class Font; diff --git a/src/graphics/ui/elements/control/TrackBar.cpp b/src/graphics/ui/elements/TrackBar.cpp similarity index 95% rename from src/graphics/ui/elements/control/TrackBar.cpp rename to src/graphics/ui/elements/TrackBar.cpp index 17c009d9..0ccf9b02 100644 --- a/src/graphics/ui/elements/control/TrackBar.cpp +++ b/src/graphics/ui/elements/TrackBar.cpp @@ -1,8 +1,8 @@ #include "TrackBar.hpp" -#include "../../../core/GfxContext.h" -#include "../../../core/Batch2D.h" -#include "../../../../assets/Assets.h" +#include "../../core/GfxContext.h" +#include "../../core/Batch2D.h" +#include "../../../assets/Assets.h" using namespace gui; diff --git a/src/graphics/ui/elements/control/TrackBar.hpp b/src/graphics/ui/elements/TrackBar.hpp similarity index 98% rename from src/graphics/ui/elements/control/TrackBar.hpp rename to src/graphics/ui/elements/TrackBar.hpp index c54e0f61..e27ff0db 100644 --- a/src/graphics/ui/elements/control/TrackBar.hpp +++ b/src/graphics/ui/elements/TrackBar.hpp @@ -1,7 +1,7 @@ #ifndef GRAPHICS_UI_ELEMENTS_TRACKBAR_HPP_ #define GRAPHICS_UI_ELEMENTS_TRACKBAR_HPP_ -#include "../UINode.hpp" +#include "UINode.hpp" namespace gui { class TrackBar : public UINode { diff --git a/src/graphics/ui/elements/UINode.cpp b/src/graphics/ui/elements/UINode.cpp index 5f0f90d8..407e6996 100644 --- a/src/graphics/ui/elements/UINode.cpp +++ b/src/graphics/ui/elements/UINode.cpp @@ -1,6 +1,6 @@ #include "UINode.hpp" -#include "layout/Container.hpp" +#include "Container.hpp" #include "../../core/Batch2D.h" using gui::UINode; diff --git a/src/graphics/ui/gui_util.cpp b/src/graphics/ui/gui_util.cpp index 40a17e88..9748d572 100644 --- a/src/graphics/ui/gui_util.cpp +++ b/src/graphics/ui/gui_util.cpp @@ -1,7 +1,7 @@ #include "gui_util.h" -#include "elements/display/Label.hpp" -#include "elements/layout/Menu.hpp" -#include "elements/control/Button.hpp" +#include "elements/Label.hpp" +#include "elements/Menu.hpp" +#include "elements/Button.hpp" #include "gui_xml.h" #include diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index 3a985416..3b762569 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -3,13 +3,13 @@ #include #include -#include "elements/layout/Panel.hpp" -#include "elements/display/Image.hpp" -#include "elements/control/Button.hpp" -#include "elements/control/CheckBox.hpp" -#include "elements/control/TextBox.hpp" -#include "elements/control/TrackBar.hpp" -#include "elements/control/InputBindBox.hpp" +#include "elements/Panel.hpp" +#include "elements/Image.hpp" +#include "elements/Button.hpp" +#include "elements/CheckBox.hpp" +#include "elements/TextBox.hpp" +#include "elements/TrackBar.hpp" +#include "elements/InputBindBox.hpp" #include "../../frontend/locale/langs.h" #include "../../logic/scripting/scripting.h" diff --git a/src/logic/EngineController.cpp b/src/logic/EngineController.cpp index 4470d26f..5928b537 100644 --- a/src/logic/EngineController.cpp +++ b/src/logic/EngineController.cpp @@ -8,10 +8,10 @@ #include "../frontend/locale/langs.h" #include "../frontend/screens.h" #include "../frontend/menu.hpp" -#include "../graphics/ui/elements/display/Label.hpp" -#include "../graphics/ui/elements/control/Button.hpp" -#include "../graphics/ui/elements/layout/Panel.hpp" -#include "../graphics/ui/elements/layout/Menu.hpp" +#include "../graphics/ui/elements/Label.hpp" +#include "../graphics/ui/elements/Button.hpp" +#include "../graphics/ui/elements/Panel.hpp" +#include "../graphics/ui/elements/Menu.hpp" #include "../graphics/ui/gui_util.h" #include "../interfaces/Task.h" #include "../util/stringutil.h" diff --git a/src/logic/scripting/lua/libgui.cpp b/src/logic/scripting/lua/libgui.cpp index 9e3fd889..f063a33e 100644 --- a/src/logic/scripting/lua/libgui.cpp +++ b/src/logic/scripting/lua/libgui.cpp @@ -10,12 +10,12 @@ #include "../../../assets/Assets.h" #include "../../../graphics/ui/gui_util.h" #include "../../../graphics/ui/elements/UINode.hpp" -#include "../../../graphics/ui/elements/control/Button.hpp" -#include "../../../graphics/ui/elements/control/CheckBox.hpp" -#include "../../../graphics/ui/elements/control/TextBox.hpp" -#include "../../../graphics/ui/elements/control/TrackBar.hpp" -#include "../../../graphics/ui/elements/layout/Panel.hpp" -#include "../../../graphics/ui/elements/layout/Menu.hpp" +#include "../../../graphics/ui/elements/Button.hpp" +#include "../../../graphics/ui/elements/CheckBox.hpp" +#include "../../../graphics/ui/elements/TextBox.hpp" +#include "../../../graphics/ui/elements/TrackBar.hpp" +#include "../../../graphics/ui/elements/Panel.hpp" +#include "../../../graphics/ui/elements/Menu.hpp" #include "../../../frontend/UiDocument.h" #include "../../../frontend/locale/langs.h" #include "../../../util/stringutil.h"