mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-20 19:02:41 +01:00
(svn r22650) [1.1] -Backport from trunk:
- Fix: When changing difficulty settings over the network, do not just reopen the difficulty window if any game options window is opened; instead invalidate them properly [FS#4653] (r22618, r22617) - Fix: [NewGRF] If callback 33 returns a value out of range, no sound effect shall be played [FS#4656] (r22614) - Fix: Use rotated heightmap sizes for reporting scaling problems [FS#4663] (r22608) - Fix: No client error packet was sent to the admin bots [FS#4585] (r22384)
This commit is contained in:
@@ -462,7 +462,7 @@ struct GameOptionsWindow : Window {
|
||||
|
||||
/**
|
||||
* Some data on this window has become invalid.
|
||||
* @param data Information about the changed data.
|
||||
* @param data Information about the changed data. @see GameOptionsInvalidationData
|
||||
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
|
||||
*/
|
||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||
@@ -596,9 +596,6 @@ public:
|
||||
{
|
||||
this->InitNested(desc);
|
||||
|
||||
/* Copy current settings (ingame or in intro) to temporary holding place
|
||||
* change that when setting stuff, copy back on clicking 'OK' */
|
||||
this->opt_mod_temp = GetGameSettings();
|
||||
/* Setup disabled buttons when creating window
|
||||
* disable all other difficulty buttons during gameplay except for 'custom' */
|
||||
this->SetWidgetsDisabledState(_game_mode != GM_MENU,
|
||||
@@ -609,8 +606,9 @@ public:
|
||||
WIDGET_LIST_END);
|
||||
this->SetWidgetDisabledState(GDW_HIGHSCORE, _game_mode == GM_EDITOR || _networking); // highscore chart in multiplayer
|
||||
this->SetWidgetDisabledState(GDW_ACCEPT, _networking && !_network_server); // Save-button in multiplayer (and if client)
|
||||
this->LowerWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
|
||||
this->OnInvalidateData();
|
||||
|
||||
/* Read data */
|
||||
this->OnInvalidateData(GOID_DIFFICULTY_CHANGED);
|
||||
}
|
||||
|
||||
virtual void SetStringParameters(int widget) const
|
||||
@@ -734,12 +732,23 @@ public:
|
||||
|
||||
/**
|
||||
* Some data on this window has become invalid.
|
||||
* @param data Information about the changed data.
|
||||
* @param data Information about the changed data. @see GameOptionsInvalidationData
|
||||
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
|
||||
*/
|
||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
|
||||
if (data == GOID_DIFFICULTY_CHANGED) {
|
||||
/* Window was created or settings were changed on server. Reread everything. */
|
||||
|
||||
/* Copy current settings (ingame or in intro) to temporary holding place
|
||||
* change that when setting stuff, copy back on clicking 'OK' */
|
||||
this->opt_mod_temp = GetGameSettings();
|
||||
|
||||
this->LowerWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
|
||||
}
|
||||
|
||||
uint i;
|
||||
const SettingDesc *sd = GetSettingFromName("difficulty.max_no_competitors", &i);
|
||||
for (i = 0; i < GAME_DIFFICULTY_NUM; i++, sd++) {
|
||||
|
||||
Reference in New Issue
Block a user