|
|
|
@ -41,6 +41,7 @@
|
|
|
|
|
#include "music/music_driver.hpp"
|
|
|
|
|
#include "gui.h"
|
|
|
|
|
#include "mixer.h"
|
|
|
|
|
#include "newgrf_config.h"
|
|
|
|
|
#include "network/core/config.h"
|
|
|
|
|
#include "network/network_gui.h"
|
|
|
|
|
#include "network/network_survey.h"
|
|
|
|
@ -601,6 +602,16 @@ struct GameOptionsWindow : Window {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WID_GO_BASE_GRF_PARAMETERS: {
|
|
|
|
|
auto *used_set = BaseGraphics::GetUsedSet();
|
|
|
|
|
if (used_set == nullptr || !used_set->IsConfigurable()) break;
|
|
|
|
|
GRFConfig &extra_cfg = used_set->GetOrCreateExtraConfig();
|
|
|
|
|
if (extra_cfg.num_params == 0) extra_cfg.SetParameterDefaults();
|
|
|
|
|
OpenGRFParameterWindow(true, &extra_cfg, _game_mode == GM_MENU);
|
|
|
|
|
if (_game_mode == GM_MENU) this->reload = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WID_GO_BASE_SFX_VOLUME:
|
|
|
|
|
case WID_GO_BASE_MUSIC_VOLUME: {
|
|
|
|
|
byte &vol = (widget == WID_GO_BASE_MUSIC_VOLUME) ? _settings_client.music.music_vol : _settings_client.music.effect_vol;
|
|
|
|
@ -692,6 +703,7 @@ struct GameOptionsWindow : Window {
|
|
|
|
|
|
|
|
|
|
case WID_GO_BASE_GRF_DROPDOWN:
|
|
|
|
|
if (_game_mode == GM_MENU) {
|
|
|
|
|
CloseWindowByClass(WC_GRF_PARAMETERS);
|
|
|
|
|
auto* set = BaseGraphics::GetSet(index);
|
|
|
|
|
BaseGraphics::SetSet(set);
|
|
|
|
|
this->reload = true;
|
|
|
|
@ -742,6 +754,8 @@ struct GameOptionsWindow : Window {
|
|
|
|
|
bool missing_files = BaseGraphics::GetUsedSet()->GetNumMissing() == 0;
|
|
|
|
|
this->GetWidget<NWidgetCore>(WID_GO_BASE_GRF_STATUS)->SetDataTip(missing_files ? STR_EMPTY : STR_GAME_OPTIONS_BASE_GRF_STATUS, STR_NULL);
|
|
|
|
|
|
|
|
|
|
this->SetWidgetDisabledState(WID_GO_BASE_GRF_PARAMETERS, BaseGraphics::GetUsedSet() == nullptr || !BaseGraphics::GetUsedSet()->IsConfigurable());
|
|
|
|
|
|
|
|
|
|
for (TextfileType tft = TFT_CONTENT_BEGIN; tft < TFT_CONTENT_END; tft++) {
|
|
|
|
|
this->SetWidgetDisabledState(WID_GO_BASE_GRF_TEXTFILE + tft, BaseGraphics::GetUsedSet() == nullptr || !BaseGraphics::GetUsedSet()->GetTextfile(tft).has_value());
|
|
|
|
|
this->SetWidgetDisabledState(WID_GO_BASE_SFX_TEXTFILE + tft, BaseSounds::GetUsedSet() == nullptr || !BaseSounds::GetUsedSet()->GetTextfile(tft).has_value());
|
|
|
|
@ -853,6 +867,7 @@ static const NWidgetPart _nested_game_options_widgets[] = {
|
|
|
|
|
NWidget(NWID_HORIZONTAL), SetPIP(0, 30, 0),
|
|
|
|
|
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_BASE_GRF_DROPDOWN), SetMinimalSize(100, 12), SetDataTip(STR_JUST_RAW_STRING, STR_GAME_OPTIONS_BASE_GRF_TOOLTIP),
|
|
|
|
|
NWidget(WWT_TEXT, COLOUR_GREY, WID_GO_BASE_GRF_STATUS), SetMinimalSize(100, 12), SetDataTip(STR_EMPTY, STR_NULL), SetFill(1, 0),
|
|
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_GO_BASE_GRF_PARAMETERS), SetDataTip(STR_NEWGRF_SETTINGS_SET_PARAMETERS, STR_NULL),
|
|
|
|
|
EndContainer(),
|
|
|
|
|
NWidget(WWT_TEXT, COLOUR_GREY, WID_GO_BASE_GRF_DESCRIPTION), SetMinimalSize(200, 0), SetDataTip(STR_EMPTY, STR_GAME_OPTIONS_BASE_GRF_DESCRIPTION_TOOLTIP), SetFill(1, 0), SetPadding(6, 0, 6, 0),
|
|
|
|
|
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(7, 0, 7),
|
|
|
|
|