Skip to content

Commit

Permalink
Close #101: Only show Welcome message once per version (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mctalian committed Sep 12, 2024
1 parent f15e4ca commit 6d746d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions RPGLootFeed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function RLF:SlashCommand(msg, editBox)
end)
end

local currentVersion = "@project-version@"
function RLF:PLAYER_ENTERING_WORLD(event, isLogin, isReload)
if self.optionsFrame == nil then
self.optionsFrame = acd:AddToBlizOptions(addonName, addonName)
Expand All @@ -44,8 +45,10 @@ function RLF:PLAYER_ENTERING_WORLD(event, isLogin, isReload)
self:LootToastHook()
self:BossBannerHook()
end)
if isLogin and isReload == false then
self:Print(G_RLF.L["Welcome"])
local isNewVersion = currentVersion ~= G_RLF.db.global.lastVersionLoaded
if isLogin and isReload == false and isNewVersion then
G_RLF.db.global.lastVersionLoaded = currentVersion
self:Print(G_RLF.L["Welcome"] .. " (" .. currentVersion .. ")")
if G_RLF.db.global.enableAutoLoot then
C_CVar.SetCVar("autoLootDefault", "1")
end
Expand Down
1 change: 1 addition & 0 deletions config/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ G_RLF.defaults = {
sessionsLogged = 0,
logs = {},
},
lastVersionLoaded = "v1.0.0",
},
}

Expand Down

0 comments on commit 6d746d9

Please sign in to comment.