Skip to content

Commit

Permalink
General fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 1, 2022
1 parent 05cf037 commit 45a9800
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 74 deletions.
6 changes: 1 addition & 5 deletions Libs/AceAddon-3.0/AceAddon-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
-- end
-- @class file
-- @name AceAddon-3.0.lua
-- @release $Id: AceAddon-3.0.lua 1238 2020-08-28 16:18:42Z nevcairiel $
-- @release $Id: AceAddon-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $

local MAJOR, MINOR = "AceAddon-3.0", 13
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
Expand All @@ -49,10 +49,6 @@ local select, pairs, next, type, unpack = select, pairs, next, type, unpack
local loadstring, assert, error = loadstring, assert, error
local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, IsLoggedIn, geterrorhandler

--[[
xpcall safecall implementation
]]
Expand Down
6 changes: 1 addition & 5 deletions Libs/AceComm-3.0/AceComm-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-- make into AceComm.
-- @class file
-- @name AceComm-3.0
-- @release $Id: AceComm-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceComm-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $

--[[ AceComm-3.0
Expand All @@ -35,10 +35,6 @@ local error, assert = error, assert
-- WoW APIs
local Ambiguate = Ambiguate

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, DEFAULT_CHAT_FRAME, geterrorhandler, RegisterAddonMessagePrefix

AceComm.embeds = AceComm.embeds or {}

-- for my sanity and yours, let's give the message type bytes some names
Expand Down
2 changes: 1 addition & 1 deletion Libs/AceComm-3.0/ChatThrottleLib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ local next = next
local strlen = string.len
local GetFramerate = GetFramerate
local strlower = string.lower
local unpack,type,pairs,wipe = unpack,type,pairs,wipe
local unpack,type,pairs,wipe = unpack,type,pairs,table.wipe
local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty


Expand Down
10 changes: 3 additions & 7 deletions Libs/AceLocale-3.0/AceLocale-3.0.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
-- @class file
-- @name AceLocale-3.0
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
-- @release $Id: AceLocale-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
local MAJOR,MINOR = "AceLocale-3.0", 6

local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
Expand All @@ -12,10 +12,6 @@ if not AceLocale then return end -- no upgrade needed
local assert, tostring, error = assert, tostring, error
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GAME_LOCALE, geterrorhandler

local gameLocale = GetLocale()
if gameLocale == "enGB" then
gameLocale = "enUS"
Expand Down Expand Up @@ -93,7 +89,7 @@ local writedefaultproxy = setmetatable({}, {
function AceLocale:NewLocale(application, locale, isDefault, silent)

-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
local gameLocale = GAME_LOCALE or gameLocale
local activeGameLocale = GAME_LOCALE or gameLocale

local app = AceLocale.apps[application]

Expand All @@ -111,7 +107,7 @@ function AceLocale:NewLocale(application, locale, isDefault, silent)
AceLocale.appnames[app] = application
end

if locale ~= gameLocale and not isDefault then
if locale ~= activeGameLocale and not isDefault then
return -- nop, we don't need these translations
end

Expand Down
12 changes: 6 additions & 6 deletions Libs/AceSerializer-3.0/AceSerializer-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-- make into AceSerializer.
-- @class file
-- @name AceSerializer-3.0
-- @release $Id: AceSerializer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceSerializer-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
local MAJOR,MINOR = "AceSerializer-3.0", 5
local AceSerializer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)

Expand Down Expand Up @@ -83,9 +83,9 @@ local function SerializeValue(v, res, nres)
elseif t=="table" then -- ^T...^t = table (list of key,value pairs)
nres=nres+1
res[nres] = "^T"
for k,v in pairs(v) do
nres = SerializeValue(k, res, nres)
nres = SerializeValue(v, res, nres)
for key,value in pairs(v) do
nres = SerializeValue(key, res, nres)
nres = SerializeValue(value, res, nres)
end
nres=nres+1
res[nres] = "^t"
Expand Down Expand Up @@ -219,12 +219,12 @@ local function DeserializeValue(iter,single,ctl,data)
if ctl=="^t" then break end -- ignore ^t's data
k = DeserializeValue(iter,true,ctl,data)
if k==nil then
error("Invalid AceSerializer table format(no table end marker)")
error("Invalid AceSerializer table format (no table end marker)")
end
ctl,data = iter()
v = DeserializeValue(iter,true,ctl,data)
if v==nil then
error("Invalid AceSerializer table format(no table end marker)")
error("Invalid AceSerializer table format (no table end marker)")
end
res[k]=v
end
Expand Down
10 changes: 5 additions & 5 deletions Libs/AceTimer-3.0/AceTimer-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-- make into AceTimer.
-- @class file
-- @name AceTimer-3.0
-- @release $Id: AceTimer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceTimer-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $

local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
Expand Down Expand Up @@ -61,11 +61,11 @@ local function new(self, loop, func, delay, ...)
-- Compensate delay to get a perfect average delay, even if individual times don't match up perfectly
-- due to fps differences
local time = GetTime()
local delay = timer.delay - (time - timer.ends)
local ndelay = timer.delay - (time - timer.ends)
-- Ensure the delay doesn't go below the threshold
if delay < 0.01 then delay = 0.01 end
C_TimerAfter(delay, timer.callback)
timer.ends = time + delay
if ndelay < 0.01 then ndelay = 0.01 end
C_TimerAfter(ndelay, timer.callback)
timer.ends = time + ndelay
else
activeTimers[timer.handle or timer] = nil
end
Expand Down
23 changes: 9 additions & 14 deletions Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--[[ $Id: CallbackHandler-1.0.lua 1186 2018-07-21 14:19:18Z nevcairiel $ ]]
--[[ $Id: CallbackHandler-1.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]
local MAJOR, MINOR = "CallbackHandler-1.0", 7
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)

Expand All @@ -7,15 +7,10 @@ if not CallbackHandler then return end -- No upgrade needed
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}

-- Lua APIs
local tconcat = table.concat
local assert, error, loadstring = assert, error, loadstring
local setmetatable, rawset, rawget = setmetatable, rawset, rawget
local error = error
local setmetatable, rawget = setmetatable, rawget
local next, select, pairs, type, tostring = next, select, pairs, type, tostring

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: geterrorhandler

local xpcall = xpcall

local function errorhandler(err)
Expand All @@ -39,7 +34,7 @@ end
-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.

function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName)
function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName)

