Thread Tools Display Modes
10-10-08, 02:58 AM   #1
Dukes
A Defias Bandit
Join Date: Oct 2008
Posts: 3
Mod help

I have a mod someone that used to be in my guild made to help me track who all in the guild is online at set events (for dkp). Unfortunately as of 3.0 this mod wont work (since its integrated in ace and apparently its changed or something).

I decided to try make this mod myself.... although I am rather stuck

All I need is a simple frame to show/hide when you type some slash command. The frame needs two buttons. One button to update a highlightable list (so as i can cut and paste the list onto another application) and a close button. I have a rough idea of some of the code but even small amounts do not work when i run wow.

this is the mod as it is at the moment using ace2.
http://www.9thorder.com/MuppetsOnline.rar

I am personaly thinking ace is not needed for something this simple which is why i was thinking of making it myself..... After spending all day and all night I have not even managed to alter any of the tutorial frames from
http://fara.webeddie.com/frames/last.html
Was hoping to use them as a base.

Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
  <Script file="FaraFrames.lua"/>
  <!-- Here the Scripts that have to be Executed -->
  <Frame name="FaraFrames_GeneralScripts" hidden="true">
  <Scripts>     <OnLoad> FaraFrames_OnLoad(); </OnLoad></Scripts>
  </Frame> 

   <Frame name="FaraFramesDialog" hidden="true" toplevel="true" virtual="true" frameStrata="DIALOG" parent="UIParent">
        <Size>
      <AbsDimension x="200" y="200"/>
    </Size>
        <Anchors>
                <Anchor point="CENTER"/>
        </Anchors>
        <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
                <TileSize>
                        <AbsValue val="32"/>
                </TileSize>
                <EdgeSize>
                        <AbsValue val="32"/>
                </EdgeSize>
                <BackgroundInsets>
                        <AbsInset left="11" right="12" top="12" bottom="11"/>
                </BackgroundInsets>
        </Backdrop>
  </Frame>

   <Frame name="FaraFramesUI" inherits="FaraFramesDialog">
    <Layers>
      <Layer level="ARTWORK">
                <FontString name="guildonlinelist" inherits="GameFontNormal">
                        <Anchors>
                          <Anchor point="LEFT" relativePoint="TOPLEFT">
                                <Offset>
                                        <AbsDimension x="4" y="-10"/>
                                </Offset>
                          </Anchor>
                        </Anchors>
                </FontString>
      </Layer>
    </Layers>  
   </Frame> 
</Ui>
Code:
function FaraFrames_OnLoad()
  out("On load Message");
  SLASH_FARAFRAMES1 = "/faraframes";
  SLASH_FARAFRAMES2 = "/ff";
  SlashCmdList["FARAFRAMES"] = function(msg)
		FaraFrames_SlashCommandHandler(msg);
	end
end


function FaraFrames_SlashCommandHandler(msg)
    out("FaraFrames: " .. msg)
    if(msg == "toggle")
       FaraFrames_Toggle(msg);
    end
end


function FaraFrames_Toggle(msg)
   local frame = getglobal("FaraFramesUI")

   if( msg == "toggle" ) then
      if (frame) then
         if(  frame:IsVisible() ) then
            frame:Hide();
         else
            frame:Show();
	    guildonlinelist:SetText("test");
         end
      end
   end
end
I have that so far but it does nothing and I really am beyond understanding why.

Last edited by Dukes : 10-10-08 at 02:59 AM. Reason: typo
  Reply With Quote
