Skip to content

Commit

Permalink
General fixes, framework update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Sep 29, 2022
1 parent 995675e commit 11aa42e
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 116 deletions.
9 changes: 8 additions & 1 deletion Libs/DF/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,16 @@ local ButtonMetaFunctions = _G[DF.GlobalWidgetControlNames ["button"]]
local isAtlas = C_Texture.GetAtlasInfo(texture)
if (isAtlas) then
self.icon:SetAtlas(texture)

elseif (DF:IsHtmlColor(texture)) then
local r, g, b, a = DF:ParseColors(texture)
self.icon:SetColorTexture(r, g, b, a)
else
self.icon:SetTexture(texture)
end
elseif (type(texture) == "table") then
local r, g, b, a = DF:ParseColors(texture)
self.icon:SetColorTexture(r, g, b, a)
else
self.icon:SetTexture(texture)
end
Expand Down Expand Up @@ -811,7 +818,7 @@ local ButtonMetaFunctions = _G[DF.GlobalWidgetControlNames ["button"]]
end
else
if (button.MyObject.icon) then
button.MyObject.icon:SetPoint ("left", button, "left", 7 + (button.MyObject.icon.leftpadding or 0), -2)
button.MyObject.icon:SetPoint ("left", button, "left", 5 + (button.MyObject.icon.leftpadding or 0), -1)
else
button.text:SetPoint ("center", button,"center", 1, -1)
end
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 = 367
local dversion = 368
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)

Expand Down
2 changes: 1 addition & 1 deletion Libs/LibOpenRaid/LibOpenRaid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ LIB_OPEN_RAID_CAN_LOAD = false
local GetContainerNumSlots = GetContainerNumSlots or C_Container.GetContainerNumSlots
local GetContainerItemID = GetContainerItemID or C_Container.GetContainerItemID
local GetContainerItemLink = GetContainerItemLink or C_Container.GetContainerItemLink

function openRaidLib.ShowDiagnosticErrors(value)
CONST_DIAGNOSTIC_ERRORS = value
end
Expand Down
15 changes: 11 additions & 4 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 10032
_detalhes.alpha_build_counter = 10032 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 10033
_detalhes.alpha_build_counter = 10033 --if this is higher than the regular counter, use it instead
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. _detalhes.build_counter
_detalhes.userversion = version .. " " .. _detalhes.build_counter
_detalhes.realversion = 146 --core version, this is used to check API version for scripts and plugins (see alias below)
_detalhes.APIVersion = _detalhes.realversion --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" --simple stirng to show to players

_detalhes.BFACORE = 131 --core version on BFA launch
_detalhes.SHADOWLANDSCORE = 143 --core version on Shadowlands launch
--
_detalhes.dragonflight_beta_version = 35
_detalhes.dragonflight_beta_version = 36

Details = _detalhes

Expand Down Expand Up @@ -349,6 +349,13 @@ do
available = {},
},
}

--make a color namespace
Details.Colors = {}
function Details.Colors.GetMenuTextColor()
return "orange"
end

--> armazena as fun��es para inicializa��o dos dados - Metatable functions
_detalhes.refresh = {}
--> armazena as fun��es para limpar e guardas os dados - Metatable functions
Expand Down
5 changes: 5 additions & 0 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4870,6 +4870,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
return Details.Schedules.After(1, Details.Check_ZONE_CHANGED_NEW_AREA)
end

--~zone ~area
function _detalhes:Check_ZONE_CHANGED_NEW_AREA()

local zoneName, zoneType, _, _, _, _, _, zoneMapID = GetInstanceInfo()
Expand All @@ -4886,6 +4887,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1

if (zoneType == "party" or zoneType == "raid") then
_is_in_instance = true

if (DetailsFramework.IsDragonflight()) then
Details:Msg("friendly reminder to enabled combat logs (/combatlog) if you're recording them (Dragonflight Beta).")
end
end

if (_detalhes.last_zone_type ~= zoneType) then
Expand Down
119 changes: 59 additions & 60 deletions frames/window_main.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

local Details = _G._detalhes
local Details = Details
local Loc = LibStub("AceLocale-3.0"):GetLocale("Details")
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
local segmentos = Details.segmentos
Expand All @@ -27,7 +26,7 @@ local modo_raid = Details._detalhes_props["MODO_RAID"]
local modo_alone = Details._detalhes_props["MODO_ALONE"]
local IsInInstance = _G.IsInInstance

local tok_functions = Details.ToKFunctions
local tokFunctions = Details.ToKFunctions

--constants
local baseframe_strata = "LOW"
Expand Down Expand Up @@ -1641,7 +1640,7 @@ local lockFunctionOnEnter = function (self)
self.label:SetTextColor (1, 1, 1, .6)

Details:CooltipPreset (2.1)
GameCooltip:SetOption ("FixedWidth", 180)
GameCooltip:SetOption("FixedWidth", 180)
GameCooltip:AddFromTable (lockButtonTooltip)

