1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-02 16:20:23 +00:00

ESM::Dialogue Lua bindings: rank filters start from 1 and filterActorCell->filterPlayerCell

This commit is contained in:
trav5 2024-05-01 12:33:25 +02:00
parent 2cdfaa69b3
commit 9001ed1e2f
2 changed files with 10 additions and 7 deletions

View File

@ -301,9 +301,9 @@ namespace
{ {
return sol::nullopt; 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<std::string> { = sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional<std::string> {
if (rec.mData.mType == ESM::Dialogue::Type::Journal || rec.mCell.empty()) if (rec.mData.mType == ESM::Dialogue::Type::Journal || rec.mCell.empty())
{ {
@ -341,7 +341,7 @@ namespace
{ {
return sol::nullopt; return sol::nullopt;
} }
return rec.mData.mPCrank; return rec.mData.mPCrank + 1;
}); });
recordInfoBindingsClass["sound"] recordInfoBindingsClass["sound"]
= sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional<std::string> { = sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional<std::string> {

View File

@ -1044,14 +1044,14 @@
--- ---
-- True if this info entry has the "Quest Name" flag checked. -- 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. -- 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 -- @field [parent=#DialogueRecordInfo] #boolean isQuestName
--- ---
-- Faction of which the speaker must be a member for this info entry to appear. -- 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. -- 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 -- @field [parent=#DialogueRecordInfo] #string filterActorFaction
--- ---
@ -1072,12 +1072,14 @@
--- ---
-- Minimum speaker's rank in their faction allowing for this info entry to appear. -- 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. -- 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 -- @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. -- 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. -- 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. -- 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. -- 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 -- @field [parent=#DialogueRecordInfo] #number filterPlayerFactionRank
--- ---