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:
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: