Visualize better mythic plus segments

This commit is contained in:
Tercio Jose
2022-12-22 22:18:28 -03:00
parent eef2d19cef
commit ce9a3b875b
9 changed files with 165 additions and 44 deletions
+29 -12
View File
@@ -15,7 +15,7 @@ local max = math.max
--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 10
local version = 11
local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
@@ -2628,23 +2628,32 @@ function DF:CreateCoolTip()
wallpaperTable[7] = desaturate
end
function gameCooltip:SetBannerText(index, text, anchor, color, fontSize, fontFace, fontFlag)
function gameCooltip:SetBannerText(menuType, index, text, anchor, color, fontSize, fontFace, fontFlag)
menuType = gameCooltip:ParseMenuType(menuType)
local frame
if (menuType == CONST_MENU_TYPE_MAINMENU) then
frame = frame1
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
frame = frame2
end
local fontstring
if (index == 1) then
fontstring = frame1.upperImageText
fontstring = frame.upperImageText
elseif (index == 2) then
fontstring = frame1.upperImageText2
fontstring = frame.upperImageText2
end
fontstring:SetText(text or "")
if (anchor and index == 1) then
local myAnchor, hisAnchor, x, y = unpack(anchor)
fontstring:SetPoint(myAnchor, frame1.upperImage, hisAnchor or myAnchor, x or 0, y or 0)
fontstring:SetPoint(myAnchor, frame.upperImage, hisAnchor or myAnchor, x or 0, y or 0)
elseif (anchor and index == 2) then
local myAnchor, hisAnchor, x, y = unpack(anchor)
fontstring:SetPoint(myAnchor, frame1, hisAnchor or myAnchor, x or 0, y or 0)
fontstring:SetPoint(myAnchor, frame, hisAnchor or myAnchor, x or 0, y or 0)
end
if (color) then
@@ -2667,7 +2676,6 @@ function DF:CreateCoolTip()
if (menuType == CONST_MENU_TYPE_MAINMENU) then
frame = frame1
elseif (menuType == CONST_MENU_TYPE_SUBMENU) then
frame = frame2
end
@@ -2685,12 +2693,21 @@ function DF:CreateCoolTip()
end
end
function gameCooltip:SetBannerImage(index, texturePath, width, height, anchor, texCoord, overlay)
function gameCooltip:SetBannerImage(menuType, index, texturePath, width, height, anchor, texCoord, overlay)
menuType = gameCooltip:ParseMenuType(menuType)
local frame
if (menuType == CONST_MENU_TYPE_MAINMENU) then
frame = frame1
elseif(menuType == CONST_MENU_TYPE_SUBMENU) then
frame = frame2
end
local texture
if (index == 1) then
texture = frame1.upperImage
texture = frame.upperImage
elseif (index == 2) then
texture = frame1.upperImage2
texture = frame.upperImage2
end
if (texturePath) then
@@ -2708,11 +2725,11 @@ function DF:CreateCoolTip()
if (type(anchor[1]) == "table") then
for anchorIndex, anchorPoints in ipairs(anchor) do
local myAnchor, hisAnchor, x, y = unpack(anchorPoints)
texture:SetPoint(myAnchor, frame1, hisAnchor or myAnchor, x or 0, y or 0)
texture:SetPoint(myAnchor, frame, hisAnchor or myAnchor, x or 0, y or 0)
end
else
local myAnchor, hisAnchor, x, y = unpack(anchor)
texture:SetPoint(myAnchor, frame1, hisAnchor or myAnchor, x or 0, y or 0)
texture:SetPoint(myAnchor, frame, hisAnchor or myAnchor, x or 0, y or 0)
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
local dversion = 405
local dversion = 406
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
+3 -9
View File
@@ -1727,16 +1727,10 @@
local avatar = NickTag:GetNicknameTable (objeto.serial, true)
if (avatar and not Details.ignore_nicktag) then
if (avatar [2] and avatar [4] and avatar [1]) then
GameCooltip:SetBannerImage (1, avatar [2], 80, 40, avatarPoint, avatarTexCoord, nil) --overlay [2] avatar path
GameCooltip:SetBannerImage (2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --background
GameCooltip:SetBannerText (1, (not Details.ignore_nicktag and avatar [1]) or objeto.nome, textPoint, avatarTextColor, 14, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --text [1] nickname
GameCooltip:SetBannerImage (1, 1, avatar [2], 80, 40, avatarPoint, avatarTexCoord, nil) --overlay [2] avatar path
GameCooltip:SetBannerImage (1, 2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --background
GameCooltip:SetBannerText (1, 1, (not Details.ignore_nicktag and avatar [1]) or objeto.nome, textPoint, avatarTextColor, 14, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --text [1] nickname
end
else
--if (Details.remove_realm_from_name and objeto.displayName:find("%*")) then
-- GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\background]], 20, 30, avatarPoint, avatarTexCoord, {0, 0, 0, 0}) --overlay [2] avatar path
-- GameCooltip:SetBannerImage (2, [[Interface\PetBattles\Weather-BurntEarth]], 160, 30, {{"bottomleft", "topleft", 0, -5}, {"bottomright", "topright", 0, -5}}, {0.12, 0.88, 1, 0}, {0, 0, 0, 0.1}) --overlay [2] avatar path {0, 0, 0, 0}
-- GameCooltip:SetBannerText (1, objeto.nome, {"left", "left", 11, -8}, {1, 1, 1, 0.7}, 10, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --text [1] nickname
--end
end
end
-7
View File
@@ -1366,13 +1366,6 @@
GameCooltip:SetOption("HeighMod", 5)
GameCooltip:SetOption("TextSize", 10)
--344 427 200 268 0.0009765625
--0.672851, 0.833007, 0.391601, 0.522460
--GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\icons]], 83*.5, 68*.5, {"bottomleft", "topleft", 1, -4}, {0.672851, 0.833007, 0.391601, 0.522460}, nil)
--GameCooltip:SetBannerImage (2, "Interface\\PetBattles\\Weather-Windy", 512*.35, 128*.3, {"bottomleft", "topleft", -25, -4}, {0, 1, 1, 0})
--GameCooltip:SetBannerText (1, "Mini Map Menu", {"left", "right", 2, -5}, "white", 10)
--reset
GameCooltip:AddMenu (1, Details.tabela_historico.resetar, true, nil, nil, Loc ["STRING_ERASE_DATA"], nil, true)
GameCooltip:AddIcon ([[Interface\COMMON\VOICECHAT-MUTED]], 1, 1, 14, 14)
+42 -6
View File
@@ -6361,22 +6361,50 @@ local buildSegmentTooltip = function(self, deltaTime)
end
end
local addIconAndStatusBar = function(redTint)
gameCooltip:AddIcon([[Interface\AddOns\Details\images\empty16]], 2, 1, 12, 12)
gameCooltip:AddStatusBar(100, 2, redTint or 0, 0, 0, 0.85, false, false, "Skyline")
end
--is mythic overall
if (isMythicOverallSegment) then
--mostrar o tempo da dungeon
local totalTime = elapsedCombatTime
gameCooltip:AddLine(zoneName .. " +" .. mythicLevel .. " (" .. Loc["STRING_SEGMENTS_LIST_OVERALL"] .. ")", Details.gump:IntegerToTimer(endedAt - startedAt), 1, dungeonColor)
local overallIcon = "|TInterface\\GLUES\\CharacterSelect\\Glues-AddOn-Icons:16:16:0:0:64:16:48:64:0:16|t"
gameCooltip:AddLine(overallIcon .. zoneName .. " +" .. mythicLevel .. " (" .. Loc["STRING_SEGMENTS_LIST_OVERALL"] .. ")", Details.gump:IntegerToTimer(endedAt - startedAt), 1, dungeonColor)
gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 14, 10, 479/512, 510/512, 24/512, 51/512)
gameCooltip:AddStatusBar(100, 1, .5, .1, 0, 0.55, false, false, "Skyline")
gameCooltip:AddLine(zoneName .. " +" .. mythicLevel .. " (" .. Loc["STRING_SEGMENTS_LIST_OVERALL"] .. ")", nil, 2, "white", "white")
gameCooltip:AddStatusBar(100, 2, 0, 0, 0, 0.85, false, false, "Skyline")
else
if (segmentID == "trashoverall") then
local trashIcon = "|TInterface\\AddOns\\Details\\images\\icons:16:16:0:0:512:512:14:58:98:160|t"
gameCooltip:AddLine(trashIcon .. "" .. (encounterName or Loc["STRING_UNKNOW"]) .. " (" .. Loc["STRING_SEGMENTS_LIST_TRASH"] .. ")", Details.gump:IntegerToTimer(endedAt - startedAt), 1, dungeonColor, "gray")
addIconAndStatusBar()
gameCooltip:AddLine((encounterName or Loc["STRING_UNKNOW"]) .. " (" .. Loc["STRING_SEGMENTS_LIST_TRASH"] .. ")", nil, 2, "white", "white")
addIconAndStatusBar()
else
local skull = "|TInterface\\AddOns\\Details\\images\\icons:16:16:0:0:512:512:496:512:0:16|t"
gameCooltip:AddLine(skull .. "" .. (encounterName or Loc["STRING_UNKNOW"]) .. " (" .. Loc["STRING_SEGMENTS_LIST_BOSS"] .. ")", Details.gump:IntegerToTimer(elapsedCombatTime), 1, dungeonColor, "gray")
addIconAndStatusBar()
gameCooltip:AddLine((encounterName or Loc["STRING_UNKNOW"]) .. " (" .. Loc["STRING_SEGMENTS_LIST_BOSS"] .. ")", nil, 2, "white", "white")
addIconAndStatusBar()
do
local avatarPoint = {"bottomleft", "topleft", -3, -4}
local backgroundPoint = {{"bottomleft", "topleft", 0, -3}, {"bottomright", "topright", 0, -3}}
local textPoint = {"left", "right", -11, -5}
local avatarTexCoord = {0, 1, 0, 1}
local backgroundColor = {0, 0, 0, 0.6}
local avatarTextColor = {1, 1, 1, 1}
--gameCooltip:SetBannerImage(2, 1, avatar [2], 80, 40, avatarPoint, avatarTexCoord, nil) --overlay [2] avatar path
local anchor = {"bottom", "top", 0, 0}
--these need to be per line, current are per frame
--gameCooltip:SetBannerImage(2, 2, [[Interface\PetBattles\Weather-Windy]], 200, 55, anchor, {1, 0.129609375, 1, 0})
--gameCooltip:SetBannerText(2, 2, encounterName, textPoint, avatarTextColor, 14, SharedMedia:Fetch("font", Details.tooltip.fontface))
end
end
gameCooltip:AddIcon([[Interface\AddOns\Details\images\icons]], "main", "left", 14, 10, 479/512, 510/512, 24/512, 51/512)
end
@@ -6404,35 +6432,43 @@ local buildSegmentTooltip = function(self, deltaTime)
if (segmentID == "trashoverall") then
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer(decorrido), 2, "white", "white")
addIconAndStatusBar()
local totalRealTime = endedAt - startedAt
local wasted = totalRealTime - decorrido
--wasted time
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer(wasted) .. " (" .. floor(wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white")
gameCooltip:AddStatusBar(100, 2, 0, 0, 0, 0.35, false, false, "Skyline")
addIconAndStatusBar(0.15)
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TOTALTIME"] .. ":", Details.gump:IntegerToTimer(endedAt - startedAt), 2, "white", "white")
addIconAndStatusBar()
elseif (isMythicOverallSegment) then
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer(decorrido), 2, "white", "white")
addIconAndStatusBar()
local totalRealTime = endedAt - startedAt
local wasted = totalRealTime - decorrido
--wasted time
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer(wasted) .. " (" .. floor(wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white")
gameCooltip:AddStatusBar(100, 2, 0, 0, 0, 0.35, false, false, "Skyline")
addIconAndStatusBar(0.15)
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TOTALTIME"] .. ":", Details.gump:IntegerToTimer(totalRealTime), 2, "white", "white")
addIconAndStatusBar()
else
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", Details.gump:IntegerToTimer(decorrido), 2, "white", "white")
addIconAndStatusBar()
end
if (thisCombat.is_boss) then
gameCooltip:AddLine("", "", 2, "white", "white")
addIconAndStatusBar()
end
gameCooltip:AddLine(Loc["STRING_SEGMENT_START"] .. ":", thisCombat.data_inicio, 2, "white", "white")
addIconAndStatusBar()
gameCooltip:AddLine(Loc["STRING_SEGMENT_END"] .. ":", thisCombat.data_fim or "in progress", 2, "white", "white")
gameCooltip:AddStatusBar (100, 1, .3, .3, .3, 0.2, false, false, "Skyline")
addIconAndStatusBar()
--gameCooltip:AddStatusBar(100, 1, .3, .3, .3, 0.2, false, false, "Skyline")
else
--the combat has mythic dungeon tag but doesn't have a mythic dungeon table information
--so this is a trash cleanup segment
+90 -6
View File
@@ -535,6 +535,11 @@ do
Details222.EJCache.CacheDungeonData_ByInstanceName = {}
Details222.EJCache.CacheDungeonData_ByMapId = {}
--exit this function if is classic wow using DetailsFramework
if (DetailsFramework.IsClassicWow()) then
return
end
--todo generate encounter spells cache
--check if the encounter journal added is loaded
@@ -545,6 +550,10 @@ do
do
--iterate among all raid instances, by passing true in the second argument of EJ_GetInstanceByIndex, indicates to the API we want to get raid instances
local bGetRaidInstances = true
EncounterJournalRaidTab:Click()
EncounterJournal_TierDropDown_Select(_, 10) --select Dragonflight
for instanceIndex = 10, 2, -1 do
local journalInstanceID, instanceName, description, bgImage, buttonImage1, loreImage, buttonImage2, dungeonAreaMapID = EJ_GetInstanceByIndex(instanceIndex, bGetRaidInstances)
@@ -615,11 +624,10 @@ do
end
do
--iterate among all dungeon instances, by passing false in the second argument of EJ_GetInstanceByIndex, indicates to the API we want to get dungeon instances
--issue: not getting vintage dungoen like Halls of Valor
local bGetRaidInstances = false
EncounterJournalDungeonTab:Click()
EncounterJournal_TierDropDown_Select(_, 11) --select mythic+
for instanceIndex = 20, 1, -1 do
local journalInstanceID, instanceName, description, bgImage, buttonImage1, loreImage, buttonImage2, dungeonAreaMapID = EJ_GetInstanceByIndex(instanceIndex, bGetRaidInstances)
@@ -688,14 +696,90 @@ do
end
end
end
EncounterJournal_TierDropDown_Select(_, 10) --select Dragonflight
for instanceIndex = 20, 1, -1 do
local journalInstanceID, instanceName, description, bgImage, buttonImage1, loreImage, buttonImage2, dungeonAreaMapID = EJ_GetInstanceByIndex(instanceIndex, bGetRaidInstances)
if (journalInstanceID and not Details222.EJCache.CacheDungeonData_ByInstanceId[journalInstanceID]) then
--tell the encounter journal to display the dungeon instance by the instanceId
EncounterJournal_DisplayInstance(journalInstanceID)
--build a table with data of the raid instance
local instanceData = {
name = instanceName,
mapId = dungeonAreaMapID,
bgImage = bgImage,
instanceId = journalInstanceID,
encountersArray = {},
encountersByName = {},
encountersByDungeonEncounterId = {},
encountersByJournalEncounterId = {},
icon = buttonImage1,
iconSize = {70, 36},
iconCoords = {0.01, .67, 0.025, .725},
iconLore = loreImage,
iconLoreSize = {70, 36},
iconLoreCoords = {0, 1, 0, 0.95},
iconTexture = buttonImage2,
iconTextureSize = {70, 36},
iconTextureCoords = {0, 1, 0, 0.95},
}
--cache the raidData on different tables using different indexes
Details222.EJCache.CacheDungeonData_ByInstanceId[journalInstanceID] = instanceData
Details222.EJCache.CacheDungeonData_ByInstanceName[instanceName] = instanceData
Details222.EJCache.CacheDungeonData_ByMapId[dungeonAreaMapID] = instanceData
--iterate among all encounters of the dungeon instance
for encounterIndex = 1, 20 do
local name, description, journalEncounterID, rootSectionID, link, journalInstanceID, dungeonEncounterID, UiMapID = _G.EJ_GetEncounterInfoByIndex(encounterIndex, journalInstanceID)
if (name) then
local encounterData = {
name = name,
mapId = dungeonAreaMapID,
uiMapId = UiMapID,
dungeonEncounterId = dungeonEncounterID,
journalEncounterId = journalEncounterID,
journalInstanceId = journalInstanceID,
}
local journalEncounterCreatureId, creatureName, creatureDescription, creatureDisplayID, iconImage, uiModelSceneID = EJ_GetCreatureInfo(1, journalEncounterID)
if (journalEncounterCreatureId) then
encounterData.creatureName = creatureName
encounterData.creatureIcon = iconImage
encounterData.creatureId = journalEncounterCreatureId
encounterData.creatureDisplayId = creatureDisplayID
encounterData.creatureUIModelSceneId = uiModelSceneID
end
instanceData.encountersArray[#instanceData.encountersArray+1] = encounterData
instanceData.encountersByName[name] = encounterData
instanceData.encountersByDungeonEncounterId[dungeonEncounterID] = encounterData
instanceData.encountersByJournalEncounterId[journalEncounterID] = encounterData
end
end
end
end
end
--reset the dungeon journal to the default state
if (EncounterJournalSuggestTab) then
EncounterJournalSuggestTab:Click()
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--core
function _detalhes:InstallEncounter (InstanceTable)
_detalhes.EncounterInformation [InstanceTable.id] = InstanceTable
function _detalhes:InstallEncounter(InstanceTable)
_detalhes.EncounterInformation[InstanceTable.id] = InstanceTable
return true
end
end
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

@@ -563,9 +563,6 @@ local function CreatePluginFrames (data)
local textPoint = {"left", "left", 4, 0}
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
--CoolTip:SetBannerImage (1, [[]], 200, 22, avatarPoint, avatarTexCoord, nil) --> overlay [2] avatar path
--CoolTip:SetBannerText (1, Loc ["STRING_PLUGIN_NAME"], textPoint, {1, 1, 1}, 14, SharedMedia:Fetch ("font", _detalhes.tooltip.fontface)) --> text [1] nickname
--apply the backdrop settings to the menu
Details:FormatCooltipBackdrop()