Division by zero fix
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 382
|
||||
local dversion = 383
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary(major, minor)
|
||||
|
||||
@@ -3392,11 +3392,11 @@ function DF:CreateGlowOverlay (parent, antsColor, glowColor)
|
||||
parent.overlay:SetPoint("TOPLEFT", parent, "TOPLEFT", -frameWidth * 0.32, frameHeight * 0.36)
|
||||
parent.overlay:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", frameWidth * 0.32, -frameHeight * 0.36)
|
||||
|
||||
local r, g, b, a = DF:ParseColors(antsColor or defaultColor)
|
||||
local r, g, b, a = DF:ParseColors(antsColor)
|
||||
glowFrame.ants:SetVertexColor(r, g, b, a)
|
||||
glowFrame.AntsColor = {r, g, b, a}
|
||||
|
||||
local r, g, b, a = DF:ParseColors(glowColor or defaultColor)
|
||||
local r, g, b, a = DF:ParseColors(glowColor)
|
||||
glowFrame.outerGlow:SetVertexColor(r, g, b, a)
|
||||
glowFrame.GlowColor = {r, g, b, a}
|
||||
|
||||
|
||||
+54
-3
@@ -924,8 +924,8 @@ function DF:NewSpecialLuaEditorEntry(parent, width, height, member, name, nointe
|
||||
scrollframeNumberLines.editbox:SetJustifyH("left")
|
||||
scrollframeNumberLines.editbox:SetJustifyV ("top")
|
||||
scrollframeNumberLines.editbox:SetTextColor(.3, .3, .3, .5)
|
||||
scrollframeNumberLines.editbox:SetPoint("topleft", borderframe, "topleft", 10, -10)
|
||||
scrollframeNumberLines.editbox:SetPoint("bottomright", borderframe, "bottomright", -30, 10)
|
||||
scrollframeNumberLines.editbox:SetPoint("topleft", borderframe, "topleft", 0, -10)
|
||||
scrollframeNumberLines.editbox:SetPoint("bottomleft", borderframe, "bottomleft", 0, 10)
|
||||
|
||||
scrollframeNumberLines:SetScrollChild(scrollframeNumberLines.editbox)
|
||||
scrollframeNumberLines:EnableMouseWheel(false)
|
||||
@@ -945,7 +945,7 @@ function DF:NewSpecialLuaEditorEntry(parent, width, height, member, name, nointe
|
||||
end)
|
||||
|
||||
--place the number lines scroll in the begining of the editing code space
|
||||
scrollframeNumberLines:SetPoint("topleft", borderframe, "topleft", 10, -10)
|
||||
scrollframeNumberLines:SetPoint("topleft", borderframe, "topleft", 2, -10)
|
||||
scrollframeNumberLines:SetPoint("bottomright", borderframe, "bottomright", -10, 10)
|
||||
|
||||
scrollframeNumberLines.editbox:SetJustifyH("left")
|
||||
@@ -968,6 +968,57 @@ function DF:NewSpecialLuaEditorEntry(parent, width, height, member, name, nointe
|
||||
scrollframeNumberLines:SetBackdrop(nil)
|
||||
scrollframeNumberLines.editbox:SetBackdrop(nil)
|
||||
|
||||
local stringLengthFontString = scrollframeNumberLines:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
|
||||
local currentUpdateLineCounterTimer = nil
|
||||
|
||||
local updateLineCounter = function()
|
||||
scrollframeNumberLines.editbox:SetSize(scrollframe.editbox:GetSize())
|
||||
|
||||
local text = scrollframe.editbox:GetText()
|
||||
local textInArray = DF:SplitTextInLines(text)
|
||||
|
||||
local maxStringWidth = scrollframe.editbox:GetWidth()
|
||||
scrollframeNumberLines.editbox:SetWidth(maxStringWidth)
|
||||
|
||||
local font, size, flags = scrollframe.editbox:GetFont()
|
||||
scrollframeNumberLines.editbox:SetFont(font, size, flags)
|
||||
stringLengthFontString:SetFont(font, size, flags)
|
||||
|
||||
local resultText = ""
|
||||
|
||||
--this approuch has many problems but it is better than nothing
|
||||
for i = 1, #textInArray do
|
||||
--set the line text into a fontstring to get its width
|
||||
local thisText = textInArray[i]
|
||||
stringLengthFontString:SetText(thisText)
|
||||
local lineTextLength = ceil(stringLengthFontString:GetStringWidth())
|
||||
|
||||
if (lineTextLength < maxStringWidth) then
|
||||
resultText = resultText .. i .. "\n"
|
||||
else
|
||||
--if the text width is bigger than the editbox width, add a blank line into the line counter
|
||||
local linesToOccupy = floor(lineTextLength / maxStringWidth)
|
||||
local fillingText = i .. ""
|
||||
for o = 1, linesToOccupy do
|
||||
fillingText = fillingText .. "\n"
|
||||
end
|
||||
resultText = resultText .. fillingText .. "\n"
|
||||
end
|
||||
end
|
||||
|
||||
scrollframeNumberLines.editbox:SetText(resultText)
|
||||
|
||||
currentUpdateLineCounterTimer = nil
|
||||
end
|
||||
|
||||
scrollframe.editbox:HookScript("OnTextChanged", function()
|
||||
if (currentUpdateLineCounterTimer) then
|
||||
return
|
||||
end
|
||||
currentUpdateLineCounterTimer = C_Timer.NewTimer(0.25, updateLineCounter)
|
||||
end)
|
||||
|
||||
else
|
||||
scrollframe:SetPoint("topleft", borderframe, "topleft", 10, -10)
|
||||
scrollframe:SetPoint("bottomright", borderframe, "bottomright", -10, 10)
|
||||
|
||||
@@ -138,7 +138,7 @@ function openRaidLib.GetUnitID(playerName)
|
||||
end
|
||||
|
||||
|
||||
local filterStringToCooldownType = {
|
||||
local filterStringToCooldownType = { --report: "filterStringToCooldownType doesn't include the new filters."
|
||||
["defensive-raid"] = CONST_COOLDOWN_TYPE_DEFENSIVE_RAID,
|
||||
["defensive-target"] = CONST_COOLDOWN_TYPE_DEFENSIVE_TARGET,
|
||||
["defensive-personal"] = CONST_COOLDOWN_TYPE_DEFENSIVE_PERSONAL,
|
||||
|
||||
@@ -68,7 +68,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
|
||||
end
|
||||
|
||||
local major = "LibOpenRaid-1.0"
|
||||
local CONST_LIB_VERSION = 63
|
||||
local CONST_LIB_VERSION = 64
|
||||
LIB_OPEN_RAID_CAN_LOAD = false
|
||||
|
||||
local unpack = table.unpack or _G.unpack
|
||||
@@ -766,6 +766,7 @@ end
|
||||
|
||||
if (IsInGroup()) then
|
||||
openRaidLib.RequestAllData()
|
||||
openRaidLib.UpdateUnitIDCache()
|
||||
end
|
||||
|
||||
--this part is under development
|
||||
@@ -1155,6 +1156,14 @@ end
|
||||
local specId, specName, specDescription, specIcon, role = GetSpecializationInfoByID(specId or 0)
|
||||
local className, classString, classId = UnitClass(unitName)
|
||||
|
||||
--cold login bug where the player class info cannot be retrived by the player name, after a /reload it's all good
|
||||
if (not className) then
|
||||
local playerName = UnitName("player")
|
||||
if (playerName == unitName) then
|
||||
className, classString, classId = UnitClass("player")
|
||||
end
|
||||
end
|
||||
|
||||
unitInfo.specId = specId or unitInfo.specId
|
||||
unitInfo.specName = specName or unitInfo.specName
|
||||
unitInfo.role = role or "DAMAGER"
|
||||
|
||||
Reference in New Issue
Block a user