Skip to content

Commit

Permalink
[DSR] Reworked configuration for Ice/Fire Dome alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryDragon committed Oct 1, 2023
1 parent aaf8cba commit 0d6c8c8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
24 changes: 22 additions & 2 deletions Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ do ------------------
bahsei_embrace_of_death = 0, -- "Off"
},
dreadsailReef = {
dome_type = 3, -- "All"
dome_activation = false,
dome_stack_alert = 0, -- "Off"
dome_stack_threshold = 15,
Expand Down Expand Up @@ -578,12 +579,18 @@ function RaidNotifier:CreateSettingsMenu()
bahsei_embrace_of_death = off_self_all,
},
dreadsailReef = {
dome_stack_alert = {
dome_type = {
L.Settings_General_Choices_Off,
L.Settings_DreadsailReef_Choices_OnlyFireDome,
L.Settings_DreadsailReef_Choices_OnlyIceDome,
L.Settings_General_Choices_All,
},
dome_stack_alert = {
L.Settings_General_Choices_Off,
L.Settings_General_Choices_Self,
L.Settings_General_Choices_Others,
L.Settings_General_Choices_All,
},
brothers_heavy_attack = off_self_all,
taleria_rapid_deluge = off_self_all,
},
Expand Down Expand Up @@ -1737,16 +1744,29 @@ function RaidNotifier:CreateSettingsMenu()

-- Dreadsail Reef
MakeSubmenu(L.Settings_DreadsailReef_Header, RaidNotifier:GetRaidDescription(RAID_DREADSAIL_REEF))
MakeControlEntry({
type = "dropdown",
name = L.Settings_DreadsailReef_Dome_Type,
tooltip = L.Settings_DreadsailReef_Dome_Type_TT,
choices = choices.dreadsailReef.dome_type,
noAlert = true,
}, "dreadsailReef", "dome_type")
MakeControlEntry({
type = "checkbox",
name = L.Settings_DreadsailReef_Dome_Activation,
tooltip = L.Settings_DreadsailReef_Dome_Activation_TT,
disabled = function()
return savedVars.dreadsailReef.dome_type == 0;
end,
}, "dreadsailReef", "dome_activation")
MakeControlEntry({
type = "dropdown",
name = L.Settings_DreadsailReef_Dome_Stack_Alert,
tooltip = L.Settings_DreadsailReef_Dome_Stack_Alert_TT,
choices = choices.dreadsailReef.dome_stack_alert,
disabled = function()
return savedVars.dreadsailReef.dome_type == 0;
end,
}, "dreadsailReef", "dome_stack_alert")
MakeControlEntry({
type = "slider",
Expand All @@ -1756,7 +1776,7 @@ function RaidNotifier:CreateSettingsMenu()
max = 25,
step = 1,
disabled = function()
return savedVars.dreadsailReef.dome_stack_alert == 0;
return savedVars.dreadsailReef.dome_type == 0 or savedVars.dreadsailReef.dome_stack_alert == 0;
end,
noAlert = true,
}, "dreadsailReef", "dome_stack_threshold")
Expand Down
16 changes: 12 additions & 4 deletions TrialDreadsailReef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,22 @@ function RaidNotifier.DSR.OnEffectChanged(eventCode, changeType, eSlot, eName, u

-- Player receiving stacks while holding Fire/Ice Dome at the Lylanar&Turlassil encounter
if ((abilityId == buffsDebuffs.destructive_ember_stack or abilityId == buffsDebuffs.piercing_hailstone_stack) and string.sub(uTag, 1, 5) == "group") then
local shouldNotify = (abilityId == buffsDebuffs.destructive_ember_stack and settings.dome_stack_alert == 1)
or (abilityId == buffsDebuffs.piercing_hailstone_stack and settings.dome_stack_alert == 2)
or settings.dome_stack_alert == 3
local shouldNotify = (abilityId == buffsDebuffs.destructive_ember_stack and settings.dome_type == 1)
or (abilityId == buffsDebuffs.piercing_hailstone_stack and settings.dome_type == 2)
or settings.dome_type == 3

local isPlayer = AreUnitsEqual(uTag, "player")

shouldNotify = shouldNotify and (
settings.dome_stack_alert == 1 and isPlayer
or settings.dome_stack_alert == 2 and not isPlayer
or settings.dome_stack_alert == 3
)

if (shouldNotify and changeType ~= EFFECT_RESULT_FADED and stackCount == settings.dome_stack_threshold) then
local text

if (AreUnitsEqual(uTag, "player")) then
if (isPlayer) then
if (abilityId == buffsDebuffs.destructive_ember_stack) then
text = zo_strformat(GetString(RAIDNOTIFIER_ALERTS_DREADSAILREEF_FIRE_DOME_STACK_ALERT), stackCount)
else
Expand Down
3 changes: 3 additions & 0 deletions lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ L.Settings_General_Choices_Near = "Near"
L.Settings_General_Choices_All = "All"
L.Settings_General_Choices_Always = "Always"
L.Settings_General_Choices_Other = "Other"
L.Settings_General_Choices_Others = "Others"
L.Settings_General_Choices_Inverted = "Inverted"
L.Settings_General_Choices_Small_Announcement = "Small (static, obsolete)"
L.Settings_General_Choices_Large_Announcement = "Large (static, obsolete)"
Expand Down Expand Up @@ -635,6 +636,8 @@ L.Alerts_Rockgrove_Embrace_Of_Death_Other = "|cFF0000<<!aC:1>>|r cursed
--------------------------------
L.Settings_DreadsailReef_Header = "Dreadsail Reef"
-- Settings
L.Settings_DreadsailReef_Dome_Type = "Lylanar & Turlassil: Fire/Ice Dome filter"
L.Settings_DreadsailReef_Dome_Type_TT = "You can restrict notifications to some specific Dome."
L.Settings_DreadsailReef_Dome_Activation = "Lylanar & Turlassil: Fire/Ice Dome activation"
L.Settings_DreadsailReef_Dome_Activation_TT = "Alerts you when someone gets Fire or Ice Dome."
L.Settings_DreadsailReef_Dome_Stack_Alert = "Lylanar & Turlassil: Fire/Ice Dome stacks alert"
Expand Down

0 comments on commit 0d6c8c8

Please sign in to comment.