diff --git a/Details.toc b/Details.toc index 646a7b563..36e337450 100644 --- a/Details.toc +++ b/Details.toc @@ -44,6 +44,7 @@ functions\report.lua functions\rowanimation.lua functions\raidinfo.lua functions\dungeon.lua +functions\pack.lua core\timemachine.lua diff --git a/boot.lua b/boot.lua index 19a709616..a20eaf1f2 100644 --- a/boot.lua +++ b/boot.lua @@ -4,8 +4,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 7259 - _detalhes.alpha_build_counter = 7259 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 7269 + _detalhes.alpha_build_counter = 7269 --if this is higher than the regular counter, use it instead _detalhes.game_version = "v8.3.0" _detalhes.userversion = "v8.3.0." .. _detalhes.build_counter _detalhes.realversion = 140 --core version, this is used to check API version for scripts and plugins (see alias below) diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index 951022e53..2ec259971 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -1,8 +1,11 @@ -- actor container file local _detalhes = _G._detalhes + local DF = DetailsFramework local _ + local CONST_CLIENT_LANGUAGE = DF.ClientLanguage + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> local pointers @@ -392,15 +395,11 @@ end return nome, dono_do_pet - end + end end - --> check pet owner name with correct declension for ruRU locale + --> check pet owner name with correct declension for ruRU locale (from user 'denis-kam' on github) local find_name_declension = function (petTooltip, playerName) - if (GetLocale() ~= "ruRU") then - return petTooltip:find(playerName) - end - --> 2 - male, 3 - female for gender = 2, 3 do for declensionSet = 1, GetNumDeclensionSets(playerName, gender) do @@ -429,68 +428,50 @@ for playerName, _ in _pairs (_detalhes.tabela_vigente.raid_roster) do local pName = playerName playerName = playerName:gsub ("%-.*", "") --remove realm name - if (find_name_declension(text1, playerName)) then - return find_pet_found_owner (pName, serial, nome, flag, self) + + --if the user client is in russian language + --make an attempt to remove declensions from the character's name + --this is equivalent to remove 's from the owner on enUS + if (CONST_CLIENT_LANGUAGE == "ruRU") then + if (find_name_declension (text1, playerName)) then + return find_pet_found_owner (pName, serial, nome, flag, self) + else + if (text1:find (playerName)) then + return find_pet_found_owner (pName, serial, nome, flag, self) + end + end + else + if (text1:find (playerName)) then + return find_pet_found_owner (pName, serial, nome, flag, self) + end end end end - + local line2 = _G ["DetailsPetOwnerFinderTextLeft3"] local text2 = line2 and line2:GetText() if (text2 and text2 ~= "") then for playerName, _ in _pairs (_detalhes.tabela_vigente.raid_roster) do local pName = playerName playerName = playerName:gsub ("%-.*", "") --remove realm name - if (find_name_declension(text2, playerName)) then - return find_pet_found_owner (pName, serial, nome, flag, self) - end - end - end - end - - --[[ - local find_pet_owner = function (serial, nome, flag, self) - - pet_tooltip_frame:SetOwner (WorldFrame, "ANCHOR_NONE") - pet_tooltip_frame:SetHyperlink ("unit:" .. serial or "") - - local text = pet_text_object:GetText() - if (text and text ~= "") then - text = text:gsub ("'s", "") --> enUS - - if (IsFactionNpc [text]) then - text = follower_text_object:GetText() - if (text) then - text = text:gsub ("'s", "") --> enUS - else - return - end - end - - for _, ownerName in _ipairs ({strsplit (" ", text)}) do - local cur_combat = _detalhes.tabela_vigente - if (cur_combat and cur_combat.raid_roster [ownerName]) then - local ownerGuid = _UnitGUID (ownerName) - if (ownerGuid) then - - _detalhes.tabela_pets:Adicionar (serial, nome, flag, ownerGuid, ownerName, 0x00000417) - local nome_dele, dono_nome, dono_serial, dono_flag = _detalhes.tabela_pets:PegaDono (serial, nome, flag) - - local dono_do_pet - if (nome_dele and dono_nome) then - nome = nome_dele - dono_do_pet = self:PegarCombatente (dono_serial, dono_nome, dono_flag, true, nome) + + if (CONST_CLIENT_LANGUAGE == "ruRU") then + if (find_name_declension (text2, playerName)) then + return find_pet_found_owner (pName, serial, nome, flag, self) + else + if (text2:find (playerName)) then + return find_pet_found_owner (pName, serial, nome, flag, self) end - - --print ("Owner Found:", ownerName, nome) - return nome, dono_do_pet + end + else + if (text2:find (playerName)) then + return find_pet_found_owner (pName, serial, nome, flag, self) end end end end end - --]] - + function container_combatentes:PegarCombatente (serial, nome, flag, criar) --[[statistics]]-- _detalhes.statistics.container_calls = _detalhes.statistics.container_calls + 1 diff --git a/functions/pack.lua b/functions/pack.lua new file mode 100644 index 000000000..e78e57758 --- /dev/null +++ b/functions/pack.lua @@ -0,0 +1,3 @@ + + +local _detalhes = _G._detalhes \ No newline at end of file