Quantcast

afk configs added

Munglunch [11-19-14 - 17:01]
afk configs added
Filename
Interface/AddOns/SVUI/framework/widgets/widget_afk.lua
Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua
Interface/AddOns/SVUI/system/configs.lua
Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
Interface/BUTTONS/Thumbs.db
Interface/Characterframe/Thumbs.db
diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua b/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua
index f93ed7e..204d16b 100644
--- a/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua
+++ b/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua
@@ -32,12 +32,7 @@ local SV = select(2, ...);

 SV.AFK = _G["SVUI_AFKFrame"];

-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)
+function SV.AFK:Activate(enabled)
 	if(InCombatLockdown()) then return end
 	if(enabled) then
 		MoveViewLeftStart(0.05);
@@ -54,20 +49,15 @@ function SV.AFK:Toggle(enabled)
 	end
 end

-local Activate = function(self)
-	self:SetAlpha(1)
-	self.Model:SetAnimation(119)
-end
-
 local AFK_OnEvent = function(self, event)
 	if(event == "PLAYER_REGEN_DISABLED") then
 		self:RegisterEvent("PLAYER_REGEN_ENABLED", "OnEvent")
-		self:Toggle(false)
+		self:Activate(false)
 	else
 		if(UnitIsAFK("player")) then
-			self:Toggle(true)
+			self:Activate(true)
 		else
-			self:Toggle(false)
+			self:Activate(false)
 		end
 	end
 end
@@ -95,9 +85,22 @@ function SV.AFK:Initialize()
 	splash:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\PLAYER-AFK")
 	splash:Point("TOPRIGHT", self, "TOPRIGHT", 0, -64)

-	self:SetScript("OnShow", Activate)
 	self:Hide()
-	self:RegisterEvent("PLAYER_FLAGS_CHANGED")
-	self:RegisterEvent("PLAYER_REGEN_DISABLED")
-	self:SetScript("OnEvent", AFK_OnEvent)
+	if(SV.db.general.afk) then
+		self:RegisterEvent("PLAYER_FLAGS_CHANGED")
+		self:RegisterEvent("PLAYER_REGEN_DISABLED")
+		self:SetScript("OnEvent", AFK_OnEvent)
+	end
+end
+
+function SV.AFK:Toggle()
+	if(SV.db.general.afk) then
+		self:RegisterEvent("PLAYER_FLAGS_CHANGED")
+		self:RegisterEvent("PLAYER_REGEN_DISABLED")
+		self:SetScript("OnEvent", AFK_OnEvent)
+	else
+		self:UnregisterEvent("PLAYER_FLAGS_CHANGED")
+		self:UnregisterEvent("PLAYER_REGEN_DISABLED")
+		self:SetScript("OnEvent", nil)
+	end
 end
\ No newline at end of file
diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua b/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua
index f7b65db..9482c22 100644
--- a/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua
+++ b/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua
@@ -67,7 +67,7 @@ local function rng()
 end

 local Activate = function(self)
-	if(not SV.db.general.ego) then
+	if(not SV.db.general.gamemenu) then
 		self:Toggle()
 		return
 	end
@@ -104,7 +104,7 @@ function SV.GameMenu:Initialize()
 end

 function SV.GameMenu:Toggle()
-	if(SV.db.general.ego) then
+	if(SV.db.general.gamemenu) then
 		self:Show()
 		self:SetScript("OnShow", Activate)
 	else
diff --git a/Interface/AddOns/SVUI/system/configs.lua b/Interface/AddOns/SVUI/system/configs.lua
index 73fbe7a..ecdf050 100644
--- a/Interface/AddOns/SVUI/system/configs.lua
+++ b/Interface/AddOns/SVUI/system/configs.lua
@@ -60,7 +60,8 @@ SV.configs["general"] = {
     ["questWatch"] = true,
     ["questHeaders"] = true,
     ["woot"] = true,
-    ["ego"] = true,
+    ["gamemenu"] = true,
+    ["afk"] = true,
     ["pvpinterrupt"] = true,
     ["lookwhaticando"] = false,
     ["reactionChat"] = false,
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
index 08693d5..ff226e3 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
@@ -373,12 +373,19 @@ SV.Options.args.common = {
 									get = function(j)return SV.db.general.reactionEmote end,
 									set = function(j,value)SV.db.general.reactionEmote = value;SV:ToggleReactions()end
 								},
-								ego = {
-									order = 1,
+								gamemenu = {
+									order = 9,
 									type = 'toggle',
 									name = L["Awesome Game Menu"],
-									get = function(j)return SV.db.general.ego end,
-									set = function(j,value) SV.db.general.ego = value; SV.GameMenu:Toggle() end
+									get = function(j)return SV.db.general.gamemenu end,
+									set = function(j,value) SV.db.general.gamemenu = value; SV.GameMenu:Toggle() end
+								},
+								afk = {
+									order = 10,
+									type = 'toggle',
+									name = L["Awesome AFK Screen"],
+									get = function(j)return SV.db.general.afk end,
+									set = function(j,value) SV.db.general.afk = value; SV.AFK:Toggle() end
 								},
 							}
 						},
diff --git a/Interface/BUTTONS/Thumbs.db b/Interface/BUTTONS/Thumbs.db
deleted file mode 100644
index 9a524d6..0000000
Binary files a/Interface/BUTTONS/Thumbs.db and /dev/null differ
diff --git a/Interface/Characterframe/Thumbs.db b/Interface/Characterframe/Thumbs.db
new file mode 100644
index 0000000..e66b1c5
Binary files /dev/null and b/Interface/Characterframe/Thumbs.db differ