Add achievements button to pause menu

This commit is contained in:
fed 2023-04-27 03:55:11 +02:00
parent 68dae08c27
commit e272922c6c
2 changed files with 13 additions and 1 deletions

View File

@ -4,6 +4,14 @@ end
LUI.onmenuopen("sp_pause_menu", function(element) LUI.onmenuopen("sp_pause_menu", function(element)
local menu = element:getFirstChild() local menu = element:getFirstChild()
local button = menu:AddButton("@LUA_MENU_ACHIEVEMENTS", function()
LUI.FlowManager.RequestAddMenu(nil, "achievements_menu")
end)
menu.list:removeElement(button)
menu.list:insertElement(button, 4)
menu:AddButton("@MENU_QUIT_TO_DESKTOP", function() menu:AddButton("@MENU_QUIT_TO_DESKTOP", function()
LUI.FlowManager.RequestAddMenu(nil, "quit_popmenu") LUI.FlowManager.RequestAddMenu(nil, "quit_popmenu")
end) end)

View File

@ -187,7 +187,11 @@ namespace gsc
std::vector<std::uint8_t> stack_data; std::vector<std::uint8_t> stack_data;
stack_data.assign(decompressed_stack.begin(), decompressed_stack.end()); stack_data.assign(decompressed_stack.begin(), decompressed_stack.end());
const xsk::gsc::buffer buffer{reinterpret_cast<uint8_t*>(script_file->bytecode), static_cast<std::size_t>(script_file->bytecodeLen)}; const xsk::gsc::buffer buffer
{
reinterpret_cast<uint8_t*>(script_file->bytecode),
static_cast<std::size_t>(script_file->bytecodeLen)
};
return std::make_pair(buffer, stack_data); return std::make_pair(buffer, stack_data);
} }