Hi!
I have two other problems with my DressupModel, respectively the model itself and a button i want to place on it. I'm really sorry for my nooby questions, but I simply have a lot more to learn. I have the following code:
Code:
local frame = CreateFrame("Frame");
frame:RegisterEvent("LOOT_OPENED");
frame:RegisterEvent("ADDON_LOADED");
frame:RegisterEvent("CHAT_MSG_ADDON");
local newframe = CreateFrame("Frame", "ORC_DressupFrame", UIFrame);
newframe:SetMovable(true);
newframe:SetClampedToScreen(true);
newframe:SetBackdrop( {
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", tile = true, tileSize = 32, edgeSize = 32,
insets = { left = 11, right = 12, top = 12, bottom = 11 }
});
newframe:SetSize(232, 320);
newframe:SetPoint("CENTER", 0, 0);
newframe:SetScript("OnDragStart", newframe:StartMoving());
newframe:Hide();
local newmodel = CreateFrame("DressUpModel", "ORC_DressupModel", ORC_DressupFrame);
newmodel:SetMovable(true);
newframe:SetClampedToScreen(true);
newmodel:SetSize(232, 320);
newmodel:SetPoint("CENTER", 0, 0);
newmodel:SetScript("OnShow", ORC_DressupModel_OnShow);
newmodel:SetScript("OnHide", ORC_DressupModel_OnHide);
newmodel:SetScript("OnDragStart", newmodel:StartMoving());
newmodel:SetFrameStrata("HIGH");
local newButton = CreateFrame("Button", "ORC_RotateRightButton", ORC_DressupModel);
newButton:SetScript("OnMouseDown", ORC_Model_RotateRight);
newButton:SetSize(35, 35);
newButton:SetPoint("TOPLEFT", 156, -3);
newButton:Show();
local newButton = CreateFrame("Button", "ORC_RotateLeftButton", ORC_DressupModel);
newButton:SetScript("OnMouseDown", ORC_Model_RotateLeft);
newButton:SetSize(35, 35);
newButton:SetPoint("TOPLEFT", 194, -3);
newButton:Show();
ORC_RotateLeftButton:SetNormalTexture("Interface\\Buttons\\UI-RotationLeft-Button-Up");
ORC_RotateRightButton:SetNormalTexture("Interface\\Buttons\\UI-RotationRight-Button-Up");
ORC_RotateLeftButton:SetPushedTexture("Interface\\Buttons\\UI-RotationLeft-Button-Down");
ORC_RotateRightButton:SetPushedTexture("Interface\\Buttons\\UI-RotationRight-Button-Down");
ORC_RotateLeftButton:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Round", "ADD");
ORC_RotateRightButton:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Round", "ADD");
local newButton = CreateFrame("Button", "ORC_DressupClose", ORC_DressupModel);
newButton:SetScript("OnClick", ORC_DressupClose_OnClick);
newButton:SetSize(75, 23);
newButton:SetPoint("TOPLEFT", 83, -279);
newButton:SetText("Schließen");
newButton:Show();
Two questions:
1.) Why is the last newButton not displayed? I've tried rename the variables and the button itself, I've changed the Anchors and deleted the Show-call, but nothing worked. I've even tried to create another button on the UIFrame and that also didn't work.
2.) Why does the DressupFrame constantly stick to the mouse cursor so I can't do anything else than close WoW? Adding the "OnDragStop", "StopMovingOrSizing" doesn't work.
Greetings!