Hey you both
.
Thank you for your answers!
I told you, that I'm really a beginner so I have some questions and maybe, you'll think "omg.."
.
I've tried to create a frame into my parentframe
( createframe() ) but I have no idea, how to handle it.
Here are my .lua and .xml code, can you please tell me, how I can commit the local frame "SchoolLockStatusBar" into the function SchoolLock_ParseParameters (called at line 13)?
Thanks a lot, if you can help me.
PHP Code:
function SchoolLock_OnLoad(this)
local b = this.CreateFrame("StatusBar", "SchoolLockStatusBar")
b:SetWidth(100);
b:SetHeight(20);
b:SetPoint("CENTER",UIParent,"CENTER",0 , 0);
b:SetMinMaxValues(1,100);
b:SetOrientation("HORIZONTAL");
b:SetValue(75);
b:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar");
b:GetStatusBarTexture():SetHorizTile(false);
b:GetStatusBarTexture():SetVertTile(false);
SLASH_SCHOOLLOCK1="/slock";
SlashCmdList["SCHOOLLOCK"]=SchoolLock_ParseParameters;
end
--[[Event Handling]]
function SchoolLock_OnEvent(this, event, arg1)
--Do nothing now
end
function SchoolLock_ParseParameters(command, bar)
local cmd = command;
local bar = bar;
cmd=string.lower(cmd);
if (cmd == 'on') then
SchoolLock_showBar(bar);
elseif (cmd == 'off') then
SchoolLock_hideBar(bar);
else
SchoolLock_Message('Befehl ' ..cmd.. ' ist unbekannt..!');
end
end
function SchoolLock_Message(message)
DEFAULT_CHAT_FRAME:AddMessage("[SchoolLock] " .. message, 0.7, 0.0, 0.4);
end --function Message
function SchoolLock_showBar(bar)
bar:Show();
end
function SchoolLock_hideBar(bar)
bar:Hide();
end
PHP 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/ ..\FrameXML\UI.xsd">
<Frame name="SchoolLock" parent="UIParent" enableMouse="true">
<Scripts>
<OnLoad>
SchoolLock_OnLoad(self);
</OnLoad>
<OnEvent>
SchoolLock_OnEvent(self, event, arg1);
</OnEvent>
</Scripts>
</Frame>
</Ui>