more refactoring

This commit is contained in:
Manuel Simon Hirsig
2015-09-09 22:40:48 +02:00
parent e07c822310
commit 70ee39d110
2 changed files with 25 additions and 19 deletions
+2 -2
View File
@@ -180,8 +180,8 @@ function Auctionator_Buy_ScrollbarUpdate()
local lineEntry_stackSize = getglobal("AuctionatorBuyEntry"..line.."_StackSize")
local color = "ffffffff"
if Auctionator.qualityColor(entry.quality) then
color = Auctionator.qualityColor(entry.quality)
if Auctionator_QualityColor(entry.quality) then
color = Auctionator_QualityColor(entry.quality)
end
lineEntry_name:SetText("\124c" .. color .. entry.name .. "\124r")
+23 -17
View File
@@ -5,7 +5,6 @@ AUCTIONATOR_ENABLE_ALT = true
AUCTIONATOR_OPEN_FIRST = false
AUCTIONATOR_INSTANT_BUYOUT = false
-- global settings
Auctionator = {
loaded = false,
orig = {},
@@ -17,26 +16,15 @@ Auctionator = {
buy = {
index = 5
}
},
qualityColor = function(code)
if code == 0 then
return "ff9d9d9d" -- poor, gray
elseif code == 1 then
return "ffffffff" -- common, white
elseif code == 2 then
return "ff1eff00" -- uncommon, green
elseif code == 3 then -- rare, blue
return "ff0070dd"
elseif code == 4 then
return "ffa335ee" -- epic, purple
elseif code == 5 then
return "ffff8000" -- legendary, orange
end
end
}
}
-----------------------------------------
local relevel
-----------------------------------------
function Auctionator_OnLoad()
Auctionator_Log("Auctionator v"..AuctionatorVersion.." loaded")
Auctionator.loaded = true
@@ -378,4 +366,22 @@ function Auctionator_ContainerFrameItemButton_OnClick(button)
end
end
end
end
-----------------------------------------
function Auctionator_QualityColor(code)
if code == 0 then
return "ff9d9d9d" -- poor, gray
elseif code == 1 then
return "ffffffff" -- common, white
elseif code == 2 then
return "ff1eff00" -- uncommon, green
elseif code == 3 then -- rare, blue
return "ff0070dd"
elseif code == 4 then
return "ffa335ee" -- epic, purple
elseif code == 5 then
return "ffff8000" -- legendary, orange
end
end