Skip to content

Commit

Permalink
Added alert for rare spawns on Icecrown from pre-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 11, 2020
1 parent 1c4ede2 commit def0ad7
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ locales/ptBR.lua
locales/ruRU.lua
locales/zhCN.lua
locales/zhTW.lua
wowapi.lua
56 changes: 45 additions & 11 deletions FlashTaskBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,44 @@ function FlashTaskBar.OnInit (self)
--/dump C_VignetteInfo.GetVignetteInfo (C_VignetteInfo.GetVignettes()[1])
--/dump C_VignetteInfo.GetVignettes()

for index, GUID in ipairs (C_VignetteInfo.GetVignettes()) do
local vignetteInfo = C_VignetteInfo.GetVignetteInfo (GUID)
if (vignetteInfo and vignetteInfo.onMinimap and not vignetteInfo.isDead and vignetteInfo.atlasName == "VignetteKill") then --vignetteID == 2004
--track special events
--[=[]]
for i, vignetteID in ipairs (C_VignetteInfo.GetVignettes()) do
local vignetteInfo = C_VignetteInfo.GetVignetteInfo (vignetteID)
if (vignetteInfo) then
local serial = vignetteInfo.objectGUID
if (serial) then
local name = vignetteInfo.name
local objectIcon = vignetteInfo.atlasName
--naga event
if (objectIcon == "nazjatar-nagaevent") then
WorldQuestTracker.NagaEventCooldown = WorldQuestTracker.NagaEventCooldown or 0
if (WorldQuestTracker.NagaEventCooldown < time()) then
WorldQuestTracker:Msg("a naga event is happening, open the map for location.|r")
WorldQuestTracker.NagaEventCooldown = time() + 360 --6min
end
end
end
end
end
--]=]
-----------------------

for _, vignetteID in ipairs (C_VignetteInfo.GetVignettes()) do
local vignetteInfo = C_VignetteInfo.GetVignetteInfo (vignetteID)

--special event on icecrown map 9.0.1 event
if (vignetteInfo and C_Map.GetBestMapForUnit ("player") == 118) then
local objectIcon = vignetteInfo.atlasName
if (objectIcon == "nazjatar-nagaevent") then
FlashTaskBar:DoFlash ("rare_scan")
end
end

if (vignetteInfo and vignetteInfo.onMinimap and not vignetteInfo.isDead and vignetteInfo.atlasName == "VignetteKill") then --vignetteID == 2004
local objectGUID = vignetteInfo.objectGUID
if (FlashTaskBar.db.profile.any_rare) then
if (not UnitOnTaxi ("player")) then
Expand All @@ -599,11 +633,11 @@ function FlashTaskBar.OnInit (self)
end

elseif (vignetteInfo.name) then
for _, npc_name in ipairs (FlashTaskBar.db.profile.rare_names) do
npc_name = lower (npc_name)
name = lower (name)
if (npc_name == name) then
if (not FlashTaskBar.RareFlashCooldown [objectGUID] or FlashTaskBar.RareFlashCooldown [objectGUID] < time()) then
for _, npcName in ipairs(FlashTaskBar.db.profile.rare_names) do
npcName = lower(npcName)
local vignetteName = lower(vignetteInfo.name)
if (npcName == vignetteName) then
if (not FlashTaskBar.RareFlashCooldown[objectGUID] or FlashTaskBar.RareFlashCooldown[objectGUID] < time()) then
FlashTaskBar:DoFlash ("rare_scan")
FlashTaskBar.RareFlashCooldown [objectGUID] = time() + 180
end
Expand Down Expand Up @@ -822,7 +856,7 @@ function FlashTaskBar.OnInit (self)
if (FlashTaskBar.db.profile.on_chat_player_name) then
FlashTaskBar:EnableChatScan()
else
--ver se tem alguma outra função usando o chat scan
--ver se tem alguma outra fun��o usando o chat scan
if (not FlashTaskBar.db.profile.chat_scan) then
FlashTaskBar:DisableChatScan()
end
Expand Down Expand Up @@ -955,7 +989,7 @@ function FlashTaskBar.OnInit (self)
if (value) then
FlashTaskBar:EnableChatScan()
else
--ver se tem alguma outra função usando o chat scan
--ver se tem alguma outra fun��o usando o chat scan
if (not FlashTaskBar.db.profile.on_chat_player_name) then
FlashTaskBar:DisableChatScan()
end
Expand Down Expand Up @@ -1006,7 +1040,7 @@ function FlashTaskBar.OnInit (self)
button_keyword_remove:SetPoint ("left", dropdown_keyword_remove, "right", 2, 0)
label_keyword_remove:SetPoint ("topleft", FlashTaskBar.OptionsFrame1, "topleft", 10, y_chat_scan-60)

--ativar o chat scan se necessário
--ativar o chat scan se necess�rio
if (FlashTaskBar.db.profile.chat_scan or FlashTaskBar.db.profile.on_chat_player_name) then
FlashTaskBar:EnableChatScan()
end
Expand Down
23 changes: 21 additions & 2 deletions libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 214
local dversion = 218

local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
Expand Down Expand Up @@ -609,7 +609,26 @@ function DF:TruncateText (fontString, maxWidth)
if (string.len (text) <= 1) then
break
end
end
end

