mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-10 23:50:01 +00:00
rangecheck: rewrite of the 40y range check
* remove the bad notice in GUI * set default interval to "2" * prevent all frames of being updated at once * refresh one unit after the other * use textures insted of spellnames * change interval settings to dropdown * remove no longer required locales
This commit is contained in:
+5
-26
@@ -17,7 +17,8 @@ function pfUI.api.strsplit(delimiter, subject)
|
||||
end
|
||||
|
||||
-- [ UnitInRange ]
|
||||
-- Returns whether a party/raid member is nearby. It uses spells with a distance of around 40 yards.
|
||||
-- Returns whether a party/raid member is nearby.
|
||||
-- It takes care of the rangecheck module if existing.
|
||||
-- unit [string] A unit to query (string, unitID)
|
||||
-- return: [bool] "1" if in range otherwise "nil"
|
||||
local RangeCache = {}
|
||||
@@ -28,32 +29,10 @@ function pfUI.api.UnitInRange(unit)
|
||||
|
||||
if CheckInteractDistance(unit, 4) then
|
||||
return 1
|
||||
else if not pfUI.rangecheck or not pfUI.rangecheck.slot then
|
||||
return nil
|
||||
else if pfUI.rangecheck then
|
||||
return pfUI.rangecheck:UnitInSpellRange(unit)
|
||||
else
|
||||
-- Extended Range Check
|
||||
if not RangeCache[unit] or RangeCache[unit].time + pfUI.rangecheck.interval < GetTime() then
|
||||
RangeCache[unit] = {}
|
||||
RangeCache[unit].time = GetTime()
|
||||
|
||||
if not UnitIsUnit("target", unit) then
|
||||
pfScanActive = true
|
||||
TargetUnit(unit)
|
||||
end
|
||||
|
||||
if IsActionInRange(pfUI.rangecheck.slot) == 1 then
|
||||
RangeCache[unit].range = 1
|
||||
else
|
||||
RangeCache[unit].range = nil
|
||||
end
|
||||
|
||||
if pfScanActive then
|
||||
TargetLastTarget()
|
||||
pfScanActive = false
|
||||
end
|
||||
end
|
||||
|
||||
return RangeCache[unit].range
|
||||
return nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+9
-2
@@ -87,8 +87,8 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", nil, "always2dportrait", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "portraittexture", "1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "layout", "default")
|
||||
pfUI:UpdateConfig("unitframes", nil, "rangecheck", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "rangechecki", "1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "rangecheck", "1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "rangechecki", "2")
|
||||
pfUI:UpdateConfig("unitframes", nil, "combosize", "6")
|
||||
pfUI:UpdateConfig("unitframes", nil, "abbrevnum", "1")
|
||||
|
||||
@@ -723,5 +723,12 @@ function pfUI:MigrateConfig()
|
||||
end
|
||||
end
|
||||
|
||||
-- migrating rangecheck interval (> 3.2.2)
|
||||
if checkversion(3, 2, 2) then
|
||||
if tonumber(pfUI_config.unitframes.rangechecki) <= 1 then
|
||||
pfUI_config.unitframes.rangechecki = "2"
|
||||
end
|
||||
end
|
||||
|
||||
pfUI_config.version = pfUI.version.string
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user