mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-29 23:08:12 -08:00
Compare commits
5 Commits
90190f5af7
...
63ddbff12a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63ddbff12a | ||
|
|
0359042c97 | ||
|
|
c8dab31265 | ||
|
|
405c5e4aad | ||
|
|
597d27b935 |
@@ -259,12 +259,12 @@ local function main_loop()
|
|||||||
end
|
end
|
||||||
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);
|
local success = pcall(buff_UI.draw);
|
||||||
if not success then
|
if not success then
|
||||||
customization_menu.status = "[In Training Area] Buff UI Drawing Function threw an Exception";
|
customization_menu.status = "[In Training Area] Buff UI Drawing Function threw an Exception";
|
||||||
end
|
end
|
||||||
end]]
|
end
|
||||||
|
|
||||||
|
|
||||||
elseif quest_status.flow_state == quest_status.flow_states.CUTSCENE then
|
elseif quest_status.flow_state == quest_status.flow_states.CUTSCENE then
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ function this.update_timer(buff, timer)
|
|||||||
|
|
||||||
buff.timer = timer;
|
buff.timer = timer;
|
||||||
buff.minutes_left = minutes_left;
|
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
|
if buff.duration ~= 0 then
|
||||||
buff.timer_percentage = timer / buff.duration;
|
buff.timer_percentage = timer / buff.duration;
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
local this = {};
|
local this = {};
|
||||||
|
|
||||||
local buff_UI_entity;
|
|
||||||
local config;
|
|
||||||
local singletons;
|
|
||||||
|
|
||||||
local buffs;
|
local buffs;
|
||||||
local buff_UI_entity;
|
local buff_UI_entity;
|
||||||
local config;
|
local config;
|
||||||
local singletons;
|
local singletons;
|
||||||
|
local players;
|
||||||
|
local utils;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -63,7 +61,6 @@ this.list = {
|
|||||||
might_seed = nil,
|
might_seed = nil,
|
||||||
adamant_seed = nil,
|
adamant_seed = nil,
|
||||||
hardshell_powder = nil,
|
hardshell_powder = nil,
|
||||||
hardshell_powder = nil,
|
|
||||||
immunizer = nil,
|
immunizer = nil,
|
||||||
dash_juice = nil
|
dash_juice = nil
|
||||||
};
|
};
|
||||||
@@ -118,7 +115,7 @@ function this.update()
|
|||||||
return;
|
return;
|
||||||
end
|
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
|
if player_data == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -373,6 +370,7 @@ end
|
|||||||
|
|
||||||
function this.update_dash_juice(player_data, item_parameter)
|
function this.update_dash_juice(player_data, item_parameter)
|
||||||
local dash_juice_timer = stamina_up_buff_second_timer_field:get_data(player_data);
|
local dash_juice_timer = stamina_up_buff_second_timer_field:get_data(player_data);
|
||||||
|
|
||||||
if dash_juice_timer == nil then
|
if dash_juice_timer == nil then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
@@ -399,8 +397,10 @@ end
|
|||||||
function this.init_module()
|
function this.init_module()
|
||||||
buffs = require("MHR_Overlay.Buffs.buffs");
|
buffs = require("MHR_Overlay.Buffs.buffs");
|
||||||
config = require("MHR_Overlay.Misc.config");
|
config = require("MHR_Overlay.Misc.config");
|
||||||
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
buff_UI_entity = require("MHR_Overlay.UI.UI_Entities.buff_UI_entity");
|
||||||
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
singletons = require("MHR_Overlay.Game_Handler.singletons");
|
||||||
|
players = require("MHR_Overlay.Damage_Meter.players");
|
||||||
end
|
end
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
@@ -61,6 +61,17 @@ function this.draw(label_name, label)
|
|||||||
imgui.tree_pop();
|
imgui.tree_pop();
|
||||||
end
|
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
|
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");
|
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;
|
label_changed = label_changed or changed;
|
||||||
@@ -79,8 +90,7 @@ function this.draw(label_name, label)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if imgui.tree_node(cached_language.shadow) then
|
if imgui.tree_node(cached_language.shadow) then
|
||||||
changed, label.shadow.visibility = imgui.checkbox(cached_language
|
changed, label.shadow.visibility = imgui.checkbox(cached_language.visible, label.shadow.visibility);
|
||||||
.visible, label.shadow.visibility);
|
|
||||||
label_changed = label_changed or changed;
|
label_changed = label_changed or changed;
|
||||||
|
|
||||||
if imgui.tree_node(cached_language.offset) then
|
if imgui.tree_node(cached_language.offset) then
|
||||||
|
|||||||
@@ -92,11 +92,11 @@ function this.draw(cached_config)
|
|||||||
|
|
||||||
config_changed = config_changed or changed;
|
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,
|
language.current_language.customization_menu.buff_UI,
|
||||||
cached_config.buff_UI);
|
cached_config.buff_UI);
|
||||||
|
|
||||||
config_changed = config_changed or changed;]]
|
config_changed = config_changed or changed;
|
||||||
|
|
||||||
return config_changed;
|
return config_changed;
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ local config;
|
|||||||
local buffs;
|
local buffs;
|
||||||
local consumables;
|
local consumables;
|
||||||
local screen;
|
local screen;
|
||||||
|
local utils;
|
||||||
|
|
||||||
local sdk = sdk;
|
local sdk = sdk;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
@@ -58,12 +59,12 @@ function this.draw()
|
|||||||
for _, consumable in pairs(consumables.list) do
|
for _, consumable in pairs(consumables.list) do
|
||||||
|
|
||||||
if not consumable.is_active then
|
if not consumable.is_active then
|
||||||
goto continue
|
goto continue2
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(displayed_buffs, consumable);
|
table.insert(displayed_buffs, consumable);
|
||||||
|
|
||||||
::continue::
|
::continue2::
|
||||||
end
|
end
|
||||||
|
|
||||||
-- sort
|
-- sort
|
||||||
@@ -99,15 +100,13 @@ function this.draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
local position_on_screen = screen.calculate_absolute_coordinates(cached_config.position);
|
||||||
|
|
||||||
-- draw
|
-- draw
|
||||||
for _, buff in ipairs(displayed_buffs) do
|
for _, buff in ipairs(displayed_buffs) do
|
||||||
|
|
||||||
if not buff.is_active then
|
if not buff.is_active then
|
||||||
goto continue2
|
goto continue3
|
||||||
end
|
end
|
||||||
|
|
||||||
buffs.draw(buff, buff.buff_UI, position_on_screen, 1);
|
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;
|
position_on_screen.y = position_on_screen.y + cached_config.spacing.y * global_scale_modifier;
|
||||||
end
|
end
|
||||||
|
|
||||||
::continue2::
|
::continue3::
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -135,6 +134,7 @@ function this.init_module()
|
|||||||
--quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
--quest_status = require("MHR_Overlay.Game_Handler.quest_status");
|
||||||
screen = require("MHR_Overlay.Game_Handler.screen");
|
screen = require("MHR_Overlay.Game_Handler.screen");
|
||||||
--drawing = require("MHR_Overlay.UI.drawing");
|
--drawing = require("MHR_Overlay.UI.drawing");
|
||||||
|
utils = require("MHR_Overlay.Misc.utils");
|
||||||
end
|
end
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
@@ -375,7 +375,7 @@ function this.draw()
|
|||||||
time_UI_changed = this.draw_time_UI();
|
time_UI_changed = this.draw_time_UI();
|
||||||
damage_meter_UI_changed = this.draw_damage_meter_UI();
|
damage_meter_UI_changed = this.draw_damage_meter_UI();
|
||||||
endemic_life_UI_changed = this.draw_endemic_life_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.pop_font();
|
||||||
imgui.end_window();
|
imgui.end_window();
|
||||||
@@ -434,11 +434,11 @@ function this.draw()
|
|||||||
end
|
end
|
||||||
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
|
for _, buff in pairs(buffs.list) do
|
||||||
buffs.init_UI(buff);
|
buffs.init_UI(buff);
|
||||||
end
|
end
|
||||||
end]]
|
end
|
||||||
|
|
||||||
if this.menu_font_changed and (apply_font_requested or config_changed) then
|
if this.menu_font_changed and (apply_font_requested or config_changed) then
|
||||||
this.menu_font_changed = false;
|
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);
|
language.current_language.customization_menu.endemic_life_UI, config.current_config.endemic_life_UI.enabled);
|
||||||
config_changed = config_changed or changed;
|
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);
|
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();
|
imgui.tree_pop();
|
||||||
end
|
end
|
||||||
@@ -1002,11 +1002,11 @@ function this.draw_global_settings(apply_font_requested, language_changed)
|
|||||||
|
|
||||||
config_changed = config_changed or 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,
|
language.current_language.customization_menu.buff_UI,
|
||||||
cached_config.module_visibility.in_training_area.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();
|
imgui.tree_pop();
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user