Add playmenuvideo function

This commit is contained in:
Federico Cecchetto 2021-09-20 20:20:06 +02:00
parent baa6ef236e
commit 1c9069b5ce
4 changed files with 20 additions and 1 deletions

View File

@ -34,6 +34,7 @@ namespace ui_scripting
{"fira_mono_bold", "fonts/fira_mono_bold.ttf"},
{"fira_mono_regular", "fonts/fira_mono_regular.ttf"},
{"defaultbold", "fonts/defaultbold.otf"},
{"objective", "fonts/defaultbold.otf"},
{"default", "fonts/default.otf"},
};

View File

@ -540,6 +540,17 @@ namespace ui_scripting::lua
}
);
menu_type["ignoreevents"] = sol::property(
[](menu& menu)
{
return menu.ignoreevents;
},
[](menu& menu, bool ignoreevents)
{
menu.ignoreevents = ignoreevents;
}
);
menu_type["isopen"] = [](menu& menu)
{
return menu.visible || (menu.type == menu_type::overlay && game::Menu_IsMenuOpenAndVisible(0, menu.overlay_menu.data()));
@ -882,6 +893,12 @@ namespace ui_scripting::lua
return screen;
};
game_type["playmenuvideo"] = [](const game&, const std::string& video)
{
reinterpret_cast<void (*)(const char* a1, int a2, int a3)>
(::game::base_address + 0x71B970)(video.data(), 64, 0);
};
struct player
{
};

View File

@ -52,7 +52,7 @@ namespace ui_scripting::lua::engine
for (const auto& menu : menus)
{
if (!is_menu_visible(menu.second))
if (!is_menu_visible(menu.second) || menu.second.ignoreevents)
{
continue;
}

View File

@ -18,6 +18,7 @@ namespace ui_scripting
bool visible = false;
bool hidden = false;
bool cursor = false;
bool ignoreevents = false;
bool cursor_was_enabled = false;
void open();