RegisterName = RegisterName or "RegisterCallback"
UnregisterName = UnregisterName or "UnregisterCallback"
Expand Down Expand Up @@ -67,13 +62,13 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll

if registry.insertQueue and oldrecurse==0 then
-- Something in one of our callbacks wanted to register more callbacks; they got queued
for eventname,callbacks in pairs(registry.insertQueue) do
local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
for self,func in pairs(callbacks) do
events[eventname][self] = func
for event,callbacks in pairs(registry.insertQueue) do
local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten.
for object,func in pairs(callbacks) do
events[event][object] = func
-- fire OnUsed callback?
if first and registry.OnUsed then
registry.OnUsed(registry, target, eventname)
registry.OnUsed(registry, target, event)
first = nil
end
end
Expand Down
23 changes: 21 additions & 2 deletions Libs/DF/cooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local max = math.max

--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 6
local version = 7

local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
Expand Down Expand Up @@ -64,7 +64,22 @@ function DF:CreateCoolTip()
return CONST_MENU_TYPE_MAINMENU
end

local languageFontEditBox = function()
gameCooltip.LanguageEditBox = gameCooltip.LanguageEditBox or CreateFrame("editbox")
gameCooltip.LanguageEditBox:SetFontObject("GameFontNormal")
gameCooltip.LanguageEditBox:ClearFocus()
gameCooltip.LanguageEditBox:SetAutoFocus(false)

function gameCooltip.CheckNeedNewFont(text)
--local file = gameCooltip.LanguageEditBox:GetFont()
--print("1", file, text)
--gameCooltip.LanguageEditBox:SetText("Цены аукциона")
--local file2 = gameCooltip.LanguageEditBox:GetFont()
--print("2", file2)
--gameCooltip.LanguageEditBox:ClearFocus()

--if (file ~= file2) then
-- gameCooltip:SetOption("TextFont", file2)
--end
end

--containers
Expand Down Expand Up @@ -2738,6 +2753,8 @@ function DF:CreateCoolTip()
end
end

gameCooltip.CheckNeedNewFont(leftText)

