From 70ee39d1108ed0da7baa635cb94ba1b594161578 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Wed, 9 Sep 2015 22:40:48 +0200 Subject: [PATCH] more refactoring --- Buy.lua | 4 ++-- Core.lua | 40 +++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Buy.lua b/Buy.lua index fb39b16..3a01cb0 100644 --- a/Buy.lua +++ b/Buy.lua @@ -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") diff --git a/Core.lua b/Core.lua index 331614f..9f7290a 100644 --- a/Core.lua +++ b/Core.lua @@ -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 \ No newline at end of file