Skip to content

Commit

Permalink
General maintenance, OpenRaid cooldown update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 17, 2024
1 parent 3d74943 commit 058d2ae
Show file tree
Hide file tree
Showing 17 changed files with 2,113 additions and 1,885 deletions.
4 changes: 2 additions & 2 deletions Details.toc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Definitions.lua

boot.lua
indent.lua
core\util.lua
functions\util.lua
functions\mixin.lua
API.lua
textures.lua
Expand Down Expand Up @@ -66,7 +66,6 @@ functions\pack.lua
functions\immersion.lua
functions\schedules.lua
functions\autorun.lua
functions\deathrecap.lua
functions\plater.lua
functions\deathmenu.lua
functions\macros.lua
Expand Down Expand Up @@ -133,6 +132,7 @@ frames\window_aura_tracker.lua
frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
4 changes: 2 additions & 2 deletions Details_Cata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Definitions.lua

boot.lua
indent.lua
core\util.lua
functions\util.lua
functions\mixin.lua
API.lua
textures.lua
Expand Down Expand Up @@ -65,7 +65,6 @@ functions\pack.lua
functions\immersion.lua
functions\schedules.lua
functions\autorun.lua
functions\deathrecap.lua
functions\plater.lua
functions\deathmenu.lua
functions\macros.lua
Expand Down Expand Up @@ -132,6 +131,7 @@ frames\window_aura_tracker.lua
frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
4 changes: 2 additions & 2 deletions Details_Classic.toc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Definitions.lua

boot.lua
indent.lua
core\util.lua
functions\util.lua
functions\mixin.lua
API.lua
textures.lua
Expand Down Expand Up @@ -62,7 +62,6 @@ functions\pack.lua
functions\immersion.lua
functions\schedules.lua
functions\autorun.lua
functions\deathrecap.lua
functions\plater.lua
functions\deathmenu.lua
functions\macros.lua
Expand Down Expand Up @@ -126,6 +125,7 @@ frames\window_statistics.lua
frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
4 changes: 2 additions & 2 deletions Details_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Definitions.lua

boot.lua
indent.lua
core\util.lua
functions\util.lua
functions\mixin.lua
API.lua
textures.lua
Expand Down Expand Up @@ -62,7 +62,6 @@ functions\pack.lua
functions\immersion.lua
functions\schedules.lua
functions\autorun.lua
functions\deathrecap.lua
functions\plater.lua
functions\deathmenu.lua
functions\macros.lua
Expand Down Expand Up @@ -126,6 +125,7 @@ frames\window_statistics.lua
frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
1 change: 1 addition & 0 deletions Libs/DF/definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
---@field IsDragonflightWow fun():boolean
---@field IsWarWow fun():boolean
---@field IsTWWWow fun():boolean
---@field CreateFullBorder fun(self:table, name:string, parent:frame) : frame
---@field CreateButton fun(self:table, parent:frame, func:function, width:number, height:number, text:any, param1:any, param2:any, texture:atlasname|texturepath|textureid|nil, member:string?, name:string?, shortMethod:any, buttonTemplate:table?, textTemplate:table?) : df_button callback function(blizzButton, clickType, param1, param2) end
---@field CreateCloseButton fun(self:table, parent:frame, frameName:string?) : df_closebutton
---@field CreateTabButton fun(self:table, parent:frame, frameName:string?) : df_tabbutton
Expand Down
53 changes: 52 additions & 1 deletion Libs/DF/ejournal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ local defaultCreatureIconCoords = {0, 1, 0, 0.95}
---@field CreateEncounterJournalDump fun()
---@field GetAllRaidInstances fun():df_instanceinfo[]
---@field GetAllDungeonInstances fun():df_instanceinfo[]
---@field GetEncounterSpells fun(journalInstanceId:number, journalEncounterId:number, difficulty:number):df_ejspell[]
---@field CacheRaidData_OnlyRaidInstances table<number, df_instanceinfo[]>
---@field CacheRaidData_OnlyDungeonInstances table<number, df_instanceinfo[]>
---@field CacheRaidData_ByInstanceId table<number, df_instanceinfo>
Expand Down Expand Up @@ -169,6 +170,56 @@ function Ejc.GetAllDungeonInstances()
return Ejc.CacheRaidData_OnlyDungeonInstances
end

