changeset 23:8664134bba4f

Add '/ouroloot ping' command, same functionality as button in options panel.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Fri, 09 Sep 2011 00:56:13 +0000
parents 33ce273687ab
children 61d932f0e8f2
files core.lua gui.lua
diffstat 2 files changed, 17 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/core.lua	Sun Sep 04 19:09:15 2011 +0000
+++ b/core.lua	Fri Sep 09 00:56:13 2011 +0000
@@ -769,6 +769,13 @@
 	elseif cmd == "off" then                            self:Deactivate()
 	elseif cmd == "broadcast" or cmd == "bcast" then    self:Activate(nil,true)
 
+	elseif cmd == "toggle" then
+		if self.display then
+			self.display:Hide()
+		else
+			return self:BuildMainDisplay()
+		end
+
 	elseif cmd == "fake" then  -- maybe comment this out for real users
 		self:_mark_boss_kill (self._addLootEntry{
 			kind='boss',reason='kill',bosskill="Baron Steamroller",instance=instance_tag(),duration=0
@@ -799,12 +806,8 @@
 
 	elseif cmd == "help" then
 		self:BuildMainDisplay('help')
-	elseif cmd == "toggle" then
-		if self.display then
-			self.display:Hide()
-		else
-			return self:BuildMainDisplay()
-		end
+	elseif cmd == "ping" then
+		self:DoPing()
 
 	elseif cmd == "fixcache" then
 		self:do_item_cache_fixup()
@@ -973,6 +976,13 @@
 	end
 end
 
+function addon:DoPing()
+	self:Print("Give me a ping, Vasili. One ping only, please.")
+	self.sender_list.active = {}
+	self.sender_list.names = {}
+	self:broadcast('ping')
+end
+
 -- Generic helpers
 function addon._find_next_after (kind, index)
 	index = index + 1
--- a/gui.lua	Sun Sep 04 19:09:15 2011 +0000
+++ b/gui.lua	Fri Sep 09 00:56:13 2011 +0000
@@ -1662,12 +1662,9 @@
 			[[Asks other raid users for their addon version and current status.  Results displayed on User Options panel.]])
 		w:SetFullWidth(true)
 		w:SetCallback("OnClick", function(_w)
-			addon:Print("Give me a ping, Vasili. One ping only, please.")
-			addon.sender_list.active = {}
-			addon.sender_list.names = {}
 			_w:SetText("5... 4... 3...")
 			_w:SetDisabled(true)
-			addon:broadcast('ping')
+			addon:DoPing()
 			addon:ScheduleTimer(function(b)
 				if b:IsVisible() then
 					return addon:redisplay()