diff --git a/data/ui_scripts/server_list/lobby.lua b/data/ui_scripts/server_list/lobby.lua index 0b9eb5c5..20027026 100644 --- a/data/ui_scripts/server_list/lobby.lua +++ b/data/ui_scripts/server_list/lobby.lua @@ -63,9 +63,18 @@ function menu_xboxlive(f16_arg0, f16_arg1) Engine.ExecNow("eliteclan_refresh", Engine.GetFirstActiveController()) end - menu:addElement(LUI.UITimer.new(4000, "vl")) - menu:registerEventHandler("vl", function() - game:virtuallobbypresentable() + local root = Engine.GetLuiRoot() + if (root.vltimer) then + root.vltimer:close() + end + + root.vltimer = LUI.UITimer.new(4000, "vl") + root:addElement(root.vltimer) + root:registerEventHandler("vl", function() + if (Engine.GetDvarBool("virtualLobbyReady")) then + root.vltimer:close() + game:virtuallobbypresentable() + end end) return menu diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index ef8c58a7..ec6418c3 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -339,8 +339,7 @@ namespace ui_scripting game_type["virtuallobbypresentable"] = [](const game&) { - static const auto presentable = ::game::Dvar_FindVar("virtualLobbyPresentable"); - presentable->current.enabled = true; + ::game::Dvar_SetFromStringByNameFromSource("virtualLobbyPresentable", "1", ::game::DvarSetSource::DVAR_SOURCE_INTERNAL); }; auto updater_table = table();