diff HotCorners.lua @ 11:371e14cd2feb

- major fixes with icons not showing correctly.
author Tercio
date Thu, 08 Dec 2016 13:01:40 -0200
parents d8a463c5ef5a
children 6c1cc07c389d
line wrap: on
line diff
--- a/HotCorners.lua	Tue Oct 25 15:59:51 2016 -0200
+++ b/HotCorners.lua	Thu Dec 08 13:01:40 2016 -0200
@@ -558,10 +558,10 @@
 			--item frame
 			LibHotCorners:RefereshItems (self)
 			
-			self.AnimOnShow:Play()
+			--self.AnimOnShow:Play()
 			HotCornersInfosFrame:Show()
 			HotCornersInfosFrame:SetAlpha (0)
-			HotCornersInfosFrame.AnimOnShow:Play()
+			--HotCornersInfosFrame.AnimOnShow:Play()
 			
 			--update repair
 			local percent, items = 0, 0
@@ -647,7 +647,7 @@
 					item_button.itemtable = itemTable
 					
 					if (not item_button:IsShown() or item_button:GetAlpha() < 1) then
-						HotCornersStartAnimOnShow (item_button, "item_topleft")
+--						HotCornersStartAnimOnShow (item_button, "item_topleft")
 					end
 				end
 				index = index + 1
@@ -731,7 +731,7 @@
 					end
 					
 					if (not item_button:IsShown() or item_button:GetAlpha() < 1) then
-						HotCornersStartAnimOnShow (item_button, "item_topleft")
+--						HotCornersStartAnimOnShow (item_button, "item_topleft")
 					end
 				end
 				index = index + 1
@@ -763,7 +763,7 @@
 					end
 					
 					if (not item_button:IsShown() or item_button:GetAlpha() < 1) then
-						HotCornersStartAnimOnShow (item_button, "item_topleft")
+--						HotCornersStartAnimOnShow (item_button, "item_topleft")
 					end
 				end
 				index = index + 1
@@ -914,12 +914,14 @@
 			if (axis == "y") then
 				--button:SetPoint ("topleft", button:GetParent(), "topleft", -32, button.y)
 				button:SetPoint ("topleft", button:GetParent(), "topleft", 4, button.y)
-				button.AnimOnShow:Play()
+				--button.AnimOnShow:Play()
+				button:Show()
+				button:SetAlpha (1)
 				
 			elseif (axis == "item_topleft") then
+				--button.AnimOnShow:Play()
 				button:Show()
-				button.AnimOnShow:Play()
-				
+				button:SetAlpha (1)
 			end
 		end
 		
@@ -972,11 +974,22 @@
 		--> set the icon
 		button:SetNormalTexture (button_table.icon)
 		button:SetHighlightTexture (button_table.icon)
-		
-		if (string.lower (button_table.icon):find ([[\icons\]])) then
+	
+		if (string.lower (button_table.icon):find ([[\icons\]]) or string.lower (button_table.icon):find ([[\ICONS\]]) or string.lower (button_table.icon):find ([[\Icons\]])) then
 			button:GetNormalTexture():SetTexCoord (0.078125, 0.9375, 0.078125, 0.9375)
 			button:GetHighlightTexture():SetTexCoord (0.078125, 0.9375, 0.078125, 0.9375)
 		end
 		
+		button:SetNormalTexture (button_table.icon)
+		button:SetHighlightTexture (button_table.icon)
+		
+		button.Icon = button:CreateTexture (nil, "overlay")
+		button.Icon:SetTexture (button_table.icon)
+		button.Icon:SetSize (32, 32)
+		button.Icon:SetPoint ("center", button, "center", 0, 0)
+		
+		--print (button:GetName())
+		--print (1, button:GetAlpha())
+		
 		return button
 	end
\ No newline at end of file