Mercurial > wow > devian
comparison UI.lua @ 50:c3166f700438
dock beacons and text fader cleaned up
fixed OnLeave ending at mouseOverDock false and causing beacons to stick
fixed a nil argument in dock framescript
author | Nenue |
---|---|
date | Tue, 05 Jan 2016 01:37:29 -0500 |
parents | eb7544afd77a |
children | 1b8c597dba44 |
comparison
equal
deleted
inserted
replaced
49:36290c315606 | 50:c3166f700438 |
---|---|
1 --- ${PACKAGE_NAME} | 1 --- Devian - UI.lua |
2 -- @file-author@ | 2 -- @file-author@ |
3 -- @project-revision@ @project-hash@ | 3 -- @project-revision@ @project-hash@ |
4 -- @file-revision@ @file-hash@ | 4 -- @file-revision@ @file-hash@ |
5 -- Created: 12/27/2015 3:01 AM | 5 -- Created: 12/27/2015 3:01 AM |
6 | |
7 | |
8 if not LibStub then | 6 if not LibStub then |
9 print('Something has happened...') | 7 print('Something has happened...') |
10 end | 8 end |
11 local D = LibStub("AceAddon-3.0"):GetAddon("Devian") | 9 local D = LibStub("AceAddon-3.0"):GetAddon("Devian") |
12 | |
13 | |
14 | |
15 local DEVIAN_FRAME = 'DevianConsole' | 10 local DEVIAN_FRAME = 'DevianConsole' |
16 local DEVIAN_DOCK_FRAME = 'DevianDock' | |
17 | 11 |
18 | 12 |
19 local function Console_MinMax(self) | 13 local function Console_MinMax(self) |
20 if self.minimized then | 14 if self.minimized then |
21 self:Maximize() | 15 self:Maximize() |
75 db.docked = self.docked | 69 db.docked = self.docked |
76 | 70 |
77 db.minimized = self.minimized and true or nil | 71 db.minimized = self.minimized and true or nil |
78 db.enabled = self:IsVisible() and true or nil | 72 db.enabled = self:IsVisible() and true or nil |
79 db.active = self.active and true or nil | 73 db.active = self.active and true or nil |
80 --print('save:', db.signature, 'min=', db.minimized, ' enabled=', db.enabled, ' active = ', db.active, 'x=', db.x, 'y=', db.y, 'h=', db.height, 'w=', db.width) | |
81 self:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', db.x, db.y) | 74 self:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', db.x, db.y) |
82 self:SetWidth(db.width) | 75 self:SetWidth(db.width) |
83 end | 76 end |
84 | 77 |
85 --- Brings the console to the front. | 78 --- Brings the console to the front. |
86 -- Frame method used to bring a console frame to the front of the display stack. | 79 -- Frame method used to bring a console frame to the front of the display stack. |
87 local function Console_ToFront(c) | 80 local function Console_ToFront(c) |
88 local db = D.db | 81 local db = D.db |
89 --print(D.raise_ct, 'Raising', c.signature) | |
90 --print(unpack(db.frontdrop)) | |
91 --print(unpack(db.frontgrad)) | |
92 --print(db.frontblend) | |
93 -- D.raise_ct = D.raise_ct + 1 | |
94 c:Raise() | 82 c:Raise() |
95 c:SetAlpha(db.frontalpha) | 83 c:SetAlpha(db.frontalpha) |
96 c.out.backdrop:SetTexture(unpack(db.frontdrop)) | 84 c.out.backdrop:SetTexture(unpack(db.frontdrop)) |
97 c.out.backdrop:SetGradientAlpha(unpack(db.frontgrad)) | 85 c.out.backdrop:SetGradientAlpha(unpack(db.frontgrad)) |
98 c.out.backdrop:SetBlendMode(db.frontblend) | 86 c.out.backdrop:SetBlendMode(db.frontblend) |
99 c.dropmenu.icon:SetVertexColor(unpack(db.frontheader)) | 87 c.dropmenu.icon:SetVertexColor(unpack(db.frontheader)) |
100 c.title:SetTextColor(unpack(db.frontborder)) | 88 c.title:SetTextColor(unpack(db.frontborder)) |
101 db.current_channel = c.index | 89 db.current_channel = c.index |
102 | 90 |
91 -- update dock buttons | |
92 local beacon = D.dock.buttons[c.index] | |
93 beacon.selected = true | |
94 D.UpdateBeacon(beacon) | |
95 | |
103 for _, part in pairs(c.border) do | 96 for _, part in pairs(c.border) do |
104 part:SetTexture(unpack(db.frontborder)) | 97 part:SetTexture(unpack(db.frontborder)) |
105 end | 98 end |
106 | 99 |
107 for id, bc in pairs(D.console) do | 100 for id, bc in pairs(D.console) do |
108 if id ~= c.index then | 101 if id ~= c.index then |
109 --print(D.raise_ct, 'Lowering', bc.signature) | |
110 --print(unpack(db.backdrop)) | |
111 --print(unpack(db.backgrad)) | |
112 --print(db.backblend) | |
113 bc:SetAlpha(db.backalpha) | 102 bc:SetAlpha(db.backalpha) |
114 bc.out.backdrop:SetTexture(unpack(db.backdrop)) | 103 bc.out.backdrop:SetTexture(unpack(db.backdrop)) |
115 bc.out.backdrop:SetGradientAlpha(unpack(db.backgrad)) | 104 bc.out.backdrop:SetGradientAlpha(unpack(db.backgrad)) |
116 bc.out.backdrop:SetBlendMode(db.backblend) | 105 bc.out.backdrop:SetBlendMode(db.backblend) |
117 bc.dropmenu.icon:SetVertexColor(unpack(db.backheader)) | 106 bc.dropmenu.icon:SetVertexColor(unpack(db.backheader)) |
118 bc.title:SetTextColor(unpack(db.backborder)) | 107 bc.title:SetTextColor(unpack(db.backborder)) |
108 | |
109 local beacon = D.dock.buttons[bc.index] | |
110 beacon.selected = nil | |
111 D.UpdateBeacon(beacon) | |
119 | 112 |
120 for _, part in pairs(bc.border) do | 113 for _, part in pairs(bc.border) do |
121 part:SetTexture(unpack(db.backborder)) | 114 part:SetTexture(unpack(db.backborder)) |
122 end | 115 end |
123 end | 116 end |