Townsfolk Tracker

Townsfolk Tracker

82.8k Downloads

[TBC] LUA error on every login

millanzarreta opened this issue ยท 3 comments

commented

On TBC version, these two LUA errors happens on every login:

`1x [string "Lib_DropDownList1MenuBackdrop:OnLoad"]:1: attempt to call method 'SetBackdropBorderColor' (a nil value)
[string ":OnLoad"]:1: in function <[string ":OnLoad"]:1>

Locals:
self = Lib_DropDownList1MenuBackdrop {
0 =
}
(*temporary) = nil
(*temporary) = Lib_DropDownList1MenuBackdrop {
0 =
}
(*temporary) = 1
(*temporary) = 1
(*temporary) = 1
(*temporary) = "attempt to call method 'SetBackdropBorderColor' (a nil value)"
`

`1x [string "Lib_DropDownList2MenuBackdrop:OnLoad"]:1: attempt to call method 'SetBackdropBorderColor' (a nil value)
[string ":OnLoad"]:1: in function <[string ":OnLoad"]:1>

Locals:
self = Lib_DropDownList2MenuBackdrop {
0 =
}
(*temporary) = nil
(*temporary) = Lib_DropDownList2MenuBackdrop {
0 =
}
(*temporary) = 1
(*temporary) = 1
(*temporary) = 1
(*temporary) = "attempt to call method 'SetBackdropBorderColor' (a nil value)"
`

Although the message does not state that the cause is this addon, it is, since with all the addons disabled except this one the error occurs, if you deactivate this addon the error disappears.

commented

Ok, the problem is in the file: \TownsfolkTracker\Libs\NoTaintUIDropDown\UIDropDownMenuTemplates.xml

In the line 218:

<Frame name="$parentMenuBackdrop" setAllPoints="true">

this should be replaced by the next:

<Frame name="$parentMenuBackdrop" setAllPoints="true" inherits="BackdropTemplate">

and the error is gone.

In Shadowlands (9.0) Blizzard remove the default support of backdrops by default for frames, and now they have to inherit the BackdropTemplate or BackdropTemplateMixin to support it. In WoW Classic they didn't change this, and backdrop was supported by default for all frames, but in the TBC they update the code to add this restriction like retail (I don't know what happen in WoW Classic Era). Adding the inherit BackdropTemplate to that frame fix the error! :)

commented

I tested the original version in Classic Era and no errors, so this issue is only TBC related. In fact, if you modify the line to add the inherits="BackdropTemplate" on Classic Era version a LUA error occurs in which it says that the BackdropTemplate is not recognized.

Therefore, this issue definitely only affects TBC and should only be corrected in the TBC version so as not to affect the Classic Era version.

At last, a minor problem (only in TBC version too), the background of the Dropdown menu is missing (or transparent). It is not a very relevant bug and it does not seem to affect the functionality.
imagen

commented

I find the solution. On TBC version only, modify in the file \TownsfolkTracker\Libs\NoTaintUIDropDown\UIDropDownMenuTemplates.xml the next lines (205 to 236):

<Frame name="$parentBackdrop" setAllPoints="true">
	<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background-Dark" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
		<BackgroundInsets>
			<AbsInset left="11" right="12" top="12" bottom="9"/>
		</BackgroundInsets>
		<TileSize>
			<AbsValue val="32"/>
		</TileSize>
		<EdgeSize>
			<AbsValue val="32"/>
		</EdgeSize>
	</Backdrop>
</Frame>
<Frame name="$parentMenuBackdrop" setAllPoints="true">
	<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
		<EdgeSize>
			<AbsValue val="16"/>
		</EdgeSize>
		<TileSize>
			<AbsValue val="16"/>
		</TileSize>
		<BackgroundInsets>
			<AbsInset left="5" right="5" top="5" bottom="4"/>
		</BackgroundInsets>
	</Backdrop>
	<Scripts>
		<OnLoad>
			self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
			self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
		</OnLoad>
	</Scripts>
</Frame>

with this:

<Frame name="$parentBackdrop" setAllPoints="true" inherits="BackdropTemplate">
	<Scripts>
		<OnLoad>
			self:SetBackdrop({
				bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
				edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
				tile = true,
				tileSize = 32,
				edgeSize = 32,
				insets = { left = 11, right = 12, top = 12, bottom = 9 },
			})
		</OnLoad>
	</Scripts>
</Frame>
<Frame name="$parentMenuBackdrop" setAllPoints="true" inherits="BackdropTemplate">
	<Scripts>
		<OnLoad>
			self:SetBackdrop({
				bgFile = [[Interface\Tooltips\UI-Tooltip-Background]],
				edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
				tile = true,
				tileSize = 16,
				edgeSize = 16,
				insets = { left = 5, right = 5, top = 5, bottom = 4 },
			})
			self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
			self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
		</OnLoad>
	</Scripts>
</Frame>

As I said before, on Classic Era version nothing should be modified.