GameCooltip:SetOwner (self)
Expand Down Expand Up @@ -1776,7 +1775,7 @@ local unSnapButtonOnEnter = function (self)
self.mostrando = true

Details:CooltipPreset (2.1)
GameCooltip:SetOption ("FixedWidth", 180)
GameCooltip:SetOption("FixedWidth", 180)
GameCooltip:AddFromTable (unSnapButtonTooltip)

GameCooltip:ShowCooltip (self, "tooltip")
Expand Down Expand Up @@ -4562,7 +4561,7 @@ local fast_ps_func = function (self)

local combatTime = instance.showing:GetCombatTime()
local abbreviationType = Details.ps_abbreviation
local abbreviationFunc = tok_functions[abbreviationType]
local abbreviationFunc = tokFunctions[abbreviationType]

local isInLineTextEnabled = instance.use_multi_fontstrings
local instanceShowDataSettings = instance.row_info.textR_show_data
Expand Down Expand Up @@ -5968,7 +5967,7 @@ local OnClickNovoMenu = function (_, _, id, instance)
end

function Details:SetTooltipMinWidth()
GameCooltip:SetOption ("MinWidth", 155)
GameCooltip:SetOption("MinWidth", 155)
end

function Details:FormatCooltipBackdrop()
Expand Down Expand Up @@ -6117,8 +6116,8 @@ local build_mode_list = function(self, deltaTime)
end
end

gameCooltip:SetOption ("TextSize", Details.font_sizes.menus)
gameCooltip:SetOption ("TextFont", Details.font_faces.menus)
gameCooltip:SetOption("TextSize", Details.font_sizes.menus)
gameCooltip:SetOption("TextFont", Details.font_faces.menus)
end
end

Expand Down Expand Up @@ -6946,20 +6945,20 @@ local buildSegmentTooltip = function(self, deltaTime)

Details:SetMenuOwner (self, instance)

gameCooltip:SetOption ("TextSize", Details.font_sizes.menus)
gameCooltip:SetOption ("TextFont", Details.font_faces.menus)
gameCooltip:SetOption("TextSize", Details.font_sizes.menus)
gameCooltip:SetOption("TextFont", Details.font_faces.menus)

gameCooltip:SetOption ("SubMenuIsTooltip", true)
gameCooltip:SetOption("SubMenuIsTooltip", true)

gameCooltip:SetOption ("ButtonHeightMod", -4)
gameCooltip:SetOption ("ButtonsYMod", -10)
gameCooltip:SetOption ("YSpacingMod", 1)
gameCooltip:SetOption("ButtonHeightMod", -4)
gameCooltip:SetOption("ButtonsYMod", -10)
gameCooltip:SetOption("YSpacingMod", 1)

gameCooltip:SetOption ("ButtonHeightModSub", 4)
gameCooltip:SetOption ("ButtonsYModSub", 0)
gameCooltip:SetOption ("YSpacingModSub", -4)
gameCooltip:SetOption("ButtonHeightModSub", 4)
gameCooltip:SetOption("ButtonsYModSub", 0)
gameCooltip:SetOption("YSpacingModSub", -4)

gameCooltip:SetOption ("HeighMod", 12)
gameCooltip:SetOption("HeighMod", 12)

Details:SetTooltipMinWidth()

Expand Down Expand Up @@ -8985,41 +8984,41 @@ end
local instancia = self._instance or self.widget._instance
local baseframe = instancia.baseframe

local GameCooltip = GameCooltip
local gameCooltip = GameCooltip

OnEnterMainWindow (self.instance, self)
GameCooltip.buttonOver = true
OnEnterMainWindow(self.instance, self)
gameCooltip.buttonOver = true
self.instance.baseframe.cabecalho.button_mouse_over = true

if (self.instance.desaturated_menu) then
self:GetNormalTexture():SetDesaturated (false)
end

GameCooltip:Reset()
GameCooltip:SetType ("menu")
gameCooltip:Reset()
gameCooltip:SetType ("menu")

GameCooltip:SetOption ("ButtonsYMod", -6)
GameCooltip:SetOption ("HeighMod", 6)
GameCooltip:SetOption ("YSpacingMod", -3)
GameCooltip:SetOption ("TextHeightMod", 0)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
gameCooltip:SetOption("ButtonsYMod", -6)
gameCooltip:SetOption("HeighMod", 6)
gameCooltip:SetOption("YSpacingMod", -3)
gameCooltip:SetOption("TextHeightMod", 0)
gameCooltip:SetOption("IgnoreButtonAutoHeight", false)

Details:SetTooltipMinWidth()

