Separating DK army and apoc pets
This commit is contained in:
+61
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 262
|
||||
local dversion = 269
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary (major, minor)
|
||||
|
||||
@@ -431,6 +431,28 @@ function DF.table.dump (t, s, deep)
|
||||
return s
|
||||
end
|
||||
|
||||
--grab a text and split it into lines adding each line to a indexed table
|
||||
function DF:SplitTextInLines(text)
|
||||
local lines = {}
|
||||
local position = 1
|
||||
local startScope, endScope = text:find("\n", position, true)
|
||||
|
||||
while (startScope) do
|
||||
if (startScope ~= 1) then
|
||||
tinsert(lines, text:sub(position, startScope-1))
|
||||
end
|
||||
position = endScope + 1
|
||||
startScope, endScope = text:find("\n", position, true)
|
||||
end
|
||||
|
||||
if (position <= #text) then
|
||||
tinsert(lines, text:sub(position))
|
||||
end
|
||||
|
||||
return lines
|
||||
end
|
||||
|
||||
|
||||
DF.www_icons = {
|
||||
texture = "feedback_sites",
|
||||
wowi = {0, 0.7890625, 0, 37/128},
|
||||
@@ -590,6 +612,44 @@ function DF:AddClassColorToText (text, class)
|
||||
return text
|
||||
end
|
||||
|
||||
function DF:AddClassIconToText(text, playerName, class, useSpec, iconSize)
|
||||
local size = iconSize or 16
|
||||
|
||||
local iconToUse, spec
|
||||
if (useSpec) then
|
||||
if (Details) then
|
||||
local guid = UnitGUID(playerName)
|
||||
if (guid) then
|
||||
local spec = Details.cached_specs[guid]
|
||||
if (spec) then
|
||||
spec = spec
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (spec) then --if spec is valid, the user has Details! installed
|
||||
local specString = ""
|
||||
local L, R, T, B = unpack (Details.class_specs_coords[spec])
|
||||
if (L) then
|
||||
specString = "|TInterface\\AddOns\\Details\\images\\spec_icons_normal:" .. size .. ":" .. size .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t"
|
||||
return specString .. " " .. text
|
||||
end
|
||||
end
|
||||
|
||||
if (class) then
|
||||
local classString = ""
|
||||
local L, R, T, B = unpack (Details.class_coords[class])
|
||||
if (L) then
|
||||
local imageSize = 128
|
||||
classString = "|TInterface\\AddOns\\Details\\images\\classes_small:" .. size .. ":" .. size .. ":0:0:" .. imageSize .. ":" .. imageSize .. ":" .. (L * imageSize) .. ":" .. (R * imageSize) .. ":" .. (T * imageSize) .. ":" .. (B * imageSize) .. "|t"
|
||||
return classString .. " " .. text
|
||||
end
|
||||
end
|
||||
|
||||
return text
|
||||
end
|
||||
|
||||
function DF:GetFontSize (fontString)
|
||||
local _, size = fontString:GetFont()
|
||||
return size
|
||||
|
||||
+25
-6
@@ -1574,7 +1574,7 @@ function DF:IconPick (callback, close_when_select, param1, param2)
|
||||
DF.IconPickFrame.preview:Hide()
|
||||
|
||||
--serach
|
||||
DF.IconPickFrame.searchLabel = DF:NewLabel (DF.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:", font, size, color)
|
||||
DF.IconPickFrame.searchLabel = DF:NewLabel (DF.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:")
|
||||
DF.IconPickFrame.searchLabel:SetPoint ("topleft", DF.IconPickFrame, "topleft", 12, -36)
|
||||
DF.IconPickFrame.searchLabel:SetTemplate (DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE"))
|
||||
|
||||
@@ -8128,6 +8128,9 @@ DF.CastFrameFunctions = {
|
||||
if (self.casting) then
|
||||
local name, text, texture, startTime = UnitCastingInfo (self.unit)
|
||||
if (name) then
|
||||
--[[if not self.spellStartTime then
|
||||
self:UpdateCastingInfo(self.unit)
|
||||
end]]--
|
||||
self.value = GetTime() - self.spellStartTime
|
||||
end
|
||||
|
||||
@@ -8136,6 +8139,9 @@ DF.CastFrameFunctions = {
|
||||
elseif (self.channeling) then
|
||||
local name, text, texture, endTime = UnitChannelInfo (self.unit)
|
||||
if (name) then
|
||||
--[[if not self.spellEndTime then
|
||||
self:UpdateChannelInfo(self.unit)
|
||||
end]]--
|
||||
self.value = self.spellEndTime - GetTime()
|
||||
end
|
||||
|
||||
@@ -8329,10 +8335,12 @@ DF.CastFrameFunctions = {
|
||||
|
||||
if (isChannel) then
|
||||
self.channeling = true
|
||||
self:UpdateChannelInfo(unit)
|
||||
return self.unit == arg1 and "UNIT_SPELLCAST_CHANNEL_START"
|
||||
|
||||
elseif (isRegularCast) then
|
||||
self.casting = true
|
||||
self:UpdateCastingInfo(unit)
|
||||
return self.unit == arg1 and "UNIT_SPELLCAST_START"
|
||||
|
||||
else
|
||||
@@ -8346,8 +8354,7 @@ DF.CastFrameFunctions = {
|
||||
end
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_START = function (self, unit)
|
||||
|
||||
UpdateCastingInfo = function (self, unit)
|
||||
local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID
|
||||
if IS_WOW_PROJECT_MAINLINE then
|
||||
name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo (unit)
|
||||
@@ -8406,10 +8413,16 @@ DF.CastFrameFunctions = {
|
||||
--> update the interrupt cast border
|
||||
self:UpdateInterruptState()
|
||||
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_START = function (self, unit)
|
||||
|
||||
self:UpdateCastingInfo(unit)
|
||||
|
||||
self:RunHooksForWidget ("OnCastStart", self, self.unit, "UNIT_SPELLCAST_START")
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_CHANNEL_START = function (self, unit, ...)
|
||||
UpdateChannelInfo = function (self, unit, ...)
|
||||
local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID
|
||||
if IS_WOW_PROJECT_MAINLINE then
|
||||
name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo (unit)
|
||||
@@ -8467,6 +8480,12 @@ DF.CastFrameFunctions = {
|
||||
|
||||
--> update the interrupt cast border
|
||||
self:UpdateInterruptState()
|
||||
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_CHANNEL_START = function (self, unit, ...)
|
||||
|
||||
self:UpdateChannelInfo(unit, ...)
|
||||
|
||||
self:RunHooksForWidget ("OnCastStart", self, self.unit, "UNIT_SPELLCAST_CHANNEL_START")
|
||||
end,
|
||||
@@ -8537,7 +8556,7 @@ DF.CastFrameFunctions = {
|
||||
UNIT_SPELLCAST_FAILED = function (self, unit, ...)
|
||||
local unitID, castID, spellID = ...
|
||||
|
||||
if (self.casting and castID == self.castID and not self.fadeOut) then
|
||||
if ((self.casting or self.channeling) and castID == self.castID and not self.fadeOut) then
|
||||
self.casting = nil
|
||||
self.channeling = nil
|
||||
self.failed = true
|
||||
@@ -8558,7 +8577,7 @@ DF.CastFrameFunctions = {
|
||||
UNIT_SPELLCAST_INTERRUPTED = function (self, unit, ...)
|
||||
local unitID, castID, spellID = ...
|
||||
|
||||
if (self.casting and castID == self.castID and not self.fadeOut) then
|
||||
if ((self.casting or self.channeling) and castID == self.castID and not self.fadeOut) then
|
||||
self.casting = nil
|
||||
self.channeling = nil
|
||||
self.interrupted = true
|
||||
|
||||
@@ -1298,6 +1298,10 @@ DF.FoodIDs = {
|
||||
[327707] = 2, --stamina +20
|
||||
[327708] = 2, --intellect +20
|
||||
[327709] = 2, --agility +20
|
||||
|
||||
[327704] = 2, --intellect +18
|
||||
[327701] = 2, --strength +18
|
||||
[327705] = 2, --agility +18
|
||||
}
|
||||
|
||||
DF.PotionIDs = {
|
||||
|
||||
Reference in New Issue
Block a user