mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-23 10:20:48 +00:00
creationTime field in save info
This commit is contained in:
parent
76915ce6e9
commit
47d5868e2c
@ -89,6 +89,13 @@ namespace MWLua
|
|||||||
sol::table contentFiles(lua, sol::create);
|
sol::table contentFiles(lua, sol::create);
|
||||||
for (size_t i = 0; i < slot.mProfile.mContentFiles.size(); ++i)
|
for (size_t i = 0; i < slot.mProfile.mContentFiles.size(); ++i)
|
||||||
contentFiles[i + 1] = Misc::StringUtils::lowerCase(slot.mProfile.mContentFiles[i]);
|
contentFiles[i + 1] = Misc::StringUtils::lowerCase(slot.mProfile.mContentFiles[i]);
|
||||||
|
|
||||||
|
{
|
||||||
|
auto system_time = std::chrono::system_clock::now()
|
||||||
|
- (std::filesystem::file_time_type::clock::now() - slot.mTimeStamp);
|
||||||
|
slotInfo["creationTime"] = std::chrono::duration<double>(system_time.time_since_epoch()).count();
|
||||||
|
}
|
||||||
|
|
||||||
slotInfo["contentFiles"] = contentFiles;
|
slotInfo["contentFiles"] = contentFiles;
|
||||||
saves[slot.mPath.filename().string()] = slotInfo;
|
saves[slot.mPath.filename().string()] = slotInfo;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
-- @field #string playerName
|
-- @field #string playerName
|
||||||
-- @field #string playerLevel
|
-- @field #string playerLevel
|
||||||
-- @field #number timePlayed Gameplay time for this saved game. Note: available even with [time played](../modding/settings/saves.html#timeplayed) turned off
|
-- @field #number timePlayed Gameplay time for this saved game. Note: available even with [time played](../modding/settings/saves.html#timeplayed) turned off
|
||||||
|
-- @field #number creationTime Time at which the game was saved, as a timestamp in seconds. Can be passed as the second argument to `os.data`.
|
||||||
-- @field #list<#string> contentFiles
|
-- @field #list<#string> contentFiles
|
||||||
|
|
||||||
---
|
---
|
||||||
|
Loading…
x
Reference in New Issue
Block a user