Fix #11087: Disable base graphics/sound dropdown outside main menu

This commit is contained in:
merni-ns
2023-07-01 17:27:06 +05:30
committed by rubidium42
parent 4ae9ebf582
commit 161cc04b8a
3 changed files with 19 additions and 24 deletions

View File

@@ -22,7 +22,18 @@ void DrawArrowButtons(int x, int y, Colours button_colour, byte state, bool clic
void DrawDropDownButton(int x, int y, Colours button_colour, bool state, bool clickable);
void DrawBoolButton(int x, int y, bool state, bool clickable);
DropDownList BuildMusicSetDropDownList(int *selected_index);
template <class T>
DropDownList BuildSetDropDownList(int *selected_index)
{
int n = T::GetNumSets();
*selected_index = T::GetIndexOfUsedSet();
DropDownList list;
for (int i = 0; i < n; i++) {
list.emplace_back(new DropDownListStringItem(T::GetSet(i)->name, i, false));
}
return list;
}
/* Actually implemented in music_gui.cpp */
void ChangeMusicSet(int index);