local rightTextType = type(rightText)
if (rightTextType ~= "string") then
if (rightTextType == "number") then
Expand All @@ -2747,6 +2764,8 @@ function DF:CreateCoolTip()
end
end

gameCooltip.CheckNeedNewFont(rightText)

if (type(ColorR1) ~= "number") then
ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag = ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2
if (type(ColorR1) == "boolean" or not ColorR1) then
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 = 384
local dversion = 385
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/iteminfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (detailsFramework.IsDragonflightAndBeyond()) then
end

function detailsFramework.Items.GetContainerItemInfo(containerIndex, slotIndex)
if (containerAPIVersion == 2) then
if (containerAPIVersion == 2 and C_Container and C_Container.GetContainerItemInfo) then
local itemInfo = C_Container.GetContainerItemInfo(containerIndex, slotIndex)
return itemInfo.iconFileID, itemInfo.stackCount, itemInfo.isLocked, itemInfo.quality, itemInfo.isReadable, itemInfo.hasLoot, itemInfo.hyperlink, itemInfo.isFiltered, itemInfo.hasNoValue, itemInfo.itemID, itemInfo.isBound
else
Expand Down
8 changes: 8 additions & 0 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ do

local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )

--[=[
-
-
- this is an empty comment section
-
-
--]=]

local news = {
{"v9.2.0.10001.146", "Aug 10th, 2022"},
"New feature: Arena DPS Bar, can be enabled at the Broadcaster Tools section, shows a bar in 'kamehameha' style showing which team is doing more damage in the latest 3 seconds.",
Expand Down
22 changes: 18 additions & 4 deletions classes/container_actors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,12 @@
if (not _detalhes.tabela_vigente) then
return
end

pet_tooltip_frame:SetOwner(WorldFrame, "ANCHOR_NONE")
pet_tooltip_frame:SetHyperlink ("unit:" .. serial or "")
pet_tooltip_frame:SetHyperlink ("unit:" .. (serial or ""))

Details.tabela_vigente.raid_roster_indexed = Details.tabela_vigente.raid_roster_indexed or {}

local line1 = _G ["DetailsPetOwnerFinderTextLeft2"]
local text1 = line1 and line1:GetText()
if (text1 and text1 ~= "") then
Expand All @@ -502,11 +502,18 @@
else
if (text1:find(playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
else
local ownerName = (string.match(text1, string.gsub(UNITNAME_TITLE_PET, "%%s", "(%.*)")) or string.match(text1, string.gsub(UNITNAME_TITLE_MINION, "%%s", "(%.*)")) or string.match(text1, string.gsub(UNITNAME_TITLE_GUARDIAN, "%%s", "(%.*)")))
if (ownerName) then
if (_detalhes.tabela_vigente.raid_roster[ownerName]) then
return find_pet_found_owner (ownerName, serial, nome, flag, self)
end
end
end
end
end
end

local line2 = _G ["DetailsPetOwnerFinderTextLeft3"]
local text2 = line2 and line2:GetText()
if (text2 and text2 ~= "") then
Expand All @@ -527,6 +534,13 @@
else
if (text2:find(playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
else
local ownerName = (string.match(text2, string.gsub(UNITNAME_TITLE_PET, "%%s", "(%.*)")) or string.match(text2, string.gsub(UNITNAME_TITLE_MINION, "%%s", "(%.*)")) or string.match(text2, string.gsub(UNITNAME_TITLE_GUARDIAN, "%%s", "(%.*)")))
if (ownerName) then
if (_detalhes.tabela_vigente.raid_roster[ownerName]) then
return find_pet_found_owner (ownerName, serial, nome, flag, self)
end
end
end
end
end
Expand Down
10 changes: 4 additions & 6 deletions core/network.lua
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,10 @@
end

function Details:SendPartyData(type, ...)
local isInInstanceGroup = IsInGroup(LE_PARTY_CATEGORY_INSTANCE)
if (isInInstanceGroup) then
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "INSTANCE_CHAT")
else
Details:SendCommMessage (DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "PARTY")
end
local prefix = DETAILS_PREFIX_NETWORK
local data = Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...)
local channel = IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT" or "PARTY"
Details:SendCommMessage(prefix, data, channel)
end

function Details:SendRaidOrPartyData(type, ...)
Expand Down
Loading

0 comments on commit 45a9800

Please sign in to comment.