Small fixes

This commit is contained in:
quaK 2023-12-21 17:26:12 +02:00
parent 91f2738ec9
commit 1785159de5
3 changed files with 9 additions and 6 deletions

View File

@ -15,7 +15,7 @@ local function dialog(...)
yes_text = Engine.Localize("@MENU_YES"), yes_text = Engine.Localize("@MENU_YES"),
no_text = Engine.Localize("@MENU_NO_DONT_ASK"), no_text = Engine.Localize("@MENU_NO_DONT_ASK"),
no_action = function() no_action = function()
Engine.SetDvarInt("r_preloadShadersFrontendAllow", 0) Engine.SetDvarBool("r_preloadShadersFrontendAllow", false)
end, end,
default_focus_index = 2, default_focus_index = 2,
cancel_will_close = false cancel_will_close = false

View File

@ -25,6 +25,7 @@ namespace mapents
for (auto i = 0; i < lines.size(); i++) for (auto i = 0; i < lines.size(); i++)
{ {
auto line_num = i+1;
auto line = lines[i]; auto line = lines[i];
if (line.ends_with('\r')) if (line.ends_with('\r'))
{ {
@ -62,7 +63,7 @@ namespace mapents
if (line[0] == '{' && in_map_ent) if (line[0] == '{' && in_map_ent)
{ {
console::error("[map_ents parser] Unexpected '{' on line %i\n", i); console::error("[map_ents parser] Unexpected '{' on line %i\n", line_num);
return {}; return {};
} }
@ -87,7 +88,7 @@ namespace mapents
if (line[0] == '}' && !in_map_ent) if (line[0] == '}' && !in_map_ent)
{ {
console::error("[map_ents parser] Unexpected '}' on line %i\n", i); console::error("[map_ents parser] Unexpected '}' on line %i\n", line_num);
return {}; return {};
} }
@ -95,7 +96,7 @@ namespace mapents
std::smatch match{}; std::smatch match{};
if (!std::regex_search(line, match, expr) && !line.empty()) if (!std::regex_search(line, match, expr) && !line.empty())
{ {
console::warn("[map_ents parser] Failed to parse line %i (%s)\n", i, line.data()); console::warn("[map_ents parser] Failed to parse line %i (%s)\n", line_num, line.data());
continue; continue;
} }
@ -104,7 +105,7 @@ namespace mapents
if (key.size() <= 0) if (key.size() <= 0)
{ {
console::warn("[map_ents parser] Invalid key ('%s') on line %i (%s)\n", key.data(), i, line.data()); console::warn("[map_ents parser] Invalid key ('%s') on line %i (%s)\n", key.data(), line_num, line.data());
continue; continue;
} }
@ -126,7 +127,7 @@ namespace mapents
const auto id = gsc::gsc_ctx->token_id(key_); const auto id = gsc::gsc_ctx->token_id(key_);
if (id == 0) if (id == 0)
{ {
console::warn("[map_ents parser] Key '%s' not found, on line %i (%s)\n", key_.data(), i, line.data()); console::warn("[map_ents parser] Key '%s' not found, on line %i (%s)\n", key_.data(), line_num, line.data());
continue; continue;
} }

View File

@ -620,6 +620,8 @@ namespace ui_scripting
return; return;
} }
dvars::register_bool("r_preloadShadersFrontendAllow", true, game::DVAR_FLAG_SAVED, "Allow shader popup on startup");
utils::hook::call(SELECT_VALUE(0xE7419_b, 0x25E809_b), db_find_x_asset_header_stub); utils::hook::call(SELECT_VALUE(0xE7419_b, 0x25E809_b), db_find_x_asset_header_stub);
utils::hook::call(SELECT_VALUE(0xE72CB_b, 0x25E6BB_b), db_find_x_asset_header_stub); utils::hook::call(SELECT_VALUE(0xE72CB_b, 0x25E6BB_b), db_find_x_asset_header_stub);