vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- Title: ImproveDressingRoom v1.2 |
2 | -- Author: TotalPackage |
||
3 | -- Date: 05/21/2006 |
||
4 | |||
5 | |||
6 | function ImproveAHDressingRoomModel_Load() |
||
7 | if( not AuctionDressUpModel ) then |
||
8 | this:RegisterEvent("ADDON_LOADED"); |
||
9 | else |
||
10 | ImproveAHDressingRoomFrame:SetParent("AuctionDressUpFrame"); |
||
11 | ImproveAHDressingRoomFrame:SetFrameLevel(AuctionDressUpFrame:GetFrameLevel() + 1); |
||
12 | ImproveAHDressingRoomFrame:SetPoint("BOTTOM", "AuctionDressUpFrame", "BOTTOM", 0, 3); |
||
13 | ImproveAHDressingRoomFrame:Show(); |
||
14 | AuctionDressUpModelRotateRightButton:Hide(); |
||
15 | AuctionDressUpModelRotateLeftButton:Hide(); |
||
16 | AuctionDressUpModel:SetHeight(370); |
||
17 | AuctionDressUpModel:SetPoint("BOTTOM", "AuctionDressUpFrame", "BOTTOM", 0, 10); |
||
18 | AuctionDressUpFrameResetButton:SetPoint("BOTTOM", "AuctionDressUpFrame", "BOTTOM", 0, 15); |
||
19 | end |
||
20 | end |
||
21 | |||
22 | |||
23 | function ImproveAHDressingRoomModel_Event() |
||
24 | if (event == "ADDON_LOADED") then |
||
25 | if (arg1 == "Blizzard_AuctionUI") then |
||
26 | this:UnregisterEvent("ADDON_LOADED"); |
||
27 | ImproveAHDressingRoomFrame:SetParent("AuctionDressUpFrame"); |
||
28 | ImproveAHDressingRoomFrame:SetFrameLevel(AuctionDressUpFrame:GetFrameLevel() + 1); |
||
29 | ImproveAHDressingRoomFrame:SetPoint("BOTTOM", "AuctionDressUpFrame", "BOTTOM", 0, 3); |
||
30 | ImproveAHDressingRoomFrame:Show(); |
||
31 | AuctionDressUpModelRotateRightButton:Hide(); |
||
32 | AuctionDressUpModelRotateLeftButton:Hide(); |
||
33 | AuctionDressUpModel:SetHeight(370); |
||
34 | AuctionDressUpModel:SetPoint("BOTTOM", "AuctionDressUpFrame", "BOTTOM", 0, 10); |
||
35 | AuctionDressUpFrameResetButton:SetPoint("BOTTOM", "AuctionDressUpFrame", "BOTTOM", 0, 15); |
||
36 | end |
||
37 | end |
||
38 | end |
||
39 | |||
40 | |||
41 | function ImproveDressingRoomModel_OnLoad() |
||
42 | idu_ismoving = nil; |
||
43 | idu_ispaning = nil; |
||
44 | end |
||
45 | |||
46 | |||
47 | function ImproveDressingRoom_OnMouseDown(arg1) |
||
48 | if (arg1 == "LeftButton") then |
||
49 | idu_ismoving = 1; |
||
50 | previousx, previousy = GetCursorPosition(); |
||
51 | end |
||
52 | if (arg1 == "RightButton") then |
||
53 | idu_ispaning = 1; |
||
54 | previousx, previousy = GetCursorPosition(); |
||
55 | end |
||
56 | end |
||
57 | |||
58 | |||
59 | function ImproveDressingRoom_OnMouseUp(arg1,frameName) |
||
60 | if (arg1 == "LeftButton") then |
||
61 | idu_ismoving = nil; |
||
62 | end |
||
63 | if (arg1 == "RightButton") then |
||
64 | idu_ispaning = nil; |
||
65 | end |
||
66 | end |
||
67 | |||
68 | |||
69 | function ImproveDressingRoom_OnMouseWheel(value,frameName) |
||
70 | if (frameName == "ImproveDressingRoomFrame") then |
||
71 | local cz, cx, cy = DressUpModel:GetPosition(); |
||
72 | if ( value > 0 ) then |
||
73 | idu_zoom = cz + 0.75; |
||
74 | else |
||
75 | idu_zoom = cz - 0.75; |
||
76 | end |
||
77 | DressUpModel:SetPosition(idu_zoom, cx, cy); |
||
78 | elseif (frameName == "ImproveAHDressingRoomFrame") then |
||
79 | local cz, cx, cy = AuctionDressUpModel:GetPosition(); |
||
80 | if ( value > 0 ) then |
||
81 | idu_ahzoom = cz + 0.75; |
||
82 | else |
||
83 | idu_ahzoom = cz - 0.75; |
||
84 | end |
||
85 | AuctionDressUpModel:SetPosition(idu_ahzoom, cx, cy); |
||
86 | end |
||
87 | end |
||
88 | |||
89 | |||
90 | function ImproveDressingRoom_OnUpdate(elapsedTime) |
||
91 | if ( idu_ismoving ) then |
||
92 | local currentx, currenty = GetCursorPosition(); |
||
93 | if (ImproveAHDressingRoomFrame:IsVisible()) then |
||
94 | idu_rotation = AuctionDressUpModel:GetFacing() + ((currentx - previousx)/50); |
||
95 | AuctionDressUpModel:SetFacing(idu_rotation); |
||
96 | elseif (ImproveDressingRoomFrame:IsVisible()) then |
||
97 | idu_rotation = DressUpModel:GetFacing() + ((currentx - previousx)/50); |
||
98 | DressUpModel:SetFacing(idu_rotation); |
||
99 | end |
||
100 | previousx, previousy = GetCursorPosition(); |
||
101 | elseif ( idu_ispaning ) then |
||
102 | local currentx, currenty = GetCursorPosition(); |
||
103 | if (ImproveAHDressingRoomFrame:IsVisible()) then |
||
104 | local cz, cx, cy = AuctionDressUpModel:GetPosition(); |
||
105 | idu_ahpositionx = cx + ((currentx - previousx)/50); |
||
106 | idu_ahpositiony = cy + ((currenty - previousy)/50); |
||
107 | AuctionDressUpModel:SetPosition(cz, idu_ahpositionx, idu_ahpositiony); |
||
108 | elseif (ImproveDressingRoomFrame:IsVisible()) then |
||
109 | local cz, cx, cy = DressUpModel:GetPosition(); |
||
110 | idu_positionx = cx + ((currentx - previousx)/50); |
||
111 | idu_positiony = cy + ((currenty - previousy)/50); |
||
112 | DressUpModel:SetPosition(cz, idu_positionx, idu_positiony); |
||
113 | end |
||
114 | previousx, previousy = GetCursorPosition(); |
||
115 | end |
||
116 | end |
||
117 |