mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Reorder, remove comment
This commit is contained in:
parent
35da9578ca
commit
3e3a39539c
@ -31,7 +31,6 @@ namespace MWLua
|
|||||||
sol::table classes(context.mLua->sol(), sol::create);
|
sol::table classes(context.mLua->sol(), sol::create);
|
||||||
addRecordFunctionBinding<ESM::Class>(classes, context);
|
addRecordFunctionBinding<ESM::Class>(classes, context);
|
||||||
|
|
||||||
// class record
|
|
||||||
auto classT = lua.new_usertype<ESM::Class>("ESM3_Class");
|
auto classT = lua.new_usertype<ESM::Class>("ESM3_Class");
|
||||||
classT[sol::meta_function::to_string]
|
classT[sol::meta_function::to_string]
|
||||||
= [](const ESM::Class& rec) -> std::string { return "ESM3_Class[" + rec.mId.toDebugString() + "]"; };
|
= [](const ESM::Class& rec) -> std::string { return "ESM3_Class[" + rec.mId.toDebugString() + "]"; };
|
||||||
@ -40,16 +39,6 @@ namespace MWLua
|
|||||||
classT["description"]
|
classT["description"]
|
||||||
= sol::readonly_property([](const ESM::Class& rec) -> std::string_view { return rec.mDescription; });
|
= sol::readonly_property([](const ESM::Class& rec) -> std::string_view { return rec.mDescription; });
|
||||||
|
|
||||||
classT["majorSkills"] = sol::readonly_property([lua](const ESM::Class& rec) -> sol::table {
|
|
||||||
sol::table res(lua, sol::create);
|
|
||||||
auto skills = rec.mData.mSkills;
|
|
||||||
for (size_t i = 0; i < skills.size(); ++i)
|
|
||||||
{
|
|
||||||
ESM::RefId skillId = ESM::Skill::indexToRefId(skills[i][1]);
|
|
||||||
res[i + 1] = skillId.serializeText();
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
});
|
|
||||||
classT["attributes"] = sol::readonly_property([lua](const ESM::Class& rec) -> sol::table {
|
classT["attributes"] = sol::readonly_property([lua](const ESM::Class& rec) -> sol::table {
|
||||||
sol::table res(lua, sol::create);
|
sol::table res(lua, sol::create);
|
||||||
auto attribute = rec.mData.mAttribute;
|
auto attribute = rec.mData.mAttribute;
|
||||||
@ -60,6 +49,16 @@ namespace MWLua
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
});
|
});
|
||||||
|
classT["majorSkills"] = sol::readonly_property([lua](const ESM::Class& rec) -> sol::table {
|
||||||
|
sol::table res(lua, sol::create);
|
||||||
|
auto skills = rec.mData.mSkills;
|
||||||
|
for (size_t i = 0; i < skills.size(); ++i)
|
||||||
|
{
|
||||||
|
ESM::RefId skillId = ESM::Skill::indexToRefId(skills[i][1]);
|
||||||
|
res[i + 1] = skillId.serializeText();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
});
|
||||||
classT["minorSkills"] = sol::readonly_property([lua](const ESM::Class& rec) -> sol::table {
|
classT["minorSkills"] = sol::readonly_property([lua](const ESM::Class& rec) -> sol::table {
|
||||||
sol::table res(lua, sol::create);
|
sol::table res(lua, sol::create);
|
||||||
auto skills = rec.mData.mSkills;
|
auto skills = rec.mData.mSkills;
|
||||||
|
Loading…
Reference in New Issue
Block a user