Mercurial > wow > breuesk
diff State.lua @ 81:62805e6b46c5
Fleshing out the UI for those without the addon. Announcements in the raid, bidding via whisper.
author | John@Yosemite-PC |
---|---|
date | Fri, 13 Apr 2012 22:09:17 -0400 |
parents | 40c882db34f8 |
children | db7e4ee34dce |
line wrap: on
line diff
--- a/State.lua Fri Apr 13 00:02:56 2012 -0400 +++ b/State.lua Fri Apr 13 22:09:17 2012 -0400 @@ -134,6 +134,12 @@ state = "bidding" stateitem = item AlertStateChangeListeners() + if admin then -- todo: only ML + local chan + if _G.GetNumRaidMembers() > 0 then chan = "RAID" else chan = "PARTY" end + _G.SendChatMessage("Bidding is now open for "..item.link.."!",chan) + _G.SendChatMessage("Whisper me \"bid\" to bid or \"roll\" to offset roll; \"retract\" will remove your bid",chan) + end end end @@ -190,7 +196,6 @@ if state == "bidding" then if roll then - print("RB: ",person.value,roll) table.insert(staterolls,person) staterollvalues[roll] = person staterolls = SortByRoll(staterollvalues,staterolls) @@ -200,6 +205,23 @@ statebids = SortByList(lref,statebids) end AlertRollListeners() + if admin then -- todo: make ML + local leader + if getn(statebids) > 0 then + leader = statebids[1].textPlain + elseif getn(staterolls) > 0 then + leader = staterolls[1].textPlain + end + + local chan -- todo: this idiom is wearing on me already + if _G.GetNumRaidMembers() > 0 then chan = "RAID" else chan = "PARTY" end + + if roll then + _G.SendChatMessage(sformat("Received roll of %d from %s; current leader is %s", roll, person.textPlain, leader),chan) + else + _G.SendChatMessage(sformat("Received bid from %s; current leader is %s", person.textPlain, leader),chan) -- todo: tell what spot they're bidding from + end + end end -- else ignore ... @@ -250,7 +272,7 @@ function InitiateRetract(person) if state == "bidding" then - Comm:SendStateChange("RR",person,roll) + Comm:SendStateChange("RR",person) end end --}}} @@ -260,7 +282,13 @@ if state == "bidding" then state = "looting" AlertStateChangeListeners() - -- todo: remove the item from the window, record history + -- todo: record history + if admin then + local chan -- todo: pattern + local chan -- todo: this idiom is wearing on me already + if _G.GetNumRaidMembers() > 0 then chan = "RAID" else chan = "PARTY" end + _G.SendChatMessage("Bidding is closed",chan) + end end end