comparison Modules/DisplayInvested.lua @ 148:106c1523777e 2010-10-16

Fixed references to 'this' which Blizzard removed in 4.0.1
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sat, 16 Oct 2010 07:35:50 -0700
parents 7d258c041b11
children fbfd9dfa6d2b
comparison
equal deleted inserted replaced
147:1fb5ee067a50 148:106c1523777e
21 hasEditBox = 1, 21 hasEditBox = 1,
22 showAlert = 1, 22 showAlert = 1,
23 OnAccept = function() 23 OnAccept = function()
24 skipCODTracking = true 24 skipCODTracking = true
25 end, 25 end,
26 EditBoxOnEnterPressed = function() 26 EditBoxOnEnterPressed = function(self)
27 if ( getglobal(this:GetParent():GetName().."Button1"):IsEnabled() == 1 ) then 27 if ( self:GetParent().button1:IsEnabled() == 1 ) then
28 getglobal(this:GetParent():GetName().."Button1"):Click() 28 self:GetParent().button1:Click()
29 end 29 end
30 end, 30 end,
31 EditBoxOnTextChanged = function () 31 EditBoxOnTextChanged = function (self)
32 local parentName = this:GetParent():GetName() 32 if validateMoney(self:GetText()) then
33 local editBox = getglobal( parentName.."EditBox"); 33 self:GetParent().button1:Enable()
34 local value = editBox:GetText()
35 if validateMoney(value) then
36 getglobal(parentName.."Button1"):Enable();
37 else 34 else
38 getglobal(parentName.."Button1"):Disable(); 35 self:GetParent().button1:Disable();
39 end 36 end
40 end, 37
41 EditBoxOnEscapePressed = function() 38 end,
42 this:GetParent():Hide(); 39 EditBoxOnEscapePressed = function(self)
43 ClearCursor(); 40 self:GetParent().button2:Click()
44 end, 41 end,
45 timeout = 0, 42 timeout = 0,
46 hideOnEscape = 1, 43 hideOnEscape = 1,
47 exclusive = true, 44 exclusive = true,
48 } 45 }
62 59
63 StaticPopupDialogs["ItemAuditor_NewPrice"].OnShow = function (self, data) 60 StaticPopupDialogs["ItemAuditor_NewPrice"].OnShow = function (self, data)
64 self.editBox:SetText(ItemAuditor:FormatMoney(price, '', true)) 61 self.editBox:SetText(ItemAuditor:FormatMoney(price, '', true))
65 end 62 end
66 63
67 StaticPopupDialogs["ItemAuditor_NewPrice"].OnAccept = function() 64 StaticPopupDialogs["ItemAuditor_NewPrice"].OnAccept = function(self)
68 local name = this:GetParent():GetName().."EditBox" 65 local newValue = self.editBox:GetText()
69 local button = getglobal(name)
70 local newValue = button:GetText()
71 newValue = parseMoney(newValue) 66 newValue = parseMoney(newValue)
72 67
73 local investedTotal, investedPerItem, numOwned = ItemAuditor:GetItemCost(link) 68 local investedTotal, investedPerItem, numOwned = ItemAuditor:GetItemCost(link)
74 69
75 if type == priceTypeEach then 70 if type == priceTypeEach then