Thread Tools Display Modes
01-02-06, 07:41 PM   #1
Rainto
A Defias Bandit
Join Date: Jan 2006
Posts: 2
Working on a DKP Spam Channel Plugin.

Okay, so if the title didn't already make it clear I am working on turning a whisperbot voting sytem into a spamchannel system with a GUI. I however am having some issues with the actual coding of this. So far it is in the GUI part of the plugin. Since I am not really familiar with the way WoW plugins work I started reading the WoWinterface forums, the Wowwiki, and LUA-users.org. I Downloaded the WoW UI Designer since I love to be able to code with an IDE. However I found a problem with it :P It doesn't add the <Script file> tag to the .xml file with the graphical designer. Okay, that should be enough background on this. Here is the problem. I am trying to get a Label to show up as the player's name. So far I can get it to return a null value but that is all. Oh and if I take out line nine of the lua it will post the character name to the chatwindow with no issues.

FearInc.lua:
Code:
function DKP_Startup()
	this:RegisterEvent("VARIABLES_LOADED");
	tinsert(UISpecialFrames, "FearincForm");
end
function DKP_OnShow()
	local Label,PlayerName;
	PlayerName = UnitName("player");
	Label = getglobal("FearIncForm".."NameLabel");
	Label:SetText("Name:"..PlayerName);
	ChatFrame1:AddMessage('Hi my name is:' .. PlayerName);
end
FearIncForm.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.200.0, Culture=neutral, PublicKeyToken=null-->
  <Script file="FearInc.lua" />
  <Frame name="FearIncForm">
    <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508883-59c2-4f83-ae10-27aaad48391b" />-->
    <Size>
      <AbsDimension x="310" y="452" />
    </Size>
    <Anchors>
      <Anchor point="CENTER" relativeTo="UIParent">
        <Offset>
          <AbsDimension x="0" y="0" />
        </Offset>
      </Anchor>
    </Anchors>
    <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>
    <Layers>
      <Layer>
        <Texture name="$parentTitleBorder" file="Interface\DialogFrame\UI-DialogBox-Header">
          <Size>
            <AbsDimension x="160" y="32" />
          </Size>
          <Anchors>
            <Anchor point="TOP">
              <Offset>
                <AbsDimension x="0" y="5" />
              </Offset>
            </Anchor>
          </Anchors>
          <TexCoords left="0.2" right="0.8" top="0" bottom="0.6" />
        </Texture>
        <FontString name="$parentTitleString" font="Fonts\FRIZQT__.TTF" text="Fear Inc DKP">
          <Size>
            <AbsDimension x="140" y="0" />
          </Size>
          <Anchors>
            <Anchor point="TOP">
              <Offset>
                <AbsDimension x="0" y="-4" />
              </Offset>
            </Anchor>
          </Anchors>
          <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>
    <Frames>
      <Frame name="$NameLabel">
        <!--<FrameSkin skinid="f15d4970-d66d-444e-bb2d-1ad102c87fed" frameid="f15d4978-d66d-444e-bb2d-1ad102c87fed" />-->
        <Size>
          <AbsDimension x="281" y="31" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="15" y="-30" />
            </Offset>
          </Anchor>
        </Anchors>
        <Layers>
          <Layer>
            <FontString setAllPoints="true" font="Fonts\FRIZQT__.TTF" text="&lt;Name Label&gt;">
              <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>
        <Scripts>
          <OnShow>DKP_OnShow();</OnShow>
        </Scripts>
      </Frame>
      <Button name="$parentDoneButton" text="Done">
        <!--<FrameSkin skinid="f15d4970-d66d-444e-bb2d-1ad102c87fed" frameid="f15d4973-d66d-444e-bb2d-1ad102c87fed" />-->
        <Size>
          <AbsDimension x="100" y="22" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="102" y="-430" />
            </Offset>
          </Anchor>
        </Anchors>
        <Scripts>
          <OnClick>FearIncForm:Hide();</OnClick>
        </Scripts>
        <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>
        <NormalText name="$parentText" font="Fonts\FRIZQT__.TTF">
          <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>
        </NormalText>
        <HighlightText font="Fonts\FRIZQT__.TTF">
          <FontHeight>
            <AbsValue val="12" />
          </FontHeight>
          <Color r="1" g="1" b="1" />
          <Shadow>
            <Color r="0" g="0" b="0" />
            <Offset>
              <AbsDimension x="1" y="-1" />
            </Offset>
          </Shadow>
        </HighlightText>
        <DisabledText font="Fonts\FRIZQT__.TTF">
          <FontHeight>
            <AbsValue val="12" />
          </FontHeight>
          <Color r="0.4901961" g="0.4901961" b="0.4901961" />
          <Shadow>
            <Color r="0" g="0" b="0" />
            <Offset>
              <AbsDimension x="1" y="-1" />
            </Offset>
          </Shadow>
        </DisabledText>
        <PushedTextOffset x="0" y="0" />
      </Button>
    </Frames>
    <Scripts>
      <OnLoad>DKP_Startup();</OnLoad>
    </Scripts>
  </Frame>
</Ui>
FearInc.toc:
Code:
## Interface: 1800
## Title: FearInc
## Author: Rainto
## Notes: Fear Inc.'s own DKP system.
## DefaultState: Enabled
## LoadOnDemand: 0
FearIncForm.xml
FearInc.lua
  Reply With Quote
01-02-06, 09:47 PM   #2
Rainto
A Defias Bandit
Join Date: Jan 2006
Posts: 2
I've tried everything that I can think of now *sigh*. I've tried to find an AddOn that displays a player name in it, but I can't seem to even manage that one so.. any ideas? However, the problem is with the following line without any doubt.
Code:
Label:SetText("Name:"..PlayerName);

Last edited by Rainto : 01-03-06 at 02:15 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Working on a DKP Spam Channel Plugin.


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