View Single Post
05-08-07, 03:39 AM   #4
hellis
A Defias Bandit
Join Date: May 2007
Posts: 3
LUA:
Code:
function AdvancedPMSForm_OnLoad()
    SLASH_AdvancedPMS1 = "/advancedpms";
    SLASH_AdvancedPMS2 = "/apms";

    SlashCmdList["AdvancedPMS"] = function(msg)
    AdvancedPMS_SlashCommandHandler(msg);
    end

        DEFAULT_CHAT_FRAME:AddMessage("AdvancedPMS Loaded");
end

function AdvancedPMS_SlashCommandHandler(msg)
     if (msg == "reload") then
         ReloadUI();                  
     elseif (msg == "test") then
         outSYS("another msg");
     end
     
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="AdvancedPMSForm" hidden="true">
    <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508883-59c2-4f83-ae10-27aaad48391b" />-->
    <Size>
      <AbsDimension x="397" y="402" />
    </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="AdvancedPMS">
          <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>
      <Button name="BTNdone" text="Done">
        <!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
        <Size>
          <AbsDimension x="71" y="24" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="308" y="-358" />
            </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 inherits="GameFontNormal" 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>
        </NormalFont>
        <HighlightFont inherits="GameFontHighlight" 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>
        </HighlightFont>
        <DisabledFont inherits="GameFontDisable" font="Fonts\FRIZQT__.TTF">
          <FontHeight>
            <AbsValue val="12" />
          </FontHeight>
          <Color r="0.4980392" g="0.4980392" b="0.4980392" />
          <Shadow>
            <Color r="0" g="0" b="0" />
            <Offset>
              <AbsDimension x="1" y="-1" />
            </Offset>
          </Shadow>
        </DisabledFont>
      </Button>
    </Frames>
    <Scripts>
      <OnLoad>
    SLASH_AdvancedPMS1 = "/advancedpms";
    SLASH_AdvancedPMS2 = "/apms";

    SlashCmdList["AdvancedPMS"] = function(msg)
    AdvancedPMS_SlashCommandHandler(msg);
    end
        DEFAULT_CHAT_FRAME:AddMessage("AdvancedPMS Loaded");
      </OnLoad>
    </Scripts>
  </Frame>
</Ui>
This actually works but if I replace what's between the <OnLoad> tags in the XML with simply: AdvancedPMS_OnLoad(); it'll return a nil value.
  Reply With Quote