2022-06-24 18:44:43 -04:00
|
|
|
LUI.MenuBuilder.registerPopupType("ShaderCacheDialog_original", LUI.ShaderCacheDialog.new)
|
|
|
|
|
|
|
|
local function dialog(...)
|
2022-09-25 11:12:58 -04:00
|
|
|
if (game:sharedget("has_accepted_shader_caching") == "1") then
|
|
|
|
return LUI.ShaderCacheDialog.new(...)
|
|
|
|
end
|
2022-06-24 18:44:43 -04:00
|
|
|
|
2022-09-25 11:12:58 -04:00
|
|
|
return LUI.MenuBuilder.BuildRegisteredType("generic_yesno_popup", {
|
|
|
|
popup_title = Engine.Localize("@MENU_WARNING"),
|
|
|
|
message_text = Engine.Localize("@PLATFORM_SHADER_PRECACHE_ASK"),
|
|
|
|
yes_action = function()
|
|
|
|
game:sharedset("has_accepted_shader_caching", "1")
|
|
|
|
LUI.FlowManager.RequestAddMenu(nil, "ShaderCacheDialog_original")
|
|
|
|
end,
|
|
|
|
yes_text = Engine.Localize("@MENU_YES"),
|
|
|
|
no_text = Engine.Localize("@MENU_NO_DONT_ASK"),
|
|
|
|
no_action = function()
|
2023-12-21 10:26:12 -05:00
|
|
|
Engine.SetDvarBool("r_preloadShadersFrontendAllow", false)
|
2022-09-25 11:12:58 -04:00
|
|
|
end,
|
|
|
|
default_focus_index = 2,
|
|
|
|
cancel_will_close = false
|
|
|
|
})
|
2022-06-24 18:44:43 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
LUI.MenuBuilder.m_types_build["ShaderCacheDialog"] = dialog
|