1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Peter Nelson f3b4707872
Merge 449c8fc2d2 into 009b7cbc57 2025-07-27 15:05:56 +00:00
Peter Nelson 009b7cbc57
Fix #14480: Music player playlist buttons are clickable but non-operational in intro menu. (#14482)
In the intro menu the music is hardcoded to be the introduction track. Therefore, prevent these buttons being clickable.
2025-07-27 16:03:47 +01:00
Peter Nelson 449c8fc2d2
Fix: Prevent NewGRFs from reading parameters of graphics baseset. 2025-07-22 20:16:51 +01:00
3 changed files with 10 additions and 5 deletions

View File

@ -153,6 +153,7 @@ static std::unique_ptr<GRFConfig> GetDefaultExtraGRFConfig()
gc->palette |= GRFP_GRF_DOS;
FillGRFDetails(*gc, false, BASESET_DIR);
gc->flags.Reset(GRFConfigFlag::InitOnly);
gc->flags.Set(GRFConfigFlag::System);
return gc;
}
@ -165,6 +166,7 @@ static std::unique_ptr<GRFConfig> GetBasesetExtraGRFConfig()
auto gc = std::make_unique<GRFConfig>(BaseGraphics::GetUsedSet()->GetOrCreateExtraConfig());
if (gc->param.empty()) gc->SetParameterDefaults();
gc->flags.Reset(GRFConfigFlag::InitOnly);
gc->flags.Set(GRFConfigFlag::System);
return gc;
}

View File

@ -683,13 +683,16 @@ struct MusicWindow : public Window {
void UpdateDisabledButtons()
{
/* Disable music control widgets if there is no music
* -- except Programme button! So you can still select a music set. */
/* Disable stop and play if there is no music. */
this->SetWidgetsDisabledState(BaseMusic::GetUsedSet()->num_available == 0, WID_M_STOP, WID_M_PLAY);
/* Disable most music control widgets if there is no music, or we are in the intro menu. */
this->SetWidgetsDisabledState(
BaseMusic::GetUsedSet()->num_available == 0,
WID_M_PREV, WID_M_NEXT, WID_M_STOP, WID_M_PLAY, WID_M_SHUFFLE,
BaseMusic::GetUsedSet()->num_available == 0 || _game_mode == GM_MENU,
WID_M_PREV, WID_M_NEXT, WID_M_SHUFFLE,
WID_M_ALL, WID_M_OLD, WID_M_NEW, WID_M_EZY, WID_M_CUSTOM1, WID_M_CUSTOM2
);
/* Also disable programme button in the intro menu (not in game; it is desirable to allow change of music set.) */
this->SetWidgetsDisabledState(_game_mode == GM_MENU, WID_M_PROGRAMME);
}
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override

View File

@ -319,7 +319,7 @@ static void ParamSet(ByteReader &buf)
/* Disable the read GRF if it is a static NewGRF. */
DisableStaticNewGRFInfluencingNonStaticNewGRFs(*c);
src1 = 0;
} else if (file == nullptr || c == nullptr || c->status == GCS_DISABLED) {
} else if (file == nullptr || c == nullptr || c->status == GCS_DISABLED || c->flags.Test(GRFConfigFlag::System)) {
src1 = 0;
} else if (src1 == 0xFE) {
src1 = c->version;