Quantcast

add camera

susnow [04-02-12 - 12:27]
add camera
remove ttf
Filename
.DS_Store
SlideLock.lua
SlideLock.toc
config.lua
media/Camera.ogg
media/Camera2.tga
media/Camera3.tga
media/beta.TTF
media/core_font.ttf
diff --git a/.DS_Store b/.DS_Store
index 388d25b..79a15eb 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/SlideLock.lua b/SlideLock.lua
index cbb294b..30521ec 100644
--- a/SlideLock.lua
+++ b/SlideLock.lua
@@ -1,6 +1,7 @@
 --Susnow

 local addon,ns = ...
+local cfg = ns.cfg
 local texFile = "Interface\\Buttons\\WHITE8X8"
 local bgTex = {bgFile = texFile,edgeFile = texFile, edgeSize = 1,insets={top = 0, bottom = 0,left = 0,right = 0}}
 local tex = "Interface\\AddOns\\SlideLock\\media\\"
@@ -42,6 +43,13 @@ SL.SlideBar:SetPoint("BOTTOM",SL,0,20)
 SL.SlideBar.tex = SL.SlideBar:CreateTexture(nil,"ARTWORK")
 SL.SlideBar.tex:SetTexture(barTex)
 SL.SlideBar.tex:SetAllPoints(SL.SlideBar)
+SL.CameraButton = CreateFrame("Button",nil,SL)
+SL.CameraButton:SetSize(32,32)
+SL.CameraButton:SetPoint("LEFT",SL.SlideBar,"RIGHT",-16,1)
+SL.CameraButton.tex = SL.CameraButton:CreateTexture(nil,"OVERLAY")
+SL.CameraButton.tex:SetTexture(tex.."Camera3")
+SL.CameraButton.tex:SetPoint("CENTER",SL.CameraButton)
+SL.CameraButton:SetScale(0.94)
 SL.SlideButton = CreateFrame("Button",nil,SL)
 SL.SlideButton:SetScale(0.94)
 SL.SlideButton:SetFrameLevel(SL.SlideBar:GetFrameLevel()+10)
@@ -175,6 +183,14 @@ SL.SlideButton:SetScript("OnMouseUp",function(self)
 	end
 end)

+SL.CameraButton:RegisterEvent("SCREENSHOT_SUCCEEDED")
+SL.CameraButton:SetScript("OnClick",function(self)
+	Screenshot()
+	self:SetScript("OnEvent",function()
+		PlaySoundFile(tex.."Camera.ogg","Master")
+	end)
+end)
+
 -- don't Unregister this handler , because I need to intercept all keyboard action
 SL:SetScript("OnKeyDown",function(self,key)
 	--
@@ -193,6 +209,7 @@ local function ToggleSlideLock(flag)
 		BP1:Show()
 		BP2:Show()
 		TP:Show()
+		PlaySoundFile(tex.."lock2.ogg","Master")
 	end
 end

@@ -200,9 +217,24 @@ ToggleSlideLock("HIDE")

 UIParent:HookScript("OnHide",function()
 	ToggleSlideLock("SHOW")
-	PlaySoundFile(tex.."lock2.ogg","Master")
 end)

 UIParent:HookScript("OnShow",function()
 	ToggleSlideLock("HIDE")
 end)
+
+
+local UIP = CreateFrame("Frame")
+if cfg.AFK then
+	UIP:RegisterEvent("PLAYER_FLAGS_CHANGED")
+	UIP:SetScript("OnEvent",function()
+		if UnitIsAFK("player") then
+			UIParent:Hide()
+		else
+			return
+		end
+	end)
+else
+	return
+end
+
diff --git a/SlideLock.toc b/SlideLock.toc
index 0756b7e..5d5e1df 100644
--- a/SlideLock.toc
+++ b/SlideLock.toc
@@ -7,4 +7,6 @@
 ## Notes-zhCN: 和iOS风格类似的锁屏插件
 ## Notes-zhTW: 和iOS風格類似的鎖屏插件

+
+config.lua
 SlideLock.lua
diff --git a/config.lua b/config.lua
new file mode 100644
index 0000000..07ea4f5
--- /dev/null
+++ b/config.lua
@@ -0,0 +1,9 @@
+--Susnow
+
+local addon,ns = ...
+local cfg = CreateFrame("Frame")
+
+cfg.AFK = true -- lock screen when player away from the keyboard
+
+
+ns.cfg = cfg
diff --git a/media/Camera.ogg b/media/Camera.ogg
new file mode 100644
index 0000000..c9fe558
Binary files /dev/null and b/media/Camera.ogg differ
diff --git a/media/Camera2.tga b/media/Camera2.tga
new file mode 100644
index 0000000..6c2bf80
Binary files /dev/null and b/media/Camera2.tga differ
diff --git a/media/Camera3.tga b/media/Camera3.tga
new file mode 100644
index 0000000..677cfa6
Binary files /dev/null and b/media/Camera3.tga differ
diff --git a/media/beta.TTF b/media/beta.TTF
deleted file mode 100644
index aadf20e..0000000
Binary files a/media/beta.TTF and /dev/null differ
diff --git a/media/core_font.ttf b/media/core_font.ttf
deleted file mode 100644
index 19e0868..0000000
Binary files a/media/core_font.ttf and /dev/null differ