Skip to content

Commit

Permalink
End of mythic+ panel updates, training dummy icon, etc.
Browse files Browse the repository at this point in the history
- Added a round of polishing into the end of mythic+ panel.
- Added: Details:RegisterFrameToColor(frame) the registered frame will use the same color scheme of all the other frames from Details!.
- Segments menu will show a different icon for training dummies.
- Fixed functions that retrieve information about a dungeon.
- Fixed an issue while trying to report using the "Report Results" from the report results tooltip.
  • Loading branch information
Tercioo committed Mar 7, 2024
1 parent b7e6b89 commit c4ee7e8
Show file tree
Hide file tree
Showing 17 changed files with 218 additions and 92 deletions.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ functions/pack2.lua
*.afphoto
wowapi.lua
plugins/Details_TinyThreat/Details_TinyThreat_original.lua
*.png
Descriptions.lua
plugins/Details_EncounterDetails/.github/workflows/release.yml
plugins/Details_RaidCheck/.github/workflows/release.yml
Expand All @@ -51,3 +50,15 @@ annotations.txt
plugins/Details_Compare2/Definitions.lua
plugins/Details_Compare2/DF/
plugins/Details_Compare2/LibLuaServer/
images/castlog_image.png
images/castlog_image2.png
images/castlog_image3.png
images/castlog_raidcooldowns.png
images/chartviewer.png
images/getalpha_version.png
images/icons2.png
images/myself.png
images/package_addons.png
images/patreon_stuff.png
images/plater_darktheme_skin.png
images/Tutorial/DetailsMainWindow.png
5 changes: 3 additions & 2 deletions Definitions.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

---lower instance: each instance has an ID, starts from 1 and goes on, the lower instance is the opened instance with the lower ID.
--lower instance: each instance has an ID, starts from 1 and goes on, the lower instance is the opened instance with the lower ID.
--training dummy: a npc within major cities in world of warcraft where players can cast spells and attack to test their damage and healing output

---@alias plugintype
---| "SOLO"
Expand Down Expand Up @@ -218,7 +219,7 @@
---@field bossTimers table[] stored timers for bigwigs and dbm
---@field last_events_tables table[] where the death log of each player is stored
---@field boss_hp number percentage of the health points of the boss
---@field
---@field training_dummy boolean if true, the combat is against a training dummy
---@field
---@field
---@field __call table
Expand Down
4 changes: 2 additions & 2 deletions Libs/DF/cooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ function DF:CreateCoolTip()
if (gameCooltip.FunctionsTableMain[self.index]) then
local parameterTable = gameCooltip.ParametersTableMain[self.index]
local func = gameCooltip.FunctionsTableMain[self.index]
local okay, errortext = pcall(func, gameCooltip.Host, gameCooltip.FixedValue, parameterTable[1], parameterTable[2], parameterTable[3], button)
local okay, errortext = xpcall(func, geterrorhandler(), gameCooltip.Host, gameCooltip.FixedValue, parameterTable[1], parameterTable[2], parameterTable[3], button)
if (not okay) then
print("Cooltip OnClick Error:", errortext)
end
Expand All @@ -951,7 +951,7 @@ function DF:CreateCoolTip()
if (gameCooltip.FunctionsTableSub[self.mainIndex] and gameCooltip.FunctionsTableSub[self.mainIndex][self.index]) then
local parameterTable = gameCooltip.ParametersTableSub[self.mainIndex][self.index]
local func = gameCooltip.FunctionsTableSub[self.mainIndex][self.index]
local okay, errortext = pcall(func, gameCooltip.Host, gameCooltip.FixedValue, parameterTable[1], parameterTable[2], parameterTable[3], button)
local okay, errortext = xpcall(func, geterrorhandler(), gameCooltip.Host, gameCooltip.FixedValue, parameterTable[1], parameterTable[2], parameterTable[3], button)
if (not okay) then
print("Cooltip OnClick Error:", errortext)
end
Expand Down
20 changes: 20 additions & 0 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@
end
end

--cache of frames to call :SetColor() when the color scheme changes
Details222.RegisteredFramesToColor = {}

Details222.TrainingDummiesNpcId = {
[194649] = true, --valdraken
[189617] = true, --valdraken
[194644] = true, --valdraken
[198594] = true, --valdraken
[194643] = true, --valdraken
[189632] = true, --valdraken
[194648] = true, --valdraken
[194646] = true, --valdraken
[197834] = true, --valdraken
[31146] = true, --orgrimmar
[153285] = true, --orgrimmar
[114840] = true, --orgrimmar
[114832] = true, --stormwind
[153292] = true, --stormwind
}

--namespace for damage spells (spellTable)
Details222.DamageSpells = {}
--namespace for texture
Expand Down
21 changes: 21 additions & 0 deletions classes/class_combat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ local detailsFramework = DetailsFramework

--[[global]] DETAILS_SEGMENTTYPE_EVENT_VALENTINEDAY = 30

--[[global]] DETAILS_SEGMENTTYPE_TRAININGDUMMY = 40

