mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 11:33:55 -07:00
Add the ability to define starting life total during game creation. (#5174)
* Have the server respect gameType info when setting up zones. * ServerPlayer::setupZones is now passed the room->getGameTypes(); * ServerPlayer::setupZones now checks if the GameType String includes "Commander" and then sets the life total to 40 instead. * Formatting. * Remove debug logging imports. * Move game option value declarations to dlg_create_game. * Lint. * Fix mocks. * Add a default for backwards compatibility. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
17e6bfaca6
commit
03aff83135
11 changed files with 56 additions and 9 deletions
|
|
@ -301,6 +301,7 @@ SettingsCache::SettingsCache()
|
|||
spectatorsCanTalk = settings->value("game/spectatorscantalk", false).toBool();
|
||||
spectatorsCanSeeEverything = settings->value("game/spectatorscanseeeverything", false).toBool();
|
||||
createGameAsSpectator = settings->value("game/creategameasspectator", false).toBool();
|
||||
defaultStartingLifeTotal = settings->value("game/defaultstartinglifetotal", 20).toInt();
|
||||
rememberGameSettings = settings->value("game/remembergamesettings", true).toBool();
|
||||
clientID = settings->value("personal/clientid", CLIENT_INFO_NOT_SET).toString();
|
||||
clientVersion = settings->value("personal/clientversion", CLIENT_INFO_NOT_SET).toString();
|
||||
|
|
@ -1089,6 +1090,12 @@ void SettingsCache::setCreateGameAsSpectator(const bool _createGameAsSpectator)
|
|||
settings->setValue("game/creategameasspectator", createGameAsSpectator);
|
||||
}
|
||||
|
||||
void SettingsCache::setDefaultStartingLifeTotal(const int _defaultStartingLifeTotal)
|
||||
{
|
||||
defaultStartingLifeTotal = _defaultStartingLifeTotal;
|
||||
settings->setValue("game/defaultstartinglifetotal", defaultStartingLifeTotal);
|
||||
};
|
||||
|
||||
void SettingsCache::setRememberGameSettings(const bool _rememberGameSettings)
|
||||
{
|
||||
rememberGameSettings = _rememberGameSettings;
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ private:
|
|||
bool spectatorsCanTalk;
|
||||
bool spectatorsCanSeeEverything;
|
||||
bool createGameAsSpectator;
|
||||
int defaultStartingLifeTotal;
|
||||
int keepalive;
|
||||
int timeout;
|
||||
void translateLegacySettings();
|
||||
|
|
@ -515,6 +516,10 @@ public:
|
|||
{
|
||||
return spectatorsCanSeeEverything;
|
||||
}
|
||||
int getDefaultStartingLifeTotal() const
|
||||
{
|
||||
return defaultStartingLifeTotal;
|
||||
}
|
||||
bool getCreateGameAsSpectator() const
|
||||
{
|
||||
return createGameAsSpectator;
|
||||
|
|
@ -679,6 +684,7 @@ public slots:
|
|||
void setSpectatorsCanTalk(const bool _spectatorsCanTalk);
|
||||
void setSpectatorsCanSeeEverything(const bool _spectatorsCanSeeEverything);
|
||||
void setCreateGameAsSpectator(const bool _createGameAsSpectator);
|
||||
void setDefaultStartingLifeTotal(const int _defaultStartingLifeTotal);
|
||||
void setRememberGameSettings(const bool _rememberGameSettings);
|
||||
void setNotifyAboutUpdate(QT_STATE_CHANGED_T _notifyaboutupdate);
|
||||
void setNotifyAboutNewVersion(QT_STATE_CHANGED_T _notifyaboutnewversion);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue