Mercurial > wow > devian
diff Devian.lua @ 55:1b8c597dba44
added movement fading
todo: sort out dock mouseover hitches
author | Nenue |
---|---|
date | Wed, 06 Jan 2016 07:37:17 -0500 |
parents | 4c05e55b0433 |
children | 4b1b301cf8d4 |
line wrap: on
line diff
--- a/Devian.lua Tue Jan 05 01:41:22 2016 -0500 +++ b/Devian.lua Wed Jan 06 07:37:17 2016 -0500 @@ -24,7 +24,12 @@ local defaults = { ['global'] = {{}, {}}, ['tags'] = {}, - ['channels'] = {[1] = {signature = 'Main', index = 1, x = 100, y = 800, height = 500, width = 600, enabled = true}}, + ['channels'] = {[1] = { + signature = 'Main', + index = 1, + x = 100, y = 800, + height = 500, width = 600, + enabled = true}}, ['profiles'] = { {'Main', false}, {'Devian', true}, @@ -34,7 +39,7 @@ primary_channel = 1, -- the channel to which default output is sent current_channel = 1, -- the front channel max_channel = 1, -- the highest created channel id - enable = true, -- allow enabled consoles to appear + enabled = true, -- allow enabled consoles to appear load_message = "Defaults loaded.", -- messages to be displayed after reload font = [[Interface\Addons\Devian\font\SourceCodePro-Regular.ttf]], -- font info fontsize = 13, @@ -49,14 +54,14 @@ backdrop = {1,1,1,1}, -- background frame info backgrad = {'VERTICAL', 0.1, 0.1, 0.1, 1, 0, 0, 0, 1}, - backblend = 'MOD', + backblend = 'BLEND', backalpha = 1, backborder = {.5,.5,.5,1}, backheader = {.25,.25,.25,1}, frontdrop = {1,1,1,1}, -- foreground frame info frontgrad = {'VERTICAL', 0.1, 0.1, 0.1, 1, 0, 0, 0, 1}, - frontblend = 'MOD', + frontblend = 'BLEND', frontalpha = 1, frontborder = {.07,.47,1,1}, frontheader = {1,1,1,1}, @@ -75,8 +80,10 @@ dock_button_alpha_on = 1, dock_button_alpha_off = 0.2, dock_button_fade_in = 0.075, - dock_button_fade_out = 0.075 + dock_button_fade_out = 0.075, + movement_fade = true, + movement_fade_time = 0.15, } local function ScanAddOnList(cmd, ...) @@ -295,8 +302,8 @@ return D.oldprint(prefix, ...) end - if prefix == nil then - prefix = 1 + if tostring(prefix) == nil then + prefix = 'nil*' end local sendq = {} @@ -333,7 +340,7 @@ end pcolor = db.tagcolor[prefix] - local buffer = {'|cFF'.. pcolor..prefix ..'|r'} + local buffer = {} for i = 1, select('#',...) do local var = select(i, ...) @@ -356,7 +363,10 @@ end local message = concat(buffer, ' ') for id, channel in pairs(sendq) do - channel.out:AddMessage(message) + if channel.width < 250 then + prefix = string.sub(prefix, 0,2) + end + channel.out:AddMessage('|cFF'.. pcolor..prefix ..'|r ' .. message) UIFrameFadeIn(D.dock.buttons[id], db.dock_onshow_fade_time, db.dock_onshow_fade_from, db.dock_onshow_fade_to) UIFrameFadeIn(D.dock.buttons[id].caption, db.dock_onshow_fade_time, db.dock_onshow_fade_from, db.dock_onshow_fade_to) end @@ -401,6 +411,26 @@ end) --@end-debug@ + -- movement fading + if db.movement_fade then + self:RegisterEvent('PLAYER_STARTED_MOVING', function() + for k, v in pairs(self.console) do + if v.enabled then + v.preAlpha = v:GetAlpha() + UIFrameFadeOut(v, db.movement_fade_time, v.preAlpha, 0) + UIFrameFadeOut(v.out, db.movement_fade_time, v.preAlpha, 0) + end + end + end) + self:RegisterEvent('PLAYER_STOPPED_MOVING', function() + for k, v in pairs(self.console) do + if v.enabled then + UIFrameFadeIn(v, db.movement_fade_time, v:GetAlpha(), v.alpha) + UIFrameFadeIn(v.out, db.movement_fade_time, v:GetAlpha(), v.alpha) + end + end + end) + end end function D:OnInitialize()