10-10-08, 10:18 AM   #2
Sekrin
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 150
I think you have the Lua errors turned off, because that code should be giving at least one (you've forgotten a "then" at the end of the if-statement in the slash handler).

I can't remember where the option is in WoW 3.0, but in the Esc menu under Interface there should be an option to turn Lua errors on or off. I seem to recall the options is something similar to "Hide Lua errors" so you need to clear the tick in it's box. It may then spew some errors at you, or you may need to reload your UI....

I'm currently waiting for the updater to finish updating, so when it's done I'll load the code you have and see if I can offer some more concrete assistance.
__________________
  Reply With Quote
10-10-08, 10:37 AM   #3
Sekrin
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 150
Smile

OK, I can't get on to the beta server at the moment, so I tried loading it on the Live servers. It did indeed give me an error about that if-statement, but as soon as I corrected it, it started working fine.

Your slash command handler code should therefore read:
Code:
function FaraFrames_SlashCommandHandler(msg)
	out("FaraFrames: " .. msg)
	if (msg == "toggle") then
		FaraFrames_Toggle(msg);
	end
end
Good luck!
__________________
  Reply With Quote
10-10-08, 01:21 PM   #4
Dukes
A Defias Bandit
Join Date: Oct 2008
Posts: 3
Thanks that helped a lot. Got lua errors activated which is letting me see the code mistakes I am making. At the moment I am basicly cutting chunks of code off other peoples work and sticking it together and preying. Got some more new problems now but ill try solve them myself for now probaly get frustrated later tonight again though :P
  Reply With Quote
10-10-08, 02:40 PM   #5
Dukes
A Defias Bandit
Join Date: Oct 2008
Posts: 3
I take that back this is really annoying and I am badly stuck with GUIs.

Code:
function MuppetsOnline:ParseGuildList()

	if IsInGuild() then
		local stringToPrint = ""
		
		GuildRoster(); 
		numGuildMembersOnline = GetNumGuildMembers(false)
		numGuildMembers = GetNumGuildMembers(true)
				
		for i = 1, numGuildMembers, 1 do
			name, rank, rankIndex, level, class, zone, note, officernote, online, status = GetGuildRosterInfo(i)
			if officernote == "" then 
				officernote = nil 
			end
			
			if online then
				if rank == "OAlt" or rank == "Alt" then
					stringToPrint = stringToPrint.."\n"..note
				elseif rank == "NonRaider" or rank == "NRAlt" then
					stringToPrint = stringToPrint
				else
					stringToPrint = stringToPrint.."\n"..name
				end
			end
		end
		
****something in here that updates the text box****

	else
		self:Print("You are not in guild, sorry ;-)")
	end
end
I just need a show/hide able box that I can highlight and copy from. With a button that will run the above code. I can get a box but I cant get a text area that is editable. Also cant get buttons to do anything

I just have parts of code for different things but no real understanding of how to fit xml lua and wow api aspects together. I kind of expected tutorials for this kind of basic thing like "how to make a text box" and "how to make a button handle an event" and then just combine the two.
  Reply With Quote
10-10-08, 04:58 PM   #6
Sekrin
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 150
The only way I'm aware of to do what you mention is to create an editbox and then add the text to that.
__________________
  Reply With Quote
10-10-08, 06:44 PM   #7
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
i don't see anywhere where you are trying to create an editbox or a button. if your question is how to create them in the first place, here's some samples:

the editbox in particular is overly simplistic code that i mostly just made up and haven't tested so there might be typos or nub errors; but i think it would work if you hit ctrl-a in it and then copy.

the onclick for the button should run your function that generates a message and then run MyEditBox:SetText(messasge)

Code:
<Button name="MyButton" inherits="GameMenuButtonTemplate">
	<Size>
		<AbsDimension x="55" y="20"/>
	</Size>
	<Anchors>
		<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="SomeFrame">
			<Offset>
				<AbsDimension x="0" y="0"/>
			</Offset>
		</Anchor>
	</Anchors>
	<Scripts>
		<OnClick>
			foo()
		</OnClick>
	</Scripts>
</Button>
Code:
<EditBox name="MyEditBox" inherits="InputBoxTemplate" font="GameFontNormal">
<Size>
	<AbsDimension x="200" y="200"/>
</Size>
   <Anchors>
   	<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="Whatever">
   		<Offset>
			<AbsDimension x="0" y="0"/>
		</Offset>
	</Anchor>
   </Anchors>
   <Scripts>
      <Script>
         <OnLoad>
            self:SetMultiLine(true)
         </OnLoad>
      </Script>
   </Scripts>
</EditBox>

Last edited by Akryn : 10-10-08 at 06:47 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Mod help


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