comparison State.lua @ 75:ed1c9fd4cc95

Progress on bidding events and GUI. Slave GUIs now respond properly.
author John@Doomsday
date Mon, 09 Apr 2012 09:40:53 -0400
parents 7eb2963eea7d
children 39be9328acd0
comparison
equal deleted inserted replaced
74:15844864a5f7 75:ed1c9fd4cc95
127 -- Open Bidding {{{ 127 -- Open Bidding {{{
128 function OpenBid(packet) 128 function OpenBid(packet)
129 local item = unpack(packet) 129 local item = unpack(packet)
130 if state == "looting" then 130 if state == "looting" then
131 state = "bidding" 131 state = "bidding"
132 stateitem = item
132 AlertStateChangeListeners() 133 AlertStateChangeListeners()
133 item = value
134 end 134 end
135 end 135 end
136 136
137 function InitiateOpenBid(item) 137 function InitiateOpenBid(item)
138 if state == "looting" then 138 if state == "looting" then
189 end 189 end
190 --}}} 190 --}}}
191 -- Close Bidding {{{ 191 -- Close Bidding {{{
192 function CloseBidding(packet) 192 function CloseBidding(packet)
193 local awardedTo = unpack(packet) 193 local awardedTo = unpack(packet)
194 state = "looting" 194 if state == "bidding" then
195 AlertStateChangeListeners() 195 state = "looting"
196 -- remove the item from the window, record history 196 AlertStateChangeListeners()
197 -- todo: remove the item from the window, record history
198 end
197 end 199 end
198 200
199 function InitiateCloseBidding(awardedTo) 201 function InitiateCloseBidding(awardedTo)
200 Comm:SendStateChange("CB",awardedTo) 202 if state == "bidding" then
203 Comm:SendStateChange("CB",awardedTo)
204 end
201 end 205 end
202 --}}} 206 --}}}
203 -- Close Looting {{{ 207 -- Close Looting {{{
204 function CloseLooting(packet) 208 function CloseLooting(packet)
205 state = "neutral" 209 state = "neutral"