2016-07-10 05:05:00 +00:00
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers , whose names
* are too numerous to list here . Please refer to the COPYRIGHT
* file distributed with this source distribution .
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
*
*/
# include "gui/editgamedialog.h"
2020-01-23 09:50:52 +00:00
# include "backends/keymapper/keymapper.h"
2016-07-10 05:05:00 +00:00
# include "common/config-manager.h"
# include "common/gui_options.h"
# include "common/translation.h"
2016-07-15 12:27:56 +00:00
# include "common/system.h"
2016-07-10 05:05:00 +00:00
# include "gui/browser.h"
2018-01-06 15:13:29 +00:00
# include "gui/gui-manager.h"
2016-07-10 05:05:00 +00:00
# include "gui/message.h"
# ifdef ENABLE_EVENTRECORDER
# include "gui/onscreendialog.h"
# include "gui/recorderdialog.h"
# include "gui/EventRecorder.h"
# endif
# include "gui/widgets/edittext.h"
# include "gui/widgets/tab.h"
# include "gui/widgets/popup.h"
2018-07-21 23:01:01 +00:00
# include "gui/widgets/scrollcontainer.h"
2016-07-10 05:05:00 +00:00
2016-10-17 16:45:12 +00:00
# if defined(USE_CLOUD) && defined(USE_LIBCURL)
2016-07-10 05:05:00 +00:00
# include "backends/cloud/cloudmanager.h"
# endif
using Common : : ConfigManager ;
namespace GUI {
enum {
kStartCmd = ' STRT ' ,
kAboutCmd = ' ABOU ' ,
kOptionsCmd = ' OPTN ' ,
kAddGameCmd = ' ADDG ' ,
kEditGameCmd = ' EDTG ' ,
kRemoveGameCmd = ' REMG ' ,
kLoadGameCmd = ' LOAD ' ,
kQuitCmd = ' QUIT ' ,
kSearchCmd = ' SRCH ' ,
kListSearchCmd = ' LSSR ' ,
kSearchClearCmd = ' SRCL ' ,
kCmdGlobalGraphicsOverride = ' OGFX ' ,
2020-01-29 23:13:32 +00:00
kCmdGlobalShaderOverride = ' OSHD ' ,
2016-07-10 05:05:00 +00:00
kCmdGlobalAudioOverride = ' OSFX ' ,
kCmdGlobalMIDIOverride = ' OMID ' ,
kCmdGlobalMT32Override = ' OM32 ' ,
kCmdGlobalVolumeOverride = ' OVOL ' ,
kCmdChooseSoundFontCmd = ' chsf ' ,
kCmdExtraBrowser = ' PEXT ' ,
kCmdExtraPathClear = ' PEXC ' ,
kCmdGameBrowser = ' PGME ' ,
kCmdSaveBrowser = ' PSAV ' ,
2018-07-21 23:01:01 +00:00
kCmdSavePathClear = ' PSAC ' ,
kGraphicsTabContainerReflowCmd = ' gtcr '
2016-07-10 05:05:00 +00:00
} ;
/*
* TODO : Clean up this ugly design : we subclass EditTextWidget to perform
* input validation . It would be much more elegant to use a decorator pattern ,
* or a validation callback , or something like that .
*/
class DomainEditTextWidget : public EditTextWidget {
public :
2020-11-15 18:15:58 +00:00
DomainEditTextWidget ( GuiObject * boss , const String & name , const U32String & text , const U32String & tooltip = U32String ( ) )
2016-07-10 05:05:00 +00:00
: EditTextWidget ( boss , name , text , tooltip ) { }
protected :
2020-01-05 16:48:04 +00:00
bool tryInsertChar ( byte c , int pos ) override {
2016-07-10 05:05:00 +00:00
if ( Common : : isAlnum ( c ) | | c = = ' - ' | | c = = ' _ ' ) {
_editString . insertChar ( c , pos ) ;
return true ;
}
return false ;
}
} ;
2018-05-06 10:57:08 +00:00
EditGameDialog : : EditGameDialog ( const String & domain )
2016-07-10 05:05:00 +00:00
: OptionsDialog ( domain , " GameOptions " ) {
2016-09-15 16:43:42 +00:00
EngineMan . upgradeTargetIfNecessary ( domain ) ;
2020-03-22 14:19:56 +00:00
_engineOptions = nullptr ;
2016-09-25 06:45:42 +00:00
2016-07-10 05:05:00 +00:00
// Retrieve the plugin, since we need to access the engine's MetaEngine
// implementation.
2020-08-03 19:12:23 +00:00
const Plugin * metaEnginePlugin = nullptr ;
const Plugin * enginePlugin = nullptr ;
QualifiedGameDescriptor qgd = EngineMan . findTarget ( domain , & metaEnginePlugin ) ;
if ( ! metaEnginePlugin ) {
warning ( " MetaEnginePlugin for target \" %s \" not found! " , domain . c_str ( ) ) ;
} else {
2020-09-30 08:35:56 +00:00
enginePlugin = PluginMan . getEngineFromMetaEngine ( metaEnginePlugin ) ;
2020-08-03 19:12:23 +00:00
if ( ! enginePlugin ) {
warning ( " Engine Plugin for target \" %s \" not found! Game specific settings might be missing. " , domain . c_str ( ) ) ;
}
2016-07-10 05:05:00 +00:00
}
// GAME: Path to game data (r/o), extra data (r/o), and save data (r/w)
String gamePath ( ConfMan . get ( " path " , _domain ) ) ;
String extraPath ( ConfMan . get ( " extrapath " , _domain ) ) ;
String savePath ( ConfMan . get ( " savepath " , _domain ) ) ;
// GAME: Determine the description string
String description ( ConfMan . get ( " description " , domain ) ) ;
2020-01-01 07:19:48 +00:00
if ( description . empty ( ) & & ! qgd . description . empty ( ) ) {
2016-09-25 06:45:42 +00:00
description = qgd . description ;
2016-07-10 05:05:00 +00:00
}
// GUI: Add tab widget
TabWidget * tab = new TabWidget ( this , " GameOptions.TabWidget " ) ;
//
// 1) The game tab
//
2020-07-01 18:01:48 +00:00
tab - > addTab ( _ ( " Game " ) , " GameOptions_Game " ) ;
2016-07-10 05:05:00 +00:00
// GUI: Label & edit widget for the game ID
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-07-01 18:01:48 +00:00
new StaticTextWidget ( tab , " GameOptions_Game.Id " , _ ( " ID: " ) , _ ( " Short game identifier used for referring to saved games and running the game from the command line " ) ) ;
2016-07-10 05:05:00 +00:00
else
2020-07-01 18:01:48 +00:00
new StaticTextWidget ( tab , " GameOptions_Game.Id " , _c ( " ID: " , " lowres " ) , _ ( " Short game identifier used for referring to saved games and running the game from the command line " ) ) ;
2016-07-10 05:05:00 +00:00
_domainWidget = new DomainEditTextWidget ( tab , " GameOptions_Game.Domain " , _domain , _ ( " Short game identifier used for referring to saved games and running the game from the command line " ) ) ;
// GUI: Label & edit widget for the description
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-07-01 18:01:48 +00:00
new StaticTextWidget ( tab , " GameOptions_Game.Name " , _ ( " Name: " ) , _ ( " Full title of the game " ) ) ;
2016-07-10 05:05:00 +00:00
else
2020-07-01 18:01:48 +00:00
new StaticTextWidget ( tab , " GameOptions_Game.Name " , _c ( " Name: " , " lowres " ) , _ ( " Full title of the game " ) ) ;
2016-07-10 05:05:00 +00:00
_descriptionWidget = new EditTextWidget ( tab , " GameOptions_Game.Desc " , description , _ ( " Full title of the game " ) ) ;
// Language popup
2020-07-01 18:01:48 +00:00
_langPopUpDesc = new StaticTextWidget ( tab , " GameOptions_Game.LangPopupDesc " , _ ( " Language: " ) , _ ( " Language of the game. This will not turn your Spanish game version into English " ) ) ;
2016-07-10 05:05:00 +00:00
_langPopUp = new PopUpWidget ( tab , " GameOptions_Game.LangPopup " , _ ( " Language of the game. This will not turn your Spanish game version into English " ) ) ;
2020-07-01 18:01:48 +00:00
_langPopUp - > appendEntry ( _ ( " <default> " ) , ( uint32 ) Common : : UNK_LANG ) ;
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
_langPopUp - > appendEntry ( " " , ( uint32 ) Common : : UNK_LANG ) ;
2016-07-10 05:05:00 +00:00
const Common : : LanguageDescription * l = Common : : g_languages ;
for ( ; l - > code ; + + l ) {
if ( checkGameGUIOptionLanguage ( l - > id , _guioptionsString ) )
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
_langPopUp - > appendEntry ( l - > description , l - > id ) ;
2016-07-10 05:05:00 +00:00
}
// Platform popup
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-07-01 18:01:48 +00:00
_platformPopUpDesc = new StaticTextWidget ( tab , " GameOptions_Game.PlatformPopupDesc " , _ ( " Platform: " ) , _ ( " Platform the game was originally designed for " ) ) ;
2016-07-10 05:05:00 +00:00
else
2020-07-01 18:01:48 +00:00
_platformPopUpDesc = new StaticTextWidget ( tab , " GameOptions_Game.PlatformPopupDesc " , _c ( " Platform: " , " lowres " ) , _ ( " Platform the game was originally designed for " ) ) ;
2016-07-10 05:05:00 +00:00
_platformPopUp = new PopUpWidget ( tab , " GameOptions_Game.PlatformPopup " , _ ( " Platform the game was originally designed for " ) ) ;
2020-07-01 18:01:48 +00:00
_platformPopUp - > appendEntry ( _ ( " <default> " ) ) ;
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
_platformPopUp - > appendEntry ( " " ) ;
2016-07-10 05:05:00 +00:00
const Common : : PlatformDescription * p = Common : : g_platforms ;
for ( ; p - > code ; + + p ) {
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
_platformPopUp - > appendEntry ( p - > description , p - > id ) ;
2016-07-10 05:05:00 +00:00
}
//
2020-03-22 14:19:56 +00:00
// 2) The engine tab (shown only if the engine implements one or there are custom engine options)
2016-07-10 05:05:00 +00:00
//
2020-08-03 19:12:23 +00:00
if ( metaEnginePlugin ) {
2020-07-01 18:01:48 +00:00
int tabId = tab - > addTab ( _ ( " Engine " ) , " GameOptions_Engine " ) ;
2020-03-22 14:19:56 +00:00
2020-10-11 21:14:39 +00:00
const MetaEngineDetection & metaEngine = metaEnginePlugin - > get < MetaEngineDetection > ( ) ;
2020-03-22 14:19:56 +00:00
metaEngine . registerDefaultSettings ( _domain ) ;
2020-08-07 18:18:59 +00:00
_engineOptions = metaEngine . buildEngineOptionsWidgetStatic ( tab , " GameOptions_Engine.Container " , _domain ) ;
2020-03-22 14:19:56 +00:00
if ( _engineOptions ) {
_engineOptions - > setParentDialog ( this ) ;
} else {
tab - > removeTab ( tabId ) ;
}
2016-07-10 05:05:00 +00:00
}
//
// 3) The graphics tab
//
2020-07-01 18:01:48 +00:00
_graphicsTabId = tab - > addTab ( g_system - > getOverlayWidth ( ) > 320 ? _ ( " Graphics " ) : _ ( " GFX " ) , " GameOptions_Graphics " ) ;
2019-12-28 09:43:58 +00:00
ScrollContainerWidget * graphicsContainer = new ScrollContainerWidget ( tab , " GameOptions_Graphics.Container " , " GameOptions_Graphics_Container " , kGraphicsTabContainerReflowCmd ) ;
2019-12-28 09:43:58 +00:00
graphicsContainer - > setBackgroundType ( ThemeEngine : : kWidgetBackgroundNo ) ;
2018-07-21 23:01:01 +00:00
graphicsContainer - > setTarget ( this ) ;
2016-07-10 05:05:00 +00:00
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-11-15 18:15:58 +00:00
_globalGraphicsOverride = new CheckboxWidget ( graphicsContainer , " GameOptions_Graphics_Container.EnableTabCheckbox " , _ ( " Override global graphic settings " ) , Common : : U32String ( ) , kCmdGlobalGraphicsOverride ) ;
2016-07-10 05:05:00 +00:00
else
2020-11-15 18:15:58 +00:00
_globalGraphicsOverride = new CheckboxWidget ( graphicsContainer , " GameOptions_Graphics_Container.EnableTabCheckbox " , _c ( " Override global graphic settings " , " lowres " ) , Common : : U32String ( ) , kCmdGlobalGraphicsOverride ) ;
2016-07-10 05:05:00 +00:00
2018-07-21 23:01:01 +00:00
addGraphicControls ( graphicsContainer , " GameOptions_Graphics_Container. " ) ;
2016-07-10 05:05:00 +00:00
2020-01-29 23:13:32 +00:00
//
// The shader tab (currently visible only for Vita platform), visibility checking by features
//
_globalShaderOverride = nullptr ;
if ( g_system - > hasFeature ( OSystem : : kFeatureShader ) ) {
2020-07-01 18:01:48 +00:00
tab - > addTab ( _ ( " Shader " ) , " GameOptions_Shader " ) ;
2020-01-29 23:13:32 +00:00
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-11-15 18:15:58 +00:00
_globalShaderOverride = new CheckboxWidget ( tab , " GameOptions_Shader.EnableTabCheckbox " , _ ( " Override global shader settings " ) , Common : : U32String ( ) , kCmdGlobalShaderOverride ) ;
2020-01-29 23:13:32 +00:00
else
2020-11-15 18:15:58 +00:00
_globalShaderOverride = new CheckboxWidget ( tab , " GameOptions_Shader.EnableTabCheckbox " , _c ( " Override global shader settings " , " lowres " ) , Common : : U32String ( ) , kCmdGlobalShaderOverride ) ;
2020-01-29 23:13:32 +00:00
addShaderControls ( tab , " GameOptions_Shader. " ) ;
}
2020-01-23 09:50:52 +00:00
//
// The Keymap tab
//
2020-01-28 17:44:08 +00:00
Common : : KeymapArray keymaps ;
2020-08-03 19:12:23 +00:00
if ( enginePlugin ) {
2020-10-02 05:46:09 +00:00
keymaps = enginePlugin - > get < MetaEngine > ( ) . initKeymaps ( domain . c_str ( ) ) ;
2020-01-23 09:50:52 +00:00
}
2020-01-28 17:44:08 +00:00
if ( ! keymaps . empty ( ) ) {
2020-07-01 18:01:48 +00:00
tab - > addTab ( _ ( " Keymaps " ) , " GameOptions_KeyMapper " ) ;
2020-01-28 17:44:08 +00:00
addKeyMapperControls ( tab , " GameOptions_KeyMapper. " , keymaps , domain ) ;
2020-01-23 09:50:52 +00:00
}
2020-05-11 11:05:56 +00:00
//
// The backend tab (shown only if the backend implements one)
//
int backendTabId = tab - > addTab ( _ ( " Backend " ) , " GameOptions_Backend " ) ;
g_system - > registerDefaultSettings ( _domain ) ;
_backendOptions = g_system - > buildBackendOptionsWidget ( tab , " GameOptions_Backend.Container " , _domain ) ;
if ( _backendOptions ) {
_backendOptions - > setParentDialog ( this ) ;
} else {
tab - > removeTab ( backendTabId ) ;
}
2016-07-10 05:05:00 +00:00
//
// 4) The audio tab
//
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
tab - > addTab ( _ ( " Audio " ) , " GameOptions_Audio " ) ;
2016-07-10 05:05:00 +00:00
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-11-15 18:15:58 +00:00
_globalAudioOverride = new CheckboxWidget ( tab , " GameOptions_Audio.EnableTabCheckbox " , _ ( " Override global audio settings " ) , Common : : U32String ( ) , kCmdGlobalAudioOverride ) ;
2016-07-10 05:05:00 +00:00
else
2020-11-15 18:15:58 +00:00
_globalAudioOverride = new CheckboxWidget ( tab , " GameOptions_Audio.EnableTabCheckbox " , _c ( " Override global audio settings " , " lowres " ) , Common : : U32String ( ) , kCmdGlobalAudioOverride ) ;
2016-07-10 05:05:00 +00:00
addAudioControls ( tab , " GameOptions_Audio. " ) ;
addSubtitleControls ( tab , " GameOptions_Audio. " ) ;
//
// 5) The volume tab
//
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-07-01 18:01:48 +00:00
tab - > addTab ( _ ( " Volume " ) , " GameOptions_Volume " ) ;
2016-07-10 05:05:00 +00:00
else
2020-07-01 18:01:48 +00:00
tab - > addTab ( _c ( " Volume " , " lowres " ) , " GameOptions_Volume " ) ;
2016-07-10 05:05:00 +00:00
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-11-15 18:15:58 +00:00
_globalVolumeOverride = new CheckboxWidget ( tab , " GameOptions_Volume.EnableTabCheckbox " , _ ( " Override global volume settings " ) , Common : : U32String ( ) , kCmdGlobalVolumeOverride ) ;
2016-07-10 05:05:00 +00:00
else
2020-11-15 18:15:58 +00:00
_globalVolumeOverride = new CheckboxWidget ( tab , " GameOptions_Volume.EnableTabCheckbox " , _c ( " Override global volume settings " , " lowres " ) , Common : : U32String ( ) , kCmdGlobalVolumeOverride ) ;
2016-07-10 05:05:00 +00:00
addVolumeControls ( tab , " GameOptions_Volume. " ) ;
2019-12-03 07:35:05 +00:00
bool showMidi = ! _guioptions . contains ( GUIO_NOMIDI ) & & ! _guioptions . contains ( GUIO_NOMUSIC ) ;
2016-07-10 05:05:00 +00:00
//
// 6) The MIDI tab
//
2020-01-05 16:48:04 +00:00
_globalMIDIOverride = nullptr ;
2019-12-03 07:35:05 +00:00
if ( showMidi ) {
2020-07-01 18:01:48 +00:00
tab - > addTab ( _ ( " MIDI " ) , " GameOptions_MIDI " ) ;
2016-07-10 05:05:00 +00:00
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-11-15 18:15:58 +00:00
_globalMIDIOverride = new CheckboxWidget ( tab , " GameOptions_MIDI.EnableTabCheckbox " , _ ( " Override global MIDI settings " ) , Common : : U32String ( ) , kCmdGlobalMIDIOverride ) ;
2016-07-10 05:05:00 +00:00
else
2020-11-15 18:15:58 +00:00
_globalMIDIOverride = new CheckboxWidget ( tab , " GameOptions_MIDI.EnableTabCheckbox " , _c ( " Override global MIDI settings " , " lowres " ) , Common : : U32String ( ) , kCmdGlobalMIDIOverride ) ;
2016-07-10 05:05:00 +00:00
addMIDIControls ( tab , " GameOptions_MIDI. " ) ;
}
//
// 7) The MT-32 tab
//
2020-01-05 16:48:04 +00:00
_globalMT32Override = nullptr ;
2019-12-03 07:35:05 +00:00
if ( showMidi ) {
2020-07-01 18:01:48 +00:00
tab - > addTab ( _ ( " MT-32 " ) , " GameOptions_MT32 " ) ;
2016-07-10 05:05:00 +00:00
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-11-15 18:15:58 +00:00
_globalMT32Override = new CheckboxWidget ( tab , " GameOptions_MT32.EnableTabCheckbox " , _ ( " Override global MT-32 settings " ) , Common : : U32String ( ) , kCmdGlobalMT32Override ) ;
2016-07-10 05:05:00 +00:00
else
2020-11-15 18:15:58 +00:00
_globalMT32Override = new CheckboxWidget ( tab , " GameOptions_MT32.EnableTabCheckbox " , _c ( " Override global MT-32 settings " , " lowres " ) , Common : : U32String ( ) , kCmdGlobalMT32Override ) ;
2016-07-10 05:05:00 +00:00
addMT32Controls ( tab , " GameOptions_MT32. " ) ;
}
//
// 8) The Paths tab
//
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-07-01 18:01:48 +00:00
tab - > addTab ( _ ( " Paths " ) , " GameOptions_Paths " ) ;
2016-07-10 05:05:00 +00:00
else
2020-07-01 18:01:48 +00:00
tab - > addTab ( _c ( " Paths " , " lowres " ) , " GameOptions_Paths " ) ;
2016-07-10 05:05:00 +00:00
// These buttons have to be extra wide, or the text will be truncated
// in the small version of the GUI.
// GUI: Button + Label for the game path
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-11-15 18:15:58 +00:00
new ButtonWidget ( tab , " GameOptions_Paths.Gamepath " , _ ( " Game Path: " ) , Common : : U32String ( ) , kCmdGameBrowser ) ;
2016-07-10 05:05:00 +00:00
else
2020-11-15 18:15:58 +00:00
new ButtonWidget ( tab , " GameOptions_Paths.Gamepath " , _c ( " Game Path: " , " lowres " ) , Common : : U32String ( ) , kCmdGameBrowser ) ;
2016-07-10 05:05:00 +00:00
_gamePathWidget = new StaticTextWidget ( tab , " GameOptions_Paths.GamepathText " , gamePath ) ;
// GUI: Button + Label for the additional path
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-07-01 18:01:48 +00:00
new ButtonWidget ( tab , " GameOptions_Paths.Extrapath " , _ ( " Extra Path: " ) , _ ( " Specifies path to additional data used by the game " ) , kCmdExtraBrowser ) ;
2016-07-10 05:05:00 +00:00
else
2020-07-01 18:01:48 +00:00
new ButtonWidget ( tab , " GameOptions_Paths.Extrapath " , _c ( " Extra Path: " , " lowres " ) , _ ( " Specifies path to additional data used by the game " ) , kCmdExtraBrowser ) ;
2016-07-10 05:05:00 +00:00
_extraPathWidget = new StaticTextWidget ( tab , " GameOptions_Paths.ExtrapathText " , extraPath , _ ( " Specifies path to additional data used by the game " ) ) ;
_extraPathClearButton = addClearButton ( tab , " GameOptions_Paths.ExtraPathClearButton " , kCmdExtraPathClear ) ;
// GUI: Button + Label for the save path
if ( g_system - > getOverlayWidth ( ) > 320 )
2020-07-01 18:01:48 +00:00
new ButtonWidget ( tab , " GameOptions_Paths.Savepath " , _ ( " Save Path: " ) , _ ( " Specifies where your saved games are put " ) , kCmdSaveBrowser ) ;
2016-07-10 05:05:00 +00:00
else
2020-07-01 18:01:48 +00:00
new ButtonWidget ( tab , " GameOptions_Paths.Savepath " , _c ( " Save Path: " , " lowres " ) , _ ( " Specifies where your saved games are put " ) , kCmdSaveBrowser ) ;
2016-07-10 05:05:00 +00:00
_savePathWidget = new StaticTextWidget ( tab , " GameOptions_Paths.SavepathText " , savePath , _ ( " Specifies where your saved games are put " ) ) ;
_savePathClearButton = addClearButton ( tab , " GameOptions_Paths.SavePathClearButton " , kCmdSavePathClear ) ;
2020-03-16 00:48:57 +00:00
//
// 9) The Achievements tab
//
2020-08-06 18:12:44 +00:00
if ( enginePlugin ) {
2020-10-02 05:46:09 +00:00
const MetaEngine & metaEngineConnect = enginePlugin - > get < MetaEngine > ( ) ;
2020-08-06 18:12:44 +00:00
Common : : AchievementsInfo achievementsInfo = metaEngineConnect . getAchievementsInfo ( domain ) ;
2020-03-16 00:48:57 +00:00
if ( achievementsInfo . descriptions . size ( ) > 0 ) {
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
tab - > addTab ( _ ( " Achievements " ) , " GameOptions_Achievements " ) ;
2020-03-16 00:48:57 +00:00
addAchievementsControls ( tab , " GameOptions_Achievements. " , achievementsInfo ) ;
}
}
2020-05-19 14:12:20 +00:00
// Activate the first tab
tab - > setActiveTab ( 0 ) ;
2016-07-10 05:05:00 +00:00
_tabWidget = tab ;
// Add OK & Cancel buttons
2020-11-15 18:15:58 +00:00
new ButtonWidget ( this , " GameOptions.Cancel " , _ ( " Cancel " ) , Common : : U32String ( ) , kCloseCmd ) ;
new ButtonWidget ( this , " GameOptions.Ok " , _ ( " OK " ) , Common : : U32String ( ) , kOKCmd ) ;
2016-07-10 05:05:00 +00:00
}
2018-07-21 23:01:01 +00:00
void EditGameDialog : : setupGraphicsTab ( ) {
OptionsDialog : : setupGraphicsTab ( ) ;
_globalGraphicsOverride - > setVisible ( true ) ;
}
2016-07-10 05:05:00 +00:00
void EditGameDialog : : open ( ) {
OptionsDialog : : open ( ) ;
String extraPath ( ConfMan . get ( " extrapath " , _domain ) ) ;
if ( extraPath . empty ( ) | | ! ConfMan . hasKey ( " extrapath " , _domain ) ) {
2020-07-01 18:01:48 +00:00
_extraPathWidget - > setLabel ( _c ( " None " , " path " ) ) ;
2016-07-10 05:05:00 +00:00
}
String savePath ( ConfMan . get ( " savepath " , _domain ) ) ;
if ( savePath . empty ( ) | | ! ConfMan . hasKey ( " savepath " , _domain ) ) {
2020-07-01 18:01:48 +00:00
_savePathWidget - > setLabel ( _ ( " Default " ) ) ;
2016-07-10 05:05:00 +00:00
}
int sel , i ;
bool e ;
// En-/disable dialog items depending on whether overrides are active or not.
e = ConfMan . hasKey ( " gfx_mode " , _domain ) | |
ConfMan . hasKey ( " render_mode " , _domain ) | |
2020-10-12 16:44:15 +00:00
ConfMan . hasKey ( " stretch_mode " , _domain ) | |
ConfMan . hasKey ( " aspect_ratio " , _domain ) | |
2016-07-10 05:05:00 +00:00
ConfMan . hasKey ( " fullscreen " , _domain ) | |
2020-10-12 16:44:15 +00:00
ConfMan . hasKey ( " vsync " , _domain ) | |
ConfMan . hasKey ( " filtering " , _domain ) | |
ConfMan . hasKey ( " renderer " , _domain ) | |
ConfMan . hasKey ( " antialiasing " , _domain ) ;
2016-07-10 05:05:00 +00:00
_globalGraphicsOverride - > setState ( e ) ;
2020-01-29 23:13:32 +00:00
if ( g_system - > hasFeature ( OSystem : : kFeatureShader ) ) {
e = ConfMan . hasKey ( " shader " , _domain ) ;
_globalShaderOverride - > setState ( e ) ;
}
2016-07-10 05:05:00 +00:00
e = ConfMan . hasKey ( " music_driver " , _domain ) | |
ConfMan . hasKey ( " output_rate " , _domain ) | |
ConfMan . hasKey ( " opl_driver " , _domain ) | |
ConfMan . hasKey ( " subtitles " , _domain ) | |
ConfMan . hasKey ( " talkspeed " , _domain ) ;
_globalAudioOverride - > setState ( e ) ;
e = ConfMan . hasKey ( " music_volume " , _domain ) | |
ConfMan . hasKey ( " sfx_volume " , _domain ) | |
ConfMan . hasKey ( " speech_volume " , _domain ) ;
_globalVolumeOverride - > setState ( e ) ;
2020-01-10 02:36:52 +00:00
if ( ! _guioptions . contains ( GUIO_NOMIDI ) & & ! _guioptions . contains ( GUIO_NOMUSIC ) ) {
2016-07-10 05:05:00 +00:00
e = ConfMan . hasKey ( " soundfont " , _domain ) | |
ConfMan . hasKey ( " multi_midi " , _domain ) | |
ConfMan . hasKey ( " midi_gain " , _domain ) ;
_globalMIDIOverride - > setState ( e ) ;
e = ConfMan . hasKey ( " native_mt32 " , _domain ) | |
ConfMan . hasKey ( " enable_gs " , _domain ) ;
_globalMT32Override - > setState ( e ) ;
}
// TODO: game path
const Common : : Language lang = Common : : parseLanguage ( ConfMan . get ( " language " , _domain ) ) ;
if ( ConfMan . hasKey ( " language " , _domain ) ) {
_langPopUp - > setSelectedTag ( lang ) ;
} else {
_langPopUp - > setSelectedTag ( ( uint32 ) Common : : UNK_LANG ) ;
}
if ( _langPopUp - > numEntries ( ) < = 3 ) { // If only one language is avaliable
_langPopUpDesc - > setEnabled ( false ) ;
_langPopUp - > setEnabled ( false ) ;
}
2020-03-22 14:19:56 +00:00
if ( _engineOptions ) {
_engineOptions - > load ( ) ;
2016-07-10 05:05:00 +00:00
}
const Common : : PlatformDescription * p = Common : : g_platforms ;
const Common : : Platform platform = Common : : parsePlatform ( ConfMan . get ( " platform " , _domain ) ) ;
sel = 0 ;
for ( i = 0 ; p - > code ; + + p , + + i ) {
if ( platform = = p - > id )
sel = i + 2 ;
}
_platformPopUp - > setSelected ( sel ) ;
}
2016-10-30 15:43:14 +00:00
void EditGameDialog : : apply ( ) {
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
ConfMan . set ( " description " , _descriptionWidget - > getEditString ( ) , _domain ) ;
2018-05-22 14:03:56 +00:00
2016-10-30 15:43:14 +00:00
Common : : Language lang = ( Common : : Language ) _langPopUp - > getSelectedTag ( ) ;
if ( lang < 0 )
ConfMan . removeKey ( " language " , _domain ) ;
else
ConfMan . set ( " language " , Common : : getLanguageCode ( lang ) , _domain ) ;
2018-05-22 14:03:56 +00:00
2020-06-13 21:40:03 +00:00
U32String gamePath ( _gamePathWidget - > getLabel ( ) ) ;
2016-10-30 15:43:14 +00:00
if ( ! gamePath . empty ( ) )
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
ConfMan . set ( " path " , gamePath , _domain ) ;
2018-05-22 14:03:56 +00:00
2020-06-13 21:40:03 +00:00
U32String extraPath ( _extraPathWidget - > getLabel ( ) ) ;
if ( ! extraPath . empty ( ) & & ( extraPath ! = _c ( " None " , " path " ) ) )
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
ConfMan . set ( " extrapath " , extraPath , _domain ) ;
2016-10-30 15:43:14 +00:00
else
ConfMan . removeKey ( " extrapath " , _domain ) ;
2018-05-22 14:03:56 +00:00
2020-06-13 21:40:03 +00:00
U32String savePath ( _savePathWidget - > getLabel ( ) ) ;
if ( ! savePath . empty ( ) & & ( savePath ! = _ ( " Default " ) ) )
GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.
- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-07-20 12:36:37 +00:00
ConfMan . set ( " savepath " , savePath , _domain ) ;
2016-10-30 15:43:14 +00:00
else
ConfMan . removeKey ( " savepath " , _domain ) ;
2018-05-22 14:03:56 +00:00
2016-10-30 15:43:14 +00:00
Common : : Platform platform = ( Common : : Platform ) _platformPopUp - > getSelectedTag ( ) ;
if ( platform < 0 )
ConfMan . removeKey ( " platform " , _domain ) ;
else
ConfMan . set ( " platform " , Common : : getPlatformCode ( platform ) , _domain ) ;
2018-05-22 14:03:56 +00:00
2020-03-22 14:19:56 +00:00
if ( _engineOptions ) {
_engineOptions - > save ( ) ;
2016-07-10 05:05:00 +00:00
}
2016-10-30 15:43:14 +00:00
OptionsDialog : : apply ( ) ;
2016-07-10 05:05:00 +00:00
}
void EditGameDialog : : handleCommand ( CommandSender * sender , uint32 cmd , uint32 data ) {
switch ( cmd ) {
case kCmdGlobalGraphicsOverride :
setGraphicSettingsState ( data ! = 0 ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
2020-01-29 23:13:32 +00:00
case kCmdGlobalShaderOverride :
setShaderSettingsState ( data ! = 0 ) ;
g_gui . scheduleTopDialogRedraw ( ) ;
break ;
2016-07-10 05:05:00 +00:00
case kCmdGlobalAudioOverride :
setAudioSettingsState ( data ! = 0 ) ;
setSubtitleSettingsState ( data ! = 0 ) ;
2020-01-05 16:48:04 +00:00
if ( _globalVolumeOverride = = nullptr )
2016-07-10 05:05:00 +00:00
setVolumeSettingsState ( data ! = 0 ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
case kCmdGlobalMIDIOverride :
setMIDISettingsState ( data ! = 0 ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
case kCmdGlobalMT32Override :
setMT32SettingsState ( data ! = 0 ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
case kCmdGlobalVolumeOverride :
setVolumeSettingsState ( data ! = 0 ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
case kCmdChooseSoundFontCmd :
{
2020-07-01 18:01:48 +00:00
BrowserDialog browser ( _ ( " Select SoundFont " ) , false ) ;
2016-07-10 05:05:00 +00:00
if ( browser . runModal ( ) > 0 ) {
// User made this choice...
Common : : FSNode file ( browser . getResult ( ) ) ;
_soundFont - > setLabel ( file . getPath ( ) ) ;
2020-06-13 16:42:25 +00:00
if ( ! file . getPath ( ) . empty ( ) & & ( file . getPath ( ) ! = Common : : convertFromU32String ( _c ( " None " , " path " ) ) ) )
2016-07-10 05:05:00 +00:00
_soundFontClearButton - > setEnabled ( true ) ;
else
_soundFontClearButton - > setEnabled ( false ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
}
break ;
}
// Change path for the game
case kCmdGameBrowser :
{
2020-07-01 18:01:48 +00:00
BrowserDialog browser ( _ ( " Select directory with game data " ) , true ) ;
2016-07-10 05:05:00 +00:00
if ( browser . runModal ( ) > 0 ) {
// User made his choice...
Common : : FSNode dir ( browser . getResult ( ) ) ;
// TODO: Verify the game can be found in the new directory... Best
// done with optional specific gameid to pluginmgr detectgames?
// FSList files = dir.listDir(FSNode::kListFilesOnly);
_gamePathWidget - > setLabel ( dir . getPath ( ) ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
}
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
}
// Change path for extra game data (eg, using sword cutscenes when playing via CD)
case kCmdExtraBrowser :
{
2020-07-01 18:01:48 +00:00
BrowserDialog browser ( _ ( " Select additional game directory " ) , true ) ;
2016-07-10 05:05:00 +00:00
if ( browser . runModal ( ) > 0 ) {
// User made his choice...
Common : : FSNode dir ( browser . getResult ( ) ) ;
_extraPathWidget - > setLabel ( dir . getPath ( ) ) ;
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
}
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
}
// Change path for stored save game (perm and temp) data
case kCmdSaveBrowser :
{
2020-07-01 18:01:48 +00:00
BrowserDialog browser ( _ ( " Select directory for saved games " ) , true ) ;
2016-07-10 05:05:00 +00:00
if ( browser . runModal ( ) > 0 ) {
// User made his choice...
Common : : FSNode dir ( browser . getResult ( ) ) ;
_savePathWidget - > setLabel ( dir . getPath ( ) ) ;
2016-10-17 16:45:12 +00:00
# if defined(USE_CLOUD) && defined(USE_LIBCURL)
2016-09-18 15:39:11 +00:00
MessageDialog warningMessage ( _ ( " Saved games sync feature doesn't work with non-default directories. If you want your saved games to sync, use default directory. " ) ) ;
2016-07-10 05:05:00 +00:00
warningMessage . runModal ( ) ;
# endif
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
}
2018-01-06 15:13:29 +00:00
g_gui . scheduleTopDialogRedraw ( ) ;
2016-07-10 05:05:00 +00:00
break ;
}
case kCmdExtraPathClear :
2020-07-01 18:01:48 +00:00
_extraPathWidget - > setLabel ( _c ( " None " , " path " ) ) ;
2016-07-10 05:05:00 +00:00
break ;
case kCmdSavePathClear :
2020-07-01 18:01:48 +00:00
_savePathWidget - > setLabel ( _ ( " Default " ) ) ;
2016-07-10 05:05:00 +00:00
break ;
case kOKCmd :
{
// Write back changes made to config object
2020-06-11 15:55:05 +00:00
String newDomain ( Common : : convertFromU32String ( _domainWidget - > getEditString ( ) ) ) ;
2016-07-10 05:05:00 +00:00
if ( newDomain ! = _domain ) {
if ( newDomain . empty ( )
| | newDomain . hasPrefix ( " _ " )
| | newDomain = = ConfigManager : : kApplicationDomain
| | ConfMan . hasGameDomain ( newDomain ) ) {
MessageDialog alert ( _ ( " This game ID is already taken. Please choose another one. " ) ) ;
alert . runModal ( ) ;
return ;
}
ConfMan . renameGameDomain ( _domain , newDomain ) ;
_domain = newDomain ;
2020-04-11 06:02:30 +00:00
if ( _engineOptions ) {
_engineOptions - > setDomain ( newDomain ) ;
}
2016-07-10 05:05:00 +00:00
}
}
2017-08-06 14:54:38 +00:00
// fall through
2016-07-10 05:05:00 +00:00
default :
OptionsDialog : : handleCommand ( sender , cmd , data ) ;
}
}
} // End of namespace GUI