[Addon] XML Label updating? menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    newtech's Avatar Active Member
    Reputation
    57
    Join Date
    Aug 2008
    Posts
    308
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Addon] XML Label updating?

    Hey guys

    Alright, so I don't really know where else to post this, so I hope this section is suitable for the question. Otherwise, could a moderator move it? x)
    Well, what I want to ask is, how can I update the label on my XML frame, when something happens in my Lua script? Currently, I got it to work with only saying +1 to the variable 'Count' every time a spell is successfully casted, but I can't seem to make it actually appear on the label xP Like, update the label when the event "UNIT_SPELLCAST_SUCCEEDED" happens. So... Anyone got an idea? This is how the frame looks so far:

    But the '0' in it, just stays 0 since I have no idea how to go about updating it, and before you say 'Try google', I have tried. But there is just SO little documentation on how to do it, and those few things there is, haven't really helped me out :s
    So please, MMOwned, halp! D:


    Thanks
    Newtech



    @Edit:
    Lua:
    Code:
    local Count = 0
    
    function events:UNIT_SPELLCAST_SUCCEEDED(...)
    	Count = Count + 1
    	print(Count);
    	-- Its here, I assume it would be something like "label:SetText(Count)" or something :s
    end
    
    -- I got the code below from a tutorial somewhere xP
    
    local frame, events = CreateFrame("Frame"), {};
    function events:PLAYER_ENTERING_WORLD(...)
     -- handle PLAYER_ENTERING_WORLD here
    end
    
    function events:PLAYER_LEAVING_WORLD(...)
     -- handle PLAYER_LEAVING_WORLD here
    end
    frame:SetScript("OnEvent", function(self, event, ...)
     events[event](self, ...);
    end);
    for k, v in pairs(events) do
     frame:RegisterEvent(k);
    end
    XML:
    Code:
    <Ui xmlns="http://www.blizzard.com/wow/ui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <!--Autogenerated by wowuides, Version=1.0.300.0, Culture=neutral, PublicKeyToken=null-->
      <Frame name="SpellCounterForm" movable="true" enableMouse="true">
        <!--<FrameSkin skinid="8309da78-006d-4401-9d4f-cbc448d08261" frameid="047a5294-fa59-460b-83cb-0c19711baeb7" />-->
        <Size>
          <AbsDimension x="152" y="170" />
        </Size>
        <Anchors>
          <Anchor point="CENTER" relativeTo="UIParent">
            <Offset>
              <AbsDimension x="0" y="0" />
            </Offset>
          </Anchor>
        </Anchors>
        <TitleRegion setAllPoints="true" />
        <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
          <BackgroundInsets>
            <AbsInset left="11" right="12" top="12" bottom="11" />
          </BackgroundInsets>
          <TileSize>
            <AbsValue val="32" />
          </TileSize>
          <EdgeSize>
            <AbsValue val="32" />
          </EdgeSize>
        </Backdrop>
        <Frames>
          <Button name="$parentButton1" text="Party">
            <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
            <Size>
              <AbsDimension x="63" y="28" />
            </Size>
            <Anchors>
              <Anchor point="TOPLEFT">
                <Offset>
                  <AbsDimension x="16" y="-125" />
                </Offset>
              </Anchor>
            </Anchors>
            <NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </NormalTexture>
            <PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </PushedTexture>
            <DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </DisabledTexture>
            <HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </HighlightTexture>
            <ButtonText name="$parentText">
              <FontHeight>
                <AbsValue val="10" />
              </FontHeight>
            </ButtonText>
            <NormalFont style="GameFontNormal" />
            <HighlightFont style="GameFontHighlight" />
            <DisabledFont style="GameFontDisable" />
          </Button>
          <Frame name="SpellCounter_Number">
            <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
            <Size>
              <AbsDimension x="121" y="35" />
            </Size>
            <Anchors>
              <Anchor point="TOPLEFT">
                <Offset>
                  <AbsDimension x="16" y="-84" />
                </Offset>
              </Anchor>
            </Anchors>
            <Layers>
              <Layer>
                <FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="0">
                  <Anchors>
                    <Anchor point="TOPLEFT" />
                    <Anchor point="BOTTOMRIGHT" />
                  </Anchors>
                  <FontHeight>
                    <AbsValue val="16" />
                  </FontHeight>
                  <Color r="1" g="0.8196079" b="0" />
                  <Shadow>
                    <Color r="0" g="0" b="0" />
                    <Offset>
                      <AbsDimension x="1" y="-1" />
                    </Offset>
                  </Shadow>
                </FontString>
              </Layer>
            </Layers>
            <Scripts>
              <OnEvent>
    if event == "UNIT_SPELLCAST_SUCCEEDED" then
    count = count + 1
    print(count);
    end
    
    </OnEvent>
              <OnLoad>local count = 0</OnLoad>
            </Scripts>
          </Frame>
          <Frame name="$parentLabel2">
            <!--<FrameSkin skinid="f15d4970-d66d-444e-bb2d-1ad102c87fed" frameid="f15d4978-d66d-444e-bb2d-1ad102c87fed" />-->
            <Size>
              <AbsDimension x="112" y="26" />
            </Size>
            <Anchors>
              <Anchor point="TOPLEFT">
                <Offset>
                  <AbsDimension x="20" y="-52" />
                </Offset>
              </Anchor>
            </Anchors>
            <Layers>
              <Layer>
                <FontString name="$parentLabel" setAllPoints="true" font="Fonts\FRIZQT__.TTF" text="Spells casted:">
                  <FontHeight>
                    <AbsValue val="12" />
                  </FontHeight>
                  <Color r="1" g="0.8196079" b="0" />
                  <Shadow>
                    <Color r="0" g="0" b="0" />
                    <Offset>
                      <AbsDimension x="1" y="-1" />
                    </Offset>
                  </Shadow>
                </FontString>
              </Layer>
            </Layers>
          </Frame>
          <Frame name="$parentLabel1">
            <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
            <Size>
              <AbsDimension x="121" y="28" />
            </Size>
            <Anchors>
              <Anchor point="TOPLEFT">
                <Offset>
                  <AbsDimension x="16" y="-18" />
                </Offset>
              </Anchor>
            </Anchors>
            <Layers>
              <Layer>
                <FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="Spell Counter">
                  <Anchors>
                    <Anchor point="TOPLEFT" />
                    <Anchor point="BOTTOMRIGHT" />
                  </Anchors>
                  <FontHeight>
                    <AbsValue val="16" />
                  </FontHeight>
                  <Color r="1" g="0.8196079" b="0" />
                  <Shadow>
                    <Color r="0" g="0" b="0" />
                    <Offset>
                      <AbsDimension x="1" y="-1" />
                    </Offset>
                  </Shadow>
                </FontString>
              </Layer>
            </Layers>
          </Frame>
          <Button name="$parentComponent1" text="Reset">
            <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
            <Size>
              <AbsDimension x="52" y="28" />
            </Size>
            <Anchors>
              <Anchor point="TOPLEFT">
                <Offset>
                  <AbsDimension x="85" y="-125" />
                </Offset>
              </Anchor>
            </Anchors>
            <NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </NormalTexture>
            <PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </PushedTexture>
            <DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </DisabledTexture>
            <HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
              <TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
            </HighlightTexture>
            <ButtonText name="$parentText">
              <FontHeight>
                <AbsValue val="10" />
              </FontHeight>
            </ButtonText>
            <NormalFont style="GameFontNormal" />
            <HighlightFont style="GameFontHighlight" />
            <DisabledFont style="GameFontDisable" />
          </Button>
        </Frames>
      </Frame>
    </Ui>
    Yes, I made the XML with Wow UI Designer xP
    Last edited by newtech; 04-23-2011 at 03:52 PM.
    LuaHypArc Lua scripter - 3.3.5a World Builder.

    [Addon] XML Label updating?
  2. #2
    Timmid's Avatar Member
    Reputation
    124
    Join Date
    Apr 2007
    Posts
    244
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    post code? i'll try to help

  3. #3
    newtech's Avatar Active Member
    Reputation
    57
    Join Date
    Aug 2008
    Posts
    308
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Updated with the Lua and XML code :P

    Thanks
    Newtech
    LuaHypArc Lua scripter - 3.3.5a World Builder.

Similar Threads

  1. [Addon] Achievement Faker - updated
    By Syan in forum WoW UI, Macros and Talent Specs
    Replies: 9
    Last Post: 10-11-2009, 04:49 AM
  2. [Addon] Achievement Faker - updated
    By Syan in forum World of Warcraft Bots and Programs
    Replies: 4
    Last Post: 08-18-2009, 10:34 AM
  3. Antrix GM Addon - 2.3 Update
    By Rednexx in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 12-31-2007, 02:30 PM
  4. Updated Addons List for latest patch!
    By Unholyshaman in forum World of Warcraft General
    Replies: 6
    Last Post: 09-27-2007, 11:06 PM
  5. Popular Addons for use with Glider Last Updated Dec13
    By AlMoBdE3 in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 07-31-2007, 04:12 AM
All times are GMT -5. The time now is 08:06 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search