1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-06 12:45:36 +00:00

ESM::Dialogue Lua bindings: filterActorGender returns string

This commit is contained in:
trav5 2024-05-01 13:05:35 +02:00
parent 9001ed1e2f
commit 0e03b9bd32
2 changed files with 4 additions and 4 deletions

View file

@ -320,12 +320,12 @@ namespace
return rec.mData.mDisposition; return rec.mData.mDisposition;
}); });
recordInfoBindingsClass["filterActorGender"] recordInfoBindingsClass["filterActorGender"]
= sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional<int> { = sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional<std::string_view> {
if (rec.mData.mType == ESM::Dialogue::Type::Journal || rec.mData.mGender == -1) if (rec.mData.mType == ESM::Dialogue::Type::Journal || rec.mData.mGender == -1)
{ {
return sol::nullopt; return sol::nullopt;
} }
return rec.mData.mGender; return sol::optional<std::string_view>(rec.mData.mGender == 0 ? "male" : "female");
}); });
recordInfoBindingsClass["filterPlayerFaction"] recordInfoBindingsClass["filterPlayerFaction"]
= sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional<std::string> { = sol::readonly_property([](const ESM::DialInfo& rec) -> sol::optional<std::string> {

View file

@ -1087,9 +1087,9 @@
-- @field [parent=#DialogueRecordInfo] #number filterActorDisposition -- @field [parent=#DialogueRecordInfo] #number filterActorDisposition
--- ---
-- Speaker gender allowing for this info entry to appear: 1 if female, 0 if male. -- Speaker gender allowing for this info entry to appear: "male" or "female".
-- 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] #number filterActorGender -- @field [parent=#DialogueRecordInfo] #string filterActorGender
--- ---
-- Faction of which the player must be a member for this info entry to appear. -- Faction of which the player must be a member for this info entry to appear.