Skip to content

Commit

Permalink
Fix index error on new installs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghostopheles committed Dec 14, 2024
1 parent 3a9bf3e commit 5e3f573
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
- Added some frame borders
- Decorations
- Cleaned up the creature viewer UI to be a bit nicer to look at
- Fixed some jarring lack of explanation for the creature list functionality
- Fixed some jarring lack of explanation for the creature list functionality

#### Fixed
- Fixed an issue that would cause an error when the addon loads on a fresh install
1 change: 1 addition & 0 deletions Datamine/Core/Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Datamine.Events = {
MAPVIEW_MAP_DATA_LOADED = "MapViewMapDataLoaded",
MAPVIEW_RIGHT_CLICK = "MapViewRightClick",
CREATUREVIEW_CREATURE_LOADED = "CreatureViewCreatureLoaded",
CONFIG_LOADED = "ConfigLoaded"
};

local function GenerateCallbackEvents()
Expand Down
4 changes: 2 additions & 2 deletions Datamine/Modules/Unified/UnifiedUIMixins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ function DatamineUnifiedFrameMixin:OnLoad()
Registry:RegisterCallback(Events.UI_RESIZE_START, self.OnResizeStart, self);
Registry:RegisterCallback(Events.UI_RESIZE_END, self.OnResizeEnd, self);
Registry:RegisterCallback(Events.UI_SIZE_RESET, self.OnResetSize, self);
EventUtil.ContinueOnAddOnLoaded("Datamine", function() self:OnAddonLoaded() end);
Registry:RegisterCallback(Events.CONFIG_LOADED, self.OnConfigLoaded, self);

tinsert(UISpecialFrames, self:GetName());

Expand All @@ -1054,7 +1054,7 @@ function DatamineUnifiedFrameMixin:OnHide()
Registry:TriggerEvent(Events.UI_MAIN_HIDE);
end

function DatamineUnifiedFrameMixin:OnAddonLoaded()
function DatamineUnifiedFrameMixin:OnConfigLoaded()
-- check if we have a saved frame size and set the size accordingly
local width, height;
if not Datamine.Settings.HasSavedFrameSize() then
Expand Down
1 change: 1 addition & 0 deletions Datamine/Settings/SettingsCore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ local function InitSavedVariables()
wipe(middleman);

Datamine.Constants.ChatPrefixColor = CreateColorFromHexString(DatamineConfig.ChatPrefixColor);
Registry:TriggerEvent(Events.CONFIG_LOADED);
end

EventUtil.ContinueOnAddOnLoaded("Datamine", InitSavedVariables);
Expand Down

0 comments on commit 5e3f573

Please sign in to comment.