text = DF:CleanTruncateUTF8String(text)
fontString:SetText (text)
end

function DF:CleanTruncateUTF8String(text)
if type(text) == "string" and text ~= "" then
local b1 = (#text > 0) and strbyte(strsub(text, #text, #text)) or nil
local b2 = (#text > 1) and strbyte(strsub(text, #text-1, #text)) or nil
local b3 = (#text > 2) and strbyte(strsub(text, #text-2, #text)) or nil
if b1 and b1 >= 194 and b1 <= 244 then
text = strsub (text, 1, #text - 1)
elseif b2 and b2 >= 224 and b2 <= 244 then
text = strsub (text, 1, #text - 2)
elseif b3 and b3 >= 240 and b3 <= 244 then
text = strsub (text, 1, #text - 3)
end
end
return text
end

function DF:Msg (msg, ...)
Expand Down
19 changes: 17 additions & 2 deletions libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5131,6 +5131,7 @@ DF.IconRowFunctions = {
cooldownFrame:SetAllPoints()
cooldownFrame:EnableMouse (false)
cooldownFrame:SetFrameLevel (newIconFrame:GetFrameLevel()+1)
cooldownFrame:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer)
cooldownFrame.noCooldownCount = self.options.surpress_tulla_omni_cc

newIconFrame.CountdownText = cooldownFrame:CreateFontString (nil, "overlay", "GameFontNormal")
Expand Down Expand Up @@ -5224,12 +5225,15 @@ DF.IconRowFunctions = {

iconFrame.CountdownText:SetPoint (self.options.text_anchor or "center", iconFrame, self.options.text_rel_anchor or "center", self.options.text_x_offset or 0, self.options.text_y_offset or 0)
DF:SetFontSize (iconFrame.CountdownText, self.options.text_size)
DF:SetFontFace (iconFrame.CountdownText, self.options.text_font)
DF:SetFontOutline (iconFrame.CountdownText, self.options.text_outline)
iconFrame.CountdownText:SetText (formattedTime)
iconFrame.Cooldown:SetHideCountdownNumbers (true)

else
iconFrame.CountdownText:Hide()
iconFrame.Cooldown:SetHideCountdownNumbers (false)
end

iconFrame.Cooldown:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer)
else
iconFrame.CountdownText:Hide()
end
Expand All @@ -5240,6 +5244,8 @@ DF.IconRowFunctions = {
iconFrame.Desc:SetTextColor (DF:ParseColors (descText.text_color or self.options.desc_text_color))
iconFrame.Desc:SetPoint(self.options.desc_text_anchor or "bottom", iconFrame, self.options.desc_text_rel_anchor or "top", self.options.desc_text_x_offset or 0, self.options.desc_text_y_offset or 2)
DF:SetFontSize (iconFrame.Desc, descText.text_size or self.options.desc_text_size)
DF:SetFontFace (iconFrame.Desc, self.options.desc_text_font)
DF:SetFontOutline (iconFrame.Desc, self.options.desc_text_outline)
else
iconFrame.Desc:Hide()
end
Expand All @@ -5250,6 +5256,8 @@ DF.IconRowFunctions = {
iconFrame.StackText:SetTextColor (DF:ParseColors (self.options.desc_text_color))
iconFrame.StackText:SetPoint (self.options.stack_text_anchor or "center", iconFrame, self.options.stack_text_rel_anchor or "bottomright", self.options.stack_text_x_offset or 0, self.options.stack_text_y_offset or 0)
DF:SetFontSize (iconFrame.StackText, self.options.stack_text_size)
DF:SetFontFace (iconFrame.StackText, self.options.stack_text_font)
DF:SetFontOutline (iconFrame.StackText, self.options.stack_text_outline)
else
iconFrame.StackText:Hide()
end
Expand Down Expand Up @@ -5330,20 +5338,26 @@ local default_icon_row_options = {
show_text = true,
text_color = {1, 1, 1, 1},
text_size = 12,
text_font = "Arial Narrow",
text_outline = "NONE",
text_anchor = "center",
text_rel_anchor = "center",
text_x_offset = 0,
text_y_offset = 0,
desc_text = true,
desc_text_color = {1, 1, 1, 1},
desc_text_size = 7,
desc_text_font = "Arial Narrow",
desc_text_outline = "NONE",
desc_text_anchor = "bottom",
desc_text_rel_anchor = "top",
desc_text_x_offset = 0,
desc_text_y_offset = 2,
stack_text = true,
stack_text_color = {1, 1, 1, 1},
stack_text_size = 10,
stack_text_font = "Arial Narrow",
stack_text_outline = "NONE",
stack_text_anchor = "center",
stack_text_rel_anchor = "bottomright",
stack_text_x_offset = 0,
Expand All @@ -5356,6 +5370,7 @@ local default_icon_row_options = {
backdrop_border_color = {0, 0, 0, 1},
anchor = {side = 6, x = 2, y = 0},
grow_direction = 1, --1 = to right 2 = to left
surpress_blizzard_cd_timer = false,
surpress_tulla_omni_cc = false,
}

Expand Down

0 comments on commit def0ad7

Please sign in to comment.