Skip to content

Commit

Permalink
added gold icon and version number
Browse files Browse the repository at this point in the history
  • Loading branch information
dreanor committed Dec 31, 2016
1 parent 00f54ce commit bfc25f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
21 changes: 11 additions & 10 deletions src/SellOrnateItems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ end
function SellOrnateItems.OnAddOnLoaded(event, addonName)
if addonName == SellOrnateItems.name then
SellOrnateItems:Initialize()
SellOrnateItemsIndicator:SetHidden(true)
end
SellOrnateItemsIndicator:SetHidden(true)
end
end

function SellOrnateItems.OnVendorOpen(event)
Expand All @@ -24,18 +24,19 @@ end
function SellOrnateItems.SellTrash()
local slotId = 0
local bagsize = GetBagSize(1)
local totalAmount = 0
local itemCount = 0
local totalAmount = 0
local itemCount = 0
local goldIcon = ZO_Currency_GetPlatformFormattedGoldIcon()
for slotId = 0,bagsize do
if GetItemTrait(1,slotId)==ITEM_TRAIT_TYPE_ARMOR_ORNATE or GetItemTrait(1,slotId)==ITEM_TRAIT_TYPE_WEAPON_ORNATE or GetString("SI_ITEMTRAITTYPE",GetItemTrait(1,slotId))=="Ornate" then
SellInventoryItem(1,slotId,1)
local value = GetItemSellValueWithBonuses(1,slotId)
totalAmount = totalAmount + value
itemCount = itemCount + 1
d("Sold: " .. GetItemLink(1,slotId,1) .. " for " .. value .. " gold")
local value = GetItemSellValueWithBonuses(1,slotId)
totalAmount = totalAmount + value
itemCount = itemCount + 1
d("Sold: " .. GetItemLink(1,slotId,1) .. " for " .. value .. goldIcon)
end
end
d("Sold " .. itemCount .. " items for a total of " .. totalAmount .. " gold")
d("Sold " .. itemCount .. " items for a total of " .. totalAmount .. goldIcon)
end

EVENT_MANAGER:RegisterForEvent(SellOrnateItems.name, EVENT_ADD_ON_LOADED, SellOrnateItems.OnAddOnLoaded)
EVENT_MANAGER:RegisterForEvent(SellOrnateItems.name, EVENT_ADD_ON_LOADED, SellOrnateItems.OnAddOnLoaded)
3 changes: 2 additions & 1 deletion src/SellOrnateItems.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Description: Sells all items in the inventory to the merchant that give x% more gold.
## Title: Sell Ornate Items
## Title: Sell Ornate Items 1.1
## Author: NoPantsuNoLife
## Version: 1.1
## APIVersion: 100017

SellOrnateItems.xml
Expand Down

0 comments on commit bfc25f4

Please sign in to comment.