diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43a645ed14..83d81999ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...")
set(OPENMW_VERSION_MAJOR 0)
set(OPENMW_VERSION_MINOR 49)
set(OPENMW_VERSION_RELEASE 0)
-set(OPENMW_LUA_API_REVISION 63)
+set(OPENMW_LUA_API_REVISION 64)
set(OPENMW_POSTPROCESSING_API_REVISION 1)
set(OPENMW_VERSION_COMMITHASH "")
diff --git a/apps/launcher/settingspage.cpp b/apps/launcher/settingspage.cpp
index d336ab4f17..b7f97d24fb 100644
--- a/apps/launcher/settingspage.cpp
+++ b/apps/launcher/settingspage.cpp
@@ -319,7 +319,6 @@ bool Launcher::SettingsPage::loadSettings()
// Miscellaneous
{
// Saves
- loadSettingBool(Settings::saves().mTimeplayed, *timePlayedCheckbox);
loadSettingInt(Settings::saves().mMaxQuicksaves, *maximumQuicksavesComboBox);
// Other Settings
@@ -512,7 +511,6 @@ void Launcher::SettingsPage::saveSettings()
// Miscellaneous
{
// Saves Settings
- saveSettingBool(*timePlayedCheckbox, Settings::saves().mTimeplayed);
saveSettingInt(*maximumQuicksavesComboBox, Settings::saves().mMaxQuicksaves);
// Other Settings
diff --git a/apps/launcher/ui/settingspage.ui b/apps/launcher/ui/settingspage.ui
index 758e08481e..9362920daf 100644
--- a/apps/launcher/ui/settingspage.ui
+++ b/apps/launcher/ui/settingspage.ui
@@ -1430,16 +1430,6 @@
Saves
- -
-
-
- <html><head/><body><p>This setting determines whether the amount of the time the player has spent playing will be displayed for each saved game in the Load menu.</p></body></html>
-
-
- Add "Time Played" to Saves
-
-
-
-
-
diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp
index f83250dfd0..94f25e118b 100644
--- a/apps/openmw/mwgui/savegamedialog.cpp
+++ b/apps/openmw/mwgui/savegamedialog.cpp
@@ -435,7 +435,7 @@ namespace MWGui
mCurrentSlot->mProfile.mInGameTime.mMonth)
<< " " << hour << " " << (pm ? "#{Calendar:pm}" : "#{Calendar:am}");
- if (Settings::saves().mTimeplayed)
+ if (mCurrentSlot->mProfile.mTimePlayed > 0)
{
text << "\n"
<< "#{OMWEngine:TimePlayed}: " << formatTimeplayed(mCurrentSlot->mProfile.mTimePlayed);
diff --git a/apps/openmw/mwlua/types/activator.cpp b/apps/openmw/mwlua/types/activator.cpp
index 43e03952f7..3531a476ad 100644
--- a/apps/openmw/mwlua/types/activator.cpp
+++ b/apps/openmw/mwlua/types/activator.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -51,7 +52,8 @@ namespace MWLua
record["model"] = sol::readonly_property([](const ESM::Activator& rec) -> std::string {
return Misc::ResourceHelpers::correctMeshPath(rec.mModel);
});
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Activator& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property([](const ESM::Activator& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
+ });
}
}
diff --git a/apps/openmw/mwlua/types/apparatus.cpp b/apps/openmw/mwlua/types/apparatus.cpp
index 282dd0669d..025cba6550 100644
--- a/apps/openmw/mwlua/types/apparatus.cpp
+++ b/apps/openmw/mwlua/types/apparatus.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -39,8 +40,9 @@ namespace MWLua
record["model"] = sol::readonly_property([](const ESM::Apparatus& rec) -> std::string {
return Misc::ResourceHelpers::correctMeshPath(rec.mModel);
});
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Apparatus& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property([](const ESM::Apparatus& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
+ });
record["icon"] = sol::readonly_property([vfs](const ESM::Apparatus& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
diff --git a/apps/openmw/mwlua/types/armor.cpp b/apps/openmw/mwlua/types/armor.cpp
index 8c741a4684..3d1250af13 100644
--- a/apps/openmw/mwlua/types/armor.cpp
+++ b/apps/openmw/mwlua/types/armor.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -98,13 +99,10 @@ namespace MWLua
record["icon"] = sol::readonly_property([vfs](const ESM::Armor& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
- record["enchant"] = sol::readonly_property([](const ESM::Armor& rec) -> sol::optional {
- if (rec.mEnchant.empty())
- return sol::nullopt;
- return rec.mEnchant.serializeText();
- });
- record["mwscript"]
- = sol::readonly_property([](const ESM::Armor& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["enchant"] = sol::readonly_property(
+ [](const ESM::Armor& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mEnchant); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Armor& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["weight"] = sol::readonly_property([](const ESM::Armor& rec) -> float { return rec.mData.mWeight; });
record["value"] = sol::readonly_property([](const ESM::Armor& rec) -> int { return rec.mData.mValue; });
record["type"] = sol::readonly_property([](const ESM::Armor& rec) -> int { return rec.mData.mType; });
diff --git a/apps/openmw/mwlua/types/book.cpp b/apps/openmw/mwlua/types/book.cpp
index 92bea13748..0733d89914 100644
--- a/apps/openmw/mwlua/types/book.cpp
+++ b/apps/openmw/mwlua/types/book.cpp
@@ -6,6 +6,7 @@
#include
#include
#include
+#include
#include
#include
@@ -104,17 +105,14 @@ namespace MWLua
record["name"] = sol::readonly_property([](const ESM::Book& rec) -> std::string { return rec.mName; });
record["model"] = sol::readonly_property(
[](const ESM::Book& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
- record["mwscript"]
- = sol::readonly_property([](const ESM::Book& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Book& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["icon"] = sol::readonly_property([vfs](const ESM::Book& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
record["text"] = sol::readonly_property([](const ESM::Book& rec) -> std::string { return rec.mText; });
- record["enchant"] = sol::readonly_property([](const ESM::Book& rec) -> sol::optional {
- if (rec.mEnchant.empty())
- return sol::nullopt;
- return rec.mEnchant.serializeText();
- });
+ record["enchant"] = sol::readonly_property(
+ [](const ESM::Book& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mEnchant); });
record["isScroll"] = sol::readonly_property([](const ESM::Book& rec) -> bool { return rec.mData.mIsScroll; });
record["value"] = sol::readonly_property([](const ESM::Book& rec) -> int { return rec.mData.mValue; });
record["weight"] = sol::readonly_property([](const ESM::Book& rec) -> float { return rec.mData.mWeight; });
@@ -122,9 +120,7 @@ namespace MWLua
= sol::readonly_property([](const ESM::Book& rec) -> float { return rec.mData.mEnchant * 0.1f; });
record["skill"] = sol::readonly_property([](const ESM::Book& rec) -> sol::optional {
ESM::RefId skill = ESM::Skill::indexToRefId(rec.mData.mSkillId);
- if (!skill.empty())
- return skill.serializeText();
- return sol::nullopt;
+ return LuaUtil::serializeRefId(skill);
});
}
}
diff --git a/apps/openmw/mwlua/types/clothing.cpp b/apps/openmw/mwlua/types/clothing.cpp
index 8679ce0b67..733cf5ba11 100644
--- a/apps/openmw/mwlua/types/clothing.cpp
+++ b/apps/openmw/mwlua/types/clothing.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -94,12 +95,11 @@ namespace MWLua
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
record["enchant"] = sol::readonly_property([](const ESM::Clothing& rec) -> sol::optional {
- if (rec.mEnchant.empty())
- return sol::nullopt;
- return rec.mEnchant.serializeText();
+ return LuaUtil::serializeRefId(rec.mEnchant);
+ });
+ record["mwscript"] = sol::readonly_property([](const ESM::Clothing& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
});
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Clothing& rec) -> std::string { return rec.mScript.serializeText(); });
record["weight"] = sol::readonly_property([](const ESM::Clothing& rec) -> float { return rec.mData.mWeight; });
record["value"] = sol::readonly_property([](const ESM::Clothing& rec) -> int { return rec.mData.mValue; });
record["type"] = sol::readonly_property([](const ESM::Clothing& rec) -> int { return rec.mData.mType; });
diff --git a/apps/openmw/mwlua/types/container.cpp b/apps/openmw/mwlua/types/container.cpp
index 55f3e4a10e..b5d9c082bd 100644
--- a/apps/openmw/mwlua/types/container.cpp
+++ b/apps/openmw/mwlua/types/container.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -51,8 +52,9 @@ namespace MWLua
record["model"] = sol::readonly_property([](const ESM::Container& rec) -> std::string {
return Misc::ResourceHelpers::correctMeshPath(rec.mModel);
});
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Container& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property([](const ESM::Container& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
+ });
record["weight"] = sol::readonly_property([](const ESM::Container& rec) -> float { return rec.mWeight; });
record["isOrganic"] = sol::readonly_property(
[](const ESM::Container& rec) -> bool { return rec.mFlags & ESM::Container::Organic; });
diff --git a/apps/openmw/mwlua/types/creature.cpp b/apps/openmw/mwlua/types/creature.cpp
index dd4b1bd67b..61ddc3f4fa 100644
--- a/apps/openmw/mwlua/types/creature.cpp
+++ b/apps/openmw/mwlua/types/creature.cpp
@@ -4,6 +4,7 @@
#include
#include
+#include
#include
#include
@@ -36,8 +37,9 @@ namespace MWLua
record["name"] = sol::readonly_property([](const ESM::Creature& rec) -> std::string { return rec.mName; });
record["model"] = sol::readonly_property(
[](const ESM::Creature& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Creature& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property([](const ESM::Creature& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
+ });
record["baseCreature"] = sol::readonly_property(
[](const ESM::Creature& rec) -> std::string { return rec.mOriginal.serializeText(); });
record["soulValue"] = sol::readonly_property([](const ESM::Creature& rec) -> int { return rec.mData.mSoul; });
diff --git a/apps/openmw/mwlua/types/door.cpp b/apps/openmw/mwlua/types/door.cpp
index df1d10015a..1c0cc07b00 100644
--- a/apps/openmw/mwlua/types/door.cpp
+++ b/apps/openmw/mwlua/types/door.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
#include
@@ -64,8 +65,8 @@ namespace MWLua
record["name"] = sol::readonly_property([](const ESM::Door& rec) -> std::string { return rec.mName; });
record["model"] = sol::readonly_property(
[](const ESM::Door& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
- record["mwscript"]
- = sol::readonly_property([](const ESM::Door& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Door& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["openSound"] = sol::readonly_property(
[](const ESM::Door& rec) -> std::string { return rec.mOpenSound.serializeText(); });
record["closeSound"] = sol::readonly_property(
diff --git a/apps/openmw/mwlua/types/ingredient.cpp b/apps/openmw/mwlua/types/ingredient.cpp
index a76869308b..0df31d1e85 100644
--- a/apps/openmw/mwlua/types/ingredient.cpp
+++ b/apps/openmw/mwlua/types/ingredient.cpp
@@ -34,8 +34,9 @@ namespace MWLua
record["model"] = sol::readonly_property([](const ESM::Ingredient& rec) -> std::string {
return Misc::ResourceHelpers::correctMeshPath(rec.mModel);
});
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Ingredient& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property([](const ESM::Ingredient& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
+ });
record["icon"] = sol::readonly_property([vfs](const ESM::Ingredient& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
diff --git a/apps/openmw/mwlua/types/light.cpp b/apps/openmw/mwlua/types/light.cpp
index 2784e5a770..ab758c22ec 100644
--- a/apps/openmw/mwlua/types/light.cpp
+++ b/apps/openmw/mwlua/types/light.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -96,8 +97,8 @@ namespace MWLua
});
record["sound"]
= sol::readonly_property([](const ESM::Light& rec) -> std::string { return rec.mSound.serializeText(); });
- record["mwscript"]
- = sol::readonly_property([](const ESM::Light& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Light& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["weight"] = sol::readonly_property([](const ESM::Light& rec) -> float { return rec.mData.mWeight; });
record["value"] = sol::readonly_property([](const ESM::Light& rec) -> int { return rec.mData.mValue; });
record["duration"] = sol::readonly_property([](const ESM::Light& rec) -> int { return rec.mData.mTime; });
diff --git a/apps/openmw/mwlua/types/lockpick.cpp b/apps/openmw/mwlua/types/lockpick.cpp
index 373de4b24d..4186f44378 100644
--- a/apps/openmw/mwlua/types/lockpick.cpp
+++ b/apps/openmw/mwlua/types/lockpick.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -31,8 +32,9 @@ namespace MWLua
record["name"] = sol::readonly_property([](const ESM::Lockpick& rec) -> std::string { return rec.mName; });
record["model"] = sol::readonly_property(
[](const ESM::Lockpick& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Lockpick& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property([](const ESM::Lockpick& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
+ });
record["icon"] = sol::readonly_property([vfs](const ESM::Lockpick& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
diff --git a/apps/openmw/mwlua/types/misc.cpp b/apps/openmw/mwlua/types/misc.cpp
index 8fc9406cfd..85eb03524c 100644
--- a/apps/openmw/mwlua/types/misc.cpp
+++ b/apps/openmw/mwlua/types/misc.cpp
@@ -3,6 +3,7 @@
#include
#include
#include
+#include
#include
#include
@@ -70,10 +71,7 @@ namespace MWLua
};
miscellaneous["getSoul"] = [](const Object& object) -> sol::optional {
ESM::RefId soul = object.ptr().getCellRef().getSoul();
- if (soul.empty())
- return sol::nullopt;
- else
- return soul.serializeText();
+ return LuaUtil::serializeRefId(soul);
};
miscellaneous["soul"] = miscellaneous["getSoul"]; // for compatibility; should be removed later
@@ -87,8 +85,9 @@ namespace MWLua
record["model"] = sol::readonly_property([](const ESM::Miscellaneous& rec) -> std::string {
return Misc::ResourceHelpers::correctMeshPath(rec.mModel);
});
- record["mwscript"] = sol::readonly_property(
- [](const ESM::Miscellaneous& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property([](const ESM::Miscellaneous& rec) -> sol::optional {
+ return LuaUtil::serializeRefId(rec.mScript);
+ });
record["icon"] = sol::readonly_property([vfs](const ESM::Miscellaneous& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
diff --git a/apps/openmw/mwlua/types/npc.cpp b/apps/openmw/mwlua/types/npc.cpp
index f8a1a82e54..0f5c82f1dd 100644
--- a/apps/openmw/mwlua/types/npc.cpp
+++ b/apps/openmw/mwlua/types/npc.cpp
@@ -85,8 +85,8 @@ namespace MWLua
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mRace.serializeText(); });
record["class"]
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mClass.serializeText(); });
- record["mwscript"]
- = sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::NPC& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["hair"]
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mHair.serializeText(); });
record["baseDisposition"]
diff --git a/apps/openmw/mwlua/types/potion.cpp b/apps/openmw/mwlua/types/potion.cpp
index cc4dd5700c..a3dab55224 100644
--- a/apps/openmw/mwlua/types/potion.cpp
+++ b/apps/openmw/mwlua/types/potion.cpp
@@ -80,8 +80,8 @@ namespace MWLua
record["icon"] = sol::readonly_property([vfs](const ESM::Potion& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
- record["mwscript"]
- = sol::readonly_property([](const ESM::Potion& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Potion& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["weight"] = sol::readonly_property([](const ESM::Potion& rec) -> float { return rec.mData.mWeight; });
record["value"] = sol::readonly_property([](const ESM::Potion& rec) -> int { return rec.mData.mValue; });
record["effects"] = sol::readonly_property([context](const ESM::Potion& rec) -> sol::table {
diff --git a/apps/openmw/mwlua/types/probe.cpp b/apps/openmw/mwlua/types/probe.cpp
index 30c84326a5..5db8141a23 100644
--- a/apps/openmw/mwlua/types/probe.cpp
+++ b/apps/openmw/mwlua/types/probe.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -31,8 +32,8 @@ namespace MWLua
record["name"] = sol::readonly_property([](const ESM::Probe& rec) -> std::string { return rec.mName; });
record["model"] = sol::readonly_property(
[](const ESM::Probe& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
- record["mwscript"]
- = sol::readonly_property([](const ESM::Probe& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Probe& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["icon"] = sol::readonly_property([vfs](const ESM::Probe& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
diff --git a/apps/openmw/mwlua/types/repair.cpp b/apps/openmw/mwlua/types/repair.cpp
index 880a74d131..4d35a55fbe 100644
--- a/apps/openmw/mwlua/types/repair.cpp
+++ b/apps/openmw/mwlua/types/repair.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -31,8 +32,8 @@ namespace MWLua
record["name"] = sol::readonly_property([](const ESM::Repair& rec) -> std::string { return rec.mName; });
record["model"] = sol::readonly_property(
[](const ESM::Repair& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
- record["mwscript"]
- = sol::readonly_property([](const ESM::Repair& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Repair& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["icon"] = sol::readonly_property([vfs](const ESM::Repair& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
diff --git a/apps/openmw/mwlua/types/weapon.cpp b/apps/openmw/mwlua/types/weapon.cpp
index 71fab2e0f5..386b81c843 100644
--- a/apps/openmw/mwlua/types/weapon.cpp
+++ b/apps/openmw/mwlua/types/weapon.cpp
@@ -2,6 +2,7 @@
#include
#include
+#include
#include
#include
@@ -131,13 +132,10 @@ namespace MWLua
record["icon"] = sol::readonly_property([vfs](const ESM::Weapon& rec) -> std::string {
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
- record["enchant"] = sol::readonly_property([](const ESM::Weapon& rec) -> sol::optional {
- if (rec.mEnchant.empty())
- return sol::nullopt;
- return rec.mEnchant.serializeText();
- });
- record["mwscript"]
- = sol::readonly_property([](const ESM::Weapon& rec) -> std::string { return rec.mScript.serializeText(); });
+ record["enchant"] = sol::readonly_property(
+ [](const ESM::Weapon& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mEnchant); });
+ record["mwscript"] = sol::readonly_property(
+ [](const ESM::Weapon& rec) -> sol::optional { return LuaUtil::serializeRefId(rec.mScript); });
record["isMagical"] = sol::readonly_property(
[](const ESM::Weapon& rec) -> bool { return rec.mData.mFlags & ESM::Weapon::Magical; });
record["isSilver"] = sol::readonly_property(
diff --git a/components/lua/util.hpp b/components/lua/util.hpp
index 640b5eeeb0..2b84d9d60c 100644
--- a/components/lua/util.hpp
+++ b/components/lua/util.hpp
@@ -2,6 +2,11 @@
#define COMPONENTS_LUA_UTIL_H
#include
+#include
+
+#include
+
+#include
namespace LuaUtil
{
@@ -15,6 +20,13 @@ namespace LuaUtil
{
return i + 1;
}
+
+ inline sol::optional serializeRefId(ESM::RefId id)
+ {
+ if (id.empty())
+ return sol::nullopt;
+ return id.serializeText();
+ }
}
#endif
diff --git a/components/settings/categories/saves.hpp b/components/settings/categories/saves.hpp
index 3a64785412..4861c68ba9 100644
--- a/components/settings/categories/saves.hpp
+++ b/components/settings/categories/saves.hpp
@@ -20,7 +20,6 @@ namespace Settings
SettingValue mCharacter{ mIndex, "Saves", "character" };
SettingValue mAutosave{ mIndex, "Saves", "autosave" };
- SettingValue mTimeplayed{ mIndex, "Saves", "timeplayed" };
SettingValue mMaxQuicksaves{ mIndex, "Saves", "max quicksaves", makeMaxSanitizerInt(1) };
};
}
diff --git a/docs/source/reference/modding/settings/saves.rst b/docs/source/reference/modding/settings/saves.rst
index 0e58d66d84..88aa48fc56 100644
--- a/docs/source/reference/modding/settings/saves.rst
+++ b/docs/source/reference/modding/settings/saves.rst
@@ -21,19 +21,6 @@ This setting determines whether the game will be automatically saved when the ch
This setting can be toggled in game with the Auto-Save when Rest button in the Prefs panel of the Options menu.
-timeplayed
-----------
-
-:Type: boolean
-:Range: True/False
-:Default: False
-
-This setting determines whether the amount of the time the player has spent playing will be displayed
-for each saved game in the Load menu. Currently, the counter includes time spent in menus, including the pause menu,
-but does not include time spent with the game window minimized.
-
-This setting can only be configured by editing the settings configuration file.
-
max quicksaves
--------------
diff --git a/files/data/scripts/omw/ai.lua b/files/data/scripts/omw/ai.lua
index 59455dc8cb..e875e9f616 100644
--- a/files/data/scripts/omw/ai.lua
+++ b/files/data/scripts/omw/ai.lua
@@ -1,5 +1,6 @@
local self = require('openmw.self')
local interfaces = require('openmw.interfaces')
+local types = require('openmw.types')
local util = require('openmw.util')
local function startPackage(args)
@@ -10,6 +11,7 @@ local function startPackage(args)
self:_startAiCombat(args.target, cancelOther)
elseif args.type == 'Pursue' then
if not args.target then error("target required") end
+ if not types.Player.objectIsInstance(args.target) then error("target must be a player") end
self:_startAiPursue(args.target, cancelOther)
elseif args.type == 'Follow' then
if not args.target then error("target required") end
diff --git a/files/lang/launcher_de.ts b/files/lang/launcher_de.ts
index a39a3de4fd..9532fcc8ec 100644
--- a/files/lang/launcher_de.ts
+++ b/files/lang/launcher_de.ts
@@ -920,10 +920,6 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
-
-
-
-
@@ -1415,10 +1411,6 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
-
-
-
-
diff --git a/files/lang/launcher_en.ts b/files/lang/launcher_en.ts
index de20f743e8..36506bfb50 100644
--- a/files/lang/launcher_en.ts
+++ b/files/lang/launcher_en.ts
@@ -1363,14 +1363,6 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
-
-
-
-
-
-
-
-
diff --git a/files/lang/launcher_fr.ts b/files/lang/launcher_fr.ts
index 688726cf96..3cb015db67 100644
--- a/files/lang/launcher_fr.ts
+++ b/files/lang/launcher_fr.ts
@@ -920,10 +920,6 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
Sauvegardes
-
-
- <html><body><p>Cette option affiche le temps de jeu de chaque sauvegarde dans leur menu de sélection.</p></body></html>
-
JPG
@@ -1418,10 +1414,6 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
Permettre le zoom sur la carte
-
-
- Ajoute le temps de jeu aux sauvegardes
-
Notifier l'enregistrement des captures d'écran
diff --git a/files/lang/launcher_ru.ts b/files/lang/launcher_ru.ts
index a64eae38a3..09b2fdf0e9 100644
--- a/files/lang/launcher_ru.ts
+++ b/files/lang/launcher_ru.ts
@@ -1140,14 +1140,6 @@ to default Morrowind fonts. Check this box if you still prefer original fonts ov
Сохранения
-
-
- <html><head/><body><p>Эта настройка определяет, будет ли отображаться время с начала новой игры для выбранного сохранения в меню загрузки.</p></body></html>
-
-
-
- Выводить "Время в игре" в сохранениях
-
JPG
diff --git a/files/lang/launcher_sv.ts b/files/lang/launcher_sv.ts
index 59d076b79c..2d590fea11 100644
--- a/files/lang/launcher_sv.ts
+++ b/files/lang/launcher_sv.ts
@@ -933,10 +933,6 @@ de ordinarie fonterna i Morrowind. Bocka denna ruta om du ändå föredrar ordin
Sparfiler
-
-
- <html><head/><body><p>Denna inställning avgör huruvida mängden tid spelaren har spenderat i spelet kommer visas för varje sparat spel i Ladda spel-menyn.</p></body></html>
-
JPG
@@ -1434,10 +1430,6 @@ de ordinarie fonterna i Morrowind. Bocka denna ruta om du ändå föredrar ordin
Kan zooma på kartor
-
-
- Lägg till spelad tid i sparfiler
-
Ge notis vid sparad skärmdump
diff --git a/files/lua_api/openmw/types.lua b/files/lua_api/openmw/types.lua
index 8d54cf14df..4f8d51ab92 100644
--- a/files/lua_api/openmw/types.lua
+++ b/files/lua_api/openmw/types.lua
@@ -837,7 +837,7 @@
-- @field #string name
-- @field #string baseCreature Record id of a base creature, which was modified to create this one
-- @field #string model VFS path to the creature's model
--- @field #string mwscript
+-- @field #string mwscript MWScript on this creature (can be nil)
-- @field #number soulValue The soul value of the creature record
-- @field #number type The @{#Creature.TYPE} of the creature
-- @field #number baseGold The base barter gold of the creature
@@ -1117,7 +1117,7 @@
-- @field #string race
-- @field #string class Name of the NPC's class (e. g. Acrobat)
-- @field #string model Path to the model associated with this NPC, used for animations.
--- @field #string mwscript MWScript that is attached to this NPC
+-- @field #string mwscript MWScript on this NPC (can be nil)
-- @field #string hair Path to the hair body part model
-- @field #string head Path to the head body part model
-- @field #number baseGold The base barter gold of the NPC
@@ -1327,7 +1327,7 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this armor (can be empty)
+-- @field #string mwscript MWScript on this armor (can be nil)
-- @field #string icon VFS path to the icon
-- @field #string enchant The enchantment ID of this armor (can be nil)
-- @field #number weight
@@ -1416,7 +1416,7 @@
-- @field #string id The record ID of the book
-- @field #string name Name of the book
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this book (can be empty)
+-- @field #string mwscript MWScript on this book (can be nil)
-- @field #string icon VFS path to the icon
-- @field #string enchant The enchantment ID of this book (can be nil)
-- @field #string text The text content of the book
@@ -1494,7 +1494,7 @@
-- @field #string id Record id
-- @field #string name Name of the clothing
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this clothing (can be empty)
+-- @field #string mwscript MWScript on this clothing (can be nil)
-- @field #string icon VFS path to the icon
-- @field #string enchant The enchantment ID of this clothing (can be nil)
-- @field #number weight
@@ -1537,7 +1537,7 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this potion (can be empty)
+-- @field #string mwscript MWScript on this potion (can be nil)
-- @field #string icon VFS path to the icon
-- @field #number weight
-- @field #number value
@@ -1643,7 +1643,7 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this light (can be empty)
+-- @field #string mwscript MWScript on this light (can be nil)
-- @field #string icon VFS path to the icon
-- @field #string sound VFS path to the sound
-- @field #number weight
@@ -1714,7 +1714,7 @@
-- @field #string id The record ID of the miscellaneous item
-- @field #string name The name of the miscellaneous item
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this miscellaneous item (can be empty)
+-- @field #string mwscript MWScript on this miscellaneous item (can be nil)
-- @field #string icon VFS path to the icon
-- @field #number weight
-- @field #number value
@@ -1759,7 +1759,7 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this potion (can be empty)
+-- @field #string mwscript MWScript on this potion (can be nil)
-- @field #string icon VFS path to the icon
-- @field #number weight
-- @field #number value
@@ -1819,7 +1819,7 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this weapon (can be empty)
+-- @field #string mwscript MWScript on this weapon (can be nil)
-- @field #string icon VFS path to the icon
-- @field #string enchant The enchantment ID of this weapon (can be nil)
-- @field #boolean isMagical
@@ -1888,7 +1888,7 @@
-- @field #string id The record ID of the apparatus
-- @field #string name The name of the apparatus
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this apparatus (can be empty)
+-- @field #string mwscript MWScript on this apparatus (can be nil)
-- @field #string icon VFS path to the icon
-- @field #number type The type of apparatus. See @{#Apparatus.TYPE}
-- @field #number weight
@@ -1927,7 +1927,7 @@
-- @field #string id The record ID of the lockpick
-- @field #string name The name of the lockpick
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this lockpick (can be empty)
+-- @field #string mwscript MWScript on this lockpick (can be nil)
-- @field #string icon VFS path to the icon
-- @field #number maxCondition The maximum number of uses of this lockpick
-- @field #number weight
@@ -1966,7 +1966,7 @@
-- @field #string id The record ID of the probe
-- @field #string name The name of the probe
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this probe (can be empty)
+-- @field #string mwscript MWScript on this probe (can be nil)
-- @field #string icon VFS path to the icon
-- @field #number maxCondition The maximum number of uses of this probe
-- @field #number weight
@@ -2005,7 +2005,7 @@
-- @field #string id The record ID of the repair tool
-- @field #string name The name of the repair tool
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this repair tool (can be empty)
+-- @field #string mwscript MWScript on this repair tool (can be nil)
-- @field #string icon VFS path to the icon
-- @field #number maxCondition The maximum number of uses of this repair tool
-- @field #number weight
@@ -2042,7 +2042,7 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this activator (can be empty)
+-- @field #string mwscript MWScript on this activator (can be nil)
---
-- Creates a @{#ActivatorRecord} without adding it to the world database.
@@ -2109,7 +2109,7 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this container (can be empty)
+-- @field #string mwscript MWScript on this container (can be nil)
-- @field #number weight capacity of this container
-- @field #boolean isOrganic Whether items can be placed in the container
-- @field #boolean isRespawning Whether the container respawns its contents
@@ -2171,12 +2171,11 @@
-- @field #string id Record id
-- @field #string name Human-readable name
-- @field #string model VFS path to the model
--- @field #string mwscript MWScript on this door (can be empty)
+-- @field #string mwscript MWScript on this door (can be nil)
-- @field #string openSound The sound id for door opening
-- @field #string closeSound The sound id for door closing
-
--- Functions for @{#Static} objects
-- @field [parent=#types] #Static Static
diff --git a/files/settings-default.cfg b/files/settings-default.cfg
index 26722268a0..325bc57618 100644
--- a/files/settings-default.cfg
+++ b/files/settings-default.cfg
@@ -566,9 +566,6 @@ character =
# Automatically save the game whenever the player rests.
autosave = true
-# Display the time played on each save file in the load menu.
-timeplayed = false
-
# The maximum number of quick (or auto) save slots to have.
# If all slots are used, the oldest save is reused
max quicksaves = 1