---@class df_ejspell : table
---@field spellID number
---@field title string header name in the encounter journal
---@field abilityIcon number journal spell icon

function Ejc.GetEncounterSpells(journalInstanceId, journalEncounterId, difficulty)
EJ_SetDifficulty(difficulty or 16)
EJ_SelectInstance(journalInstanceId)
EJ_SelectEncounter(journalEncounterId)

local encounterName, encounterDescription, journalEncounterID, rootSectionID, link, journalInstanceID, dungeonEncounterID, instanceID = EJ_GetEncounterInfo(journalEncounterId)
local sectionStack = {}
local currentSectionId = rootSectionID

local spells = {}

repeat
local sectionInfo = C_EncounterJournal.GetSectionInfo(currentSectionId)
if (not sectionInfo) then
break
end

if (sectionInfo.spellID) then
local spellInfo = C_Spell.GetSpellInfo(sectionInfo.spellID)
sectionInfo.spellName = spellInfo and spellInfo.name
sectionInfo.spellIcon = spellInfo and spellInfo.iconID

table.insert(spells, sectionInfo)

spells[sectionInfo.spellID] = sectionInfo
if (sectionInfo.spellName) then
spells[sectionInfo.spellName] = sectionInfo
end
if (sectionInfo.title) then
spells[sectionInfo.title] = sectionInfo
end
end

if (sectionInfo.siblingSectionID) then
table.insert(sectionStack, sectionInfo.siblingSectionID)
end

if (sectionInfo.firstChildSectionID) then
table.insert(sectionStack, sectionInfo.firstChildSectionID)
end

currentSectionId = table.remove(sectionStack)
until not currentSectionId
end

