mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 06:55:09 +00:00
Add playtime to the value from settings
Fixes playtime being wiped out when running the game with --no-gui.
This commit is contained in:
parent
97e26f9d6c
commit
e938ddda2c
3 changed files with 13 additions and 8 deletions
|
|
@ -9,10 +9,16 @@ persistent_settings::persistent_settings(QObject* parent) : settings(parent)
|
|||
m_settings.reset(new QSettings(ComputeSettingsDir() + gui::persistent::persistent_file_name + ".dat", QSettings::Format::IniFormat, parent));
|
||||
}
|
||||
|
||||
void persistent_settings::SetPlaytime(const QString& serial, const quint64& elapsed)
|
||||
void persistent_settings::SetPlaytime(const QString& serial, quint64 playtime)
|
||||
{
|
||||
m_playtime[serial] = elapsed;
|
||||
SetValue(gui::persistent::playtime, serial, m_playtime[serial]);
|
||||
m_playtime[serial] = playtime;
|
||||
SetValue(gui::persistent::playtime, serial, playtime);
|
||||
}
|
||||
|
||||
void persistent_settings::AddPlaytime(const QString& serial, quint64 elapsed)
|
||||
{
|
||||
const quint64 playtime = GetValue(gui::persistent::playtime, serial, 0).toULongLong();
|
||||
SetPlaytime(serial, playtime + elapsed);
|
||||
}
|
||||
|
||||
quint64 persistent_settings::GetPlaytime(const QString& serial)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue