Mercurial > wow > itemauditor
comparison Modules/DisplayInvested.lua @ 44:9a6d4e2768fd
Removed SaveNewValue which wasn't being used any more.
| author | Asa Ayers <Asa.Ayers@Gmail.com> |
|---|---|
| date | Mon, 19 Jul 2010 22:49:02 -0700 |
| parents | 60ab9a4d2de1 |
| children | 5e981c1df761 |
comparison
equal
deleted
inserted
replaced
| 43:60ab9a4d2de1 | 44:9a6d4e2768fd |
|---|---|
| 30 local copper = tonumber(string.match(value, "([0-9]+)|c([0-9a-fA-F]+)c|r") or string.match(value, "([0-9]+)c")) | 30 local copper = tonumber(string.match(value, "([0-9]+)|c([0-9a-fA-F]+)c|r") or string.match(value, "([0-9]+)c")) |
| 31 | 31 |
| 32 -- Convert it all into copper | 32 -- Convert it all into copper |
| 33 return (copper or 0) + ((gold or 0) * COPPER_PER_GOLD) + ((silver or 0) * COPPER_PER_SILVER) | 33 return (copper or 0) + ((gold or 0) * COPPER_PER_GOLD) + ((silver or 0) * COPPER_PER_SILVER) |
| 34 | 34 |
| 35 end | |
| 36 | |
| 37 local function SaveNewValue(link, type, text) | |
| 38 if not validateMoney(text) then | |
| 39 error("Invalid value") | |
| 40 end | |
| 41 local investedTotal, investedPerItem, numOwned = ItemAuditor:GetItemCost(link) | |
| 42 local newValue=parseMoney(text) | |
| 43 | |
| 44 if type == priceTypeEach then | |
| 45 newValue = newValue * numOwned | |
| 46 end | |
| 47 | |
| 48 ItemAuditor:SaveValue(link, newValue-investedTotal, 0) | |
| 49 -- ItemAuditor:SaveValue(link, newValue, 0) | |
| 50 | |
| 51 promptFrame:Hide() | |
| 52 end | 35 end |
| 53 | 36 |
| 54 StaticPopupDialogs["ItemAuditor_NewPrice"] = { | 37 StaticPopupDialogs["ItemAuditor_NewPrice"] = { |
| 55 text = "New price %s %s", | 38 text = "New price %s %s", |
| 56 button1 = SAVE, | 39 button1 = SAVE, |
| 83 hideOnEscape = 1, | 66 hideOnEscape = 1, |
| 84 exclusive = true, | 67 exclusive = true, |
| 85 } | 68 } |
| 86 | 69 |
| 87 local function PromptForNewPrice(link, type) | 70 local function PromptForNewPrice(link, type) |
| 88 -- function(widget, event, text) SaveNewValue(link, type, text) end | |
| 89 local investedTotal, investedPerItem, count = ItemAuditor:GetItemCost(link) | 71 local investedTotal, investedPerItem, count = ItemAuditor:GetItemCost(link) |
| 90 | 72 |
| 91 local typeText = "Invested Each" | 73 local typeText = "Invested Each" |
| 92 local price = investedPerItem | 74 local price = investedPerItem |
| 93 if type == priceTypeTotal then | 75 if type == priceTypeTotal then |
