MCPcopy Create free account
hub / github.com/Cpasjuste/pplay / MenuMainOptionsSubmenu

Method MenuMainOptionsSubmenu

src/menus/menu_main_options_submenu.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace c2d;
10
11MenuMainOptionsSubmenu::MenuMainOptionsSubmenu(
12 Main *main, const c2d::FloatRect &rect, const std::string &_title,
13 const std::vector<MenuItem> &items, const std::string &optionName)
14 : Menu(main, rect, _title, items, true) {
15
16 option_name = optionName;
17
18 // highlight
19 highlight_selection = new Highlight({MenuMainOptionsSubmenu::getSize().x, BUTTON_HEIGHT * main->getScaling().x},
20 Highlight::CursorPosition::Left);
21 highlight_selection->setFillColor(COLOR_BLUE);
22 highlight_selection->setAlpha(60);
23 highlight_selection->setCursorColor(COLOR_RED);
24 highlight_selection->setOrigin(Origin::Left);
25 highlight_selection->setPosition(0, 200);
26 highlight_selection->setLayer(-1);
27 MenuMainOptionsSubmenu::add(highlight_selection);
28}
29
30void MenuMainOptionsSubmenu::setSelection(const std::string &name) {
31 for (auto btn: buttons) {

Callers

nothing calls this directly

Calls 4

getScalingMethod · 0.80
setCursorColorMethod · 0.80
setFillColorMethod · 0.45
setAlphaMethod · 0.45

Tested by

no test coverage detected