From 1785159de544067fef74614ba5012648339ce9ed Mon Sep 17 00:00:00 2001 From: quaK Date: Thu, 21 Dec 2023 17:26:12 +0200 Subject: [PATCH] Small fixes --- data/cdata/ui_scripts/patches/shader_dialog.lua | 2 +- src/client/component/mapents.cpp | 11 ++++++----- src/client/component/ui_scripting.cpp | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/data/cdata/ui_scripts/patches/shader_dialog.lua b/data/cdata/ui_scripts/patches/shader_dialog.lua index d4723fe0..3b18e53a 100644 --- a/data/cdata/ui_scripts/patches/shader_dialog.lua +++ b/data/cdata/ui_scripts/patches/shader_dialog.lua @@ -15,7 +15,7 @@ local function dialog(...) yes_text = Engine.Localize("@MENU_YES"), no_text = Engine.Localize("@MENU_NO_DONT_ASK"), no_action = function() - Engine.SetDvarInt("r_preloadShadersFrontendAllow", 0) + Engine.SetDvarBool("r_preloadShadersFrontendAllow", false) end, default_focus_index = 2, cancel_will_close = false diff --git a/src/client/component/mapents.cpp b/src/client/component/mapents.cpp index 56c434c1..f38016e4 100644 --- a/src/client/component/mapents.cpp +++ b/src/client/component/mapents.cpp @@ -25,6 +25,7 @@ namespace mapents for (auto i = 0; i < lines.size(); i++) { + auto line_num = i+1; auto line = lines[i]; if (line.ends_with('\r')) { @@ -62,7 +63,7 @@ namespace mapents 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 {}; } @@ -87,7 +88,7 @@ namespace mapents 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 {}; } @@ -95,7 +96,7 @@ namespace mapents std::smatch match{}; 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; } @@ -104,7 +105,7 @@ namespace mapents 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; } @@ -126,7 +127,7 @@ namespace mapents const auto id = gsc::gsc_ctx->token_id(key_); 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; } diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index 74279fa3..bfb8730d 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -620,6 +620,8 @@ namespace ui_scripting 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(0xE72CB_b, 0x25E6BB_b), db_find_x_asset_header_stub);