MCPcopy Create free account
hub / github.com/RevoSucks/BM64Recomp / ModMenu

Method ModMenu

src/ui/ui_mod_menu.cpp:632–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632ModMenu::ModMenu(Element *parent) : Element(parent) {
633 game_mod_id = "bm64";
634
635 ContextId context = get_current_context();
636
637 set_display(Display::Flex);
638 set_flex(1.0f, 1.0f, 100.0f);
639 set_flex_direction(FlexDirection::Column);
640 set_align_items(AlignItems::Center);
641 set_justify_content(JustifyContent::FlexStart);
642 set_width(100.0f, Unit::Percent);
643 set_height(100.0f, Unit::Percent);
644
645 {
646 body_container = context.create_element<Container>(this, FlexDirection::Row, JustifyContent::FlexStart);
647 body_container->set_flex(1.0f, 1.0f, 100.0f);
648 body_container->set_width(100.0f, Unit::Percent);
649 body_container->set_height(100.0f, Unit::Percent);
650 {
651 list_container = context.create_element<Container>(body_container, FlexDirection::Column, JustifyContent::Center);
652 list_container->set_display(Display::Block);
653 list_container->set_flex_basis(100.0f);
654 list_container->set_align_items(AlignItems::Center);
655 list_container->set_height(100.0f, Unit::Percent);
656 list_container->set_background_color(Color{ 0, 0, 0, 89 });
657 list_container->set_border_bottom_left_radius(16.0f);
658 {
659 list_scroll_container = context.create_element<ScrollContainer>(list_container, ScrollDirection::Vertical);
660 } // list_container
661
662 mod_details_panel = context.create_element<ModDetailsPanel>(body_container);
663 mod_details_panel->set_mod_toggled_callback([this](bool enabled){ mod_toggled(enabled); });
664 mod_details_panel->set_mod_configure_pressed_callback([this](){ mod_configure_requested(); });
665 } // body_container
666
667 body_empty_container = context.create_element<Container>(this, FlexDirection::Column, JustifyContent::SpaceBetween);
668 body_empty_container->set_flex(1.0f, 1.0f, 100.0f);
669 body_empty_container->set_display(Display::None);
670 {
671 context.create_element<Element>(body_empty_container);
672 context.create_element<Label>(body_empty_container, "You have no mods. Go get some!", LabelStyle::Large);
673 context.create_element<Element>(body_empty_container);
674 } // body_empty_container
675
676 footer_container = context.create_element<Container>(this, FlexDirection::Row, JustifyContent::FlexStart);
677 footer_container->set_width(100.0f, recompui::Unit::Percent);
678 footer_container->set_align_items(recompui::AlignItems::Center);
679 footer_container->set_background_color(Color{ 0, 0, 0, 89 });
680 footer_container->set_border_top_width(1.1f);
681 footer_container->set_border_top_color(Color{ 255, 255, 255, 25 });
682 footer_container->set_padding(20.0f);
683 footer_container->set_gap(20.0f);
684 footer_container->set_border_bottom_left_radius(16.0f);
685 footer_container->set_border_bottom_right_radius(16.0f);
686 {
687 Button* configure_button = mod_details_panel->get_configure_button();
688 install_mods_button = context.create_element<Button>(footer_container, "Install Mods", recompui::ButtonStyle::Primary);
689 install_mods_button->add_pressed_callback([this](){ open_install_dialog(); });

Callers

nothing calls this directly

Calls 15

get_asset_pathFunction · 0.85
set_flexMethod · 0.80
set_widthMethod · 0.80
set_heightMethod · 0.80
set_flex_basisMethod · 0.80
set_align_itemsMethod · 0.80
set_background_colorMethod · 0.80
set_border_top_widthMethod · 0.80
set_border_top_colorMethod · 0.80

Tested by

no test coverage detected