function Ejc.CreateEncounterJournalDump()
--if the cache has been already created, then return
if (bHasLoaded) then
Expand Down Expand Up @@ -310,7 +361,7 @@ function Ejc.CreateEncounterJournalDump()
else
Ejc.CacheRaidData_OnlyDungeonInstances[#Ejc.CacheRaidData_OnlyDungeonInstances+1] = instanceData
end

--get information about the bosses in the raid
for encounterIndex = 1, maxRaidBosses do
local encounterName, encounterDescription, journalEncounterID, rootSectionID, link, journalInstanceID, dungeonEncounterID, instanceID = EJ_GetEncounterInfoByIndex(encounterIndex, journalInstanceID)
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 580
local dversion = 582
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down
17 changes: 13 additions & 4 deletions Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4366,6 +4366,7 @@ local default_radiogroup_options = {
---@field FadeIn fun(self:df_checkboxgroup)
---@field FadeOut fun(self:df_checkboxgroup)
---@field GetAllCheckboxes fun(self:df_checkboxgroup):df_radiogroup_checkbox[]
---@field ExecuteOnAllCheckboxes fun(self:df_checkboxgroup, func:function) fun(radioGroup, checkbox, param, optionId)
---@field GetCheckbox fun(self:df_checkboxgroup, checkboxId:number):df_radiogroup_checkbox
---@field CreateCheckbox fun(self:df_checkboxgroup):df_radiogroup_checkbox
---@field ResetAllCheckboxes fun(self:df_checkboxgroup)
Expand Down Expand Up @@ -4468,6 +4469,13 @@ detailsFramework.RadioGroupCoreFunctions = {
return checkbox
end,

ExecuteOnAllCheckboxes = function(self, func)
local checkBoxList = self:GetAllCheckboxes()
for _, checkbox in ipairs(checkBoxList) do
detailsFramework:QuickDispatch(func, self, checkbox, checkbox._param, checkbox._optionid)
end
end,

ResetAllCheckboxes = function(self)
local radioCheckboxes = self:GetAllCheckboxes()
for i = 1, #radioCheckboxes do
Expand Down Expand Up @@ -4649,9 +4657,9 @@ detailsFramework.RadioGroupCoreFunctions = {
}

---@class df_radiooptions : table
---@field name string|table can be a regular string or a locTable
---@field get fun():any?
---@field set fun(self:df_radiooptions, param, value)
---@field name string|table? can be a regular string or a locTable
---@field get fun()?
---@field set fun(self:df_radiooptions, param, value)?
---@field param any?
---@field texture string?
---@field texcoord table?
Expand All @@ -4664,7 +4672,8 @@ detailsFramework.RadioGroupCoreFunctions = {
---@field backdrop_color table?
---@field backdrop_border_color table?
---@field checkbox_template string?
---@field on_click_option fun(self:df_checkboxgroup, checkbox:df_radiogroup_checkbox, param:any, optionId:number)
---@field on_click_option fun(self:df_checkboxgroup, checkbox:df_radiogroup_checkbox, param:any, optionId:number)?
---@field on_create_checkbox fun(self:df_checkboxgroup, checkbox:df_radiogroup_checkbox)?

--[=[
radionOptions: an index table with options for the radio group {name = "", set = func (self, param, value), param = value, get = func, texture = "", texcoord = {}}
Expand Down
64 changes: 60 additions & 4 deletions Libs/DF/slider.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

--[=[
SLIDER:
When the value of the slider is changed, it'll call self.OnValueChanged if the value exists.
slider.OnValueChanged = function(self, FixedValue, value) end
All hooks set for "OnValueChanged" will also be called, example: slider:SetHook("OnValueChanged", function(self, FixedValue, value) end)
SWITCH:
When the value of the switch is changed, it'll call self.OnSwitch if the key exists.
switch.OnSwitch = function(self, FixedValue, value) end
All hooks set for "OnSwitch" will also be called, example: switch:SetHook("OnSwitch", function(self, FixedValue, value) end)
--]=]

---@type detailsframework
Expand Down Expand Up @@ -837,12 +842,17 @@ local switch_get_value = function(self)
return self.value
end

local switch_set_value = function(self, value)
local switch_set_value = function(self, value, forcedState)
if (self.switch_func) then
value = self:switch_func(value)
end

SwitchOnClick (self.widget, nil, true, value)
local bForceValue = true
if (forcedState == "RUN_CALLBACK") then
bForceValue = false
end

SwitchOnClick (self.widget, nil, bForceValue, value)
end

local switch_set_fixparameter = function(self, value)
Expand Down Expand Up @@ -955,9 +965,53 @@ local set_as_checkbok = function(self)
end
end

local createExtraSpaceToClick = function(self, label, widgetWidth, highlight)
--self = self.widget or self
label = label.widget or label
widgetWidth = widgetWidth or 140

local extraSpaceFrame = CreateFrame("button", nil, self.widget)
extraSpaceFrame:EnableMouse(true)
extraSpaceFrame:SetFrameLevel(self:GetFrameLevel()-1)

PixelUtil.SetSize(extraSpaceFrame, widgetWidth, self:GetHeight() + 1)
PixelUtil.SetPoint(extraSpaceFrame, "topleft", self.widget, "topleft", 0, 0)

local highlightTexture

if (highlight) then
highlightTexture = extraSpaceFrame:CreateTexture(nil, "highlight")
if (type(highlight) ~= "boolean") then
highlightTexture:SetTexture(highlight)
else
highlightTexture:SetColorTexture(1, 1, 1, 0.1)
end
PixelUtil.SetPoint(highlightTexture, "topleft", extraSpaceFrame, "topleft", 0, 0)
PixelUtil.SetPoint(highlightTexture, "bottomright", extraSpaceFrame, "bottomright", 0, 0)
end

extraSpaceFrame:SetScript("OnClick", function()
local bNewState = not self:GetValue()
self.OnSwitch(self, nil, bNewState)

if (bNewState) then
self:SetValue(true, "RUN_CALLBACK")
else
self:SetValue(false, "RUN_CALLBACK")
end

if (self._valueChangeHook) then
self._valueChangeHook()
end
end)

extraSpaceFrame.parent = self
return extraSpaceFrame, highlightTexture
end

---@class df_checkbox : df_button, df_widgets
---@field OnSwitch fun(self:df_checkbox, fixedValue:any, value:boolean)
---@field SetValue fun(self:df_button, value:boolean)
---@field SetValue fun(self:df_button, value:boolean, state:string?)
---@field GetValue fun(self:df_button):boolean
---@field SetFixedParameter fun(self:df_button, value:any)
---@field GetFixedParameter fun(self:df_button):any
Expand All @@ -970,6 +1024,7 @@ end
---@field GetCapsule fun(self:df_button):df_button capsule only exists in the actual frame of the encapsulated widget
---@field SetCheckedTexture fun(self:df_button, texture:string)
---@field SetChecked fun(self:df_button, value:boolean)
---@field CreateExtraSpaceToClick fun(self:df_button, label:df_label, widgetWidth:number?, highlight:any?):button


function DF:CreateSwitch(parent, onSwitch, defaultValue, width, height, leftText, rightText, member, name, colorInverted, switchFunc, returnFunc, withLabel, switch_template, label_template)
Expand Down Expand Up @@ -1021,6 +1076,7 @@ function DF:NewSwitch(parent, container, name, member, width, height, leftText,
slider.SetTemplate = DFSliderMetaFunctions.SetTemplate
slider.SetSwitchFunction = set_switch_func
slider.GetSwitchFunction = get_switch_func
slider.CreateExtraSpaceToClick = createExtraSpaceToClick

if (member) then
parent[member] = slider
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/timebar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ local OnUpdateFunc = function(self, deltaTime)
self.MyObject:StopTimer()
end

self.MyObject:RunHooksForWidget("OnUpdate", self, self)
self.MyObject:RunHooksForWidget("OnUpdate", self, self, deltaTime)
end

---start a timer on the timebar
Expand Down
6 changes: 4 additions & 2 deletions Libs/LibOpenRaid/ThingsToMantain_WarWithin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ do
[305483] = {cooldown = 45, duration = 5, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Lightning Lasso
[197214] = {cooldown = 40, duration = 2, specs = {262}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Sundering
[108270] = {cooldown = 180, duration = 15,specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 2}, --Stone Bulwark Totem

[384352] = {cooldown = 60, duration = 0,specs = {263}, talent = false, charges = 1, class = "SHAMAN", type = 1}, --Doom Winds

--~monk
-- 268 - Brewmaster
-- 269 - Windwalker
Expand Down Expand Up @@ -697,7 +698,8 @@ do
[384631] = {cooldown = 90, duration = 12, specs = {261}, talent = false, charges = 1, class = "ROGUE", type = 1}, --Flagellation
[277925] = {cooldown = 60, duration = 4, specs = {261}, talent = false, charges = 1, class = "ROGUE", type = 1}, --Shuriken Tornado
[360194] = {cooldown = 120, duration = 16, specs = {259}, talent = false, charges = 1, class = "ROGUE", type = 1}, -- Deathmark

[385627] = {cooldown = 60, duration = 14, specs = {259}, talent = false, charges = 1, class = "ROGUE", type = 1}, -- Kingsbane

--~evoker
-- 1467 - Devastation
-- 1468 - Preservation
Expand Down
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
local addonName, Details222 = ...
local version, build, date, tvs = GetBuildInfo()

Details.build_counter = 13190
Details.alpha_build_counter = 13190 --if this is higher than the regular counter, use it instead
Details.build_counter = 13191
Details.alpha_build_counter = 13191 --if this is higher than the regular counter, use it instead
Details.dont_open_news = true
Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter
Expand Down
3 changes: 3 additions & 0 deletions core/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,9 @@
Details:Msg("(debug) starting a new arena segment.")
end

--cleanup the first death of the arena
Details.first_arena_deathlog = nil

local _, timeSeconds = select(1, ...)

if (Details.start_arena) then
Expand Down
Loading

0 comments on commit 058d2ae

Please sign in to comment.