creationTime field in save info

ini_importer_tests
uramer 11 months ago
parent 76915ce6e9
commit 47d5868e2c

@ -89,6 +89,13 @@ namespace MWLua
sol::table contentFiles(lua, sol::create);
for (size_t i = 0; i < slot.mProfile.mContentFiles.size(); ++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;
saves[slot.mPath.filename().string()] = slotInfo;
}

@ -51,6 +51,7 @@
-- @field #string playerName
-- @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 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
---

Loading…
Cancel
Save