mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 00:23:55 -07:00
Add option to share decklists on load. (#6029)
* Add option to share decklists on load. Took 1 hour 58 minutes Took 9 minutes Took 39 minutes * Lint. Took 14 minutes Took 2 minutes * Stuffs Took 39 minutes Took 4 seconds Took 43 minutes * Process local player first. Took 45 minutes * Consider if the setting is set on the game info first. Took 4 minutes * Save an indent level. Took 43 seconds * Don't commit logging config. Took 3 minutes * Remove a debug print. Took 10 seconds Took 7 seconds * Add another optional guard. Took 5 minutes * Hide the tab bar if only one (own deck) is visible. Took 9 minutes * Rename setting label for clarity Took 2 minutes * Capitalization. Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
881243da6a
commit
09381575a7
26 changed files with 268 additions and 33 deletions
|
|
@ -355,6 +355,7 @@ SettingsCache::SettingsCache()
|
|||
spectatorsCanSeeEverything = settings->value("game/spectatorscanseeeverything", false).toBool();
|
||||
createGameAsSpectator = settings->value("game/creategameasspectator", false).toBool();
|
||||
defaultStartingLifeTotal = settings->value("game/defaultstartinglifetotal", 20).toInt();
|
||||
shareDecklistsOnLoad = settings->value("game/sharedecklistsonload", false).toBool();
|
||||
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();
|
||||
|
|
@ -1360,7 +1361,13 @@ void SettingsCache::setDefaultStartingLifeTotal(const int _defaultStartingLifeTo
|
|||
{
|
||||
defaultStartingLifeTotal = _defaultStartingLifeTotal;
|
||||
settings->setValue("game/defaultstartinglifetotal", defaultStartingLifeTotal);
|
||||
};
|
||||
}
|
||||
|
||||
void SettingsCache::setShareDecklistsOnLoad(const bool _shareDecklistsOnLoad)
|
||||
{
|
||||
shareDecklistsOnLoad = _shareDecklistsOnLoad;
|
||||
settings->setValue("game/sharedecklistsonload", shareDecklistsOnLoad);
|
||||
}
|
||||
|
||||
void SettingsCache::setCheckUpdatesOnStartup(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
|
|
@ -1373,6 +1380,7 @@ void SettingsCache::setStartupCardUpdateCheckPromptForUpdate(bool value)
|
|||
startupCardUpdateCheckPromptForUpdate = value;
|
||||
settings->setValue("personal/startupCardUpdateCheckPromptForUpdate", startupCardUpdateCheckPromptForUpdate);
|
||||
}
|
||||
|
||||
void SettingsCache::setStartupCardUpdateCheckAlwaysUpdate(bool value)
|
||||
{
|
||||
startupCardUpdateCheckAlwaysUpdate = value;
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ private:
|
|||
bool spectatorsCanSeeEverything;
|
||||
bool createGameAsSpectator;
|
||||
int defaultStartingLifeTotal;
|
||||
bool shareDecklistsOnLoad;
|
||||
int keepalive;
|
||||
int timeout;
|
||||
void translateLegacySettings();
|
||||
|
|
@ -805,6 +806,10 @@ public:
|
|||
{
|
||||
return defaultStartingLifeTotal;
|
||||
}
|
||||
bool getShareDecklistsOnLoad() const
|
||||
{
|
||||
return shareDecklistsOnLoad;
|
||||
}
|
||||
bool getCreateGameAsSpectator() const
|
||||
{
|
||||
return createGameAsSpectator;
|
||||
|
|
@ -1032,6 +1037,7 @@ public slots:
|
|||
void setSpectatorsCanSeeEverything(const bool _spectatorsCanSeeEverything);
|
||||
void setCreateGameAsSpectator(const bool _createGameAsSpectator);
|
||||
void setDefaultStartingLifeTotal(const int _defaultStartingLifeTotal);
|
||||
void setShareDecklistsOnLoad(const bool _shareDecklistsOnLoad);
|
||||
void setRememberGameSettings(const bool _rememberGameSettings);
|
||||
void setCheckUpdatesOnStartup(QT_STATE_CHANGED_T value);
|
||||
void setStartupCardUpdateCheckPromptForUpdate(bool value);
|
||||
|
|
|
|||
|
|
@ -83,6 +83,17 @@ bool GameFiltersSettings::isHideNotBuddyCreatedGames()
|
|||
return !(previous == QVariant()) && previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHideOpenDecklistGames(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_open_decklist_games", "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHideOpenDecklistGames()
|
||||
{
|
||||
QVariant previous = getValue("hide_open_decklist_games", "filter_games");
|
||||
return !(previous == QVariant()) && previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameNameFilter(QString gameName)
|
||||
{
|
||||
setValue(gameName, "game_name_filter", "filter_games");
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ public:
|
|||
bool isHidePasswordProtectedGames();
|
||||
bool isHideIgnoredUserGames();
|
||||
bool isHideNotBuddyCreatedGames();
|
||||
void setHideOpenDecklistGames(bool hide);
|
||||
bool isHideOpenDecklistGames();
|
||||
QString getGameNameFilter();
|
||||
QString getCreatorNameFilter();
|
||||
int getMinPlayers();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue