From 0a2adfee1667a5239916a9d18b376872557fa327 Mon Sep 17 00:00:00 2001 From: uramer Date: Sun, 14 Jan 2024 16:40:46 +0100 Subject: [PATCH] SaveInfo.timePlayed field --- apps/openmw/mwlua/menuscripts.cpp | 1 + files/lua_api/openmw/menu.lua | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwlua/menuscripts.cpp b/apps/openmw/mwlua/menuscripts.cpp index 16e57961b1..e4a3962912 100644 --- a/apps/openmw/mwlua/menuscripts.cpp +++ b/apps/openmw/mwlua/menuscripts.cpp @@ -85,6 +85,7 @@ namespace MWLua slotInfo["description"] = slot.mProfile.mDescription; slotInfo["playerName"] = slot.mProfile.mPlayerName; slotInfo["playerLevel"] = slot.mProfile.mPlayerLevel; + slotInfo["timePlayed"] = slot.mProfile.mTimePlayed; 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]); diff --git a/files/lua_api/openmw/menu.lua b/files/lua_api/openmw/menu.lua index 3e2e02954a..4deb5d00a3 100644 --- a/files/lua_api/openmw/menu.lua +++ b/files/lua_api/openmw/menu.lua @@ -50,6 +50,7 @@ -- @field #string description -- @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 #list<#string> contentFiles --- @@ -59,9 +60,9 @@ -- @return #list<#SaveInfo> --- --- List of all available saves +-- List of all available saves, grouped by directory -- @function [parent=#menu] getAllSaves --- @return #list<#SaveInfo> +-- @return #map<#string, #list<#SaveInfo>> --- -- Exit the game