Quantcast

Trash files

Safturento [12-20-11 - 00:05]
Trash files
Filename
SaftUI/modules/chat - Copy.lua
SaftUI/modules/chat.bak
diff --git a/SaftUI/modules/chat - Copy.lua b/SaftUI/modules/chat - Copy.lua
deleted file mode 100644
index f7c57ab..0000000
--- a/SaftUI/modules/chat - Copy.lua
+++ /dev/null
@@ -1,218 +0,0 @@
-local T, C, L = unpack(Tukui)
-
-local chatBGLeft = TukuiChatBackgroundLeft
-local tabBGLeft = TukuiTabsLeftBackground
-local chatBGRight = TukuiChatBackgroundRight
-local tabBGRight = TukuiTabsRightBackground
-
-local function SetupChat(self)
-	self:UnregisterAllEvents()
-
-	if C.chat.background == true then
-		tabBGLeft:ClearAllPoints()
-		tabBGLeft:SetPoint("TOPLEFT", chatBGLeft, "TOPLEFT", 6, -6)
-		tabBGLeft:SetPoint("TOPRIGHT", TukuiButtonCF1, "TOPLEFT", -4, 0)
-		tabBGLeft:SetHeight(16)
-		tabBGLeft:SetTemplate("Transparent")
-		tabBGLeft:ThickBorder()
-
-		chatBGLeft:SetTemplate("Transparent")
-		chatBGLeft:ThickBorder()
-		chatBGLeft:SetMovable(true)
-		tinsert(T.AllowFrameMoving, chatBGLeft)
-		if not chatBGLeft:IsUserPlaced() then
-			chatBGLeft:ClearAllPoints()
-			chatBGLeft:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 6, 6)
-		end
-
-		if C.chat.rightLoot then
-			tabBGRight:ClearAllPoints()
-			tabBGRight:SetPoint("TOPLEFT", chatBGRight, "TOPLEFT", 6, -6)
-			tabBGRight:SetPoint("TOPRIGHT", TukuiButtonCF4, "TOPLEFT", -4, 0)
-			tabBGRight:SetHeight(16)
-			tabBGRight:SetTemplate("Transparent")
-			tabBGRight:ThickBorder()
-
-			chatBGRight:SetTemplate("Transparent")
-			chatBGRight:ThickBorder()
-			chatBGRight:SetMovable(true)
-			tinsert(T.AllowFrameMoving, chatBGRight)
-			if not chatBGRight:IsUserPlaced() then
-				chatBGRight:ClearAllPoints()
-				chatBGRight:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -6, 6)
-			end
-		else
-			chatBGRight:Kill()
-			tabBGRight:Kill()
-		end
-	end
-
-	for i = 1, NUM_CHAT_WINDOWS do
-		local frameName = format("ChatFrame%s", i)
-		local frame = _G[frameName]
-		local tab = _G[frameName.."Tab"]
-		local tabText = _G[frameName.."TabText"]
-		local ID = frame:GetID()
-		local copyButton = _G[format("TukuiButtonCF%s", i)]
-		local editbox = _G[frameName.."EditBox"]
-
-
-		editbox:ClearAllPoints()
-		if tabBGLeft then
-			editbox:AllPoints(tabBGLeft)
-			editbox:SetTemplate()
-			editbox:ThickBorder()
-		else
-			editbox:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", 0, -2)
-			editbox:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", 0, -2)
-		end
-		TukuiChatchatEditBoxBackground:Kill()
-
-
-		copyButton:ClearAllPoints()
-		copyButton:SetPoint("TOPRIGHT", (i == 4 and chatBGRight or chatBGLeft) or frame, "TOPRIGHT", -6, -6)
-		copyButton:SetParent(frame)
-		copyButton:SetHeight(tabBGLeft and tabBGLeft:GetHeight() or 16)
-		copyButton:SetWidth(tabBGLeft and tabBGLeft:GetHeight() or 16)
-		copyButton:SetAlpha(C.chat.background and 1 or 0)
-		copyButton:SetScript("OnEnter", function(self)
-			if C.chat.background then
-				T.SetModifiedBackdrop(self)
-			else
-				self:SetAlpha(1)
-			end
-		end)
-		copyButton:SetScript("OnLeave", function(self)
-			if C.chat.background then
-				T.SetOriginalBackdrop(self)
-			else
-				self:SetAlpha(0)
-			end
-		end)
-
-		if C.chat.background then
-			frame:ClearAllPoints()
-			frame:SetPoint("BOTTOMLEFT", chatBGLeft, "BOTTOMLEFT", 6, 6)
-			frame:SetPoint("TOPRIGHT", chatBGLeft, "TOPRIGHT", -6, -28)
-		end
-
-		-- FCF_SetLocked(frame, 1)
-		if i==4 then
-			if C.chat.rightLoot then
-				FCF_DockFrame(frame)
-			else
-				FCF_UndockFrame(frame)
-				frame:ClearAllPoints()
-				frame:SetPoint("BOTTOMLEFT", chatBGRight, "BOTTOMLEFT", 6, 6)
-				frame:SetPoint("TOPRIGHT", chatBGRight, "TOPRIGHT", -6, -28)
-				frame:SetJustifyH("RIGHT")
-			end
-		end
-
-		tabText:SetFont(unpack(C.pFont))
-		tabText:SetShadowOffset(0, 0)
-	end
-
-	if C.chat.background then
-		local ConfigFrame = CreateFrame("Frame", nil, chatBGLeft)
-		ConfigFrame:SetAllPoints(chatBGLeft)
-		ConfigFrame:AddEditBox("width", 30, 14, {"BOTTOMRIGHT", -6, 6})
-		ConfigFrame.width:AddText("label", "Width", "RIGHT", ConfigFrame.width, "LEFT", -3, 0)
-		ConfigFrame:AddEditBox("height", 30, 14, {"BOTTOM", ConfigFrame.width, "TOP", 0, 4})
-		ConfigFrame.height:AddText("label", "Height", "RIGHT", ConfigFrame.height, "LEFT", -3, 0)
-		ConfigFrame:Hide()
-		if SaftUISaved and SaftUISaved.Chat then
-			chatSaved = SaftUISaved.Chat
-			C.chat.width = chatSaved.width
-			C.chat.height = chatSaved.height
-		else
-			C.chat.width = floor(chatBGLeft:GetWidth())
-			C.chat.height = floor(chatBGLeft:GetHeight())
-		end
-		ConfigFrame:RegisterEvent("PLAYER_LOGOUT")
-		ConfigFrame:SetScript("OnEvent", function(self, event)
-			if event=="PLAYER_LOGOUT" then
-				if not SaftUISaved then SaftUISaved = {} end
-				if not SaftUISaved["Chat"] then SaftUISaved["Chat"] = {} end
-				chatSaved = SaftUISaved.Chat
-				chatSaved.width = C.chat.width
-				chatSaved.height = C.chat.height
-			end
-		end)
-
-		ConfigFrame.width:SetText(format("%d", floor(C.chat.width)))
-		ConfigFrame.width:SetScript("OnEnterPressed", function(self)
-			self:ClearFocus()
-			if not tonumber(self:GetText()) then self:SetText(format("%d", floor(C.chat.width))) return end
-			local newChatWidth = tonumber(self:GetText())
-			if newChatWidth > 500 then newChatWidth = 500; self:SetText("500") end
-			if newChatWidth < 200 then newChatWidth = 200; self:SetText("200") end
-			C.chat.width = newChatWidth
-			chatBGLeft:SetWidth(C.chat.width)
-		end)
-		ConfigFrame.height:SetText(C.chat.height)
-		ConfigFrame.height:SetScript("OnEnterPressed", function(self)
-			self:ClearFocus()
-			if not tonumber(self:GetText()) then self:SetText(C.chat.height) return end
-			local newChatHeight = tonumber(self:GetText())
-			if newChatHeight > 300 then newChatHeight = 300; self:SetText("500") end
-			if newChatHeight < 50 then newChatHeight = 50; self:SetText("50") end
-			C.chat.height = newChatHeight
-			chatBGLeft:SetHeight(C.chat.height)
-		end)
-
-		chatBGLeft:SetWidth(C.chat.width)
-		chatBGLeft:SetHeight(C.chat.height)
-		local enable = true
-		local function MoveUI()
-			if InCombatLockdown() then return end
-			if not chatBGLeft.moveText then chatBGLeft:AddText("moveText", "", "CENTER", 0, 1) end
-
-			if enable then
-				chatBGLeft:SetTemplate("Transparent")
-				chatBGLeft:SetBackdropBorderColor(1, 0, 0)
-				chatBGLeft.moveText:SetText(chatBGLeft:GetName())
-				chatBGLeft:SetFrameStrata("MEDIUM")
-				chatBGLeft:EnableMouse(true)
-				ConfigFrame:Show()
-			else
-				chatBGLeft:SetTemplate("Transparent")
-				chatBGLeft:ThickBorder()
-				tabBGLeft:SetTemplate("Transparent")
-				tabBGLeft:ThickBorder()
-				chatBGLeft.moveText:SetText("")
-				chatBGLeft:SetFrameStrata("BACKGROUND")
-				chatBGLeft:EnableMouse(false)
-				ConfigFrame:Hide()
-			end
-
-			if enable then enable = false else enable = true end
-		end
-		hooksecurefunc(_G.SlashCmdList, "MOVING", MoveUI)
-	end
-end
-
-local OnLoad = CreateFrame("Frame")
-OnLoad:RegisterEvent("PLAYER_ENTERING_WORLD")
-OnLoad:SetScript("OnEvent", SetupChat)
-
-local numlines = 1
-function FloatingChatFrame_OnMouseScroll(self, delta)
-	if delta < 0 then
-		if IsShiftKeyDown() then
-			self:ScrollToBottom()
-		else
-			for i=1, numlines do
-				self:ScrollDown()
-			end
-		end
-	elseif delta > 0 then
-		if IsShiftKeyDown() then
-			self:ScrollToTop()
-		else
-			for i=1, numlines do
-				self:ScrollUp()
-			end
-		end
-	end
-end
diff --git a/SaftUI/modules/chat.bak b/SaftUI/modules/chat.bak
deleted file mode 100644
index 1320007..0000000
--- a/SaftUI/modules/chat.bak
+++ /dev/null
@@ -1,198 +0,0 @@
-local T, C, L = unpack(Tukui)
-
-local chatBG = TukuiChatBackgroundLeft
-local tabBG = TukuiTabsLeftBackground
-
-if not chatBG then
-	chatBG = CreateFrame("Frame", "TukuiChatBackgroundLeft", UIParent)
-end
-if not tabBG then
-	tabBG = CreateFrame("Frame", "TukuiTabsLeftBackground", chatBG)
-end
-
-local function SetupChatBG()
-	print("settin' shit up")
-	if C.chat.background == true then
-		for _, f in pairs({chatBG, tabBG}) do
-			f:SetTemplate("Transparent")
-			f:ThickBorder()
-		end
-	else
-		for _, f in pairs({chatBG, tabBG}) do
-			f:SetBackdrop(nil)
-			if f.innerborder then f.innerborder:Hide() end
-			if f.outerborder then f.outerborder:Hide() end
-		end
-	end
-end
-
-local function SetupChat(self)
-	self:UnregisterAllEvents()
-	tabBG:ClearAllPoints()
-	tabBG:SetPoint("TOPLEFT", chatBG, "TOPLEFT", 6, -6)
-	tabBG:SetPoint("TOPRIGHT", TukuiButtonCF1, "TOPLEFT", -4, 0)
-	tabBG:SetHeight(16)
-	for i = 1, NUM_CHAT_WINDOWS do
-		local frameName = format("ChatFrame%s", i)
-		local frame = _G[frameName]
-		local tab = _G[frameName.."Tab"]
-		local tabText = _G[frameName.."TabText"]
-		local ID = frame:GetID()
-		local copyButton = _G[format("TukuiButtonCF%s", i)]
-		local editbox = _G[frameName.."EditBox"]
-
-		editbox:ClearAllPoints()
-		if not C.chat.background then
-			editbox:AllPoints(TukuiInfoLeft)
-		else
-			editbox:Point("TOPLEFT", tabBG, "BOTTOMLEFT", 2, -2)
-			editbox:Point("TOPRIGHT", tabBG, "BOTTOMRIGHT", -2, 2)
-			editbox:SetTemplate()
-			editbox:ThickBorder()
-		end
-
-		copyButton:ClearAllPoints()
-		copyButton:SetPoint("TOPRIGHT", chatBG, "TOPRIGHT", -6, -6)
-		copyButton:SetHeight(tabBG:GetHeight())
-		copyButton:SetWidth(tabBG:GetHeight())
-		copyButton:SetAlpha(C.chat.background and 1 or 0)
-		copyButton:SetScript("OnEnter", function(self)
-			if C.chat.background then
-				T.SetModifiedBackdrop(self)
-			else
-				self:SetAlpha(1)
-			end
-		end)
-		copyButton:SetScript("OnLeave", function(self)
-			if C.chat.background then
-				T.SetOriginalBackdrop(self)
-			else
-				self:SetAlpha(0)
-			end
-		end)
-
-		SetupChatBG()
-		chatBG:SetMovable(true)
-		tinsert(T.AllowFrameMoving, chatBG)
-		if not chatBG:IsUserPlaced() then
-			chatBG:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 6, 6)
-		end
-
-		if TukuiChatBackgroundRight then
-			TukuiChatBackgroundRight:Kill()
-			TukuiTabsRightBackground:Kill()
-		end
-
-		if i==1 then
-			frame:ClearAllPoints()
-			frame:SetPoint("BOTTOMLEFT", chatBG, "BOTTOMLEFT", 6, 6)
-			frame:SetPoint("TOPRIGHT", chatBG, "TOPRIGHT", -6, -28)
-		elseif i==4 then
-			FCF_SetLocked(frame, 1)
-			FCF_DockFrame(frame)
-		end
-
-		tabText:SetFont(unpack(C.pFont))
-		tabText:SetShadowOffset(0, 0)
-	end
-
-	local ConfigFrame = CreateFrame("Frame", nil, chatBG)
-	ConfigFrame:SetAllPoints(chatBG)
-	ConfigFrame:AddEditBox("width", 30, 14, {"BOTTOMRIGHT", -6, 6})
-	ConfigFrame.width:AddText("label", "Width", "RIGHT", ConfigFrame.width, "LEFT", -3, 0)
-	ConfigFrame:AddEditBox("height", 30, 14, {"BOTTOM", ConfigFrame.width, "TOP", 0, 4})
-	ConfigFrame.height:AddText("label", "Height", "RIGHT", ConfigFrame.height, "LEFT", -3, 0)
-	ConfigFrame:Hide()
-
-	if SaftUISaved and SaftUISaved.Chat then
-		chatSaved = SaftUISaved.Chat
-		C.chat.width = chatSaved.width
-		C.chat.height = chatSaved.height
-	else
-		C.chat.width = floor(chatBG:GetWidth())
-		C.chat.height = floor(chatBG:GetHeight())
-	end
-	ConfigFrame:RegisterEvent("PLAYER_LOGOUT")
-	ConfigFrame:SetScript("OnEvent", function(self, event)
-		if event=="PLAYER_LOGOUT" then
-			if not SaftUISaved then SaftUISaved = {} end
-			if not SaftUISaved["Chat"] then SaftUISaved["Chat"] = {} end
-			chatSaved = SaftUISaved.Chat
-			chatSaved.width = C.chat.width
-			chatSaved.height = C.chat.height
-		end
-	end)
-
-	ConfigFrame.width:SetText(format("%d", floor(C.chat.width)))
-	ConfigFrame.width:SetScript("OnEnterPressed", function(self)
-		self:ClearFocus()
-		if not tonumber(self:GetText()) then self:SetText(format("%d", floor(C.chat.width))) return end
-		local newChatWidth = tonumber(self:GetText())
-		if newChatWidth > 500 then newChatWidth = 500; self:SetText("500") end
-		if newChatWidth < 200 then newChatWidth = 200; self:SetText("200") end
-		C.chat.width = newChatWidth
-		chatBG:SetWidth(C.chat.width)
-	end)
-	ConfigFrame.height:SetText(C.chat.height)
-	ConfigFrame.height:SetScript("OnEnterPressed", function(self)
-		self:ClearFocus()
-		if not tonumber(self:GetText()) then self:SetText(C.chat.height) return end
-		local newChatHeight = tonumber(self:GetText())
-		if newChatHeight > 300 then newChatHeight = 300; self:SetText("500") end
-		if newChatHeight < 50 then newChatHeight = 50; self:SetText("50") end
-		C.chat.height = newChatHeight
-		chatBG:SetHeight(C.chat.height)
-	end)
-
-	chatBG:SetWidth(C.chat.width)
-	chatBG:SetHeight(C.chat.height)
-	print("settin' shit up")
-	local enable = true
-	local function MoveUI()
-		if InCombatLockdown() then return end
-		if not chatBG.moveText then chatBG:AddText("moveText", "", "CENTER", 0, 1) end
-
-		if enable then
-			chatBG:SetTemplate("Transparent")
-			chatBG:SetBackdropBorderColor(1, 0, 0)
-			chatBG.moveText:SetText(chatBG:GetName())
-			chatBG:SetFrameStrata("MEDIUM")
-			chatBG:EnableMouse(true)
-			ConfigFrame:Show()
-		else
-			SetupChatBG()
-			chatBG.moveText:SetText("")
-			chatBG:SetFrameStrata("BACKGROUND")
-			chatBG:EnableMouse(false)
-			ConfigFrame:Hide()
-		end
-
-		if enable then enable = false else enable = true end
-	end
-	hooksecurefunc(_G.SlashCmdList, "MOVING", MoveUI)
-end
-
-local OnLoad = CreateFrame("Frame")
-OnLoad:RegisterEvent("PLAYER_ENTERING_WORLD")
-OnLoad:SetScript("OnEvent", SetupChat)
-
-local numlines = 1
-function FloatingChatFrame_OnMouseScroll(self, delta)
-	if delta < 0 then
-		if IsShiftKeyDown() then
-			self:ScrollToBottom()
-		else
-			for i=1, numlines do
-				self:ScrollDown()
-			end
-		end
-	elseif delta > 0 then
-		if IsShiftKeyDown() then
-			self:ScrollToTop()
-		else
-			for i=1, numlines do
-				self:ScrollUp()
-			end
-		end
-	end
-end