修改优化等
This commit is contained in:
18
ConfigUI.lua
18
ConfigUI.lua
@@ -471,6 +471,7 @@ local function EnsureDB()
|
||||
if SFramesDB.afkOutsideRest == nil then SFramesDB.afkOutsideRest = false end
|
||||
|
||||
if SFramesDB.trainerReminder == nil then SFramesDB.trainerReminder = true end
|
||||
if SFramesDB.trainerCache == nil then SFramesDB.trainerCache = {} end
|
||||
|
||||
if SFramesDB.smoothBars == nil then SFramesDB.smoothBars = true end
|
||||
if SFramesDB.mobRealHealth == nil then SFramesDB.mobRealHealth = true end
|
||||
@@ -3021,6 +3022,23 @@ function SFrames.ConfigUI:BuildPersonalizePage()
|
||||
if SFrames.Player and SFrames.Player.ShowTrainerReminder then
|
||||
local testLevel = UnitLevel("player")
|
||||
if mod(testLevel, 2) ~= 0 then testLevel = testLevel + 1 end
|
||||
local _, classEn = UnitClass("player")
|
||||
local cachedSkills = SFramesDB and SFramesDB.trainerCache and SFramesDB.trainerCache[classEn]
|
||||
local staticSkills = SFrames.ClassSkillData and SFrames.ClassSkillData[classEn]
|
||||
local function hasData(lv)
|
||||
if cachedSkills then
|
||||
if cachedSkills[lv] then return true end
|
||||
if lv > 1 and cachedSkills[lv - 1] then return true end
|
||||
end
|
||||
if staticSkills and staticSkills[lv] then return true end
|
||||
return false
|
||||
end
|
||||
if not hasData(testLevel) then
|
||||
while testLevel <= 60 and not hasData(testLevel) do
|
||||
testLevel = testLevel + 2
|
||||
end
|
||||
if testLevel > 60 then testLevel = 60 end
|
||||
end
|
||||
SFrames.Player:ShowTrainerReminder(testLevel)
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user