5 Commits

Author SHA1 Message Date
GreenComfyTea
63ddbff12a Fix Consumable Buff UI not working in online request if not host 2023-08-03 12:21:17 +03:00
GreenComfyTea
0359042c97 Fix Buff timers showing xx:60 sometimes 2023-08-03 12:20:36 +03:00
GreenComfyTea
c8dab31265 Add back(?) label include customization code 2023-08-03 12:20:08 +03:00
GreenComfyTea
405c5e4aad Fix continue labels ambiguity 2023-08-03 12:19:41 +03:00
GreenComfyTea
597d27b935 Uncomment Buff UI code 2023-08-03 12:19:13 +03:00
7 changed files with 36 additions and 26 deletions

View File

@@ -259,12 +259,12 @@ local function main_loop()
end
end
--[[if config.current_config.buff_UI.enabled and module_visibility_config.buff_UI then
if config.current_config.buff_UI.enabled and module_visibility_config.buff_UI then
local success = pcall(buff_UI.draw);
if not success then
customization_menu.status = "[In Training Area] Buff UI Drawing Function threw an Exception";
end
end]]
end
elseif quest_status.flow_state == quest_status.flow_states.CUTSCENE then

View File

@@ -94,7 +94,7 @@ function this.update_timer(buff, timer)
buff.timer = timer;
buff.minutes_left = minutes_left;
buff.seconds_left = timer - 60 * minutes_left;
buff.seconds_left = math.floor(timer - 60 * minutes_left);
if buff.duration ~= 0 then
buff.timer_percentage = timer / buff.duration;

View File

@@ -1,13 +1,11 @@
local this = {};
local buff_UI_entity;
local config;
local singletons;
local buffs;
local buff_UI_entity;
local config;
local singletons;
local players;
local utils;
local sdk = sdk;
local tostring = tostring;
@@ -63,7 +61,6 @@ this.list = {
might_seed = nil,
adamant_seed = nil,
hardshell_powder = nil,
hardshell_powder = nil,
immunizer = nil,
dash_juice = nil
};
@@ -118,7 +115,7 @@ function this.update()
return;
end
local player_data = get_value_method:call(player_data_array, 0);
local player_data = get_value_method:call(player_data_array, players.myself.id);
if player_data == nil then
return;
end
@@ -373,6 +370,7 @@ end
function this.update_dash_juice(player_data, item_parameter)
local dash_juice_timer = stamina_up_buff_second_timer_field:get_data(player_data);
if dash_juice_timer == nil then
return;
end
@@ -399,8 +397,10 @@ end
function this.init_module()
buffs = require("MHR_Overlay.Buffs.buffs");
config = require("MHR_Overlay.Misc.config");
utils = require("MHR_Overlay.Misc.utils");
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
singletons = require("MHR_Overlay.Game_Handler.singletons");
players = require("MHR_Overlay.Damage_Meter.players");
end
return this;

View File

@@ -61,6 +61,17 @@ function this.draw(label_name, label)
imgui.tree_pop();
end
if label.include ~= nil then
if imgui.tree_node(cached_language.include) then
for include_name, include in pairs(label.include) do
changed, label.include[include_name] = imgui.checkbox(cached_language[include_name], label.include[include_name]);
label_changed = label_changed or changed;
end
imgui.tree_pop();
end
end
if imgui.tree_node(cached_language.offset) then
changed, label.offset.x = imgui.drag_float(cached_language.x, label.offset.x, 0.1, -screen.width, screen.width, "%.1f");
label_changed = label_changed or changed;
@@ -79,8 +90,7 @@ function this.draw(label_name, label)
end
if imgui.tree_node(cached_language.shadow) then
changed, label.shadow.visibility = imgui.checkbox(cached_language
.visible, label.shadow.visibility);
changed, label.shadow.visibility = imgui.checkbox(cached_language.visible, label.shadow.visibility);
label_changed = label_changed or changed;
if imgui.tree_node(cached_language.offset) then

View File

@@ -92,11 +92,11 @@ function this.draw(cached_config)
config_changed = config_changed or changed;
--[[changed, cached_config.buff_UI = imgui.checkbox(
changed, cached_config.buff_UI = imgui.checkbox(
language.current_language.customization_menu.buff_UI,
cached_config.buff_UI);
config_changed = config_changed or changed;]]
config_changed = config_changed or changed;
return config_changed;
end

View File

@@ -5,6 +5,7 @@ local config;
local buffs;
local consumables;
local screen;
local utils;
local sdk = sdk;
local tostring = tostring;
@@ -58,12 +59,12 @@ function this.draw()
for _, consumable in pairs(consumables.list) do
if not consumable.is_active then
goto continue
goto continue2
end
table.insert(displayed_buffs, consumable);
::continue::
::continue2::
end
-- sort
@@ -99,15 +100,13 @@ function this.draw()
end
end
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
-- draw
for _, buff in ipairs(displayed_buffs) do
if not buff.is_active then
goto continue2
goto continue3
end
buffs.draw(buff, buff.buff_UI, position_on_screen, 1);
@@ -118,7 +117,7 @@ function this.draw()
position_on_screen.y = position_on_screen.y + cached_config.spacing.y * global_scale_modifier;
end
::continue2::
::continue3::
end
end
@@ -135,6 +134,7 @@ function this.init_module()
--quest_status = require("MHR_Overlay.Game_Handler.quest_status");
screen = require("MHR_Overlay.Game_Handler.screen");
--drawing = require("MHR_Overlay.UI.drawing");
utils = require("MHR_Overlay.Misc.utils");
end
return this;

View File

@@ -375,7 +375,7 @@ function this.draw()
time_UI_changed = this.draw_time_UI();
damage_meter_UI_changed = this.draw_damage_meter_UI();
endemic_life_UI_changed = this.draw_endemic_life_UI()
--buff_UI_changed = customization_menu.draw_buff_UI();
buff_UI_changed = this.draw_buff_UI();
imgui.pop_font();
imgui.end_window();
@@ -434,11 +434,11 @@ function this.draw()
end
end
--[[if buff_UI_changed or modifiers_changed or config_changed then
if buff_UI_changed or modifiers_changed or config_changed then
for _, buff in pairs(buffs.list) do
buffs.init_UI(buff);
end
end]]
end
if this.menu_font_changed and (apply_font_requested or config_changed) then
this.menu_font_changed = false;
@@ -569,9 +569,9 @@ function this.draw_modules()
language.current_language.customization_menu.endemic_life_UI, config.current_config.endemic_life_UI.enabled);
config_changed = config_changed or changed;
--[[changed, config.current_config.buff_UI.enabled = imgui.checkbox(
changed, config.current_config.buff_UI.enabled = imgui.checkbox(
language.current_language.customization_menu.buff_UI, config.current_config.buff_UI.enabled);
config_changed = config_changed or changed;]]
config_changed = config_changed or changed;
imgui.tree_pop();
end
@@ -1002,11 +1002,11 @@ function this.draw_global_settings(apply_font_requested, language_changed)
config_changed = config_changed or changed;
--[[changed, cached_config.module_visibility.in_training_area.buff_UI = imgui.checkbox(
changed, cached_config.module_visibility.in_training_area.buff_UI = imgui.checkbox(
language.current_language.customization_menu.buff_UI,
cached_config.module_visibility.in_training_area.buff_UI);
config_changed = config_changed or changed;]]
config_changed = config_changed or changed;
imgui.tree_pop();
end