#include "Cubed/ui/host_game_ui.hpp" #include "Cubed/app.hpp" #include "Cubed/localization.hpp" #include "Cubed/scene/host_game_scene.hpp" #include "Cubed/scene/scene_manager.hpp" #include "Cubed/ui/button.hpp" #include "Cubed/ui/column_layout.hpp" #include "Cubed/ui/default_image.hpp" #include "Cubed/ui/image.hpp" #include "Cubed/ui/text_field.hpp" namespace Cubed { HostGameUI::HostGameUI(HostGameScene& scene) : m_scene(scene) {} void HostGameUI::init() { auto bi = std::make_unique(nullptr); auto& renderer = m_scene.scene_manager().app().renderer(); auto& texture_manager = m_scene.scene_manager().app().texture_manager(); bi->set_window_size(renderer.window_width(), renderer.window_height()); bi->set_anchor(Anchor::TOP_LEFT); bi->set_image("texture/ui/background.png", texture_manager); bi->set_fill(true); auto& rect = bi->add_child(); rect.set_fill(true); rect.set_alpha(0.7f); rect.set_color(Color::BLACK); auto& layout = rect.add_child(); layout.set_anchor(Anchor::CENTER); layout.set_offset({0, 20}); layout.set_spacing(20.0f); auto& param = m_scene.scene_manager().world_scene_param(); param.host_game = true; { auto& label = layout.add_child