From 9001ed1e2f27aa57c67b4eaad763665e85d60eb9 Mon Sep 17 00:00:00 2001 From: trav5 Date: Wed, 1 May 2024 12:33:25 +0200 Subject: [PATCH] ESM::Dialogue Lua bindings: rank filters start from 1 and filterActorCell->filterPlayerCell --- apps/openmw/mwlua/dialoguebindings.cpp | 6 +++--- files/lua_api/openmw/core.lua | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwlua/dialoguebindings.cpp b/apps/openmw/mwlua/dialoguebindings.cpp index 710bec0727..42a1a0b4b0 100644 --- a/apps/openmw/mwlua/dialoguebindings.cpp +++ b/apps/openmw/mwlua/dialoguebindings.cpp @@ -301,9 +301,9 @@ namespace { return sol::nullopt; } - return rec.mData.mRank; + return rec.mData.mRank + 1; }); - recordInfoBindingsClass["filterActorCell"] + recordInfoBindingsClass["filterPlayerCell"] = sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional { if (rec.mData.mType == ESM::Dialogue::Type::Journal || rec.mCell.empty()) { @@ -341,7 +341,7 @@ namespace { return sol::nullopt; } - return rec.mData.mPCrank; + return rec.mData.mPCrank + 1; }); recordInfoBindingsClass["sound"] = sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional { diff --git a/files/lua_api/openmw/core.lua b/files/lua_api/openmw/core.lua index c630839d04..5fc820dedf 100644 --- a/files/lua_api/openmw/core.lua +++ b/files/lua_api/openmw/core.lua @@ -1044,14 +1044,14 @@ --- -- True if this info entry has the "Quest Name" flag checked. --- If true, then the @{#DialogueRecord}, to which this info entry belongs, should have this info entry's @{#DialogueRecordInfo.text} value available in its @{#DialogueRecord.questName}. -- Non-nil only for journal records. +-- If true, then the @{#DialogueRecord}, to which this info entry belongs, should have this info entry's @{#DialogueRecordInfo.text} value available in its @{#DialogueRecord.questName}. -- @field [parent=#DialogueRecordInfo] #boolean isQuestName --- -- Faction of which the speaker must be a member for this info entry to appear. --- Can return an empty string - this means that the actor must not be a member of any faction for this filtering to apply. -- Always nil for journal records. Otherwise the nil value represents no conditions, i.e. no filtering applied using these criteria. +-- Can return an empty string - this means that the actor must not be a member of any faction for this filtering to apply. -- @field [parent=#DialogueRecordInfo] #string filterActorFaction --- @@ -1072,12 +1072,14 @@ --- -- Minimum speaker's rank in their faction allowing for this info entry to appear. -- Always nil for journal records. Otherwise the nil value represents no conditions, i.e. no filtering applied using these criteria. +-- Rank index starts from 1, matching the value in @{openmw_types#NPC.getFactionRank} -- @field [parent=#DialogueRecordInfo] #number filterActorFactionRank --- --- Cell name of location where speaker must be for this info entry to appear. +-- Cell name prefix of location where the player must be for this info entry to appear. -- Always nil for journal records. Otherwise the nil value represents no conditions, i.e. no filtering applied using these criteria. --- @field [parent=#DialogueRecordInfo] #string filterActorCell +-- "Prefix" means that the cell's name starting with this value shall pass the filtering. For example: `filterPlayerCell` being "Seyda Neen" does apply to the cell "Seyda Neen, Fargoth's House". +-- @field [parent=#DialogueRecordInfo] #string filterPlayerCell --- -- Minimum speaker disposition allowing for this info entry to appear. @@ -1097,6 +1099,7 @@ --- -- Minimum player's rank in their faction allowing for this info entry to appear. -- Always nil for journal records. Otherwise the nil value represents no conditions, i.e. no filtering applied using these criteria. +-- Rank index starts from 1, matching the value in @{openmw_types#NPC.getFactionRank} -- @field [parent=#DialogueRecordInfo] #number filterPlayerFactionRank ---