This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
About Frames (Help)!
Post Reply
Return to board index
Post by
Nesos
Hi there :)
I made an simple add to give me some info via my message frame. That is achieved but i'd like to be able to move and resize that frame..... I don't know what i'm doing wrong :(
This is the code for my frame....
<Ui xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns="
http://www.blizzard.com/wow/ui/">
<MessageFrame name="HealerHelperNesos" parent="UIParent" toplevel="true" movable="true" enableMouse="true" displayDuration="4">
<FontString inherits="ErrorFont" justifyH="CENTER" />
<Size>
<AbsDimension x="609" y="31" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="183" y="-178" />
</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>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonUp", "RightButtonUp")
self:RegisterForDrag("LeftButton")
self:SetUserPlaced(true)
</OnLoad>
<OnDragStart>
self:StartMoving()
self.isMoving = true
</OnDragStart>
<OnDragStop>
self:StopMovingOrSizing()
self.isMoving = false
</OnDragStop>
</Scripts>
</MessageFrame>
</Ui>
TY all for your time :)
Post by
TheReal
Hi there :)
I made an simple add to give me some info via my message frame. That is achieved but i'd like to be able to move and resize that frame..... I don't know what i'm doing wrong :(
This is the code for my frame....
<Ui xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns="
http://www.blizzard.com/wow/ui/">
<MessageFrame name="HealerHelperNesos" parent="UIParent" toplevel="true" movable="true" enableMouse="true" displayDuration="4">
<FontString inherits="ErrorFont" justifyH="CENTER" />
<Size>
<AbsDimension x="609" y="31" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="183" y="-178" />
</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>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonUp", "RightButtonUp")
self:RegisterForDrag("LeftButton")
self:SetUserPlaced(true)
</OnLoad>
<OnDragStart>
self:StartMoving()
self.isMoving = true
</OnDragStart>
<OnDragStop>
self:StopMovingOrSizing()
self.isMoving = false
</OnDragStop>
</Scripts>
</MessageFrame>
</Ui>
TY all for your time :)
The \ tag is your friend.
:)
Post by
Neffi
I see no issue with that code. Can you elaborate? Post the rest of your code? Give us some idea of what's failing? Perhaps error messages?
Post by
Nesos
The issue is that my frame appears correctly and it gets the message via LUA file. When i try to drag the frame nothing happens...There is no error message, the stupid thing just dont move :(
The lua code is something like that.....
-- Author : Nesos
-- Create Date : 2/3/2013 1:39:23 PM
local mana_percentage
local msg_triger1=1
local msg_option_triger=true
------------------------------------register events-----------------------------------------------
HealerHelperNesos:RegisterEvent("CURRENT_SPELL_CAST_CHANGED")
HealerHelperNesos:RegisterEvent("PLAYER_ENTERING_WORLD")
--------------------------------------------------------------------------------------------------
-------------------------------------set script handler-------------------------------------------
HealerHelperNesos:SetScript("OnEvent", function(self,event,...)
if event== "PLAYER_ENTERING_WORLD" then --------------say hi to player
mesag = "Hi "..UnitName("PLAYER").." :)"
HealerHelperNesos:AddMessage(mesag , 0 , 1 ,0 , 0.7)
HealerHelperNesos:SetFading(true)
elseif event== "CURRENT_SPELL_CAST_CHANGED" then
if UnitPower("Player")<UnitPowerMax("Player")*0.3 then
mana_percentage=(UnitPower("Player")*100)/UnitPowerMax("Player")
HealerHelperNesos:AddMessage("MANA ON "..mana_percentage.."%" , 1 , 0 ,0 , 0.7)
HealerHelperNesos:SetFading(true)
if (msg_triger1==1) and (msg_option_triger==true) then
SendChatMessage("mb! i need to eat :S" , "SAY")
msg_triger1=2
end
elseif UnitPower("Player")<UnitPowerMax("Player")*0.5 then
mana_percentage=(UnitPower("Player")*100)/UnitPowerMax("Player")
HealerHelperNesos:AddMessage("MANA ON "..mana_percentage.."%" , 1 , 1 ,0 , 0.7)
HealerHelperNesos:SetFading(true)
else
msg_triger1=1
end
end
end)
--------------------------------------------------------------------------------------------------
------------------------------slash---------------------------------------------------------------
SLASH_Healer_Helper_Nesos1="/HealerHelperNesos"
SLASH_Healer_Helper_Nesos2="/hhn"
SlashCmdList = function(msg)
if (msg=="on") then
HealerHelperNesos:Show()
mes1="Mana monitor is ON"
DEFAULT_CHAT_FRAME:AddMessage(mes1)
elseif(msg=="off") then
HealerHelperNesos:Hide()
msg_option_triger=false
mes1="Mana monitor is OFF"
DEFAULT_CHAT_FRAME:AddMessage(mes1)
elseif(msg=="nomsg") then
msg_option_triger=false
HealerHelperNesos:Show()
mes1="Chat messages are disabled :S"
DEFAULT_CHAT_FRAME:AddMessage(mes1)
elseif(msg=="yesmsg") then
msg_option_triger=true
HealerHelperNesos:Show()
mes1="Chat messages are enabled :)"
DEFAULT_CHAT_FRAME:AddMessage(mes1)
else
mes1="Plz try on or off to enable Frame or yesmsg or nomsg to enable/disable messages"
DEFAULT_CHAT_FRAME:AddMessage(mes1)
end
end
Post by
Neffi
You may have labeled some XML flags incorrectly. I don't know the XML syntax. Try doing the following in the OnLoad portion and see if it alleviates the issue. If so, double-check the XML reference to make sure your flags are correct.
self:SetMovable(true)
self:EnableMouse(true)
Your issue may also be that OnDragStart is not being run because your OnClick handler is interfering. I doubt this is the issue, as this should not happen, but you never know. Try either removing the RegisterForClicks portion; or removing the RegisterForDrag portion and changing OnDragStart/Stop to OnMouseDown/Up.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.