@@ -18,6 +18,7 @@ MainWindow::MainWindow()
1818 Controller->Initialize ();
1919
2020 Controller->GetPermittedValues (Dasher::SP_ALPHABET_ID, Alphabets);
21+ Controller->GetPermittedValues (Dasher::SP_COLOUR_ID, ColorPalettes);
2122}
2223
2324#define FORWARD_KEY (ImGui_Key, DasherKey ) { \
@@ -105,10 +106,16 @@ bool MainWindow::render(float DeltaTime)
105106 Controller->SetLongParameter (Dasher::LP_MAX_BITRATE, speed);
106107 }
107108
108- static int item_current = 0 ;
109- if (ImGui::Combo (" Alphabet" , &item_current , [](void * data, int idx, const char ** out_text) { *out_text = static_cast <const std::vector<std::string>*>(data)->at (idx).c_str (); return true ; }, (void *)&Alphabets, static_cast <int >(Alphabets.size ()), 10 ))
109+ static int item_current_alphabet = 0 ;
110+ if (ImGui::Combo (" Alphabet" , &item_current_alphabet , [](void * data, int idx, const char ** out_text) { *out_text = static_cast <const std::vector<std::string>*>(data)->at (idx).c_str (); return true ; }, (void *)&Alphabets, static_cast <int >(Alphabets.size ()), 10 ))
110111 {
111- Controller->SetStringParameter (Dasher::SP_ALPHABET_ID, Alphabets[item_current]);
112+ Controller->SetStringParameter (Dasher::SP_ALPHABET_ID, Alphabets[item_current_alphabet]);
113+ }
114+
115+ static int item_current_colorpalette = 0 ;
116+ if (ImGui::Combo (" Color Palette" , &item_current_colorpalette, [](void * data, int idx, const char ** out_text) { *out_text = static_cast <const std::vector<std::string>*>(data)->at (idx).c_str (); return true ; }, (void *)&ColorPalettes, static_cast <int >(ColorPalettes.size ()), 10 ))
117+ {
118+ Controller->SetStringParameter (Dasher::SP_COLOUR_ID, ColorPalettes[item_current_colorpalette]);
112119 }
113120
114121 ImGui::EndMenu ();
0 commit comments