comparison Gui.lua @ 78:5b507f4125d4

Finalized bid handling
author John@Yosemite-PC
date Thu, 12 Apr 2012 22:19:15 -0400
parents 39be9328acd0
children 7b8fcea357d2
comparison
equal deleted inserted replaced
77:0a3f590f69e6 78:5b507f4125d4
208 ["Release"] = function(self) self.data = {}; self.widget = nil end, 208 ["Release"] = function(self) self.data = {}; self.widget = nil end,
209 ["ItemListEvent"] = function(self) self:Redraw() end, 209 ["ItemListEvent"] = function(self) self:Redraw() end,
210 ["Redraw"]= function(self) 210 ["Redraw"]= function(self)
211 self.data = {} 211 self.data = {}
212 for i,v in pairs(stateitemlist) do 212 for i,v in pairs(stateitemlist) do
213 local entry = {value=i, text=v, link=v} 213 local entry = {value=i, text=v.link, link=v.link, mlid=v.mlid}
214 table.insert(self.data,entry) 214 table.insert(self.data,entry)
215 end 215 end
216 if self.widget then 216 if self.widget then
217 self.widget:SetList(self.data) 217 self.widget:SetList(self.data)
218 LListEventDispatch:Event("Redraw") 218 LListEventDispatch:Event("Redraw")
372 else 372 else
373 adminForce:SetText("Force bid") 373 adminForce:SetText("Force bid")
374 adminForce:SetDisabled(true) 374 adminForce:SetDisabled(true)
375 end 375 end
376 adminForce:SetWidth(160) 376 adminForce:SetWidth(160)
377 adminForce:SetCallback("OnClick",function(widget) RListPopulator:Force(SListEventDispatch:LatestValue()) end) 377 adminForce:SetCallback("OnClick",function(widget) InitiateBid(SListEventDispatch:LatestValue()) end)
378 adminForce.userdata = 378 adminForce.userdata =
379 { 379 {
380 widget = adminForce, 380 widget = adminForce,
381 ["Redraw"] = function(self,_) self.widget:SetDisabled(true); self.widget:SetText("Force bid") end, 381 ["Redraw"] = function(self,_) self.widget:SetDisabled(true); self.widget:SetText("Force bid") end,
382 ["OnSelection"] = function(self,_) self.widget:SetDisabled(false); self.widget:SetText(sformat("Force bid (%s)",SListEventDispatch:LatestValue().textPlain)) end, 382 ["OnSelection"] = function(self,_) self.widget:SetDisabled(false); self.widget:SetText(sformat("Force bid (%s)",SListEventDispatch:LatestValue().textPlain)) end,
499 self.assignButton:SetText("Assign") 499 self.assignButton:SetText("Assign")
500 self.assignButton:SetDisabled(false) 500 self.assignButton:SetDisabled(false)
501 self.assignButton:SetCallback("OnClick", function(widget) FreeLoot(LListEventDispatch:LatestValue(),SListEventDispatch:LatestValue()) end) 501 self.assignButton:SetCallback("OnClick", function(widget) FreeLoot(LListEventDispatch:LatestValue(),SListEventDispatch:LatestValue()) end)
502 self.suicideButton:SetText("Suicide") 502 self.suicideButton:SetText("Suicide")
503 self.suicideButton:SetDisabled(false) 503 self.suicideButton:SetDisabled(false)
504 self.suicideButton:SetCallback("OnClick", function(widget) DirectSuicideLoot(LListEventDispatch:LatestValue(),SListEventDispatch:LatestValue(),SListPopulator.lref) end)
504 else 505 else
505 self.assignButton:SetText("Assign") 506 self.assignButton:SetText("Assign")
506 self.assignButton:SetDisabled(true) 507 self.assignButton:SetDisabled(true)
507 self.suicideButton:SetText("Suicide") 508 self.suicideButton:SetText("Suicide")
508 self.suicideButton:SetDisabled(true) 509 self.suicideButton:SetDisabled(true)