WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR API and Graphics Changes (https://www.wowinterface.com/forums/forumdisplay.php?f=175)
-   -   8.1.5 ItemButtonTemplate Changes (https://www.wowinterface.com/forums/showthread.php?t=57008)

thomasjohnshannon 02-02-19 11:33 AM

8.1.5 ItemButtonTemplate Changes
 
In 8.1.5 they changed how the item button template works. Instead of being a virtual button that is inherited it is now a new widget type that can be created directly.

Old Way

local button = CreateFrame("Button", "ButtonNameHere"..id, ParentFrame, "ItemButtonTemplate");

New Way

local button = CreateFrame("ItemButton", "ButtonNameHere"..id, ParentFrame, "OptionalTemplateHere");

Zam89 03-12-19 03:02 PM

Hi, thanks for the Info.
Do you know, how we can set the IconBorder or texture with this new way?

Fizzlemizz 03-12-19 07:43 PM

They should still be the same:

xxx.IconBorder:SetTexture(...)
xxx:SetNormalTexture(...)

Koviko 03-12-19 08:53 PM

Were similar changes made to ContainerFrameItemButtonTemplate?

Fizzlemizz 03-12-19 09:02 PM

It went from inheriting ItemButtonTemplate (because that's now its base widget) to using ContainerFrameItemButtonMixin.

Koviko 03-12-19 09:20 PM

Pardon me as I'm not very well-versed in making addons, especially the XML templates.


So, in an XML template, instead of:
Code:

<Button inherits="ItemButtonTemplate" />
We'd have:
Code:

<ItemButton />

And, instead of:
Code:

<Button inherits="ContainerFrameItemButtonTemplate" />
We'd have:
Code:

<ItemButton inherits="ContainerFrameItemButtonMixin" />

Is this accurate?

Fizzlemizz 03-12-19 09:26 PM

That's sort of it. ItemButtonTemplate is now the base widget ItemButton. It appears to have all the same elements (textures fontstrings etc.) using the same names and parent keys as the original template.

Instead of
Code:

<Button name="ContainerFrameItemButtonTemplate" inherits="ItemButtonTemplate" virtual="true"/>
you have
Code:

<ItemButton name="ContainerFrameItemButtonTemplate" mixin="ContainerFrameItemButtonMixin" virtual="true"/>
and to create the actual button you will
Code:

<ItemButton inherits="ContainerFrameItemButtonTemplate"/>
The lines with "virtual="true" means these are not real, created in-game widgets, they are just a set of instructions that can be used to make one or more real and identical widgets later on.

Koviko 03-12-19 11:20 PM

Thank you very much for the help. With this, I was able to get ArkInventory working again!

Zam89 03-13-19 09:50 AM

Hmm I do not get it to work,

This is the way we creating the template:

Code:

<ItemButton name="GwPaperDollButtonTemplate" registerForDrag="LeftButton" registerForClicks="LeftButtonUp RightButtonUp" mixin="ContainerFrameItemButtonMixin" virtual="true">
        <Size x="49" y="49"></Size>
        <Layers>
            <Layer level="BACKGROUND">
                <Texture parentKey="BACKGROUND" file="Interface\AddOns\GW2_UI\textures\character\slot-bg">
                    <Size x="49" y="49"></Size>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                        <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>
                    </Anchors>
                    <TexCoords left="0" right="0.25" top="0" bottom="0.25"/>
                </Texture>
            </Layer>
            <Layer level="OVERLAY">
                <Texture name="$parentRepair" hidden="true" parentKey="repairIcon" file="Interface\AddOns\GW2_UI\textures\repair">
                    <Size x="20" y="20"></Size>
                    <Anchors>
                        <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" x="0" y="0"></Anchor>

                    </Anchors>

                    <TexCoords left="0" right="1" top="0.5" bottom="1"/>
                </Texture>
            </Layer>

            <Frames>
                <CheckButton hidden="true" name="$parentCheckButton" checked="false">

                    <Size x="160" y="160"></Size>
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="10" y="0"></Anchor>
                    </Anchors>
                    <NormalTexture file="Interface\AddOns\GW2_UI\textures\checkbox"></NormalTexture>
                    <CheckedTexture file="Interface\AddOns\GW2_UI\textures\checkboxchecked"></CheckedTexture>
                </CheckButton>
            </Frames>

        </Layers>

    </ItemButton>

    <ItemButton name="GwPaperDollBagItem" registerForClicks="LeftButtonDown, RightButtonDown" inherits="GwPaperDollButtonTemplate" virtual="true"/>

And this to use it:

Code:

<ItemButton name="GwPaperDollBagItem" registerForClicks="LeftButtonDown, RightButtonDown" inherits="GwPaperDollButtonTemplate" virtual="true"/>
or

Code:

<ItemButton name="GwPaperDollHeadSlot" parentKey="head" inherits="GwPaperDollButtonTemplate,PaperDollAzeriteItemOverlayTemplate">
                        <Anchors>
                            <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"></Anchor>
                        </Anchors>
                        <Layers>
                            <Layer level="OVERLAY" textureSubLevel="2">
                                <FontString parentKey="itemlevel" inherits="GameFontNormalSmall" justifyH="LEFT">
                                    <Size x="100" y="10"/>
                                    <Color r="1" g="1" b="1"></Color>
                                    <Anchors>
                                        <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="2" y="2"></Anchor>
                                    </Anchors>
                                </FontString>
                            </Layer>
                        </Layers>
                        <Frames>
                            <CheckButton hidden="true" name="$parentCheckButton" parentKey="ignoreSlotCheck" checked="false">
                                <Size x="16" y="16"></Size>
                                <Anchors>
                                    <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="0" y="0"></Anchor>
                                </Anchors>
                                <NormalTexture file="Interface\AddOns\GW2_UI\textures\checkbox"></NormalTexture>
                                <CheckedTexture file="Interface\AddOns\GW2_UI\textures\checkboxchecked"></CheckedTexture>
                            </CheckButton>
                        </Frames>
                    </ItemButton>

but we get this error all the time:

Code:

3x ...faceGW2_UI\character/paperdoll_equipment.lua:194: attempt to index field 'IconBorder' (a nil value)
...faceGW2_UI\character/paperdoll_equipment.lua:194: in function <...faceGW2_UI\character/paperdoll_equipment.lua:193>
...faceGW2_UI\character/paperdoll_equipment.lua:504: in function <...faceGW2_UI\character/paperdoll_equipment.lua:487>
...faceGW2_UI\character/paperdoll_equipment.lua:531: in function <...faceGW2_UI\character/paperdoll_equipment.lua:512>
...faceGW2_UI\character/paperdoll_equipment.lua:933: in function `LoadPDBagList'
GW2_UI\character/paperdoll.lua:100: in function `?'
GW2_UI\character/character.lua:423: in function `LoadCharacter'
GW2_UI\GW2_ui.lua:506: in function <GW2_UI\GW2_ui.lua:423>
GW2_UI\GW2_ui.lua:588: in function <GW2_UI\GW2_ui.lua:584>

Locals:
self = gwPaperDollBagSlotButton1 {
 0 = <userdata>

in this Code:

Code:

self.IconBorder:SetSize(self:GetSize(), self:GetSize())
Hope you can help me :)

Fizzlemizz 03-13-19 11:50 AM

It's complaining about gwPaperDollBagSlotButton1 not having a key called IconBorder. I can't see from the code supplied what you used to create gwPaperDollBagSlotButton1 (and presumably others).

My guess is you have something like:
Lua Code:
  1. <Button name="gwPaperDollBag" ....>
  2.         <Button name="$parentSlotButton1" inherits="GwPaperDollBagItem" ...>
  3.                 ....
  4.         </Button>
  5.         <Button name="$parentSlotButton2" inherits="GwPaperDollBagItem" ...>
  6.                 ....
  7.         </Button>
  8.         <Button name="$parentSlotButton3" inherits="GwPaperDollBagItem" ...>
  9.                 ....
  10.         </Button>
  11.     ...
  12. </Button>
Where it should be:
Lua Code:
  1. <Button name="gwPaperDollBag" ....>
  2.         <ItemButton name="$parentSlotButton1" inherits="GwPaperDollBagItem" ...>
  3.                 ....
  4.         </ItemButton>
  5.         <ItemButton name="$parentSlotButton2" inherits="GwPaperDollBagItem" ...>
  6.                 ....
  7.         </ItemButton>
  8.         <ItemButton name="$parentSlotButton3" inherits="GwPaperDollBagItem" ...>
  9.                 ....
  10.         </ItemButton>
  11.     ...
  12. </Button>

The base widget specified for creating the actual widget overwrites the base widget specified in the template it inherits.

Lua Code:
  1. <Frame name="SomeTemplate" virtual="true">
  2.     ...
  3. </Frame>
  4.  
  5. <Button name="B1" inherits="SomeTemplate"> --creates a plain Button
  6. <ItemButton name="B1" inherits="SomeTemplate"> --creates an ItemButton
Even though SomeTemplate is based on a Frame.

Zam89 03-13-19 12:34 PM

Thanks.

Here is the Code to create this:

Code:

if _G["gwPaperDollBagSlotButton" .. i] ~= nil then
        return _G["gwPaperDollBagSlotButton" .. i]
    end

    local f = CreateFrame("Button", "gwPaperDollBagSlotButton" .. i, GwPaperDollBagItemList, "GwPaperDollBagItem")

Code:

<ItemButton name="GwPaperDollBagItem" registerForClicks="LeftButtonDown, RightButtonDown" inherits="GwPaperDollButtonTemplate" virtual="true"/>
any idea?

Fizzlemizz 03-13-19 12:39 PM

Code:

local f = CreateFrame("ItemButton", "gwPaperDollBagSlotButton" .. i, GwPaperDollBagItemList, "GwPaperDollBagItem")
Code:

CreateFrame("Button ..)
CreateFrame("ItemButton ..)

is lua code for
Code:

<Button ..>
<ItemButton ..>


Zam89 03-13-19 12:41 PM

That was it :) Thank you very much :)


Some other short Question:
Do you have any idea how we can get the warfront ressources?

Fizzlemizz 03-13-19 12:49 PM

I don't play the game enough to know if there is a difference between war (mission table) resources and warfront resources.

Zam89 03-13-19 01:13 PM

I think not, and I do not find any api to get the infos. And also tried to get it via the scenario widget.

Fizzlemizz 03-13-19 02:14 PM

I thought you were asking how to pick them up in-game :o

Lua Code:
  1. local name, qty, icon = GetCurrencyInfo(1560)
  2. print("You have", qty, name)
Resources Ids: 824=WoD Garrison, 1220=Legion Order Hall, 1560=BfA War, 1416=Coins of Air, You'll have to find the rest youself ;).

Zam89 03-13-19 02:50 PM

Thanks, but with this api you do not get the Metal and Wood Ressourcen from the Warfront secenarios

Fizzlemizz 03-13-19 05:06 PM

I don't know if or how that information might be obtained. Possibly someone else might know.

Fizzlemizz 03-13-19 07:20 PM

Lua Code:
  1. local iname, iqty, iicon = GetCurrencyInfo(1541)  --iron
  2. local wname, wqty, wicon = GetCurrencyInfo(1540)  -- wood
  3. print("You have", iqty, iname, "and", wqty, wname)

Zam89 03-15-19 12:39 AM

Thanks, that is it exactly :)

LudiusMaximus 03-26-19 06:00 PM

I am trying to fix this issue for Altoholic.

We just get this error message when entering the "Character" tab:
"Couldn't find inherited node: ItemButtonTemplate"

So I assume it is due to the xml codes of AuctionHouse.xml (and Mails.xml respectively):

Code:

<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
  <Script file="AuctionHouse.lua"></Script>

  <Button name="AltoAuctionEntryTemplate" virtual="true">
    <Size x="615" y="41" />
    <Layers>
      <Layer level="BACKGROUND">
        <FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
          <Size x="220" y="14" />
          <Anchors>
            <Anchor point="TOPLEFT" x="53" y="0" />
          </Anchors>
        </FontString>
        <FontString name="$parentTimeLeft" inherits="GameFontNormal" justifyH="LEFT">
          <Size x="220" y="10" />
          <Anchors>
            <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="BOTTOMLEFT" x="0" y="-2" />
          </Anchors>
        </FontString>
        <FontString name="$parentHighBidder" inherits="GameFontNormal">
          <Size x="160" y="32" />
          <Anchors>
            <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="TOPRIGHT" x="5" y="0" />
          </Anchors>
        </FontString>
        <FontString name="$parentPrice" inherits="GameFontNormal" justifyH="RIGHT">
          <Size x="150" y="32" />
          <Anchors>
            <Anchor point="BOTTOMLEFT" relativeTo="$parentHighBidder" relativePoint="BOTTOMRIGHT" x="5" y="0" />
          </Anchors>
        </FontString>
      </Layer>
    </Layers>
    <Frames>
      <Button name="$parentItem" inherits="ItemButtonTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" x="10" y="0" />
        </Anchors>
        <Scripts>
          <OnEnter>
            Altoholic.AuctionHouse:OnEnter(self)
          </OnEnter>
          <OnLeave>
            GameTooltip:Hide();
          </OnLeave>
          <OnClick>
            Altoholic.AuctionHouse:OnClick(self, button)
          </OnClick>
        </Scripts>
      </Button>
    </Frames>
    <Scripts>
      <OnLoad>
        self:RegisterForClicks("LeftButtonDown", "RightButtonDown");
      </OnLoad>
      <OnClick>
        if button == "RightButton" then
          ToggleDropDownMenu(1, nil, AltoholicFrameAuctionsRightClickMenu, self:GetName(), 0, -5);
        end
      </OnClick>
    </Scripts>
    <HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
      <Size x="555" y="37" />
      <Anchors>
        <Anchor point="TOPLEFT" x="55" y="0" />
      </Anchors>
      <TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
    </HighlightTexture>
  </Button>

  <Frame name="AltoholicFrameAuctions" parent="AltoholicTabCharacters" hidden="true">
    <Size x="615" y="306" />
    <Anchors>
      <Anchor point="TOPRIGHT" x="39" y="-105" />
    </Anchors>
    <Frames>
      <ScrollFrame name="$parentScrollFrame" inherits="AltoBaseScrollFrameTemplate" hidden="true">
        <Scripts>
          <OnVerticalScroll>
            self:OnVerticalScroll(offset, 41, Altoholic.AuctionHouse.Update)
          </OnVerticalScroll>
        </Scripts>
      </ScrollFrame>
     
      <Button name="$parentEntry1" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentScrollFrame" relativePoint="TOPLEFT" x="0" y="0" />
        </Anchors>
      </Button>
      <Button name="$parentEntry2" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry1" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </Button>
      <Button name="$parentEntry3" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry2" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </Button>
      <Button name="$parentEntry4" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry3" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </Button>
      <Button name="$parentEntry5" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry4" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </Button>
      <Button name="$parentEntry6" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry5" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </Button>
      <Button name="$parentEntry7" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry6" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </Button>
    </Frames>
  </Frame>
 
</Ui>


I obviously don't understand the concepts at hand.
Simply changing
Code:

<Button name="$parentItem" inherits="ItemButtonTemplate">
into
Code:

<ItemButton name="$parentItem">
and all the other occurences of "Button" into "ItemButton" just breaks everything:
"...erface\AddOns\Altoholic_Characters\TabCharacters.lua:72: attempt to index global 'AltoholicFrameAuctions' (a nil value)"

Any help would be greatly appreciated. Thanks!

Fizzlemizz 03-26-19 07:25 PM

Assuming for each ItemButton you also simply changed:
Code:

</Button>
to
Code:

</ItemButton>

Something in the xml above the line:
Code:

<Frame name="AltoholicFrameAuctions" parent="AltoholicTabCharacters" hidden="true">
broke. But we can't see the xml as it is now.

LudiusMaximus 03-27-19 05:58 AM

All right, sorry for not being too specific yesterday. This is what's happening now:

I replaced all the occurences of Button in the xml files resulting in this:

AuctionHouse.xml
Code:

<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
  <Script file="AuctionHouse.lua"></Script>

  <ItemButton name="AltoAuctionEntryTemplate" virtual="true">
    <Size x="615" y="41" />
    <Layers>
      <Layer level="BACKGROUND">
        <FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
          <Size x="220" y="14" />
          <Anchors>
            <Anchor point="TOPLEFT" x="53" y="0" />
          </Anchors>
        </FontString>
        <FontString name="$parentTimeLeft" inherits="GameFontNormal" justifyH="LEFT">
          <Size x="220" y="10" />
          <Anchors>
            <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="BOTTOMLEFT" x="0" y="-2" />
          </Anchors>
        </FontString>
        <FontString name="$parentHighBidder" inherits="GameFontNormal">
          <Size x="160" y="32" />
          <Anchors>
            <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="TOPRIGHT" x="5" y="0" />
          </Anchors>
        </FontString>
        <FontString name="$parentPrice" inherits="GameFontNormal" justifyH="RIGHT">
          <Size x="150" y="32" />
          <Anchors>
            <Anchor point="BOTTOMLEFT" relativeTo="$parentHighBidder" relativePoint="BOTTOMRIGHT" x="5" y="0" />
          </Anchors>
        </FontString>
      </Layer>
    </Layers>
    <Frames>
      <ItemButton name="$parentItem">
        <Anchors>
          <Anchor point="TOPLEFT" x="10" y="0" />
        </Anchors>
        <Scripts>
          <OnEnter>
            Altoholic.AuctionHouse:OnEnter(self)
          </OnEnter>
          <OnLeave>
            GameTooltip:Hide();
          </OnLeave>
          <OnClick>
            Altoholic.AuctionHouse:OnClick(self, button)
          </OnClick>
        </Scripts>
      </ItemButton>
    </Frames>
    <Scripts>
      <OnLoad>
        self:RegisterForClicks("LeftButtonDown", "RightButtonDown");
      </OnLoad>
      <OnClick>
        if button == "RightButton" then
          ToggleDropDownMenu(1, nil, AltoholicFrameAuctionsRightClickMenu, self:GetName(), 0, -5);
        end
      </OnClick>
    </Scripts>
    <HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
      <Size x="555" y="37" />
      <Anchors>
        <Anchor point="TOPLEFT" x="55" y="0" />
      </Anchors>
      <TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
    </HighlightTexture>
  </ItemButton>

  <Frame name="AltoholicFrameAuctions" parent="AltoholicTabCharacters" hidden="true">
    <Size x="615" y="306" />
    <Anchors>
      <Anchor point="TOPRIGHT" x="39" y="-105" />
    </Anchors>
    <Frames>
      <ScrollFrame name="$parentScrollFrame" inherits="AltoBaseScrollFrameTemplate" hidden="true">
        <Scripts>
          <OnVerticalScroll>
            self:OnVerticalScroll(offset, 41, Altoholic.AuctionHouse.Update)
          </OnVerticalScroll>
        </Scripts>
      </ScrollFrame>
     
      <ItemButton name="$parentEntry1" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentScrollFrame" relativePoint="TOPLEFT" x="0" y="0" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry2" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry1" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry3" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry2" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry4" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry3" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry5" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry4" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry6" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry5" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry7" inherits="AltoAuctionEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry6" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
    </Frames>
  </Frame>
 
</Ui>

Mails.xml
Code:

<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
  <Script file="Mails.lua"></Script>

  <ItemButton name="AltoMailEntryTemplate" virtual="true">
    <Size x="615" y="41" />
    <Layers>
      <Layer level="BACKGROUND">
        <FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
          <Size x="220" y="32" />
          <Anchors>
            <Anchor point="TOPLEFT" x="53" y="0" />
          </Anchors>
        </FontString>
        <FontString name="$parentCharacter" inherits="GameFontNormal">
          <Size x="130" y="32" />
          <Anchors>
            <Anchor point="BOTTOMLEFT" relativeTo="$parentName" relativePoint="BOTTOMRIGHT" x="5" y="0" />
          </Anchors>
        </FontString>
        <FontString name="$parentExpiry" inherits="GameFontNormal">
          <Size x="200" y="32" />
          <Anchors>
            <Anchor point="BOTTOMLEFT" relativeTo="$parentCharacter" relativePoint="BOTTOMRIGHT" x="5" y="0" />
          </Anchors>
        </FontString>
      </Layer>
    </Layers>
    <Frames>
      <ItemButton name="$parentItem">
        <Anchors>
          <Anchor point="TOPLEFT" x="10" y="0" />
        </Anchors>
        <Scripts>
          <OnEnter>
            Altoholic.Mail:OnEnter(self)
          </OnEnter>
          <OnLeave>
            GameTooltip:Hide();
          </OnLeave>
          <OnClick>
            Altoholic.Mail:OnClick(self, button)
          </OnClick>
        </Scripts>
      </ItemButton>
    </Frames>
    <HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
      <Size x="560" y="37" />
      <Anchors>
        <Anchor point="TOPLEFT" x="50" y="0" />
      </Anchors>
      <TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
    </HighlightTexture>
  </ItemButton>

  <Frame name="AltoholicFrameMail" parent="AltoholicTabCharacters" hidden="true">
    <Size x="615" y="306" />
    <Anchors>
      <Anchor point="TOPRIGHT" x="39" y="-105" />
    </Anchors>
    <Frames>
      <ScrollFrame name="$parentScrollFrame" parentKey="ScrollFrame" inherits="AltoBaseScrollFrameTemplate" hidden="true">
        <Scripts>
          <OnVerticalScroll>
            self:OnVerticalScroll(offset, 41, Altoholic.Mail.Update)
          </OnVerticalScroll>
        </Scripts>
        <!--
        <KeyValues>
          <KeyValue key="numRows" value="7" type="number" />
          <KeyValue key="rowTemplate" value="AltoMailEntryTemplate" />
        </KeyValues>
        -->
      </ScrollFrame>
     
      <ItemButton name="$parentEntry1" inherits="AltoMailEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentScrollFrame" relativePoint="TOPLEFT" x="0" y="0" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry2" inherits="AltoMailEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry1" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry3" inherits="AltoMailEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry2" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry4" inherits="AltoMailEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry3" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry5" inherits="AltoMailEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry4" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry6" inherits="AltoMailEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry5" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
      <ItemButton name="$parentEntry7" inherits="AltoMailEntryTemplate">
        <Anchors>
          <Anchor point="TOPLEFT" relativeTo="$parentEntry6" relativePoint="BOTTOMLEFT" />
        </Anchors>
      </ItemButton>
    </Frames>
  </Frame>
 
</Ui>


When I go to Altoholic's "Characters" tab now, there is no "Couldn't find inherited node: ItemButtonTemplate" error message any more.

Instead, now when I try to look at the "Auction House" or "Mails" view, I get errors.
But these errors are not even what I ment by "breaks everything"!

Because if I do a gui /reload now, I find myself having no message console any more and this error pops up:
Code:

Message: Interface\FrameXML\ChatAlertFrameMixin.lua:6: attempt to index global 'DEFAULT_CHAT_FRAME' (a nil value)
Time: Wed Mar 27 12:47:31 2019
Count: 1
Stack: Interface\FrameXML\ChatAlertFrameMixin.lua:6: attempt to index global 'DEFAULT_CHAT_FRAME' (a nil value)
Interface\FrameXML\ChatAlertFrameMixin.lua:6: in function <Interface\FrameXML\ChatAlertFrameMixin.lua:3>

Locals: self = ChatAlertFrame {
 0 = <userdata>
 SetSubSystemAnchorPriority = <function> defined @Interface\FrameXML\AlertFrames.lua:350
 shouldQueueAlertsFlags = <table> {
 }
 SetJustification = <function> defined @Interface\FrameXML\AlertFrames.lua:377
 CreateSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:311
 CreateQueuedSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:328
 SetEnabledFlag = <function> defined @Interface\FrameXML\AlertFrames.lua:277
 SetVariablesLoaded = <function> defined @Interface\FrameXML\AlertFrames.lua:294
 SetAlertsEnabled = <function> defined @Interface\FrameXML\AlertFrames.lua:299
 AreAlertsEnabled = <function> defined @Interface\FrameXML\AlertFrames.lua:303
 AddQueuedAlertFrameSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:338
 AddAlertFrameSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:342
 GetJustification = <function> defined @Interface\FrameXML\AlertFrames.lua:384
 OnLoad = <function> defined @Interface\FrameXML\ChatAlertFrameMixin.lua:3
 justification = "LEFT"
 AddExternallyAnchoredSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:318
 CleanAnchorPriorities = <function> defined @Interface\FrameXML\AlertFrames.lua:360
 OnEvent = <function> defined @Interface\FrameXML\AlertFrames.lua:269
 AddAutoAnchoredSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:323
 SetChatButtonSide = <function> defined @Interface\FrameXML\ChatAlertFrameMixin.lua:10
 AddSimpleAlertFrameSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:332
 SetPlayerEnteredWorld = <function> defined @Interface\FrameXML\AlertFrames.lua:289
 alertFrameSubSystems = <table> {
 }
 UpdateAnchors = <function> defined @Interface\FrameXML\AlertFrames.lua:368
 GetPointsForJustification = <function> defined @Interface\FrameXML\AlertFrames.lua:402
 AddAlertFrame = <function> defined @Interface\FrameXML\AlertFrames.lua:409
}
(*temporary) = <function> defined =[C]:-1
(*temporary) = ChatAlertFrame {
 0 = <userdata>
 SetSubSystemAnchorPriority = <function> defined @Interface\FrameXML\AlertFrames.lua:350
 shouldQueueAlertsFlags = <table> {
 }
 SetJustification = <function> defined @Interface\FrameXML\AlertFrames.lua:377
 CreateSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:311
 CreateQueuedSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:328
 SetEnabledFlag = <function> defined @Interface\FrameXML\AlertFrames.lua:277
 SetVariablesLoaded = <function> defined @Interface\FrameXML\AlertFrames.lua:294
 SetAlertsEnabled = <function> defined @Interface\FrameXML\AlertFrames.lua:299
 AreAlertsEnabled = <function> defined @Interface\FrameXML\AlertFrames.lua:303
 AddQueuedAlertFrameSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:338
 AddAlertFrameSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:342
 GetJustification = <function> defined @Interface\FrameXML\AlertFrames.lua:384
 OnLoad = <function> defined @Interface\FrameXML\ChatAlertFrameMixin.lua:3
 justification = "LEFT"
 AddExternallyAnchoredSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:318
 CleanAnchorPriorities = <function> defined @Interface\FrameXML\AlertFrames.lua:360
 OnEvent = <function> defined @Interface\FrameXML\AlertFrames.lua:269
 AddAutoAnchoredSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:323
 SetChatButtonSide = <function> defined @Interface\FrameXML\ChatAlertFrameMixin.lua:10
 AddSimpleAlertFrameSubSystem = <function> defined @Interface\FrameXML\AlertFrames.lua:332
 SetPlayerEnteredWorld =



Similarly, I have no bag icons any more and trying to open my bags pressing "B" results in:

Code:

Message: Interface\FrameXML\ContainerFrame.lua:982: attempt to index local 'itemButton' (a nil value)
Time: Wed Mar 27 12:49:11 2019
Count: 1
Stack: Interface\FrameXML\ContainerFrame.lua:982: attempt to index local 'itemButton' (a nil value)
Interface\FrameXML\ContainerFrame.lua:982: in function `ContainerFrame_GenerateFrame'
Interface\FrameXML\ContainerFrame.lua:118: in function `ToggleBag'
Interface\FrameXML\ContainerFrame.lua:140: in function `ToggleBackpack'
Interface\FrameXML\ContainerFrame.lua:364: in function `OpenBackpack'
Interface\FrameXML\ContainerFrame.lua:1507: in function `ToggleAllBags'
[string "OPENALLBAGS"]:1: in function <[string "OPENALLBAGS"]:1>

Locals: frame = ContainerFrame1 {
 0 = <userdata>
 PortraitButton = ContainerFrame1PortraitButton {
 }
 Portrait = ContainerFrame1Portrait {
 }
 ExtraBagSlotsHelpBox = ContainerFrame1ExtraBagSlotsHelpBox {
 }
 ClickableTitleFrame = <unnamed> {
 }
 bags = <table> {
 }
 forceExtended = false
 FilterDropDown = ContainerFrame1FilterDropDown {
 }
 bagsShown = 0
 FilterIcon = <unnamed> {
 }
 allBags = true
 size = 16
}
size = 16
id = 0
name = "ContainerFrame1"
bgTextureTop = ContainerFrame1BackgroundTop {
 0 = <userdata>
}
bgTextureMiddle = ContainerFrame1BackgroundMiddle1 {
 0 = <userdata>
}
bgTextureMiddle2 = ContainerFrame1BackgroundMiddle2 {
 0 = <userdata>
}
bgTextureBottom = ContainerFrame1BackgroundBottom {
 0 = <userdata>
}
bgTexture1Slot = ContainerFrame1Background1Slot {
 0 = <userdata>
}
columns = 4
rows = 4
backpackFirstButtonOffset = -225
secured = false
baseSize = 16
index = 16
itemButton = nil
(for index) = 1
(for limit) = 16
(for step) = 1
i = 1
(*temporary) = <table> {
 UpdateOnBarHighlightMarksBySpell = <function> defined @Interface\FrameXML\ActionButton.lua:74
 ERR_OUT_OF_CHI = "Not enough chi"
 DH_HAVOC_CORE_ABILITY_2 = "Strong melee attack that consumes Fury. If it critical strikes, some Fury is refunded."
 MultiCastActionButton6Cooldown = MultiCastActionButton6Cooldown {
 }
 GetTrainerServiceTypeFilter = <function> defined =[C]:-1
 UNIT_NAMES_COMBATLOG_TOOLTIP = "Color unit names."
 SetTrainerServiceTypeFilter = <function> defined =[C]:-1
 LE_GAME_ERR_CHAT_RAID_RESTRICTED_TRIAL = 740
 SPELL_FAILED_CUSTOM_ERROR_71 = "This partygoer wants to dance with you."
 LE_GAME_ERR_PET_SPELL_TARGETS_DEAD = 398
 ERROR_CLUB_TICKET_COUNT_AT_MAX_COMMUNITY = "Can't create any more invite links for this community."
 RecruitAFriendFrame = RecruitAFriendFrame {
 }
 CompactUnitFrameProfilesGeneralOptionsFrameHealthTextDropdownButtonNormalTexture = CompactUnitFrameProfilesGeneralOptionsFrameHealthTextDropdownButtonNormalTexture {
 }
 TutorialFrameLeft19 = TutorialFrameLeft19 {
 }
 MultiCastActionButton2Cooldown = MultiCastActionButton2Cooldown {
 }
 ERR_TRADE_EQUIPPED_BAG = "You can't trade equipped bags."
 PVP_RANK_6_1 = "Corporal"
 BOOKTYPE_PROFESSION = "professions"
 AudioOptionsVoicePanelOutputDeviceDropdownButtonHighlightTexture = AudioOptionsVoicePanelOutputDeviceDropdownButtonHighlightTexture {
 }
 VideoOptionsFrameDefaults = VideoOptionsFrameDefaults {
 }
 MerchantItem1AltCurrencyFrameItem1Text = MerchantItem1AltCurrencyFrameItem1Text {
 }
 OPTION_TOOLTIP_ACTION_BUTTON_USE_KEY_DOWN = "Action button keybinds will respond on key down, rather than on key up."
 BINDING_NAME_NAMEPLATES = "Show Enemy Name Plates"
 INSTANCE_UNAVAILABLE_OTHER_TEMPORARILY_DISABLED = "%s cannot enter. This instance is temporarily disabled."
 MultiBarBottomRightButton8Shine5 = MultiBarBottomRightButton8Shine5 {
 }
 IsReferAFriendLinked = <function> defined =[C]:-1
 MAIL_LETTER_TOOLTIP = "Click to make a permanent
copy of this letter."
 UnitFrameManaBar_UnregisterDefaultEvents = <function> defined @Interface\FrameXML\UnitFrame.lua:794
 PaperDollTitlesPaneButton12BgTop = PaperDollTitlesPaneButton12BgTop {
 }
 ERR_NOAMMO_S = "%s"
 CHAT_CONFIG_OTHER_COMBAT = <table> {
 }
 FCFDockOverflowButton_OnClick = <function> defined @Interface\FrameXML\FloatingChatFrame.lua:2372
 TutorialFrameRight19 = Tut

This behaviour persists until I completely quit and restart WoW.
Then it's the same again. Everything OK before I go on Altoholic's "Character" tab (NB without any error messages so far) and then /reload -> leading to the "completely broken" state.

Does this make any sense to you?

Fizzlemizz 03-27-19 10:23 AM

I downloaded the addon from WoWI, changed the 2 occurrences of the template and everything seems to work, AH, Mail, Character tab in Altoholic.

Mails.xml
Code:

<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
        <Script file="Mails.lua"></Script>

        <Button name="AltoMailEntryTemplate" virtual="true">
                <Size x="615" y="41" />
                <Layers>
                        <Layer level="BACKGROUND">
                                <FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
                                        <Size x="220" y="32" />
                                        <Anchors>
                                                <Anchor point="TOPLEFT" x="53" y="0" />
                                        </Anchors>
                                </FontString>
                                <FontString name="$parentCharacter" inherits="GameFontNormal">
                                        <Size x="130" y="32" />
                                        <Anchors>
                                                <Anchor point="BOTTOMLEFT" relativeTo="$parentName" relativePoint="BOTTOMRIGHT" x="5" y="0" />
                                        </Anchors>
                                </FontString>
                                <FontString name="$parentExpiry" inherits="GameFontNormal">
                                        <Size x="200" y="32" />
                                        <Anchors>
                                                <Anchor point="BOTTOMLEFT" relativeTo="$parentCharacter" relativePoint="BOTTOMRIGHT" x="5" y="0" />
                                        </Anchors>
                                </FontString>
                        </Layer>
                </Layers>
                <Frames>
                        <ItemButton name="$parentItem"> <!-- inherits="ItemButtonTemplate"> -->
                                <Anchors>
                                        <Anchor point="TOPLEFT" x="10" y="0" />
                                </Anchors>
                                <Scripts>
                                        <OnEnter>
                                                Altoholic.Mail:OnEnter(self)
                                        </OnEnter>
                                        <OnLeave>
                                                GameTooltip:Hide();
                                        </OnLeave>
                                        <OnClick>
                                                Altoholic.Mail:OnClick(self, button)
                                        </OnClick>
                                </Scripts>
                        </ItemButton>
                </Frames>
                <HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
                        <Size x="560" y="37" />
                        <Anchors>
                                <Anchor point="TOPLEFT" x="50" y="0" />
                        </Anchors>
                        <TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
                </HighlightTexture>
        </Button>

        <Frame name="AltoholicFrameMail" parent="AltoholicTabCharacters" hidden="true">
                <Size x="615" y="306" />
                <Anchors>
                        <Anchor point="TOPRIGHT" x="39" y="-105" />
                </Anchors>
                <Frames>
                        <ScrollFrame name="$parentScrollFrame" parentKey="ScrollFrame" inherits="AltoBaseScrollFrameTemplate" hidden="true">
                                <Scripts>
                                        <OnVerticalScroll>
                                                self:OnVerticalScroll(offset, 41, Altoholic.Mail.Update)
                                        </OnVerticalScroll>
                                </Scripts>
                                <!--
                                <KeyValues>
                                        <KeyValue key="numRows" value="7" type="number" />
                                        <KeyValue key="rowTemplate" value="AltoMailEntryTemplate" />
                                </KeyValues>
                                -->
                        </ScrollFrame>
                       
                        <Button name="$parentEntry1" inherits="AltoMailEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentScrollFrame" relativePoint="TOPLEFT" x="0" y="0" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry2" inherits="AltoMailEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry1" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry3" inherits="AltoMailEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry2" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry4" inherits="AltoMailEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry3" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry5" inherits="AltoMailEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry4" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry6" inherits="AltoMailEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry5" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry7" inherits="AltoMailEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry6" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                </Frames>
        </Frame>
       
</Ui>

Auctionhouse.xml
Code:

<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
        <Script file="AuctionHouse.lua"></Script>

        <Button name="AltoAuctionEntryTemplate" virtual="true">
                <Size x="615" y="41" />
                <Layers>
                        <Layer level="BACKGROUND">
                                <FontString name="$parentName" inherits="GameFontNormal" justifyH="LEFT">
                                        <Size x="220" y="14" />
                                        <Anchors>
                                                <Anchor point="TOPLEFT" x="53" y="0" />
                                        </Anchors>
                                </FontString>
                                <FontString name="$parentTimeLeft" inherits="GameFontNormal" justifyH="LEFT">
                                        <Size x="220" y="10" />
                                        <Anchors>
                                                <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="BOTTOMLEFT" x="0" y="-2" />
                                        </Anchors>
                                </FontString>
                                <FontString name="$parentHighBidder" inherits="GameFontNormal">
                                        <Size x="160" y="32" />
                                        <Anchors>
                                                <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="TOPRIGHT" x="5" y="0" />
                                        </Anchors>
                                </FontString>
                                <FontString name="$parentPrice" inherits="GameFontNormal" justifyH="RIGHT">
                                        <Size x="150" y="32" />
                                        <Anchors>
                                                <Anchor point="BOTTOMLEFT" relativeTo="$parentHighBidder" relativePoint="BOTTOMRIGHT" x="5" y="0" />
                                        </Anchors>
                                </FontString>
                        </Layer>
                </Layers>
                <Frames>
                        <ItemButton name="$parentItem">  <!-- inherits="ItemButtonTemplate">-->
                                <Anchors>
                                        <Anchor point="TOPLEFT" x="10" y="0" />
                                </Anchors>
                                <Scripts>
                                        <OnEnter>
                                                Altoholic.AuctionHouse:OnEnter(self)
                                        </OnEnter>
                                        <OnLeave>
                                                GameTooltip:Hide();
                                        </OnLeave>
                                        <OnClick>
                                                Altoholic.AuctionHouse:OnClick(self, button)
                                        </OnClick>
                                </Scripts>
                        </ItemButton>
                </Frames>
                <Scripts>
                        <OnLoad>
                                self:RegisterForClicks("LeftButtonDown", "RightButtonDown");
                        </OnLoad>
                        <OnClick>
                                if button == "RightButton" then
                                        ToggleDropDownMenu(1, nil, AltoholicFrameAuctionsRightClickMenu, self:GetName(), 0, -5);
                                end
                        </OnClick>
                </Scripts>
                <HighlightTexture name="$parentHighlight" file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
                        <Size x="555" y="37" />
                        <Anchors>
                                <Anchor point="TOPLEFT" x="55" y="0" />
                        </Anchors>
                        <TexCoords left="0" right="1.0" top="0" bottom="0.578125"/>
                </HighlightTexture>
        </Button>

        <Frame name="AltoholicFrameAuctions" parent="AltoholicTabCharacters" hidden="true">
                <Size x="615" y="306" />
                <Anchors>
                        <Anchor point="TOPRIGHT" x="39" y="-105" />
                </Anchors>
                <Frames>
                        <ScrollFrame name="$parentScrollFrame" inherits="AltoBaseScrollFrameTemplate" hidden="true">
                                <Scripts>
                                        <OnVerticalScroll>
                                                self:OnVerticalScroll(offset, 41, Altoholic.AuctionHouse.Update)
                                        </OnVerticalScroll>
                                </Scripts>
                        </ScrollFrame>
                       
                        <Button name="$parentEntry1" inherits="AltoAuctionEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentScrollFrame" relativePoint="TOPLEFT" x="0" y="0" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry2" inherits="AltoAuctionEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry1" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry3" inherits="AltoAuctionEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry2" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry4" inherits="AltoAuctionEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry3" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry5" inherits="AltoAuctionEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry4" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry6" inherits="AltoAuctionEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry5" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                        <Button name="$parentEntry7" inherits="AltoAuctionEntryTemplate">
                                <Anchors>
                                        <Anchor point="TOPLEFT" relativeTo="$parentEntry6" relativePoint="BOTTOMLEFT" />
                                </Anchors>
                        </Button>
                </Frames>
        </Frame>
       
</Ui>


Fizzlemizz 03-27-19 10:49 AM

In your two files you also changed the top level template nodes (AltoAuctionEntryTemplate and AltoMailEntryTemplate) from Button to ItemButton even though they never inherited ItemButtonTemplate.

LudiusMaximus 03-27-19 06:05 PM

@Fizzlemizz: You are so right! I feel really stupid right now. :o
I wanted to try from scratch, so I used the Twitch App's "reinstall" on Altoholic.
As a result I got completely new error messages. So I compared the content of my Altoholic folders with that of the downloadable zip file and realised that there were several files completely missing. No idea how this could happen. Maybe the Twitch App got confused by the multitude of single addons Altoholic is comprised of? Anyway I uninstalled Altoholic, then installed anew, applied your changes (i.e. only the Button tags inheriting from ItemButtonTemplate) and everything works fine now. Thank you so much! I guess I should henceforth use Minion instead of Twitch... :p

One follow-up question, if I may: Is it possible to make such an xml correction "from outside" the addon? I am working on some other fixes for Altoholic that I can apply by hooking/overriding its public functions in lua. Is something similar possible to override the xml file's content?

Fizzlemizz 03-27-19 08:34 PM

I would say you can't do anything like this with xml virtuals or intrinsics, at least not without some post creation gymnastics in the odd instance where they don't do anything OnLoad.

Someone else may know better.

tkle 04-05-19 03:14 PM

Hi.

I have a similar problem with showing itemlevel in Syiana's UI, SUI 7.2. Since he has discontinued the project(stopped playing), I'm trying to fix some few bugs for personal use

Here's the code for showing iLvL in the characterpanel and bags(bags work). Does not work after 8.1.5:
Lua Code:
  1. --[[SUI ITEMLEVEL v1.0]]
  2.  
  3. --FIX LIBSTUB
  4.  
  5. local CF=CreateFrame("Frame")
  6. CF:RegisterEvent("PLAYER_LOGIN")
  7. CF:SetScript("OnEvent", function(self, event)
  8.  
  9. if not SUIDB.A_ITEMLEVEL == true then return end
  10.  
  11. local MAJOR, MINOR = "ItemLevel", 1
  12. local lib = LibStub:NewLibrary(MAJOR, MINOR)
  13.  
  14. if not lib then
  15.     return
  16. end
  17.  
  18. local ItemLevelPattern = gsub(ITEM_LEVEL, "%%d", "(%%d+)")
  19.  
  20. local tooltip = CreateFrame("GameTooltip", "LibItemLevelTooltip1", UIParent, "GameTooltipTemplate")
  21. local unittip = CreateFrame("GameTooltip", "LibItemLevelTooltip2", UIParent, "GameTooltipTemplate")
  22.  
  23. function lib:hasLocally(ItemID)
  24.     if (not ItemID or ItemID == "" or ItemID == "0") then
  25.         return true
  26.     end
  27.     return select(10, GetItemInfo(tonumber(ItemID)))
  28. end
  29.  
  30. function lib:itemLocally(ItemLink)
  31.     local id, gem1, gem2, gem3 = string.match(ItemLink, "item:(%d+):[^:]*:(%d-):(%d-):(%d-):")
  32.     return (self:hasLocally(id) and self:hasLocally(gem1) and self:hasLocally(gem2) and self:hasLocally(gem3))
  33. end
  34.  
  35. function lib:GetItemInfo(ItemLink)
  36.     if (not ItemLink or ItemLink == "") then
  37.         return 0, 0
  38.     end
  39.     if (not string.match(ItemLink, "item:%d+:")) then
  40.         return -1, 0
  41.     end
  42.     if (not self:itemLocally(ItemLink)) then
  43.         return 1, 0
  44.     end
  45.     local level, text
  46.     tooltip:SetOwner(UIParent, "ANCHOR_NONE")
  47.     tooltip:ClearLines()
  48.     tooltip:SetHyperlink(ItemLink)
  49.     for i = 2, 5 do
  50.         text = _G[tooltip:GetName() .. "TextLeft" .. i]:GetText() or ""
  51.         level = string.match(text, ItemLevelPattern)
  52.         if (level) then
  53.             break
  54.         end
  55.     end
  56.     return 0, tonumber(level) or 0, GetItemInfo(ItemLink)
  57. end
  58.  
  59. LibItemLevel = LibStub:GetLibrary("ItemLevel")
  60.  
  61. function lib:GetUnitItemInfo(unit, index)
  62.     if (not UnitExists(unit)) then
  63.         return 1, 0
  64.     end
  65.     unittip:SetOwner(UIParent, "ANCHOR_NONE")
  66.     unittip:ClearLines()
  67.     unittip:SetInventoryItem(unit, index)
  68.     local ItemLink = select(2, unittip:GetItem())
  69.     if (not ItemLink or ItemLink == "") then
  70.         return 0, 0
  71.     end
  72.     if (not self:itemLocally(ItemLink)) then
  73.         return 1, 0
  74.     end
  75.     local level, text
  76.     for i = 2, 5 do
  77.         text = _G[unittip:GetName() .. "TextLeft" .. i]:GetText() or ""
  78.         level = string.match(text, ItemLevelPattern)
  79.         if (level) then
  80.             break
  81.         end
  82.     end
  83.     return 0, tonumber(level) or 0, GetItemInfo(ItemLink)
  84. end
  85.  
  86. function lib:GetUnitItemLevel(unit)
  87.     local total, counts = 0, 0
  88.     local _, count, level
  89.     for i = 1, 15 do
  90.         if (i ~= 4) then
  91.             count, level = self:GetUnitItemInfo(unit, i)
  92.             total = total + level
  93.             counts = counts + count
  94.         end
  95.     end
  96.     local mcount, mlevel, mquality, mslot, ocount, olevel, oquality, oslot
  97.     mcount, mlevel, _, _, mquality, _, _, _, _, _, mslot = self:GetUnitItemInfo(unit, 16)
  98.     ocount, olevel, _, _, oquality, _, _, _, _, _, oslot = self:GetUnitItemInfo(unit, 17)
  99.     counts = counts + mcount + ocount
  100.  
  101.     if
  102.         (mquality == 6 or oslot == "INVTYPE_2HWEAPON" or mslot == "INVTYPE_2HWEAPON" or mslot == "INVTYPE_RANGED" or
  103.             mslot == "INVTYPE_RANGEDRIGHT")
  104.      then
  105.         total = total + max(mlevel, olevel) * 2
  106.     else
  107.         total = total + mlevel + olevel
  108.     end
  109.     return counts, total / (16 - counts), total
  110. end
  111.  
  112. function ShowPaperDollItemLevel(self, unit)
  113.     result = ""
  114.     id = self:GetID()
  115.     if id == 4 or id > 17 then
  116.         return
  117.     end
  118.     if not self.levelString then
  119.         self.levelString = self:CreateFontString(nil, "OVERLAY")
  120.         self.levelString:SetFont(STANDARD_TEXT_FONT, 12, "OUTLINE")
  121.         self.levelString:SetPoint("TOP")
  122.         self.levelString:SetTextColor(1, 0.82, 0)
  123.     end
  124.     if unit and self.hasItem then
  125.         _, level, _, _, quality = LibItemLevel:GetUnitItemInfo(unit, id)
  126.         if level > 0 and quality > 2 then
  127.             self.levelString:SetText(level)
  128.             result = true
  129.         end
  130.     else
  131.         self.levelString:SetText("")
  132.         result = true
  133.     end
  134.     if id == 16 or id == 17 then
  135.         _, offhand, _, _, quality = LibItemLevel:GetUnitItemInfo(unit, 17)
  136.         if quality == 6 then
  137.             _, mainhand = LibItemLevel:GetUnitItemInfo(unit, 16)
  138.             self.levelString:SetText(math.max(mainhand, offhand))
  139.         end
  140.     end
  141.     return result
  142. end
  143. hooksecurefunc(
  144.     "PaperDollItemSlotButton_Update",
  145.     function(self)
  146.         ShowPaperDollItemLevel(self, "player")
  147.     end
  148. )
  149.  
  150. function SetContainerItemLevel(button, ItemLink)
  151.     if not button then
  152.         return
  153.     end
  154.     if not button.levelString then
  155.         button.levelString = button:CreateFontString(nil, "OVERLAY")
  156.         button.levelString:SetFont(STANDARD_TEXT_FONT, 12, "THICKOUTLINE")
  157.         button.levelString:SetPoint("TOP")
  158.     end
  159.     if button.origItemLink ~= ItemLink then
  160.         button.origItemLink = ItemLink
  161.     else
  162.         return
  163.     end
  164.     if ItemLink then
  165.         count, level, _, _, quality, _, _, class, subclass, _, _ = LibItemLevel:GetItemInfo(ItemLink)
  166.         name, _ = GetItemSpell(ItemLink)
  167.         _, equipped, _ = GetAverageItemLevel()
  168.         if level >= (98 * equipped / 100) then
  169.             button.levelString:SetTextColor(0, 1, 0)
  170.         else
  171.             button.levelString:SetTextColor(1, 1, 1)
  172.         end
  173.         if count == 0 and level > 0 and quality > 1 then
  174.             button.levelString:SetText(level)
  175.         else
  176.             button.levelString:SetText("")
  177.         end
  178.     else
  179.         button.levelString:SetText("")
  180.     end
  181. end
  182. hooksecurefunc(
  183.     "ContainerFrame_Update",
  184.     function(self)
  185.         local name = self:GetName()
  186.         for i = 1, self.size do
  187.             local button = _G[name .. "Item" .. i]
  188.             SetContainerItemLevel(button, GetContainerItemLink(self:GetID(), button:GetID()))
  189.         end
  190.     end
  191. )
  192.  
  193. end)

Hope someone can help :)

myrroddin 04-06-19 05:00 AM

tkle, you are better off posting this in the Lua/XML help thread in the Developer section of the forums.

Not really to your point, but line 9 contains superfluous code.
Lua Code:
  1. if not SUIDB.A_ITEMLEVEL == true then return end
  2.  
  3. -- is exactly the same as writing
  4.  
  5. if not SUIDB.A_ITEMLEVEL then return end
not assumes false or nil values. It does not distinguish between false or nil, so if you are checking against true, false, and nil, then you'd have to specify.
Conversely, these are the same:
Lua Code:
  1. if something then -- assumes true OR a value that is non-nil and non-false, like 1 or "dog"
  2.  
  3. if something == true then -- also non-false, non-nil, but specifically Boolean

FranekW 06-22-19 07:22 AM

I jumped in this thread because I was also interested in Altoholic issue with ItemButton--thanks for pointing out the erroneous parts.


Just having this opportunity, could someone describe the difference between Button and ItemButton? I know the latter is inherited from Button.

Fizzlemizz 06-22-19 07:46 AM

ItemButtonTemplate used to be a template (xml with the virtual attribute that inherited the button widget and added extra "bits" like frames, textures etc. that was automatically "applied" to any other widget that inherited from ItemButtonTemplate).

Blizzard moved ItemButtonTemplate to being an intrinsic (pseudo widget) ItemButton. In both cases they inherit from the button widget adding the extras.

Difference in usage:

Code:

local f = CreateFrame("Button", "MyItemButton", UIParent, "ItemButtonTemplate")

local f = CreateFrame("ItemButton", "MyItemButton", UIParent)



All times are GMT -6. The time now is 11:43 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2019 MMOUI