Quantcast 8.1.5 ItemButtonTemplate Changes - Page 2 - WoWInterface
Thread Tools Display Modes
03-26-19, 06:00 PM   #21
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 109
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!
  Reply With Quote
03-26-19, 07:25 PM   #22
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,128
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-26-19 at 08:05 PM.
  Reply With Quote
03-27-19, 05:58 AM   #23
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 109
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?
  Reply With Quote
03-27-19, 10:23 AM   #24
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,128
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
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-27-19 at 10:50 AM.
  Reply With Quote
03-27-19, 10:49 AM   #25
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,128
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-27-19 at 02:55 PM.
  Reply With Quote
03-27-19, 06:05 PM   #26
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 109
@Fizzlemizz: You are so right! I feel really stupid right now.
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...

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?
  Reply With Quote
03-27-19, 08:34 PM   #27
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,128
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
04-05-19, 03:14 PM   #28
tkle
A Defias Bandit
Join Date: Apr 2019
Posts: 2
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
  Reply With Quote
04-06-19, 05:00 AM   #29
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,027
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
  Reply With Quote
06-22-19, 07:22 AM   #30
FranekW
An Aku'mai Servant
 
FranekW's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 35
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.
  Reply With Quote
06-22-19, 07:46 AM   #31
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,128
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)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-22-19 at 10:47 AM.
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » 8.1.5 ItemButtonTemplate Changes

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off