From 791ebed6017b8846f8bd63c323c12a5c56fe14b9 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 3 Jul 2016 19:27:05 -0400 Subject: control save/load, tracking default config --- src/ui_menu.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/ui_menu.cpp') diff --git a/src/ui_menu.cpp b/src/ui_menu.cpp index 2419ed2..ca830d8 100644 --- a/src/ui_menu.cpp +++ b/src/ui_menu.cpp @@ -63,12 +63,7 @@ void initControls(Menu *m) for (const auto &l : cfg) { z = static_cast(std::stoi(l)); setControl(i, z); - std::cout<<"1\n"; - auto fs = sym2str(z); - std::cout<<"2 " << i << "\n"; - std::cout<items[i].button.text<<'\n'; - m->items[i++].button.text += fs; - std::cout<<"3\n"; + m->items[i++].button.text += sym2str(z); } } @@ -175,12 +170,12 @@ namespace ui { optionsMenu.parent = &pauseMenu; // Create the controls menu - controlsMenu.items.push_back(ui::menu::createButton({-450,300}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Left: ", nullptr)); - controlsMenu.items.back().button.func = [](){ setControlF(1, controlsMenu.items[0]); }; - controlsMenu.items.push_back(ui::menu::createButton({-450,200}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Right: ", nullptr)); - controlsMenu.items.back().button.func = [](){ setControlF(2, controlsMenu.items[1]); }; - controlsMenu.items.push_back(ui::menu::createButton({-450,100}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Up: ", nullptr)); - controlsMenu.items.back().button.func = [](){ setControlF(0, controlsMenu.items[2]); }; + controlsMenu.items.push_back(ui::menu::createButton({-450,300}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Up: ", nullptr)); + controlsMenu.items.back().button.func = [](){ setControlF(0, controlsMenu.items[0]); }; + controlsMenu.items.push_back(ui::menu::createButton({-450,200}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Left: ", nullptr)); + controlsMenu.items.back().button.func = [](){ setControlF(1, controlsMenu.items[1]); }; + controlsMenu.items.push_back(ui::menu::createButton({-450,100}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Right: ", nullptr)); + controlsMenu.items.back().button.func = [](){ setControlF(2, controlsMenu.items[2]); }; controlsMenu.items.push_back(ui::menu::createButton({-450,0}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Sprint: ", nullptr)); controlsMenu.items.back().button.func = [](){ setControlF(3, controlsMenu.items[3]); }; controlsMenu.items.push_back(ui::menu::createButton({-450,-100}, {400, 75}, {0.0f, 0.0f, 0.0f}, "Creep: ", nullptr)); -- cgit v1.2.3