Mercurial > wow > inventory
comparison Core.lua @ 188:5cee31b1418a
Cleaning up.
| author | Zerotorescue |
|---|---|
| date | Mon, 31 Jan 2011 15:06:37 +0100 |
| parents | 05b4f8ad6445 |
| children | 072dd16803d6 |
comparison
equal
deleted
inserted
replaced
| 187:2707dea58d96 | 188:5cee31b1418a |
|---|---|
| 372 end | 372 end |
| 373 | 373 |
| 374 function addon:DisplayItemCount(value, minimumStock) | 374 function addon:DisplayItemCount(value, minimumStock) |
| 375 if value == -1 then | 375 if value == -1 then |
| 376 return "|cffffff00Unknown|r"; | 376 return "|cffffff00Unknown|r"; |
| 377 elseif value == -2 then | |
| 378 return "|cffffff00-|r"; | |
| 377 elseif value == -3 then | 379 elseif value == -3 then |
| 378 return "|cffffff00Unknown|r"; | 380 return "|cffffff00Unknown|r"; |
| 379 elseif value == -4 then | |
| 380 return "|cffffff00-|r"; | |
| 381 else | 381 else |
| 382 return sformat("%s / %d", self:ColorCode(value, minimumStock), minimumStock); | 382 return sformat("%s / %d", self:ColorCode(value, minimumStock), minimumStock); |
| 383 end | 383 end |
| 384 end | 384 end |
| 385 | 385 |
| 521 local temp = "{\n"; | 521 local temp = "{\n"; |
| 522 | 522 |
| 523 for i, v in pairs(t) do | 523 for i, v in pairs(t) do |
| 524 if type(v) == "table" then | 524 if type(v) == "table" then |
| 525 if includeKeys then | 525 if includeKeys then |
| 526 local key = (type(i) == "number" and tostring(i)) or string.format("\"%s\"", tostring(i)); | 526 local key = (type(i) == "number" and tostring(i)) or sformat("\"%s\"", tostring(i)); |
| 527 | 527 |
| 528 temp = string.format("%s%s [%s] => %s,\n", temp, tabs, key, ReadableTable(v, includeKeys, (jumps or 0) + 1)); | 528 temp = sformat("%s%s [%s] => %s,\n", temp, tabs, key, ReadableTable(v, includeKeys, (jumps or 0) + 1)); |
| 529 else | 529 else |
| 530 temp = string.format("%s%s %s,\n", temp, tabs, ReadableTable(v, includeKeys, (jumps or 0) + 1)); | 530 temp = sformat("%s%s %s,\n", temp, tabs, ReadableTable(v, includeKeys, (jumps or 0) + 1)); |
| 531 end | 531 end |
| 532 else | 532 else |
| 533 if includeKeys then | 533 if includeKeys then |
| 534 local key = (type(i) == "number" and tostring(i)) or string.format("\"%s\"", tostring(i)); | 534 local key = (type(i) == "number" and tostring(i)) or sformat("\"%s\"", tostring(i)); |
| 535 local value = (type(v) == "number" and tostring(v)) or string.format("\"%s\"", tostring(v)); | 535 local value = (type(v) == "number" and tostring(v)) or sformat("\"%s\"", tostring(v)); |
| 536 | 536 |
| 537 temp = string.format("%s%s [%s] => %s,\n", temp, tabs, key, value); | 537 temp = sformat("%s%s [%s] => %s,\n", temp, tabs, key, value); |
| 538 else | 538 else |
| 539 local value = (type(v) == "number" and tostring(v)) or string.format("\"%s\"", tostring(v)); | 539 local value = (type(v) == "number" and tostring(v)) or sformat("\"%s\"", tostring(v)); |
| 540 | 540 |
| 541 temp = string.format("%s%s %s,\n", temp, tabs, value); | 541 temp = sformat("%s%s %s,\n", temp, tabs, value); |
| 542 end | 542 end |
| 543 end | 543 end |
| 544 end | 544 end |
| 545 temp = temp .. tabs .. "}"; | 545 temp = temp .. tabs .. "}"; |
| 546 | 546 |
