mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Add local game options (#6669)
* Add local game options dialog. Introduces LocalGameOptions struct and DlgLocalGameOptions dialog to replace the previous QInputDialog for starting local games. Encapsulates game configuration with a simple interface that prevents parameter explosion as options are added. The dialog provides UI with settings persistence via SettingsCache * integrate local game options into main window. Replaces QInputDialog with DlgLocalGameOptions in actSinglePlayer(). The startLocalGame() function now accepts LocalGameOptions, enabling configuration of starting life total and spectator visibility in addition to player count. Also adds user documentation for the local game options flow. * Removed superfluous documentation file * removed spectator option and moved structure definition * Now remember settings separately and & shortcuts removed * re-run checks
This commit is contained in:
parent
20ad9af989
commit
aa4592dc9e
8 changed files with 199 additions and 12 deletions
|
|
@ -385,6 +385,13 @@ SettingsCache::SettingsCache()
|
|||
defaultStartingLifeTotal = settings->value("game/defaultstartinglifetotal", 20).toInt();
|
||||
shareDecklistsOnLoad = settings->value("game/sharedecklistsonload", false).toBool();
|
||||
rememberGameSettings = settings->value("game/remembergamesettings", true).toBool();
|
||||
|
||||
// Local game settings use "localgameoptions/" prefix to keep them separate
|
||||
// from server game settings which use "game/" prefix
|
||||
localGameRememberSettings = settings->value("localgameoptions/remembersettings", false).toBool();
|
||||
localGameMaxPlayers = settings->value("localgameoptions/maxplayers", 1).toInt();
|
||||
localGameStartingLifeTotal = settings->value("localgameoptions/startinglifetotal", 20).toInt();
|
||||
|
||||
clientID = settings->value("personal/clientid", CLIENT_INFO_NOT_SET).toString();
|
||||
clientVersion = settings->value("personal/clientversion", CLIENT_INFO_NOT_SET).toString();
|
||||
}
|
||||
|
|
@ -1242,6 +1249,24 @@ void SettingsCache::setRememberGameSettings(const bool _rememberGameSettings)
|
|||
settings->setValue("game/remembergamesettings", rememberGameSettings);
|
||||
}
|
||||
|
||||
void SettingsCache::setLocalGameRememberSettings(bool value)
|
||||
{
|
||||
localGameRememberSettings = value;
|
||||
settings->setValue("localgameoptions/remembersettings", value);
|
||||
}
|
||||
|
||||
void SettingsCache::setLocalGameMaxPlayers(int value)
|
||||
{
|
||||
localGameMaxPlayers = value;
|
||||
settings->setValue("localgameoptions/maxplayers", value);
|
||||
}
|
||||
|
||||
void SettingsCache::setLocalGameStartingLifeTotal(int value)
|
||||
{
|
||||
localGameStartingLifeTotal = value;
|
||||
settings->setValue("localgameoptions/startinglifetotal", value);
|
||||
}
|
||||
|
||||
void SettingsCache::setNotifyAboutUpdate(QT_STATE_CHANGED_T _notifyaboutupdate)
|
||||
{
|
||||
notifyAboutUpdates = static_cast<bool>(_notifyaboutupdate);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue