diff --git a/reframework/autorun/MHR_Overlay.lua b/reframework/autorun/MHR_Overlay.lua index b9763d2..018f53f 100644 --- a/reframework/autorun/MHR_Overlay.lua +++ b/reframework/autorun/MHR_Overlay.lua @@ -505,9 +505,7 @@ end -- #region re.on_draw_ui(function() if imgui.button(language.current_language.customization_menu.mod_name .. " v" .. config.current_config.version) then - local cached_config = config.current_config.customization_menu; - cached_config.visible = not cached_config.visible; - config.save_current(); + customization_menu.is_opened = not customization_menu.is_opened; end end); @@ -542,9 +540,9 @@ end); -- #endregion -----------------------Loop Callbacks------------------------ +time.init_global_timers(); +time.new_timer(update_UI, 0.5); + if imgui.begin_table == nil then re.msg(language.current_language.customization_menu.reframework_outdated); -end - -time.init_global_timers(); -time.new_timer(update_UI, 0.5); \ No newline at end of file +end \ No newline at end of file diff --git a/reframework/autorun/MHR_Overlay/Misc/config.lua b/reframework/autorun/MHR_Overlay/Misc/config.lua index 7b234f3..ae51539 100644 --- a/reframework/autorun/MHR_Overlay/Misc/config.lua +++ b/reframework/autorun/MHR_Overlay/Misc/config.lua @@ -7973,8 +7973,6 @@ function this.init_default() }, customization_menu = { - visible = false, - position = { x = 360, y = 50 diff --git a/reframework/autorun/MHR_Overlay/UI/customization_menu.lua b/reframework/autorun/MHR_Overlay/UI/customization_menu.lua index 5a00938..28a5210 100644 --- a/reframework/autorun/MHR_Overlay/UI/customization_menu.lua +++ b/reframework/autorun/MHR_Overlay/UI/customization_menu.lua @@ -64,6 +64,8 @@ local os = os; local ValueType = ValueType; local package = package; +this.is_opened = false; + this.font = nil; this.full_font_range = {0x1, 0xFFFF, 0}; @@ -326,7 +328,7 @@ function this.init() end function this.draw() - if not config.current_config.customization_menu.visible then + if not this.is_opened then return; end @@ -339,13 +341,13 @@ function this.draw() imgui.push_font(this.font); - config.current_config.customization_menu.visible = imgui.begin_window( + this.is_opened = imgui.begin_window( string.format("%s v%s", language.current_language.customization_menu.mod_name, config.current_config.version), - config.current_config.customization_menu.visible, + this.is_opened, this.window_flags); - if not config.current_config.customization_menu.visible then + if not this.is_opened then imgui.pop_font(); imgui.end_window(); config.save_current();