diff CensusButton.lua @ 21:1aeab8164ef5

Merge 3rd try
author EmFor
date Sun, 14 Aug 2011 17:21:31 +0200
parents 663f782bd903
children
line wrap: on
line diff
--- a/CensusButton.lua	Sun Aug 14 15:16:35 2011 +0000
+++ b/CensusButton.lua	Sun Aug 14 17:21:31 2011 +0200
@@ -1,23 +1,23 @@
---[[
-	CensusPlus for World of Warcraft(tm).
-	
-	Copyright 2005 - 2006 Cooper Sellers and WarcraftRealms.com
-
-	License:
-		This program is free software; you can redistribute it and/or
-		modify it under the terms of the GNU General Public License
-		as published by the Free Software Foundation; either version 2
-		of the License, or (at your option) any later version.
-
-		This program is distributed in the hope that it will be useful,
-		but WITHOUT ANY WARRANTY; without even the implied warranty of
-		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-		GNU General Public License for more details.
-
-		You should have received a copy of the GNU General Public License
-		along with this program(see GLP.txt); if not, write to the Free Software
-		Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-]]
+--[[
+	CensusPlus for World of Warcraft(tm).
+	
+	Copyright 2005 - 2006 Cooper Sellers and WarcraftRealms.com
+
+	License:
+		This program is free software; you can redistribute it and/or
+		modify it under the terms of the GNU General Public License
+		as published by the Free Software Foundation; either version 2
+		of the License, or (at your option) any later version.
+
+		This program is distributed in the hope that it will be useful,
+		but WITHOUT ANY WARRANTY; without even the implied warranty of
+		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+		GNU General Public License for more details.
+
+		You should have received a copy of the GNU General Public License
+		along with this program(see GLP.txt); if not, write to the Free Software
+		Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+]]
 
 
 local init = false;
@@ -46,7 +46,7 @@
 	end
 end
 
-function CensusButton_UpdatePosition()
+function CensusButton_UpdatePosition()
 	CensusButtonFrame:SetPoint(
 		"TOPLEFT",
 		"Minimap",
@@ -62,11 +62,11 @@
 	end
 end
 
-function CensusPlusButton_OnClick( arg1, arg2 )
+function CensusPlusButton_OnClick( arg1 )
 	if ( arg1 == "LeftButton" ) then
 		CensusButton_OnClick();
 	else
-  ToggleDropDownMenu( 1, nil, CP_ButtonDropDown, "CensusButtonFrame", 20, 20 );
+        ToggleDropDownMenu( 1, nil, CP_ButtonDropDown, "CensusButtonFrame", 20, 20 );
 	end
 
 end
@@ -75,24 +75,24 @@
 		
 		local info;
 
-		if (g_IsCensusPlusInProgress == true) then
-			if( g_CensusPlusManuallyPaused == true ) then
+		if (g_IsCensusPlusInProgress == true) then
+			if( g_CensusPlusManuallyPaused == true ) then
 				info = {
 					text = CENSUSPlus_UNPAUSE;
 					func = CensusPlus_Take_OnClick;
 				};
-			else
+			else
 				info = {
 					text = CENSUSPlus_PAUSE;
 					func = CensusPlus_Take_OnClick;
 				};
-			end
-		else
+			end
+		else
 			info = {
 				text = CENSUSPlus_TAKE;
 				func = CensusPlus_Take_OnClick;
 			};
-		end
+		end
 		UIDropDownMenu_AddButton(info, 1);
 
 		info = {
@@ -103,13 +103,25 @@
 		
 		info = {
 			text = CENSUSPlus_CANCEL;
-			func = CensusPlus_CloseDropDown;
+			func = CensusPlus_CloseDropDown;
 		};
 		UIDropDownMenu_AddButton(info, 1);		
 		
 end
-
-
-function CensusPlus_CloseDropDown()
-	CloseDropDownMenus();
+
+
+function CensusPlus_CloseDropDown()
+	CloseDropDownMenus();
+end
+function CensusPlus_Button_OnMouseDown( self, arg1 )
+	if ( ( ( not CensusButtonFrame.isLocked ) or ( CensusButtonFrame.isLocked == 0 ) ) and ( arg1 == "LeftButton" ) ) then
+		CensusButtonFrame:StartMoving();
+		CensusButtonFrame.isMoving = true;
+	end
+end
+function CensusPlus_Button_OnClick( self, arg1, arg2 )
+	if( not CensusButtonFrame.isMoving ) then
+		CensusPlusButton_OnClick(arg1, arg2);
+		PlaySound("igMainMenuOptionCheckBoxOn");
+	end
 end
\ No newline at end of file