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"),
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

View File

@ -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;
}

View File

@ -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);