PDA

View Full Version : My mod shows up on the AddOns list, but doesn't do anything in-game


Kaburornewit
06-11-2006, 08:12 PM
Hi,
recently started coding, and made this clock mod with the help of a tutorial.
It shows up as "PenguinClock" on the AddOns list, but doesn't show in-game. It also shows up in the list when I ask Ace to list mods.
Ok, so here's what I've done. In the Interface / AddOns I've got a folder called "penguinclock". In that folder I have these three files:

"penguinclock.toc"
## Interface: 6005
## Title: PenguinClock
## Notes: It's a Clock.. and I like penguins.
penguinclock.xml

"penguinclock.xml"
<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/
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
<Script file="penguinclock.lua" />
<Frame name="ClockFrame" frameStrata="HIGH" toplevel="true" enableMouse="true" movable="true" parent="UIParent">
<Size>
<AbsDimension x="128" y="32"/>
</Size>
<Anchors>
<Anchor point="TOP"/>
</Anchors>
<Backdrop name="$parentBackdrop" bgFile="Interface\TutorialFrame\TutorialFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="BACKGROUND">
<FontString name="ClockText" inherits="GameFontNormal" wraponspaces="true">
<Size>
<AbsDimension x="128" y="12"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
Clock_OnLoad();
</OnLoad>
<OnUpdate>
Clock_OnUpdate(arg1);
</OnUpdate>
<OnDragStart>
Clock_OnDragStart();
</OnDragStart>
<OnDragStop>
Clock_OnDragStop();
</OnDragStop>
<OnMouseUp>
Clock_OnDragStop();
</OnMouseUp>
</Scripts>
</Frame>
</Ui>


And "penguinclock.lua"
CLOCK_UPDATE_RATE = 0.1;

function Clock_OnLoad()
this:RegisterForDrag("LeftButton");
ClockFrame.TimeSinceLastUpdate = 0;
end

function Clock_OnUpdate(arg1)
ClockFrame.TimeSinceLastUpdate = ClockFrame.TimeSinceLastUpdate + arg1;
if( ClockFrame.TimeSinceLastUpdate > CLOCK_UPDATE_RATE ) then
local hour, minute = GetGameTime();
local TimeString = format(TEXT(TIME_TWENTYFOURHOURS), hour, minute);
ClockText:SetText(TimeString);
ClockFrame.TimeSinceLastUpdate = 0;
end
end

function Clock_OnDragStart()
ClockFrame:StartMoving()
end

function Clock_OnDragStop()
ClockFrame:StopMovingOrSizing()
end

I can't see what's wrong with it. Maybe someone else will have a little more luck at figuring out the problem :undecided:

Klishu
06-11-2006, 08:51 PM
Hi there! Let's try solving the problem! :wink:

The first thing you could try is changing line 5 in "penguinclock.xml" to:


<Frame name="ClockFrame" frameStrata="HIGH" hidden="false" toplevel="true" enableMouse="true" movable="true" parent="UIParent">


Do that and tell me if it works. What it does is set the default property, "hidden", to false (therefore it's visible) in the beginning. If you leave that out, the game will assume that you want hidden="true".

Kaburornewit
06-11-2006, 09:37 PM
Oh, I understand what that means, and I can see what you're saying. I'm just off to try that...

Kaburornewit
06-11-2006, 09:42 PM
:D :D :D It works! Thank you so much! You've made a budding modder very happy :)

Daviesh
07-11-2006, 12:59 PM
Also, I don't think this is what you intended in your .toc file:

## Interface: 6005

The current interface version is 11200.

Kaburornewit
07-11-2006, 05:41 PM
Oh, didn't know that. Thanks to you aswell, Daveish :D