Mercurial > wow > devian
comparison Console.lua @ 102:c3e7d2a3f4e9
Fix consoles disappearing after movement events.
| author | Nenue |
|---|---|
| date | Mon, 10 Apr 2017 13:21:11 -0400 |
| parents | 790dca545f1d |
| children | 8dc0c1917890 |
comparison
equal
deleted
inserted
replaced
| 101:e1f6e5c97da6 | 102:c3e7d2a3f4e9 |
|---|---|
| 159 self:Update() | 159 self:Update() |
| 160 end | 160 end |
| 161 | 161 |
| 162 | 162 |
| 163 | 163 |
| 164 function DevianConsoleMixin:OnHide() end | 164 function DevianConsoleMixin:OnHide() |
| 165 end | |
| 165 | 166 |
| 166 function DevianConsoleMixin:OnMouseWheel(delta) | 167 function DevianConsoleMixin:OnMouseWheel(delta) |
| 167 | 168 |
| 168 local up = delta > 0 | 169 local up = delta > 0 |
| 169 if IsControlKeyDown() then | 170 if IsControlKeyDown() then |
| 270 D:Print('Console #'..self:GetID(), self.enabled and 'open' or 'closed') | 271 D:Print('Console #'..self:GetID(), self.enabled and 'open' or 'closed') |
| 271 | 272 |
| 272 self:Update(true) | 273 self:Update(true) |
| 273 end | 274 end |
| 274 | 275 |
| 276 | |
| 277 | |
| 275 function DevianConsoleMixin:OnEvent(event, arg) | 278 function DevianConsoleMixin:OnEvent(event, arg) |
| 276 --oldprint(event, arg) | 279 --oldprint(event, arg) |
| 277 local db = D.db | 280 local db = D.db |
| 278 if self.enabled then | 281 if self.enabled then |
| 279 | |
| 280 local progress = self.moveFade:GetProgress() or 1 | |
| 281 self.moveFade:Stop() | |
| 282 | |
| 283 if event == 'PLAYER_STARTED_MOVING' then | 282 if event == 'PLAYER_STARTED_MOVING' then |
| 284 local F1 = self.moveFade.alphaOut | 283 local F1 = self.moveFade.alphaOut |
| 285 F1:SetFromAlpha(db.movement_fade_from + (1-progress)) | 284 self:SetAlpha(db.movement_fade_to) |
| 286 F1:SetToAlpha(db.movement_fade_to) | |
| 287 F1:SetDuration(db.movement_fade_time * (1-progress)) | |
| 288 self.moveFade:Play() | |
| 289 self:EnableMouse(false) | 285 self:EnableMouse(false) |
| 290 elseif event == 'PLAYER_STOPPED_MOVING' then | 286 elseif event == 'PLAYER_STOPPED_MOVING' then |
| 291 self.moveFade:Stop() | 287 self:SetAlpha(db.movement_fade_from) |
| 292 local F1 = self.moveFade.alphaOut | |
| 293 F1:SetFromAlpha(db.movement_fade_to + (1-progress)) | |
| 294 F1:SetToAlpha(db.movement_fade_from) | |
| 295 F1:SetDuration(db.movement_fade_time * (progress)) | |
| 296 self.moveFade:Play() | |
| 297 self:EnableMouse(true) | 288 self:EnableMouse(true) |
| 298 end | 289 end |
| 299 end | 290 end |
| 300 end | 291 end |
| 301 | 292 |
