mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Consumables: Formatting + Use key if missing name
This commit is contained in:
@@ -137,7 +137,7 @@ function this.update_generic(consumable_key, player_data, item_parameter, value_
|
|||||||
|
|
||||||
local value = value_field:get_data(player_data);
|
local value = value_field:get_data(player_data);
|
||||||
if value == nil then
|
if value == nil then
|
||||||
error_handler.report("consumables.update_generic_with_value", string.format("Failed to access Data: %s_value", consumable_key));
|
error_handler.report("consumables.update_generic", string.format("Failed to access Data: %s_value", consumable_key));
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ function this.update_generic(consumable_key, player_data, item_parameter, value_
|
|||||||
|
|
||||||
local timer = timer_field:get_data(player_data);
|
local timer = timer_field:get_data(player_data);
|
||||||
if timer == nil then
|
if timer == nil then
|
||||||
error_handler.report("consumables.update_generic_with_value", string.format("Failed to access Data: %s_timer", consumable_key));
|
error_handler.report("consumables.update_generic", string.format("Failed to access Data: %s_timer", consumable_key));
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ function this.update_generic(consumable_key, player_data, item_parameter, value_
|
|||||||
if consumable == nil then
|
if consumable == nil then
|
||||||
local timer_const_value = timer_const_value_field:get_data(item_parameter);
|
local timer_const_value = timer_const_value_field:get_data(item_parameter);
|
||||||
if timer_const_value == nil then
|
if timer_const_value == nil then
|
||||||
error_handler.report("consumables.update_generic_with_value", string.format("Failed to access Data: %s_timer_const_value", consumable_key));
|
error_handler.report("consumables.update_generic", string.format("Failed to access Data: %s_timer_const_value", consumable_key));
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -303,8 +303,14 @@ function this.update_gourmet_fish(player_data, item_parameter)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function this.init_names()
|
function this.init_names()
|
||||||
for key, buff in pairs(this.list) do
|
for consumable_key, consumable in pairs(this.list) do
|
||||||
buff.name = language.current_language.consumables[key];
|
local name = language.current_language.consumables[consumable_key];
|
||||||
|
|
||||||
|
if name == nil then
|
||||||
|
name = consumable_key;
|
||||||
|
end
|
||||||
|
|
||||||
|
consumable.name = name;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user