Skip to content

Commit

Permalink
xrGame/script_game_object_inventory_owner.cpp: support for SOC-style …
Browse files Browse the repository at this point in the history
…give_game_news Lua function (#392)
  • Loading branch information
Xottab-DUTY committed Apr 17, 2023
1 parent 9425069 commit a9d0a11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/xrGame/script_game_object_script3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ luabind::class_<CScriptGameObject>& script_register_game_object2(luabind::class_
.def("give_info_portion", &CScriptGameObject::GiveInfoPortion)
.def("disable_info_portion", &CScriptGameObject::DisableInfoPortion)

.def("give_game_news", +[](CScriptGameObject* self,
pcstr news, pcstr texture_name, Frect /*tex_rect*/, int delay, int show_time)
{
// SOC give_game_news style
// tex_rect is ignored, we could add support for it back, if really needed.
// It also should be safe to pass nullptr to caption param
self->GiveGameNews(nullptr, news, texture_name, delay, show_time);
return true;
})
.def("give_game_news",
(void (CScriptGameObject::*)(LPCSTR, LPCSTR, LPCSTR, int, int))(&CScriptGameObject::GiveGameNews))
.def("give_game_news",
Expand Down

0 comments on commit a9d0a11

Please sign in to comment.