Merge branch 'master' into save_ext

# Conflicts:
#	src/saveload/saveload.cpp
This commit is contained in:
Jonathan G Rennison
2018-05-25 19:09:20 +01:00
222 changed files with 2570 additions and 1542 deletions

View File

@@ -114,19 +114,24 @@ static int GetCurRes()
static void ShowCustCurrency();
template <class T>
static DropDownList *BuiltSetDropDownList(int *selected_index)
static DropDownList *BuildSetDropDownList(int *selected_index, bool allow_selection)
{
int n = T::GetNumSets();
*selected_index = T::GetIndexOfUsedSet();
DropDownList *list = new DropDownList();
for (int i = 0; i < n; i++) {
*list->Append() = new DropDownListCharStringItem(T::GetSet(i)->name, i, (_game_mode == GM_MENU) ? false : (*selected_index != i));
*list->Append() = new DropDownListCharStringItem(T::GetSet(i)->name, i, !allow_selection && (*selected_index != i));
}
return list;
}
DropDownList *BuildMusicSetDropDownList(int *selected_index)
{
return BuildSetDropDownList<BaseMusic>(selected_index, true);
}
/** Window for displaying the textfile of a BaseSet. */
template <class TBaseSet>
struct BaseSetTextfileWindow : public TextfileWindow {
@@ -297,15 +302,15 @@ struct GameOptionsWindow : Window {
}
case WID_GO_BASE_GRF_DROPDOWN:
list = BuiltSetDropDownList<BaseGraphics>(selected_index);
list = BuildSetDropDownList<BaseGraphics>(selected_index, (_game_mode == GM_MENU));
break;
case WID_GO_BASE_SFX_DROPDOWN:
list = BuiltSetDropDownList<BaseSounds>(selected_index);
list = BuildSetDropDownList<BaseSounds>(selected_index, (_game_mode == GM_MENU));
break;
case WID_GO_BASE_MUSIC_DROPDOWN:
list = BuiltSetDropDownList<BaseMusic>(selected_index);
list = BuildMusicSetDropDownList(selected_index);
break;
default:
@@ -544,7 +549,7 @@ struct GameOptionsWindow : Window {
break;
case WID_GO_BASE_MUSIC_DROPDOWN:
this->SetMediaSet<BaseMusic>(index);
ChangeMusicSet(index);
break;
}
}
@@ -1508,9 +1513,8 @@ static SettingsContainer &GetSettingsTree()
SettingsPage *viewports = interface->Add(new SettingsPage(STR_CONFIG_SETTING_INTERFACE_VIEWPORTS));
{
viewports->Add(new SettingEntry("gui.auto_scrolling"));
viewports->Add(new SettingEntry("gui.reverse_scroll"));
viewports->Add(new SettingEntry("gui.scroll_mode"));
viewports->Add(new SettingEntry("gui.smooth_scroll"));
viewports->Add(new SettingEntry("gui.left_mouse_btn_scrolling"));
/* While the horizontal scrollwheel scrolling is written as general code, only
* the cocoa (OSX) driver generates input for it.
* Since it's also able to completely disable the scrollwheel will we display it on all platforms anyway */