comparison gui.lua @ 24:61d932f0e8f2

Reassigning loot in the main tab also updates entries in the history tab.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Wed, 21 Sep 2011 06:21:48 +0000
parents 8664134bba4f
children cb9635999171
comparison
equal deleted inserted replaced
23:8664134bba4f 24:61d932f0e8f2
489 ["Edit note"] = function(rowi) 489 ["Edit note"] = function(rowi)
490 eoi_editcell (rowi, _d:GetUserData("DD loot cell")) 490 eoi_editcell (rowi, _d:GetUserData("DD loot cell"))
491 end, 491 end,
492 492
493 df_REASSIGN = function(rowi,to_whom) 493 df_REASSIGN = function(rowi,to_whom)
494 g_loot[rowi].person = to_whom 494 addon:reassign_loot (rowi, to_whom)
495 g_loot[rowi].person_class = select(2,UnitClass(to_whom))
496 -- FIXME also update history
497 CloseDropDownMenus() -- also need to close parent menu 495 CloseDropDownMenus() -- also need to close parent menu
498 end, 496 end,
499 ["Enter name..."] = function(rowi) 497 ["Enter name..."] = function(rowi)
500 local dialog = StaticPopup_Show "OUROL_REASSIGN_ENTER" 498 local dialog = StaticPopup_Show "OUROL_REASSIGN_ENTER"
501 dialog.data = {index=rowi, display=_d} 499 dialog.data = {index=rowi, display=_d}
2186 dialog.editBox:SetText("") 2184 dialog.editBox:SetText("")
2187 dialog.editBox:SetFocus() 2185 dialog.editBox:SetFocus()
2188 end,]] 2186 end,]]
2189 OnAccept = function(dialog, data) 2187 OnAccept = function(dialog, data)
2190 local name = dialog.usertext --editBox:GetText() 2188 local name = dialog.usertext --editBox:GetText()
2191 g_loot[data.index].person = name 2189 addon:reassign_loot (data.index, name)
2192 g_loot[data.index].person_class = select(2,UnitClass(name))
2193 -- FIXME also update history
2194 addon:Print("Reassigned entry %d to '%s'.", data.index, name)
2195 data.display:GetUserData("eoiST"):OuroLoot_Refresh(data.index) 2190 data.display:GetUserData("eoiST"):OuroLoot_Refresh(data.index)
2196 end, 2191 end,
2197 } 2192 }
2198 2193
2199 StaticPopupDialogs["OUROL_SAVE_SAVEAS"] = flib.StaticPopup{ 2194 StaticPopupDialogs["OUROL_SAVE_SAVEAS"] = flib.StaticPopup{