From 041574b2f502d6e620235d64b043e91a24d8a557 Mon Sep 17 00:00:00 2001 From: Munglunch Date: Tue, 18 Nov 2014 13:34:43 -0600 Subject: [PATCH] 5.2.14 --- .../AddOns/SVUI/framework/widgets/widget_afk.lua | 100 ++++++++++++++++++++ .../AddOns/SVUI/framework/widgets/widget_ego.lua | 99 ------------------- .../AddOns/SVUI/framework/widgets/widgets.xml | 6 +- 3 files changed, 103 insertions(+), 102 deletions(-) create mode 100644 Interface/AddOns/SVUI/framework/widgets/widget_afk.lua delete mode 100644 Interface/AddOns/SVUI/framework/widgets/widget_ego.lua diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua b/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua new file mode 100644 index 0000000..728ee42 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua @@ -0,0 +1,100 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local math = _G.math; +--[[ MATH METHODS ]]-- +local random = math.random; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...); + +SV.AFK = _G["SVUI_AFKFrame"]; + +local Sequences = { + --{65, 1000}, --shrug + {70, 1000}, --laugh + --{74, 1000}, --roar + --{82, 1000}, --flex + {5, 1000}, --run + {125, 1000}, --spell2 + {125, 1000}, --spell2 + {26, 1000}, --attack + {26, 1000}, --attack + {26, 1000}, --attack + {26, 1000}, --attack + {4, 1000}, --walk + {5, 1000}, --run + {69, 1000}, --dance +}; + +local function rng() + return random(1, #Sequences) +end + +local function WatchAFKTime() + local time = GetTime() - self.startTime + self.time:SetText(("%02d:%02d"):format(floor(time/60), time % 60)) +end + +function SV.AFK:Toggle(enabled) + if(enabled) then + MoveViewLeftStart(CAMERA_SPEED); + self:Show(); + --UIParent:Hide(); + self:SetAlpha(1); + self.Model:SetAnimation(4) + else + --UIParent:Show(); + self:SetAlpha(0); + self:Hide(); + MoveViewLeftStop(); + end +end + +local Activate = function(self) + if(not SV.db.general.afk) then + self:Toggle() + return + end + self:SetAlpha(1) + self.Model:SetAnimation(4) +end + +function SV.AFK:Initialize() + self:SetFrameLevel(0) + self:SetAllPoints(SV.Screen) + + self.Model:SetUnit("player") + self.Model:SetCamDistanceScale(1.15) + self.Model:SetFacing(6) + + -- local splash = self:CreateTexture(nil, "OVERLAY") + -- splash:SetSize(600, 300) + -- splash:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH-BLACK") + -- splash:SetBlendMode("ADD") + -- splash:SetPoint("TOP", 0, 0) + + self:SetScript("OnShow", Activate) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_ego.lua b/Interface/AddOns/SVUI/framework/widgets/widget_ego.lua deleted file mode 100644 index 801a291..0000000 --- a/Interface/AddOns/SVUI/framework/widgets/widget_ego.lua +++ /dev/null @@ -1,99 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local math = _G.math; ---[[ MATH METHODS ]]-- -local random = math.random; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...); - -SV.Ego = _G["SVUI_EgoFrame"]; - -local Sequences = { - --{65, 1000}, --shrug - {70, 1000}, --laugh - --{74, 1000}, --roar - --{82, 1000}, --flex - {5, 1000}, --run - {125, 1000}, --spell2 - {125, 1000}, --spell2 - {26, 1000}, --attack - {26, 1000}, --attack - {26, 1000}, --attack - {26, 1000}, --attack - {5, 1000}, --run - {69, 1000}, --dance -}; - -local function rng() - return random(1, #Sequences) -end - -local Activate = function(self) - if(not SV.db.general.ego) then - self:Toggle() - return - end - - local key = rng() - local emote = Sequences[key][1] - self:SetAlpha(1) - self.ModelLeft:SetAnimation(emote) - self.ModelRight:SetAnimation(emote) -end - -function SV.Ego:Initialize() - self:SetFrameLevel(0) - self:SetAllPoints(SV.Screen) - - self.ModelLeft:SetUnit("player") - self.ModelLeft:SetRotation(1) - self.ModelLeft:SetPortraitZoom(0.05) - self.ModelLeft:SetPosition(0,0,-0.25) - - self.ModelRight:SetUnit("player") - self.ModelRight:SetRotation(-1) - self.ModelRight:SetPortraitZoom(0.05) - self.ModelRight:SetPosition(0,0,-0.25) - - -- local splash = self:CreateTexture(nil, "OVERLAY") - -- splash:SetSize(600, 300) - -- splash:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH-BLACK") - -- splash:SetBlendMode("ADD") - -- splash:SetPoint("TOP", 0, 0) - - self:SetScript("OnShow", Activate) -end - -function SV.Ego:Toggle() - if(SV.db.general.ego) then - self:Show() - self:SetScript("OnShow", Activate) - else - self:Hide() - self:SetScript("OnShow", nil) - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widgets.xml b/Interface/AddOns/SVUI/framework/widgets/widgets.xml index a64faab..a3b7410 100644 --- a/Interface/AddOns/SVUI/framework/widgets/widgets.xml +++ b/Interface/AddOns/SVUI/framework/widgets/widgets.xml @@ -133,7 +133,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -212,6 +212,6 @@