Skip to content

Commit

Permalink
Add alternative syntax for CName and TweakDBID
Browse files Browse the repository at this point in the history
  • Loading branch information
psiberx committed Aug 25, 2021
1 parent b2c6dfc commit 5355d73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scripting/Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ void Scripting::PostInitialize()
};

luaVm.new_usertype<CName>("CName",
sol::constructors<CName(const std::string&), CName(uint32_t), CName(uint32_t, uint32_t),
sol::constructors<CName(const std::string&), CName(uint64_t), CName(uint32_t, uint32_t),
CName(const CName&), CName()>(),
sol::call_constructor, sol::constructors<CName(const std::string&), CName(uint64_t)>(),
sol::meta_function::to_string, &CName::ToString,
sol::meta_function::equal_to, &CName::operator==,
"hash_lo", &CName::hash_lo,
Expand All @@ -286,6 +287,7 @@ void Scripting::PostInitialize()
luaVm.new_usertype<TweakDBID>("TweakDBID",
sol::constructors<TweakDBID(const std::string&), TweakDBID(const TweakDBID&, const std::string&),
TweakDBID(uint32_t, uint8_t), TweakDBID(const TweakDBID&), TweakDBID()>(),
sol::call_constructor, sol::constructors<TweakDBID(const std::string&)>(),
sol::meta_function::to_string, &TweakDBID::ToString,
sol::meta_function::equal_to, &TweakDBID::operator==,
sol::meta_function::addition, &TweakDBID::operator+,
Expand Down

0 comments on commit 5355d73

Please sign in to comment.