#include "ui_mod_menu.h" #include "recomp_ui.h" #include "librecomp/mods.hpp" #include #ifdef WIN32 #include #endif // TODO: // - Set up navigation. // - Add hover and active state for mod entries. namespace recompui { static std::string generate_thumbnail_src_for_mod(const std::string &mod_id) { return "?/mods/" + mod_id + "/thumb"; } // ModEntryView ModEntryView::ModEntryView(Element *parent) : Element(parent) { ContextId context = get_current_context(); set_display(Display::Flex); set_flex_direction(FlexDirection::Row); set_width(100.0f, Unit::Percent); set_height_auto(); set_padding_top(4.0f); set_padding_right(8.0f); set_padding_bottom(4.0f); set_padding_left(8.0f); set_border_width(1.1f); set_border_color(Color{ 242, 242, 242, 12 }); set_background_color(Color{ 242, 242, 242, 12 }); set_cursor(Cursor::Pointer); checked_style.set_border_color(Color{ 242, 242, 242, 160 }); hover_style.set_border_color(Color{ 242, 242, 242, 64 }); checked_hover_style.set_border_color(Color{ 242, 242, 242, 204 }); { thumbnail_image = context.create_element(this, ""); thumbnail_image->set_width(100.0f); thumbnail_image->set_height(100.0f); thumbnail_image->set_min_width(100.0f); thumbnail_image->set_min_height(100.0f); thumbnail_image->set_background_color(Color{ 190, 184, 219, 25 }); body_container = context.create_element(this, FlexDirection::Column, JustifyContent::FlexStart); body_container->set_width_auto(); body_container->set_height(100.0f); body_container->set_margin_left(16.0f); body_container->set_overflow(Overflow::Hidden); { name_label = context.create_element