Uniform quotation format.

This commit is contained in:
GreenComfyTea
2022-07-19 17:01:50 +03:00
parent 56a6167466
commit 783993caa8
3 changed files with 11 additions and 11 deletions

View File

@@ -82,7 +82,7 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
local attacker_type = get_damage_attacker_type_method:call(enemy_calc_damage_info); local attacker_type = get_damage_attacker_type_method:call(enemy_calc_damage_info);
local is_marionette_attack = is_marionette_attack_method:call(enemy_calc_damage_info) local is_marionette_attack = is_marionette_attack_method:call(enemy_calc_damage_info)
-- 4 is virtual player in singleplayer that 'owns' 2nd otomo -- 4 is virtual player in singleplayer that "owns" 2nd otomo
if not quest_status.is_online and attacker_id == 4 then if not quest_status.is_online and attacker_id == 4 then
attacker_id = player.myself.player_id; attacker_id = player.myself.player_id;
end end

View File

@@ -4062,10 +4062,10 @@ end
function config.load() function config.load()
local loaded_config = json.load_file(config.config_file_name); local loaded_config = json.load_file(config.config_file_name);
if loaded_config ~= nil then if loaded_config ~= nil then
log.info('[MHR Overlay] config.json loaded successfully'); log.info("[MHR Overlay] config.json loaded successfully");
config.current_config = table_helpers.merge(config.default_config, loaded_config); config.current_config = table_helpers.merge(config.default_config, loaded_config);
else else
log.error('[MHR Overlay] Failed to load config.json'); log.error("[MHR Overlay] Failed to load config.json");
config.current_config = table_helpers.deep_copy(config.default_config); config.current_config = table_helpers.deep_copy(config.default_config);
end end
end end
@@ -4074,9 +4074,9 @@ function config.save()
-- save current config to disk, replacing any existing file -- save current config to disk, replacing any existing file
local success = json.dump_file(config.config_file_name, config.current_config); local success = json.dump_file(config.config_file_name, config.current_config);
if success then if success then
log.info('[MHR Overlay] config.json saved successfully'); log.info("[MHR Overlay] config.json saved successfully");
else else
log.error('[MHR Overlay] Failed to save config.json'); log.error("[MHR Overlay] Failed to save config.json");
end end
end end

View File

@@ -4,7 +4,7 @@ function table_helpers.deep_copy(original, copies)
copies = copies or {}; copies = copies or {};
local original_type = type(original); local original_type = type(original);
local copy; local copy;
if original_type == 'table' then if original_type == "table" then
if copies[original] then if copies[original] then
copy = copies[original]; copy = copies[original];
else else
@@ -62,15 +62,15 @@ function table_helpers.merge(...)
end end
function table_helpers.tostring(table) function table_helpers.tostring(table)
if type(table) == 'table' then if type(table) == "table" then
local s = '{ \n'; local s = "{ \n";
for k,v in pairs(table) do for k,v in pairs(table) do
if type(k) ~= 'number' then if type(k) ~= "number" then
k = '"' .. k .. '"'; k = '"' .. k .. '"';
end end
s = s .. '\t['..k..'] = ' .. table_helpers.tostring(v) .. ',\n'; s = s .. "\t["..k.."] = " .. table_helpers.tostring(v) .. ",\n";
end end
return s .. '} \n'; return s .. "} \n";
else else
return tostring(table); return tostring(table);
end end