From e449983e0c2aa8339726fcb33666fcbca2a6b3fe Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sat, 8 Oct 2022 11:22:36 -0300 Subject: [PATCH] small adjustments and bug fixes --- Libs/DF/fw.lua | 2 +- Libs/DF/label.lua | 13 +- Libs/DF/languages.lua | 154 ++++++++++++++++++++-- Libs/LibOpenRaid/GetPlayerInformation.lua | 8 +- Libs/LibOpenRaid/LibOpenRaid.lua | 2 +- boot.lua | 12 +- classes/class_instance.lua | 18 +-- core/gears.lua | 51 ++++++- core/network.lua | 5 +- core/parser.lua | 5 +- core/windows.lua | 5 + frames/window_main.lua | 65 +++++---- frames/window_options2_sections.lua | 2 +- functions/skins.lua | 18 +-- functions/slash.lua | 33 ++++- images/white_gradient.tga | Bin 0 -> 65580 bytes 16 files changed, 314 insertions(+), 79 deletions(-) create mode 100644 images/white_gradient.tga diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 48502d9d..0fdfc7fb 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 376 +local dversion = 377 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) diff --git a/Libs/DF/label.lua b/Libs/DF/label.lua index 36e94fa4..40f6337d 100644 --- a/Libs/DF/label.lua +++ b/Libs/DF/label.lua @@ -304,7 +304,18 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.SetPointMixin) end end - labelObject.label:SetText(text) + --if the text is a table, it means a language table has been passed + if (type(text) == "table") then + local locTable = text + if (detailsFramework.Language.IsLocTable(locTable)) then + detailsFramework.Language.SetTextWithLocTable(labelObject.widget, locTable) + else + labelObject.label:SetText(text) + end + else + labelObject.label:SetText(text) + end + labelObject.label:SetJustifyH("left") if (color) then diff --git a/Libs/DF/languages.lua b/Libs/DF/languages.lua index a3026ac2..1ae01e45 100644 --- a/Libs/DF/languages.lua +++ b/Libs/DF/languages.lua @@ -1,7 +1,9 @@ --todo: need to send a callback when setting a new language, this will be used by the volatile menu to refresh the menu --[=[ - DetailsFramework.Language.Register(addonId, languageId[, gameLanguageOnly]) + namespace = DetailsFramework.Language = DetailsFramework.Language.Register() + + Register(addonId, languageId[, gameLanguageOnly]) create a language table within an addon namespace @addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater @languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other value if 'gameLanguageOnly' is false (default) @@ -17,7 +19,7 @@ local newLanguageTable = DetailsFramework.Language.Register(_G.Details, "valyrianValyria", false) newLanguageTable["STRING_MY_PHRASE"] = "ñuha udrir" - DetailsFramework.Language.GetLanguageTable(addonId[, languageId]) + GetLanguageTable(addonId[, languageId]) get the languageTable for the requested languageId within the addon namespace if languageId is not passed, uses the current language set for the addonId the default languageId for the addon is the first language registered with DetailsFramework.Language.Register() @@ -34,19 +36,19 @@ local languageTable = DetailsFramework.Language.GetLanguageTable("Details", "valyrianValyria") fontString:SetText(languageTable["STRING_MY_PHRASE"]) - DetailsFramework.Language.GetText(addonId, phraseId[, silent]) + GetText(addonId, phraseId[, silent]) get a text from a registered addonId and phraseId @addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater @phraseId: any string to identify the a translated text, example: phraseId: "OPTIONS_FRAME_WIDTH" text: "Adjust the Width of the frame." @silent: if true won't error on invalid phrase text and instead use the phraseId as the text, it will still error on invalid addonId - DetailsFramework.Language.SetCurrentLanguage(addonId, languageId) + SetCurrentLanguage(addonId, languageId) set the language used by default when retriving a languageTable with DF.Language.GetLanguageTable() and not passing the second argument (languageId) within the call use this in combination with a savedVariable to use a language of the user choice @addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater @languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other value if 'gameLanguageOnly' is false (default) - DetailsFramework.Language.RegisterObject(addonId, object, phraseId[, silent[, ...]]) + RegisterObject(addonId, object, phraseId[, silent[, ...]]) to be registered, the Object need to have a SetText method when setting a languageId with DetailsFramework.Language.SetCurrentLanguage(), automatically change the text of all registered Objects @addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater @@ -55,7 +57,7 @@ @silent: if true won't error on invalid phrase text and instead use the phraseId as the text, it will still error on invalid addonId and Object @vararg: arguments to pass for format(text, ...) - DetailsFramework.Language.UpdateObjectArguments(addonId, object, ...) + UpdateObjectArguments(addonId, object, ...) update the arguments (...) of a registered Object, if no argument passed it'll erase the arguments previously set the Object need to be already registered with DetailsFramework.Language.RegisterObject() the font string text will be changed to update the text with the new arguments @@ -63,7 +65,7 @@ @object: any UIObject or table with SetText method @vararg: arguments to pass for format(text, ...) - DetailsFramework.Language.RegisterTableKey(addonId, table, key, phraseId[, silent[, ...]]) + RegisterTableKey(addonId, table, key, phraseId[, silent[, ...]]) when setting a languageId with DetailsFramework.Language.SetCurrentLanguage(), automatically change the text of all registered tables, table[key] = 'new translated text' @addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater @table: a lua table @@ -72,19 +74,27 @@ @silent: if true won't error on invalid phrase text or table already registered, it will still error on invalid addonId, table, key and phraseId @vararg: arguments to pass for format(text, ...) - DetailsFramework.Language.UpdateTableKeyArguments(addonId, table, key, ...) + UpdateTableKeyArguments(addonId, table, key, ...) same as UpdateObjectArguments() but for table keys @addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater @table: a lua table @key: any value except nil or boolean @vararg: arguments to pass for format(text, ...) - DetailsFramework.Language.RegisterObjectWithDefault(addonId, object, phraseId, defaultText[, ...]) + RegisterObjectWithDefault(addonId, object, phraseId, defaultText[, ...]) (helper function) register an object if a phraseID is valid or object:SetText(defaultText) is called - DetailsFramework.Language.RegisterTableKeyWithDefault(addonId, table, key, phraseId, defaultText[, ...]) + RegisterTableKeyWithDefault(addonId, table, key, phraseId, defaultText[, ...]) (helper function) register a tableKey if a phraseID is valid or table[key] = defaultText + CreateLocTable(addonId, phraseId, shouldRegister[, ...]) + make a table to pass instead of the text while using DetailsFramework widgets + this avoid to call the register object function right after creating the widget + also make easy to register the same phraseID in many different widgets + + SetTextWithLocTable(object, locTable) + set the text of an object using a locTable, the object need the method SetText + --]=] local DF = _G["DetailsFramework"] @@ -92,6 +102,10 @@ if (not DF or not DetailsFrameworkCanLoad) then return end +local format = string.format +local unpack = table.unpack or unpack +local GetLocale = _G.GetLocale + local CONST_LANGAGEID_ENUS = "enUS" local supportedGameLanguages = { @@ -123,6 +137,13 @@ local functionSignature = { ["RegisterObjectWithDefault"] = "RegisterObjectWithDefault(addonId, object, phraseId, defaultText[, ...])", ["RegisterTableKeyWithDefault"] = "RegisterTableKeyWithDefault(addonId, table, key, phraseId, defaultText[, ...])", + + ["CreateLocTable"] = "CreateLocTable(addonId, phraseId, shouldRegister[, ...])", + ["UnpackLocTable"] = "UnpackLocTable(locTable)", + ["CanRegisterLocTable"] = "CanRegisterLocTable(locTable)", + ["RegisterObjectWithLocTable"] = "RegisterObjectWithLocTable(object, locTable)", + ["SetTextWithLocTable"] = "SetTextWithLocTable(object, locTable)", + ["IsLocTable"] = "IsLocTable(locTable)", } local functionCallPath = { @@ -138,10 +159,18 @@ local functionCallPath = { ["RegisterObjectWithDefault"] = "DetailsFramework.Language.RegisterObjectWithDefault", ["RegisterTableKeyWithDefault"] = "DetailsFramework.Language.RegisterTableKeyWithDefault", + + ["CreateLocTable"] = "DetailsFramework.Language.CreateLocTable", + ["UnpackLocTable"] = "DetailsFramework.Language.UnpackLocTable", + ["CanRegisterLocTable"] = "DetailsFramework.Language.CanRegisterLocTable", + ["RegisterObjectWithLocTable"] = "DetailsFramework.Language.RegisterObjectWithLocTable", + ["SetTextWithLocTable"] = "DetailsFramework.Language.SetTextWithLocTable", + ["IsLocTable"] = "DetailsFramework.Language.IsLocTable", } local errorText = { ["AddonID"] = "require a valid addonID (table or string) on #%d argument", + ["AddonIDInvalidOrNotRegistered"] = "invalid addonID or no languages registered", ["LanguageID"] = "require a languageID supported by the game on #%d argument", ["PhraseID"] = "require a string on #%d argument", ["NoLanguages"] = "no languages registered for addonId", @@ -154,6 +183,8 @@ local errorText = { ["InvalidTable"] = "require a table on #%d argument", ["InvalidTableKey"] = "require a table key on #%d argument", ["TableKeyAlreadyRegistered"] = "table already registered", --not in use + ["InvalidLocTable"] = "invalid locTable on #%d argument", + ["LocTableCantRegister"] = "cannot register object, locTable.register == false", } @@ -743,4 +774,107 @@ function DF.Language.RegisterObjectWithDefault(addonId, object, phraseId, defaul else object:SetText(defaultText) end +end + + +function DF.Language.CreateLocTable(addonId, phraseId, shouldRegister, ...) + if (not isValid_AddonID(addonId)) then + error(functionCallPath["CreateLocTable"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["CreateLocTable"] .. ".") + end + + if (not isValid_PhraseID(phraseId)) then + error(functionCallPath["CreateLocTable"] .. ": " .. format(errorText["PhraseID"], 2) .. ", use: " .. functionSignature["CreateLocTable"] .. ".") + end + + local newLocTable = { + addonId = addonId, + phraseId = phraseId, + shouldRegister = shouldRegister, + arguments = parseArguments(...), + } + + return newLocTable +end + +function DF.Language.IsLocTable(locTable) + if (type(locTable) ~= "table") then + return false + + elseif (locTable.addonId and locTable.phraseId) then + return true + end + + return false +end + + +function DF.Language.CanRegisterLocTable(locTable) + if (not DF.Language.IsLocTable(locTable)) then + error(functionCallPath["CanRegisterLocTable"] .. ": " .. format(errorText["InvalidLocTable"], 1) .. ", use: " .. functionSignature["CanRegisterLocTable"] .. ".") + end + return locTable.shouldRegister +end + + +function DF.Language.UnpackLocTable(locTable) + if (type(locTable) ~= "table") then + error(functionCallPath["UnpackLocTable"] .. ": " .. format(errorText["InvalidLocTable"], 1) .. ", use: " .. functionSignature["UnpackLocTable"] .. ".") + end + return locTable.addonId, locTable.phraseId, locTable.shouldRegister or false, locTable.arguments +end + + +function DF.Language.RegisterObjectWithLocTable(object, locTable) + if (not isValid_Object(object)) then + error(functionCallPath["RegisterObjectWithLocTable"] .. ": " .. format(errorText["InvalidObject"], 1) .. ", use: " .. functionSignature["RegisterObjectWithLocTable"] .. ".") + end + + if (not DF.Language.IsLocTable(locTable)) then + error(functionCallPath["RegisterObjectWithLocTable"] .. ": " .. format(errorText["InvalidLocTable"], 2) .. ", use: " .. functionSignature["RegisterObjectWithLocTable"] .. ".") + end + + local addonId, phraseId, shouldRegister, arguments = DF.Language.UnpackLocTable(locTable) + + if (not isValid_AddonID(addonId)) then + error(functionCallPath["RegisterObjectWithLocTable"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["RegisterObjectWithLocTable"] .. ".") + end + + if (not isValid_PhraseID(phraseId)) then + error(functionCallPath["RegisterObjectWithLocTable"] .. ": " .. format(errorText["PhraseID"], 2) .. ", use: " .. functionSignature["RegisterObjectWithLocTable"] .. ".") + end + + if (not shouldRegister) then + error(functionCallPath["RegisterObjectWithLocTable"] .. ": " .. errorText["LocTableCantRegister"] .. ", use: " .. functionSignature["RegisterObjectWithLocTable"] .. ".") + end + + DF.Language.RegisterObject(addonId, object, phraseId, true, arguments and unpack(arguments)) +end + + +function DF.Language.SetTextWithLocTable(object, locTable) + if (not isValid_Object(object)) then + error(functionCallPath["SetTextWithLocTable"] .. ": " .. format(errorText["InvalidObject"], 1) .. ", use: " .. functionSignature["SetTextWithLocTable"] .. ".") + end + + if (not DF.Language.IsLocTable(locTable)) then + error(functionCallPath["SetTextWithLocTable"] .. ": " .. format(errorText["InvalidLocTable"], 2) .. ", use: " .. functionSignature["SetTextWithLocTable"] .. ".") + end + + local addonId, phraseId, shouldRegister, arguments = DF.Language.UnpackLocTable(locTable) + + local addonNamespaceTable = getAddonNamespace(addonId) + if (not addonNamespaceTable) then + error(functionCallPath["SetTextWithLocTable"] .. ": " .. errorText["AddonIDInvalidOrNotRegistered"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".") + end + + if (DF.Language.CanRegisterLocTable(locTable)) then + DF.Language.RegisterObjectWithLocTable(object, locTable) + return true + end + + local text = getText(addonNamespaceTable, phraseId) + + --can use the locTable instead of the phraseInfoTable because both has the .arguments member + setObject_Text(object, locTable, text) + return true end \ No newline at end of file diff --git a/Libs/LibOpenRaid/GetPlayerInformation.lua b/Libs/LibOpenRaid/GetPlayerInformation.lua index b702fe1f..33750d8f 100644 --- a/Libs/LibOpenRaid/GetPlayerInformation.lua +++ b/Libs/LibOpenRaid/GetPlayerInformation.lua @@ -28,16 +28,16 @@ end function openRaidLib.GetTalentVersion() local _, _, _, buildInfo = GetBuildInfo() - local gamePatch = buildInfo / 10000 - if (gamePatch >= 1 and gamePatch <= 4) then --vanilla tbc wotlk cataclysm + + if (buildInfo >= 1 and buildInfo <= 40000) then --vanilla tbc wotlk cataclysm return CONST_TALENT_VERSION_CLASSIC end - if (gamePatch >= 7 and gamePatch <= 9) then --legion bfa shadowlands + if (buildInfo >= 70000 and buildInfo <= 100000) then --legion bfa shadowlands return CONST_TALENT_VERSION_LEGION end - if (gamePatch >= 10 and gamePatch <= 20) then --dragonflight + if (buildInfo >= 100000 and buildInfo <= 200000) then --dragonflight return CONST_TALENT_VERSION_DRAGONFLIGHT end end diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index 5d3f4e75..c1083f83 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -63,7 +63,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t end local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 58 +local CONST_LIB_VERSION = 59 LIB_OPEN_RAID_CAN_LOAD = false --declae the library within the LibStub diff --git a/boot.lua b/boot.lua index 0de229f4..c5625f67 100644 --- a/boot.lua +++ b/boot.lua @@ -2,12 +2,12 @@ --> global name declaration _ = nil - _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") + _G._detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 10033 - _detalhes.alpha_build_counter = 10033 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 10129 + _detalhes.alpha_build_counter = 10129 --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 @@ -845,7 +845,11 @@ do function Details.SendHighFive() Details.users = {{UnitName("player"), GetRealmName(), (Details.userversion or "") .. " (" .. Details.APIVersion .. ")"}} Details.sent_highfive = GetTime() - Details:SendRaidData (Details.network.ids.HIGHFIVE_REQUEST) + if (IsInRaid()) then + Details:SendRaidData(Details.network.ids.HIGHFIVE_REQUEST) + else + Details:SendPartyData(Details.network.ids.HIGHFIVE_REQUEST) + end end ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/classes/class_instance.lua b/classes/class_instance.lua index bd06f625..6f472901 100644 --- a/classes/class_instance.lua +++ b/classes/class_instance.lua @@ -1924,29 +1924,29 @@ end ------------------------------------------------------------------------------------------------------------------------ -function _detalhes:InstanceReset (instance) +function _detalhes:InstanceReset(instance) if (instance) then self = instance end - Details.FadeHandler.Fader (self, "in", nil, "barras") - self:AtualizaSegmentos (self) + + Details.FadeHandler.Fader(self, "in", nil, "barras") + self:AtualizaSegmentos(self) self:AtualizaSoloMode_AfertReset() self:ResetaGump() - + if (not _detalhes.initializing) then - _detalhes:RefreshMainWindow (self, true) --atualiza todas as instancias + _detalhes:RefreshMainWindow(self, true) --atualiza todas as instancias end end -function _detalhes:RefreshBars (instance) +function _detalhes:RefreshBars(instance) if (instance) then self = instance end - self:InstanceRefreshRows (instancia) + self:InstanceRefreshRows(instance) end -function _detalhes:SetBackgroundColor (...) - +function _detalhes:SetBackgroundColor(...) local red = select (1, ...) if (not red) then self.bgdisplay:SetBackdropColor (self.bg_r, self.bg_g, self.bg_b, self.bg_alpha) diff --git a/core/gears.lua b/core/gears.lua index fc51b47a..ede5d2a6 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -3044,4 +3044,53 @@ local timePlayerFrame = CreateFrame("frame") timePlayerFrame:RegisterEvent("TIME_PLAYED_MSG") timePlayerFrame:SetScript("OnEvent", function() --C_Timer.After(0, function() print(Details.GetPlayTimeOnClassString()) end) -end) \ No newline at end of file +end) + +local stutterCounter = 0 +local UpdateAddOnMemoryUsage_Original = _G.UpdateAddOnMemoryUsage +_G["UpdateAddOnMemoryUsage"] = function() + local currentTime = debugprofilestop() + UpdateAddOnMemoryUsage_Original() + local deltaTime = debugprofilestop() - currentTime + + if (deltaTime > 16) then + local callStack = debugstack(2, 0, 4) + --ignore if is coming from the micro menu tooltip + if (callStack:find("MainMenuBarPerformanceBarFrame_OnEnter")) then + return + end + + stutterCounter = stutterCounter + 1 + local stutterDegree = 0 + if (stutterCounter > 60) then + if (deltaTime < 48) then + Details:Msg("some addon may be causing small framerate stuttering, use '/details perf' to know more.") + stutterDegree = 1 + + elseif (deltaTime <= 100) then + Details:Msg("some addon may be causing framerate drops, use '/details perf' to know more.") + stutterDegree = 2 + + else + Details:Msg("some addon might be causing performance issues, use '/details perf' to know more.") + stutterDegree = 3 + end + + stutterCounter = 0 + end + + Details.performanceData = { + deltaTime = deltaTime, + callStack = callStack, + culpritFunc = "_G.UpdateAddOnMemoryUsage()", + culpritDesc = "Calculates memory usage of addons", + } + end +end + +Details.performanceData = { + deltaTime = 0, + callStack = "", + culpritFunc = "", + culpritDesc = "", +} \ No newline at end of file diff --git a/core/network.lua b/core/network.lua index 8223c2ee..4b9a1d60 100644 --- a/core/network.lua +++ b/core/network.lua @@ -435,6 +435,9 @@ --> register comm function Details:CommReceived(commPrefix, data, channel, source) + + --print("comm", source, data) + local deserializedTable = {Details:Deserialize(data)} if (not deserializedTable[1]) then if (Details.debugnet) then @@ -448,7 +451,7 @@ player = source if (Details.debugnet) then - Details:Msg("(debug) network received prefix:", prefix, "length:", string.len(data)) + Details:Msg("(debug) network received prefix:", prefix, "length:", string.len(data), source) end if (type(prefix) ~= "string") then diff --git a/core/parser.lua b/core/parser.lua index e06a3c66..bdd7412d 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -413,7 +413,7 @@ ignore_spikeballs = 0, } - local NPCID_KELTHUZAD_ADDMIMICPLAYERS = 176605 + local NPCID_KELTHUZAD_ADDMIMICPLAYERS = 176605 --> damage spells to ignore local damage_spells_to_ignore = { @@ -421,8 +421,9 @@ --it is not useful for damage done or friendly fire [SPELLID_WARLOCK_SOULLINK] = true, [371597] = true, --Protoform Barrier gotten from an SPELL_ABSORBED cleu event + [371701] = true, --Protoform Barrier } - + --> expose the ignore spells table to external scripts _detalhes.SpellsToIgnore = damage_spells_to_ignore diff --git a/core/windows.lua b/core/windows.lua index b8607532..36207ba8 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -1676,6 +1676,11 @@ function Details.ShowCopyValueFrame(textToShow) frame.editBox:ClearFocus() frame:Hide() end) + + frame.editBox:SetScript("OnChar", function() + frame.editBox:ClearFocus() + frame:Hide() + end) end DetailsCopyValueFrame:Show() diff --git a/frames/window_main.lua b/frames/window_main.lua index a0bc530d..1c811ef5 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -5346,63 +5346,60 @@ function Details:InstanceAlpha (alpha) self.baseframe.UPFrame:SetAlpha (alpha) end -function Details:InstanceColor (red, green, blue, alpha, no_save, change_statusbar) - +function Details:InstanceColor(red, green, blue, alpha, noSave, changeStatusbar) if (not red) then red, green, blue, alpha = unpack(self.color) - no_save = true + noSave = true end - if (type (red) ~= "number") then - red, green, blue, alpha = gump:ParseColors (red) + if (type(red) ~= "number") then + red, green, blue, alpha = gump:ParseColors(red) end - if (not no_save) then - --> saving - self.color [1] = red - self.color [2] = green - self.color [3] = blue - self.color [4] = alpha - if (change_statusbar) then - self:StatusBarColor (red, green, blue, alpha) + if (not noSave) then + --saving + self.color[1] = red + self.color[2] = green + self.color[3] = blue + self.color[4] = alpha + if (changeStatusbar) then + self:StatusBarColor(red, green, blue, alpha) end else - --> not saving - self:StatusBarColor (nil, nil, nil, alpha, true) + --not saving + self:StatusBarColor(nil, nil, nil, alpha, true) end - local skin = Details.skins [self.skin] + local skin = Details.skins[self.skin] if (not skin) then --the skin isn't available any more --put the skin into wait to install local tempSkin = self:WaitForSkin() skin = tempSkin end - self.baseframe.cabecalho.ball_r:SetVertexColor (red, green, blue) - self.baseframe.cabecalho.ball_r:SetAlpha (alpha) + self.baseframe.cabecalho.ball_r:SetVertexColor(red, green, blue) + self.baseframe.cabecalho.ball_r:SetAlpha(alpha) - self.baseframe.cabecalho.ball:SetVertexColor (red, green, blue) - self.baseframe.cabecalho.ball:SetAlpha (alpha) + self.baseframe.cabecalho.ball:SetVertexColor(red, green, blue) + self.baseframe.cabecalho.ball:SetAlpha(alpha) if (not skin.icon_ignore_alpha) then - self.baseframe.cabecalho.atributo_icon:SetAlpha (alpha) + self.baseframe.cabecalho.atributo_icon:SetAlpha(alpha) end - self.baseframe.cabecalho.emenda:SetVertexColor (red, green, blue) - self.baseframe.cabecalho.emenda:SetAlpha (alpha) - self.baseframe.cabecalho.top_bg:SetVertexColor (red, green, blue) - self.baseframe.cabecalho.top_bg:SetAlpha (alpha) + self.baseframe.cabecalho.emenda:SetVertexColor(red, green, blue) + self.baseframe.cabecalho.emenda:SetAlpha(alpha) + self.baseframe.cabecalho.top_bg:SetVertexColor(red, green, blue) + self.baseframe.cabecalho.top_bg:SetAlpha(alpha) - self.baseframe.barra_esquerda:SetVertexColor (red, green, blue) - self.baseframe.barra_esquerda:SetAlpha (alpha) - self.baseframe.barra_direita:SetVertexColor (red, green, blue) - self.baseframe.barra_direita:SetAlpha (alpha) - self.baseframe.barra_fundo:SetVertexColor (red, green, blue) - self.baseframe.barra_fundo:SetAlpha (alpha) + self.baseframe.barra_esquerda:SetVertexColor(red, green, blue) + self.baseframe.barra_esquerda:SetAlpha(alpha) + self.baseframe.barra_direita:SetVertexColor(red, green, blue) + self.baseframe.barra_direita:SetAlpha(alpha) + self.baseframe.barra_fundo:SetVertexColor(red, green, blue) + self.baseframe.barra_fundo:SetAlpha(alpha) - self.baseframe.UPFrame:SetAlpha (alpha) - - --self.color[1], self.color[2], self.color[3], self.color[4] = red, green, blue, alpha + self.baseframe.UPFrame:SetAlpha(alpha) end function Details:StatusBarAlertTime (instance) diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index d2acfa58..05086e4d 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -2847,7 +2847,7 @@ do desc = Loc ["STRING_OPTIONS_SHOW_SIDEBARS_DESC"], }, - {--background color + {--row's area color type = "color", get = function() return {currentInstance.bg_r, currentInstance.bg_g, currentInstance.bg_b, currentInstance.bg_alpha} diff --git a/functions/skins.lua b/functions/skins.lua index 8b98d779..3d4323c7 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -337,7 +337,7 @@ local _ icon_point_anchor_bottom = {-37, 12}, left_corner_anchor_bottom = {-107, 0}, right_corner_anchor_bottom = {96, 0}, - + icon_on_top = true, icon_ignore_alpha = true, icon_titletext_position = {3, 3}, @@ -346,20 +346,20 @@ local _ menu_icons_alpha = 0.92, ["menu_icons_size"] = 0.82, ["color"] = { - 0.086274512112141, -- [1] - 0.086274512112141, -- [2] - 0.086274512112141, -- [3] - 0.84036460518837, -- [4] + 0.1215, + 0.1176, + 0.1294, + 0.91, }, ["menu_anchor"] = { 20, 0, ["side"] = 2, }, - ["bg_r"] = 0.2039215862751, - ["bg_g"] = 0.19607844948769, - ["bg_b"] = 0.2039215862751, - ["bg_alpha"] = 0.49454617500305, + ["bg_r"] = 0.243, + ["bg_g"] = 0.2352, + ["bg_b"] = 0.2588, + ["bg_alpha"] = 0.6, ["color_buttons"] = { 1, -- [1] 1, -- [2] diff --git a/functions/slash.lua b/functions/slash.lua index 8f80b8b4..c2097086 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -63,7 +63,36 @@ function SlashCmdList.DETAILS (msg, editbox) else _detalhes:ShutDownAllInstances() end - + + elseif (command == "perf") then + local performanceData = Details.performanceData + local framesLost = ceil(performanceData.deltaTime / 60) + local callStack = performanceData.callStack + + local returnTable = {} + + returnTable[#returnTable+1] = "Stuttering Information:" + returnTable[#returnTable+1] = "An addon feature, script is using: " .. performanceData.culpritFunc .. "" + + returnTable[#returnTable+1] = "" + + returnTable[#returnTable+1] = "Description: " .. performanceData.culpritDesc + + returnTable[#returnTable+1] = "" + + returnTable[#returnTable+1] = "You may first: disable the addon feature that uses the functionality." + returnTable[#returnTable+1] = "Second: disable a script which are using the function call: " .. performanceData.culpritFunc .. "." + + returnTable[#returnTable+1] = "" + + returnTable[#returnTable+1] = "Callstack for Debug:" + local callStackTable = DetailsFramework:SplitTextInLines(callStack) + for i = 1, #callStackTable do + returnTable[#returnTable+1] = callStackTable[i] + end + + dumpt(returnTable) + elseif (command == "softhide") then for instanceID, instance in _detalhes:ListInstances() do if (instance:IsEnabled()) then @@ -1687,6 +1716,8 @@ function SlashCmdList.DETAILS (msg, editbox) print ("|cffffaeae/details|r |cffffff33" .. "spells" .. "|r: list of spells already saw.") --localize-me print("|cFFFFFF00DETAILS! VERSION|r:|cFFFFAA00" .. " " .. Details.GetVersionString()) + print ("|cffffaeae/details|r |cffffff33" .. "version" .. "|r: copy version.") + end end diff --git a/images/white_gradient.tga b/images/white_gradient.tga new file mode 100644 index 0000000000000000000000000000000000000000..54be16ba425bc40a14117a25b35ce30522309f1f GIT binary patch literal 65580 zcmeIu-)7eV0Kn1j_9R{Irai;R%5VCot(g%cqKh$NL_`-6V~i0ob`cRHBF2b_h=>s} zW<xYUKAany8ZJ!y#ejkAz!?S%WC#9Wz(983HwFx32Tn0yAUkk^ z0R!2AV+e4`{J?;L?7$HQ3}gomF<>A&aDV{=*@5pEFpwSih5-ZF zfqe`Z$PRqPfPw757YrE44t&Odf$YF13>e4`e8hl(?7#;M7|0I1$AE$Cz#aw+WCwOJ zU?4m24g&_V18*^4AUp5|0|v4KI~XvK9e9la1KELB7%-3>c!>c6*@0~g7|0H6VZcCk z-~|Q@WCxyOz(96j69Wda0~;7HkR4dZfPw758U_qx2cBWTKz86M1`K2eo?yU0cHl7v z3}go$VZcCk;2{PKWCvC;U?4m200RcH11lIXkR4dYfPw75eGC}L4&1|lf$YFt3>e4` zEMdSvcHj;M3}gouF<>A&FpmKP*@0OM7|0IX#DIb9z%>jQ$PUb4z(9833I+^h2QFd2 hKz3jX0|v4K!+&$PZcopTW=A)!UtG96x;i~M`~%~57WDuC literal 0 HcmV?d00001