diff LibFarmbuyer.lua @ 16:5ee4edd24c13

- new blizz methods for editboxes in dialog popups - initial code for dropdowns in history (not active yet) - hovering and shift-clicking to link out of history - proper confirmations for history rewriting - options checkboxes more grid-like - saved texts get a scrollbar instead of expanding indefinitely (duh) - rearranged savedvars a bit (and added transition code) - stores raider join/leave times and "demographic" info, all for MLEQDKP - minor bugfixes and tweaks
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Thu, 25 Aug 2011 00:45:31 +0000
parents df3e27edbd60
children f560cf82e7d3
line wrap: on
line diff
--- a/LibFarmbuyer.lua	Sun Jul 17 17:40:00 2011 +0000
+++ b/LibFarmbuyer.lua	Thu Aug 25 00:45:31 2011 +0000
@@ -53,7 +53,7 @@
   Ditto for table recycling.
 ]]
 
-local MAJOR, MINOR = "LibFarmbuyer", 9
+local MAJOR, MINOR = "LibFarmbuyer", 11
 assert(LibStub,MAJOR.." requires LibStub")
 local lib = LibStub:NewLibrary(MAJOR, MINOR)
 if not lib then return end
@@ -157,18 +157,24 @@
 end
 local function OnShow_witheditbox (dialog, data)
 	local info = StaticPopupDialogs[dialog.which]
-	dialog[info.hasWideEditBox and "wideEditBox" or "editBox"]:SetFocus()
+	--dialog[info.hasWideEditBox and "wideEditBox" or "editBox"]:SetFocus()
+	dialog.editBox:SetFocus()
     if info.farm_OnShow then
         return info.farm_OnShow (dialog, data)
     end
 end
 local function OnAccept_witheditbox (dialog, data, data2)
 	local info = StaticPopupDialogs[dialog.which]
-	dialog.usertext = dialog[info.hasWideEditBox and "wideEditBox" or "editBox"]:GetText():trim()
+	--dialog.usertext = dialog[info.hasWideEditBox and "wideEditBox" or "editBox"]:GetText():trim()
+	dialog.usertext = dialog.editBox:GetText():trim()
     if info.farm_OnAccept then
         return info.farm_OnAccept (dialog, data, data2)
     end
 end
+local function OnHide_cleanup (dialog)
+	dialog.data = nil
+	dialog.data2 = nil
+end
 
 --[[
 	StaticPopup
@@ -189,6 +195,10 @@
         t.EditBoxOnEscapePressed = StaticPopup_EscapePressed
     end
 
+	if not t.OnHide then
+		t.OnHide = OnHide_cleanup
+	end
+
     t.timeout = 0
     t.whileDead = true
     t.hideOnEscape = true
@@ -208,6 +218,7 @@
 	["Bandwagon"] = true, ["Kilvin"] = true, ["Waterfaucet"] = true,
 	["Farmbuyer"] = true, ["Oxdeadbeef"] = true, ["Pointystick"] = true,
 	["Angryhobbit"] = true, ["Malrubius"] = true, ["Hemogoblin"] = true,
+	["Ossipago"] = true,
 })[UnitName("player")] then
 	lib.author_debug = true
 	_G.safeprint = lib.safeprint