local segmentTypeToString = {
[DETAILS_SEGMENTTYPE_GENERIC] = "Generic",
[DETAILS_SEGMENTTYPE_OVERALL] = "Overall",
Expand Down Expand Up @@ -403,6 +405,9 @@ local segmentTypeToString = {
elseif (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC) then
return textureAtlas["segment-icon-mythicplus"]

elseif (combatType == DETAILS_SEGMENTTYPE_TRAININGDUMMY) then
return textureAtlas["segment-icon-training-dummy-zoom"]

elseif (combatType == DETAILS_SEGMENTTYPE_PVP_ARENA) then
return textureAtlas["segment-icon-arena"]

Expand Down Expand Up @@ -687,6 +692,10 @@ local segmentTypeToString = {
return DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC, DETAILS_SEGMENTTYPE_MYTHICDUNGEON
end

if (self.training_dummy) then
return DETAILS_SEGMENTTYPE_TRAININGDUMMY
end

--arena
local arenaInfo = self.is_arena
if (arenaInfo) then
Expand Down Expand Up @@ -1038,8 +1047,20 @@ function classCombat:NovaTabela(bTimeStarted, overallCombatObject, combatId, ...
Details.combat_counter = Details.combat_counter + 1
combatObject.combat_counter = Details.combat_counter

--combatObject.training_dummy = false

--try discover if is a pvp combat
local sourceGUID, sourceName, sourceFlags, targetGUID, targetName, targetFlags = ...

if (targetGUID) then
local npcId = Details:GetNpcIdFromGuid(targetGUID)
if (npcId) then
if (Details222.TrainingDummiesNpcId[npcId]) then
combatObject.training_dummy = true
end
end
end

if (sourceGUID) then --aqui ir� identificar o boss ou o oponente
if (targetName and bitBand (targetFlags, REACTION_HOSTILE) ~= 0) then --tentando pegar o inimigo pelo alvo
combatObject.contra = targetName
Expand Down
1 change: 1 addition & 0 deletions core/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
optionsFrame:Hide()

detailsFramework:AddRoundedCornersToFrame(optionsFrame, Details.PlayerBreakdown.RoundedCornerPreset)
Details:RegisterFrameToColor(optionsFrame)

--create a an icon to display the pluginIcon
local pluginIconTexture = detailsFramework:CreateTexture(optionsFrame, pluginIcon, 20, 20, "artwork", pluginIconCoords or {0, 1, 0, 1}, "pluginIconTexture", "$parentPluginIconTexture")
Expand Down
12 changes: 12 additions & 0 deletions frames/window_breakdown/window_playerbreakdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ Details.PlayerBreakdown.RoundedCornerPreset = {
color = {.1, .1, .1, 0.834},
}

Details222.RegisteredFramesToColor = {}

function Details:RegisterFrameToColor(frame)
Details222.RegisteredFramesToColor[#Details222.RegisteredFramesToColor+1] = frame
local colorTable = Details.frame_background_color
frame:SetColor(unpack(colorTable))
end

function Details:RefreshWindowColor()
local colorTable = Details.frame_background_color
Details:SetWindowColor(unpack(colorTable))
Expand Down Expand Up @@ -290,6 +298,10 @@ function Details:SetWindowColor(r, g, b, a)
DetailsSpellBreakdownOptionsPanel:SetColor(r, g, b, a)
end

for idx, frame in ipairs(Details222.RegisteredFramesToColor) do
frame:SetColor(r, g, b, a)
end

local colorTable = Details.frame_background_color
colorTable[1] = r
colorTable[2] = g
Expand Down
11 changes: 10 additions & 1 deletion frames/window_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ local Details = _G.Details
local Loc = LibStub("AceLocale-3.0"):GetLocale("Details")
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
local segmentos = Details.segmentos


---@type detailsframework
local gump = Details.gump
local _

Expand Down Expand Up @@ -6632,6 +6635,12 @@ local buildSegmentTooltip = function(self, deltaTime)
gameCooltip:AddLine(combatName, formattedElapsedTime, 1, "hotpink", "hotpink")
gameCooltip:AddIcon(thisCombat:GetCombatIcon(), "main", "left")

elseif (combatType == DETAILS_SEGMENTTYPE_TRAININGDUMMY) then
mythicDungeonRunId = false
local combatName, r, g, b = thisCombat:GetCombatName()
gameCooltip:AddLine(combatName, formattedElapsedTime, 1, "yellow", "yellow")
gameCooltip:AddIcon(thisCombat:GetCombatIcon(), "main", "left")

elseif (combatType == DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND) then
mythicDungeonRunId = false
enemyName = thisCombat:GetCombatName()
Expand Down Expand Up @@ -9232,7 +9241,7 @@ local reportButton_OnEnter = function(self, motion, forced)

GameCooltip:AddLine(Loc["STRING_REPORT_TOOLTIP"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
GameCooltip:AddIcon([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19)
GameCooltip:AddMenu(1, Details.Reportar, instancia, nil, "INSTANCE" .. instancia.meu_id)
GameCooltip:AddMenu(1, function() instancia:Reportar("INSTANCE" .. instancia.meu_id) end)

show_anti_overlap(instancia, self, "top")
Details:SetMenuOwner(self, instancia)
Expand Down
2 changes: 1 addition & 1 deletion frames/window_mythicplus/window_chart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function mythicDungeonCharts.ShowChart()

dungeonChartFrame:SetSize(1200, 620)
dungeonChartFrame:SetPoint("center", UIParent, "center", 0, 0)
dungeonChartFrame:SetFrameStrata("LOW")
dungeonChartFrame:SetFrameStrata("DIALOG")
dungeonChartFrame:EnableMouse(true)
dungeonChartFrame:SetMovable(true)
DetailsFramework:ApplyStandardBackdrop(dungeonChartFrame)
Expand Down
Loading

0 comments on commit c4ee7e8

Please sign in to comment.