From 97602756a8a5504d1cf92c65dede61507e374c87 Mon Sep 17 00:00:00 2001 From: Ridepad Date: Sat, 11 Jun 2022 16:31:38 +0300 Subject: [PATCH] 2.0.2 --- README.md | 2 +- TrinketCDs/TrinketCDs.lua | 16 ++++++++++++---- TrinketCDs/TrinketCDs.toc | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 89cbfaa..58473b8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TrinketCDs v2.0.1 +# TrinketCDs v2.0.2 ![](https://raw.githubusercontent.com/Ridepad/TrinketCDs/main/showcase/showcase_main.png) diff --git a/TrinketCDs/TrinketCDs.lua b/TrinketCDs/TrinketCDs.lua index b41df84..4ea1a36 100644 --- a/TrinketCDs/TrinketCDs.lua +++ b/TrinketCDs/TrinketCDs.lua @@ -506,7 +506,8 @@ end local function update_settings(svars_table, settings_table) if not svars_table then return end - for old_table_key, _ in pairs(settings_table) do + + for old_table_key in pairs(settings_table) do local new_table_value = svars_table[old_table_key] if new_table_value then settings_table[old_table_key] = new_table_value @@ -514,15 +515,22 @@ local function update_settings(svars_table, settings_table) end end +local function update_nested_settings(svars, key) + local _svars = svars[key] + if not _svars then return end + + for item_slot_id, settings_item in pairs(SETTINGS[key]) do + update_settings(_svars[item_slot_id], settings_item) + end +end + function ADDON:OnEvent(event, arg1) if event == "ADDON_LOADED" then if arg1 ~= ADDON_NAME then return end local svars = _G[ADDON_PROFILE] if svars then - for item_slot_id, settings_item in pairs(SETTINGS.ITEMS) do - update_settings(svars.ITEMS[item_slot_id], settings_item) - end + update_nested_settings(svars, "ITEMS") update_settings(svars.SWITCHES, SWITCHES) end _G[ADDON_PROFILE] = SETTINGS diff --git a/TrinketCDs/TrinketCDs.toc b/TrinketCDs/TrinketCDs.toc index ee64802..9d69fde 100644 --- a/TrinketCDs/TrinketCDs.toc +++ b/TrinketCDs/TrinketCDs.toc @@ -1,13 +1,13 @@ ## Interface: 30300 ## Title:|cffee0080TrinketCDs|r ## Author: Ridepad (|cff888888Ridepad#7722|r) -## Version: 2.0.1 +## Version: 2.0.2 ## SavedVariables: TrinketCDsProfile ## Notes: Trinkets and item enchants proc tracker. ## OptionalDeps: OmniCC ## X-Category: Combat -## X-Date: 2022-06-09--08-00 +## X-Date: 2022-06-11--16-30 ## X-Website: https://github.com/Ridepad/TrinketCDs TrinketCDsDB.lua