Exemplo n.º 1
0
        public MainWindow(LuaTable p_Object, bool p_SelfCreated)
            : base(p_Object, p_SelfCreated)
        {
            if (p_SelfCreated)
            {
                var l_ActivePlayer = WoW.ObjectManager.ActivePlayer;

                this.Visible = false;
                this.SetPoint(AnchorPoint.Center);
                this.Width  = 260;
                this.Height = 300;
                this.Title  = "Morpher";

                DropDownMenuLoadSettings = this.CreateChildFrame <DropDownMenu>();
                DropDownMenuLoadSettings.SetPoint(AnchorPoint.Top, this, AnchorPoint.Top, 0, -30);
                DropDownMenuLoadSettings.Width   = this.Width - 50;;
                DropDownMenuLoadSettings.Text    = "Load settings ...";
                DropDownMenuLoadSettings.OnLoad += DropDownMenuLoadSettings_OnLoad;

                LabelDisplayId = this.CreateFontString();
                LabelDisplayId.SetPoint(AnchorPoint.TopLeft, 12, -85);
                LabelDisplayId.Text = "Display id :";

                TextBoxDisplayId = this.CreateChildFrame <TextBox>();
                TextBoxDisplayId.SetPoint(AnchorPoint.TopLeft, 110, -80);
                TextBoxDisplayId.IsNumeric = true;
                TextBoxDisplayId.Text      = l_ActivePlayer != null?l_ActivePlayer.DisplayId.ToString() : string.Empty;

                TextBoxDisplayId.Width  = 50;
                TextBoxDisplayId.Height = 26;

                ButtonMorphDisplayId = this.CreateChildFrame <Button>();
                ButtonMorphDisplayId.SetPoint(AnchorPoint.TopLeft, 180, -80);
                ButtonMorphDisplayId.Width    = 60;
                ButtonMorphDisplayId.Height   = 26;
                ButtonMorphDisplayId.Text     = "Morph";
                ButtonMorphDisplayId.OnClick += ButtonMorphDisplayId_OnClick;

                ButtonCopyTarget = this.CreateChildFrame <Button>();
                ButtonCopyTarget.SetPoint(AnchorPoint.Bottom, 0, 20);
                ButtonCopyTarget.Width    = this.Width - 40;
                ButtonCopyTarget.Text     = "Copy target data";
                ButtonCopyTarget.OnClick += ButtonCopyTarget_OnClick;

                this.OnUpdate += MainWindow_OnUpdate;
            }
        }