Quantcast

* provided option to change the Junk List's behavior: toggle between 0c value (default) and actual value (new)

ckaotik [10-03-10 - 17:12]
* provided option to change the Junk List's behavior: toggle between 0c value (default) and actual value (new)
* cleaned up the help panel. Texts are the same but the code is now much neater
Filename
constants.lua
locale/deDE.lua
locale/enUS.lua
options.lua
diff --git a/constants.lua b/constants.lua
index 2e30c45..20e78cd 100644
--- a/constants.lua
+++ b/constants.lua
@@ -15,9 +15,9 @@ BrokerGarbage.defaultGlobalSettings = {
 	sellNotWearable = false,
 	sellNWQualityTreshold = 4,
 	autoSellIncludeItems = false,
+	useRealValues = false,
 	-- hidden options
 	hideZeroValue = true,		-- false: have zero value items (quest items, event items etc.) show up in BG tooltip, true: hide them [DEFAULT]
-	useRealValues = false,		-- false: use zero value for included items (junk list items) [DEFAULT], true: use the item's actual value

 	-- default values
 	tooltipMaxHeight = 220,
diff --git a/locale/deDE.lua b/locale/deDE.lua
index 9c8364f..79b7d18 100644
--- a/locale/deDE.lua
+++ b/locale/deDE.lua
@@ -169,6 +169,9 @@ if GetLocale() == "deDE" then
 	BrokerGarbage.locale.LOIncludeAutoSellText = "Müll-Items verkaufen"
 	BrokerGarbage.locale.LOIncludeAutoSellTooltip = "Aktivieren, um Items von deiner Müll-Liste automatisch beim Händler zu verkaufen. Items ohne Wert werden ignoriert."

+	BrokerGarbage.locale.LOUseRealValues = "Echte Werte für Müll-Items"
+	BrokerGarbage.locale.LOUseRealValuesTooltip = "Aktivieren, um für Müll-Items den tatsächlichen Preis zu nutzen, anstatt sie auf 0c zu setzen."
+
 	BrokerGarbage.locale.listsBestUse = [[|cffffd200Listen-Beispiele|r
 Die Standardlisten geben eine Hilfestellung, was auf welcher Liste nützlich sein könnte.
 Setze erst alle Items, die du auf jeden Fall behalten möchtest, auf die |cffffd200Behalten-Liste|r. Denke auch daran, dass es Kategorien (s.u.) gibt! Ist der LootManager aktiv, wird er Items von dieser Liste immer plündern.
@@ -179,6 +182,10 @@ Sollte ein Item einen ungewollt hohen Wert zugewiesen bekommen, setze das Item a
 |cffAAAAAAz.B. Fischöl|r
 Auf die |cffffd200Verkaufen-Liste|r kannst du alles setzen, was Broker_Garbage verkaufen soll.
 |cffAAAAAAz.B. Wasser (als Krieger), Alterachochkäse|r]]
+
+	BrokerGarbage.locale.listsSpecialOptions = [[|cffffd200Spezielle Müll-Listen Optionen|r
+|cffffd200Verkaufen|r: Diese Einstellung ist nützlich für all diejenigen, die keine Unterscheidung zwischen Müll und zu verkaufenden Items treffen wollen. Wenn ausgewählt, werden sowohl die Items aus der Müll-Liste als auch die aus der Verkaufen-Liste bei Händlern verkauft.
+|cffffd200Echte Werte|r: Diese Einstellungen ändert das Verhalten der Müll-Liste. Standardmäßig (deaktiviert) bekommen Müll-Items einen Wert von 0c zugewiesen (beeinflusst nicht die Statistiken) und erscheinen damit als erstes im Tooltip. Wenn aktiviert, behalten diese Items ihren normalen Wert und tauchen entsprechend später in der Liste auf.]]

 	BrokerGarbage.locale.iconButtonsUse = [[|cffffd200Item-Buttons|r
 Angezeigt wird entweder das Icon des Items, ein Zahnrad, wenn es sich um eine Kategorie handelt, oder ein Fragezeichen, wenn der Server das Item nicht finden kann.
diff --git a/locale/enUS.lua b/locale/enUS.lua
index 06c3c1f..a09e1e7 100644
--- a/locale/enUS.lua
+++ b/locale/enUS.lua
@@ -169,8 +169,11 @@ BrokerGarbage.locale = {
 	LOIncludeAutoSellText = "Sell Junk List items",
 	LOIncludeAutoSellTooltip = "Check this to automatically sell items on your include list when at a merchant. Items without a value will be ignored.",

+	LOUseRealValues = "Use actual value for junk items",
+	LOUseRealValuesTooltip = "Check this to have junk items considered with their actual value, rather than 0c.",
+
 	listsBestUse = [[|cffffd200List Examples|r
-Don't forget to use the standard lists! They provide a great example.
+Don't forget to use the default lists! They provide a great example.
 First, put any items you don't want to lose on your |cffffd200Keep List|r. Make good use of categories (see below)! If the LootManager is active it will alwas try to loot these items.
 |cffAAAAAAe.g. class reagents, flasks|r
 Items which may be thrown away any time belong on the |cffffd200Junk List|r.
@@ -179,6 +182,10 @@ In case you encounter highly overrated items, put them on your |cffffd200Vendor
 |cffAAAAAAe.g. fish oil|r
 Put items on your |cffffd200Sell List|r that should be sold when visiting a merchant.
 |cffAAAAAAe.g. water as a warrior, cheese|r]],
+
+	listsSpecialOptions = [[|cffffd200Junk List special options|r
+|cffffd200Sell Junk List items|r: This setting is useful for those who do not want to distinguish between the Sell List and the Junk List. If you check this, any items on your Junk -or- Sell List will be sold when you visit a vendor.
+|cffffd200Use actual values|r: This setting changes the behavior of the Junk List. By default (disabled) Junk List items will get their value set to 0c (statistics will still work just fine!) and they will be shown first in the tooltip. If you enable this setting, these items will retain their regular value and will only show up in the tooltip once their value is reached.]],

 	iconButtonsUse = [[|cffffd200Item Buttons|r
 For any item you'll either see its icon, a gear if it's a category or a question mark in case the server doesn't know this item.
diff --git a/options.lua b/options.lua
index 52f4c62..cb56538 100644
--- a/options.lua
+++ b/options.lua
@@ -684,7 +684,7 @@ local function ShowListOptions(frame)
 		BrokerGarbage:CreateDefaultLists(IsShiftKeyDown())
 	end)

-	local autoSellIncludeItems = LibStub("tekKonfig-Checkbox").new(frame, nil, BrokerGarbage.locale.LOIncludeAutoSellText, "LEFT", default, "RIGHT", 10, 0)
+	local autoSellIncludeItems = LibStub("tekKonfig-Checkbox").new(frame, nil, BrokerGarbage.locale.LOIncludeAutoSellText, "LEFT", default, "RIGHT", 10, 8)
 	autoSellIncludeItems.tiptext = BrokerGarbage.locale.LOIncludeAutoSellTooltip .. BrokerGarbage.locale.GlobalSetting
 	autoSellIncludeItems:SetChecked(BG_GlobalDB.autoSellIncludeItems)
 	local checksound = autoSellIncludeItems:GetScript("OnClick")
@@ -695,7 +695,19 @@ local function ShowListOptions(frame)
 		BrokerGarbage:ScanInventory()
 	end)

-	local panel = LibStub("tekKonfig-Group").new(frame, nil, "TOP", default, "BOTTOM", 0, -24)
+	local includeMode = LibStub("tekKonfig-Checkbox").new(frame, nil, BrokerGarbage.locale.LOUseRealValues, "TOPLEFT", autoSellIncludeItems, "BOTTOMLEFT", 0, 8)
+	includeMode.tiptext = BrokerGarbage.locale.LOUseRealValuesTooltip .. BrokerGarbage.locale.GlobalSetting
+	includeMode:SetChecked(BG_GlobalDB.useRealValues)
+	local checksound = includeMode:GetScript("OnClick")
+	includeMode:SetScript("OnClick", function(includeMode)
+		checksound(includeMode)
+		BG_GlobalDB.useRealValues = not BG_GlobalDB.useRealValues
+		BrokerGarbage.itemsCache = {}
+		BrokerGarbage:ScanInventory()
+		-- maybe: Update LDB
+	end)
+
+	local panel = LibStub("tekKonfig-Group").new(frame, nil, "TOP", default, "BOTTOM", 0, -28)
 	panel:SetPoint("LEFT", 8 + 3, 0)
 	panel:SetPoint("BOTTOMRIGHT", -8 -4, 34)

@@ -759,6 +771,9 @@ local function ShowListOptions(frame)
 	searchbox:SetFontObject("GameFontHighlightSmall")
 	CreateFrameBorders(searchbox)

+	searchbox:SetTextColor(0.75, 0.75, 0.75, 1)
+	searchbox:SetText(BrokerGarbage.locale.search)
+
 	searchbox:SetScript("OnEscapePressed", searchbox.ClearFocus)
 	searchbox:SetScript("OnEnterPressed", searchbox.ClearFocus)
 	searchbox:SetScript("OnEditFocusGained", function(self)
@@ -778,8 +793,6 @@ local function ShowListOptions(frame)
 		self.searchString = t ~= "" and t ~= BrokerGarbage.locale.search and t:lower() or nil
 		BrokerGarbage:UpdateSearch(self.searchString)
 	end)
-	searchbox:SetText(BrokerGarbage.locale.search)
-	searchbox:SetTextColor(0.75, 0.75, 0.75, 1)

 	-- tab changing actions
 	include:SetScript("OnClick", function(self)
@@ -1036,29 +1049,16 @@ local function ShowListOptions(frame)
 			local helpFrame = CreateFrame("Frame", "BG_HelpFrame", scrollContent)
 			helpFrame:SetAllPoints()

-			local bestUse = helpFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
-			bestUse:SetHeight(190)
-			bestUse:SetPoint("TOPLEFT", helpFrame, "TOPLEFT", 8, -4)
-			bestUse:SetPoint("RIGHT", helpFrame, -4, 0)
-			bestUse:SetNonSpaceWrap(true)
-			bestUse:SetJustifyH("LEFT"); bestUse:SetJustifyV("TOP")
-			bestUse:SetText(BrokerGarbage.locale.listsBestUse)
-
-			local iconButtons = helpFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
-			iconButtons:SetHeight(124)
-			iconButtons:SetPoint("TOPLEFT", bestUse, "BOTTOMLEFT", 0, -10)
-			iconButtons:SetPoint("RIGHT", helpFrame, -4, 0)
-			iconButtons:SetNonSpaceWrap(true)
-			iconButtons:SetJustifyH("LEFT"); iconButtons:SetJustifyV("TOP")
-			iconButtons:SetText(BrokerGarbage.locale.iconButtonsUse)
-
-			local actionButtons = helpFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
-			actionButtons:SetHeight(180)
-			actionButtons:SetPoint("TOPLEFT", iconButtons, "BOTTOMLEFT", 0, -10)
-			actionButtons:SetPoint("RIGHT", helpFrame, -4, 0)
-			actionButtons:SetNonSpaceWrap(true)
-			actionButtons:SetJustifyH("LEFT"); actionButtons:SetJustifyV("TOP")
-			actionButtons:SetText(BrokerGarbage.locale.actionButtonsUse)
+			local helpTexts = helpFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
+			helpTexts:SetPoint("TOPLEFT", helpFrame, "TOPLEFT", 8, -4)
+			helpTexts:SetWidth(helpFrame:GetWidth() - 8)	-- substract the offset we added to the left
+			helpTexts:SetWordWrap(true)
+			helpTexts:SetJustifyH("LEFT")
+			helpTexts:SetJustifyV("TOP")
+			helpTexts:SetText(BrokerGarbage.locale.listsBestUse .. "\n\n" ..
+				BrokerGarbage.locale.listsSpecialOptions .. "\n\n" ..
+				BrokerGarbage.locale.iconButtonsUse .. "\n\n" ..
+				BrokerGarbage.locale.actionButtonsUse .. "\n")
 		else
 			_G["BG_HelpFrame"]:Show()
 		end