hello everyone, I'm new in this fantastic world, I begin to apologize for my bad English (not English). I hope you can make me clarity on the global variables...I've read various things but I did not understand very well
. I created this little addon for fun, I'd like a button that saves the text in the editbox and the other button sends message with text saved even after reload or relog. Thanks for the help!
My .toc:
Code:
## Title: SaveVar
## Version: 1.0
## Author: Prova
## Interface: 50300
Frame.xml
My .lua:
Code:
local SaveMex
function Save_OnClick()
SaveMex=EdTex:GetText();
end
function Send_OnClick()
SendChatMessage(SaveMex, "SAY");
end
My .xml:
Code:
<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/">
<Script file="Frame.lua" />
<Frame name="Frame1" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
<Size x="200" y="200" />
<Anchors>
<Anchor point="CENTER" />
</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>
<Frames>
<EditBox name="EdTex" inherits="InputBoxTemplate" enableKeyboard="true" autoFocus="false">
<Size x="100" y="32" />
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="45" y="-48" />
</Anchor>
</Anchors>
</EditBox>
<Button name="Send" inherits="UIPanelButtonTemplate" enableMouse="true" text="Send">
<Size x="75" y="23" />
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="108" y="-118" />
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Send_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="Save" inherits="UIPanelButtonTemplate" text="Save">
<Size x="75" y="23" />
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="23" y="-118" />
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Save_OnClick()
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnDragStart>
self:StartMoving();
</OnDragStart>
<OnDragStop>
self:StopMovingOrSizing();
</OnDragStop>
</Scripts>
</Frame>
</Ui>