GameCooltip:AddLine(Loc["STRING_ERASE_DATA_OVERALL"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
GameCooltip:AddIcon([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "orange")
GameCooltip:AddMenu(1, Details.tabela_historico.resetar_overall)
gameCooltip:AddLine(Loc["STRING_ERASE_DATA_OVERALL"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
gameCooltip:AddIcon([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "orange")
gameCooltip:AddMenu(1, Details.tabela_historico.resetar_overall)

GameCooltip:AddLine("$div", nil, 1, nil, -5, -11)
gameCooltip:AddLine("$div", nil, 1, nil, -5, -11)

GameCooltip:AddLine(Loc["STRING_ERASE_DATA"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
GameCooltip:AddIcon([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "red")
GameCooltip:AddMenu(1, Details.tabela_historico.resetar)
gameCooltip:AddLine(Loc["STRING_ERASE_DATA"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
gameCooltip:AddIcon([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "red")
gameCooltip:AddMenu(1, Details.tabela_historico.resetar)

show_anti_overlap (self.instance, self, "top")

Details:SetMenuOwner (self, self.instance)
GameCooltip:ShowCooltip()
gameCooltip:ShowCooltip()
end

local reset_button_onleave = function (self)
Expand Down Expand Up @@ -9096,19 +9095,19 @@ end

GameCooltip:Reset()
GameCooltip:SetType ("menu")
GameCooltip:SetOption ("ButtonsYMod", -7)
GameCooltip:SetOption ("ButtonsYModSub", -2)
GameCooltip:SetOption ("YSpacingMod", 0)
GameCooltip:SetOption ("YSpacingModSub", -3)
GameCooltip:SetOption ("TextHeightMod", 0)
GameCooltip:SetOption ("TextHeightModSub", 0)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
GameCooltip:SetOption ("IgnoreButtonAutoHeightSub", false)
GameCooltip:SetOption ("SubMenuIsTooltip", true)
GameCooltip:SetOption ("FixedWidthSub", 180)
--GameCooltip:SetOption ("FixedHeight", 30)

GameCooltip:SetOption ("HeighMod", 9)
GameCooltip:SetOption("ButtonsYMod", -7)
GameCooltip:SetOption("ButtonsYModSub", -2)
GameCooltip:SetOption("YSpacingMod", 0)
GameCooltip:SetOption("YSpacingModSub", -3)
GameCooltip:SetOption("TextHeightMod", 0)
GameCooltip:SetOption("TextHeightModSub", 0)
GameCooltip:SetOption("IgnoreButtonAutoHeight", false)
GameCooltip:SetOption("IgnoreButtonAutoHeightSub", false)
GameCooltip:SetOption("SubMenuIsTooltip", true)
GameCooltip:SetOption("FixedWidthSub", 180)
--GameCooltip:SetOption("FixedHeight", 30)

GameCooltip:SetOption("HeighMod", 9)

local font = SharedMedia:Fetch ("font", "Friz Quadrata TT")
GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
Expand Down Expand Up @@ -9187,11 +9186,11 @@ local report_on_enter = function (self, motion, forced, from_click)
GameCooltip:Reset()

GameCooltip:SetType ("menu")
GameCooltip:SetOption ("ButtonsYMod", -6)
GameCooltip:SetOption ("HeighMod", 6)
GameCooltip:SetOption ("YSpacingMod", -1)
GameCooltip:SetOption ("TextHeightMod", 0)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
GameCooltip:SetOption("ButtonsYMod", -6)
GameCooltip:SetOption("HeighMod", 6)
GameCooltip:SetOption("YSpacingMod", -1)
GameCooltip:SetOption("TextHeightMod", 0)
GameCooltip:SetOption("IgnoreButtonAutoHeight", false)

Details:SetTooltipMinWidth()

Expand Down Expand Up @@ -9287,10 +9286,10 @@ local atributo_on_enter = function (self, motion, forced, from_click)
local have_plugins = Details:MontaRaidOption (instancia)
if (not have_plugins) then
GameCooltip:SetType ("tooltip")
GameCooltip:SetOption ("ButtonsYMod", 0)
GameCooltip:SetOption("ButtonsYMod", 0)

GameCooltip:SetOption ("TextHeightMod", 0)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
GameCooltip:SetOption("TextHeightMod", 0)
GameCooltip:SetOption("IgnoreButtonAutoHeight", false)
GameCooltip:AddLine("All raid plugins already\nin use or disabled.", nil, 1, "white", nil, 10, SharedMedia:Fetch ("font", "Friz Quadrata TT"))
GameCooltip:AddIcon([[Interface\GROUPFRAME\UI-GROUP-ASSISTANTICON]], 1, 1)
GameCooltip:SetWallpaper (1, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true)
Expand All @@ -9299,11 +9298,11 @@ local atributo_on_enter = function (self, motion, forced, from_click)

else
Details:MontaAtributosOption (instancia)
GameCooltip:SetOption ("YSpacingMod", -1)
GameCooltip:SetOption ("YSpacingModSub", -2)
GameCooltip:SetOption("YSpacingMod", -1)
GameCooltip:SetOption("YSpacingModSub", -2)
end

GameCooltip:SetOption ("TextSize", Details.font_sizes.menus)
GameCooltip:SetOption("TextSize", Details.font_sizes.menus)

Details:SetMenuOwner (self, instancia)

Expand Down
Loading

0 comments on commit 11aa42e

Please sign in to comment.