diff --git a/deDE.lua b/deDE.lua new file mode 100644 index 0000000..cca085b --- /dev/null +++ b/deDE.lua @@ -0,0 +1,219 @@ +-- German localisation file +_, BrokerGarbage = ... + +if GetLocale() == "deDE" then + +BrokerGarbage.locale = { + label = "Kein Müll", + + -- Chat Messages + sellAndRepair = "Müll für %1$s verkauft, repariert für %2$s. Änderung: %3$s.", + repair = "Repariert für %s.", + sell = "Müll verkauft für %s.", + + addedToSaveList = "%s zur Ausnahmeliste hinzugefügt.", + addedToPriceList = "Für %s wird nun nur der Händlerpreis genutzt.", + addedToIncludeList = "%s zur Einschlussliste hinzugefügt.", + addedToSellList = "%s wird bei Händlern automatisch verkauft.", + limitSet = "Für %s wurde das Limit auf %d gesetzt.", + itemDeleted = "%s wurde gelöscht.", + + openPlease = "Bitte öffne %s - es nimmt unnötig Platz weg.", + openClams = "Du hast eine %s im Inventar!", + couldNotLootValue = "%s wurde nicht geplündert, da es zu billig ist.", + couldNotLootLocked = "Konnte %s nicht plündern, da es gesperrt ist. Bitte plündere es manuell.", + couldNotLootSpace = "Konnte %s nicht plündern, da dein Inventar voll ist.", + couldNotLootLM = "%s wurde nicht geplündert. Du bist Plündermeister, bitte verteile es manuell.", + slashCommandHelp = "Folgende Kommandos werden unterstützt: |cffc0c0c0/garbage|r\n|cffc0c0c0 config|r öffnet die Optionen.\n|cffc0c0c0format |cffc0c0ffformatstring|r lässt dich das Format der LDB Anzeige anpassen, |cffc0c0c0 format reset|r setzt es zurück.\n|cffc0c0c0stats|r gibt dir eine Kurzstatistik aus.\n|cffc0c0c0limit |cffc0c0ffitemLink/ID Anzahl|r setzt ein Limit für das gewählte Item für den aktuellen Charakter.\n|cffc0c0c0globallimit |cffc0c0ffitemLink/ID Anzahl|r setzt ein Limit für alle Charaktere.\n|cffc0c0c0value |cffc0c0ffWertInKupfer|r setzt den Itemwert, ab dem Items gelootet werden.", + statistics = "Statistik:\nGesamtverdienst (alle Charaktere): %1$s\nGesamtverlust (alle Charaktere): %2$s", + minValueSet = "Mindestwert für items wurde auf %s gesetzt.", + + -- Tooltip + headerRightClick = "Rechts-Klick: Optionen", + headerShiftClick = "SHIFT-Klick: Zerstören", + headerCtrlClick = "STRG-Klick: Behalten", + moneyLost = "Gold verloren:", + moneyEarned = "Gold verdient:", + noItems = "Keine Items zum Löschen.", + increaseTreshold = "Erhöhe die Item Qualität", + + autoSellTooltip = "Müll für %s verkaufen", + reportNothingToSell = "Nichts zu verkaufen!", + + -- Statistics Frame + StatisticsHeading = "Statistiken, jeder braucht sie!\nUm Teile davon zu löschen, klicke auf das jeweilige 'x'.", + + MemoryUsageText = "Bitte beachte, dass insbesondere nach dem Inventarscan der Speicherbedarf stark zunimmt. Er schrumpft wieder, wenn der 'Garbage Collector' ans Werk geht.", + MemoryUsageTitle = "Speicherverbrauch (kB)", + CollectMemoryUsageTooltip = "Klicke um den 'Garbage Collector' (Blizzard Funktion) manuell zu starten.", + + GlobalStatisticsHeading = "Globale Geldstatistiken:", + AverageSellValueTitle = "Durchschnittl. Verkaufswert", + AverageDropValueTitle = "Durchschnittl. weggeworfen", + + GlobalMoneyEarnedTitle = "Gesamtverdienst", + ResetGlobalMoneyEarnedTooltip = "Klicke um deinen Gesamtverdienst zurückzusetzen.", + GlobalMoneyLostTitle = "Gesamtverlust", + ResetGlobalMoneyLostTooltip = "Klicke um deinen Gesamtverlust zurückzusetzen.", + + GlobalItemsSoldTitle = "Items verkauft", + ResetGlobalItemsSoldTooltip = "Klicke um die Anzahl an verkauften Items zurückzusetzen.", + ItemsDroppedTitle = "Items weggeworfen", + ResetGlobalItemsDroppedTooltip = "Klicke um die Anzahl der weggeworfenen Items zurückzusetzen.", + + LocalStatisticsHeading = "Statistiken von %s:", + StatisticsLocalAmountEarned = "Verdienst", + ResetLocalMoneyEarnedTooltip = "Klicke um deinen (lokalen) Verdienst zurückzusetzen.", + StatisticsLocalAmountLost = "Verlust", + ResetLocalMoneyLostTooltip = "Klicke um deinen (lokalen) Verlust zurückzusetzen.", + + ResetGlobalDataText = "Reset: Global", + ResetGlobalDataTooltip = "Klicke hier um alle globalen Statistikdaten zurückzusetzen.", + ResetLocalDataText = "Reset: Lokal", + ResetLocalDataTooltip = "Klicke um alle charakterspezifischen Statistiken zurückzusetzen.", + + -- Basic Options Frame + BasicOptionsTitle = "Grundeinstellungen", + BasicOptionsText = "Möchtest du einmal nicht automatisch verkaufen / reparieren? \nHalte SHIFT gedrückt, wenn du den Händler ansprichst!", + autoSellTitle = "Automatisch Verkaufen", + autoSellText = "Wenn ausgewählt, werden graue Gegenstände automatisch beim Händler verkauft.", + + showAutoSellIconTitle = "Icon anzeigen", + showAutoSellIconText = "Wenn ausgewählt, wird bei Händlern ein Icon zum automatischen Verkaufen angezeigt.", + + showNothingToSellTitle = "'Nichts zu verkaufen'", + showNothingToSellText = "Wenn ausgewählt, wird bei Besuch eines Händlers eine Nachricht ausgegeben, falls es nichts zu verkaufen gibt.", + + autoRepairTitle = "Automatisch Reparieren", + autoRepairText = "Wenn ausgewählt, wird deine Ausrüstung automatisch repariert wenn möglich.", + + autoRepairGuildTitle = "Reparatur selbst zahlen", + autoRepairGuildText = "Wenn ausgewählt, wird Broker_Garbage nicht auf Gildenkosten reparieren.", + + showLostTitle = "'Verlorenes Gold' zeigen", + showLostText = "Wenn ausgewählt, wird im Tooltip die Zeile 'Verlorenes Gold' gezeigt.", + + showSourceTitle = "Quelle anzeigen", + showSourceText = "Wenn ausgewählt, wird im Tooltip als letzte Spalte die Preisquelle gezeigt.", + + showEarnedTitle = "'Verdientes Gold' zeigen", + showEarnedText = "Wenn ausgewählt, wird im Tooltip die Zeile 'Verdientes Gold' gezeigt.", + + dropQualityTitle = "Item Qualität", + dropQualityText = "Wähle, bis zu welcher Qualität Items zum Löschen vorgeschlagen werden. Standard: Schlecht (0)", + + moneyFormatTitle = "Geldformat", + moneyFormatText = "Ändere die Art, wie Geldbeträge angezeigt werden. Standard: 2", + + maxItemsTitle = "Max. Items", + maxItemsText = "Lege fest, wie viele Zeilen im Tooltip angezeigt werden. Standard: 9", + + maxHeightTitle = "Max. Höhe", + maxHeightText = "Lege fest, wie hoch der Tooltip sein darf. Standard: 220", + + enchanterTitle = "Verzauberer", + enchanterTooltip = "Setze das Häkchen, wenn du einen Verzauberer besitzt/kennst. Wenn aktiviert, wird Broker_Garbage Entzauberpreise verwenden, welche in der Regel höher sind als Händlerpreise.", + + rescanInventory = "Inventar neu scannen", + rescanInventoryText = "Klicke um dein Inventar neu zu scannen. Dies sollte normalerweise nicht nötig sein!", + + emptyExcludeList = "Ausschlussliste leeren", + emptyExcludeListText = "Klicke um deine globale (!) Ausschlussliste zu leeren.", + + emptyIncludeList = "Einschlussliste leeren", + emptyIncludeListText = "Klicke um deine globale (!) Einschlussliste zu leeren.", + + LDBDisplayTextTitle = "LDB Anzeige:", + LDBDisplayTextHelpTooltip = "Schnellhilfe:\n%1$s - Itemlink\n%2$s - Item Anzahl\n%3$s - Itemwert\n%4$d - freier Taschenplatz\n%5$d - Gesamttaschenplatz", + LDBDisplayTextResetTooltip = "Setze den LDB Anzeigetext auf den Standardwert zurück.", + + -- List Options Panel + LOPTitle = "Positiv-Listen", + LOPSubTitle = "Zum Hinzufügen ziehe Items auf das jeweilige '+'. Zum Entfernen wähle sie aus und klicke auf '-'. Nutze Kategorien per Rechts-Klick auf '+'.", + + -- Exclude List + LOPExcludeHeader = "Ausschlussliste - Items hier werden nie verkauft/gelöscht.", + LOPExcludePlusTT = "Items hinzufügen, indem du sie hierher ziehst/hier ablegst. Rechtsklick, um Kategorien hinzuzufügen!", + LOPExcludeMinusTT = "Wähle Items, die du entfernen willst. Dann klicke hier.", + LOPExcludePromoteTT = "Klicke um alle markierten Items in die globale Ausnahmeliste zu übernehmen.", + LOPExcludeEmptyTT = "Klicke, um die lokale Ausschlussliste völlig zu leeren.\n|cffff0000Achtung!", + + -- Force Vendor Price List + LOPForceHeader = "Händlerpreis-Liste - Für diese Items wird nur der Händlerpreis betrachtet.", + LOPForcePlusTT = "Items hinzufügen, indem du sie hierher ziehst/hier ablegst. Rechtsklick, um Kategorien hinzuzufügen!", + LOPForceMinusTT = "Wähle Items, die du entfernen willst. Dann klicke hier.", + LOPForcePromoteTT = "Die Händlerpreis-Liste ist bereits global.", + LOPForceEmptyTT = "Klicke, um die Händlerliste völlig zu leeren.\n|cffff0000Achtung!", + + -- AutoSell Options Panel + LONTitle = "Negativ-Listen", + LONSubTitle = "Analog zu den Positiv-Listen. Um eine maximale Anzahl für ein bestimmtes Item festzulegen, nutze das Mausrad über dem Item-Icon.", + + -- Include List + LONIncludeHeader = "Einschlussliste - Items werden zuerst angezeigt und vom LM nicht geplündert.", + LONIncludePlusTT = "Items hinzufügen, indem du sie hierher ziehst/hier ablegst. Rechtsklick, um Kategorien hinzuzufügen!", + LONIncludeMinusTT = "Wähle Items, die du entfernen willst. Dann klicke hier.", + LONIncludePromoteTT = "Klicke, um alle markierten Items in die globale Einschlussliste zu übernehmen.", + LONIncludeEmptyTT = "Klicke, um die lokale Einschlussliste völlig zu leeren.\n|cffff0000Achtung!", + + -- Auto Sell List + LONAutoSellHeader = "Verkaufsliste - Items hier werden bei Händlern automatisch verkauft.", + LONAutoSellPlusTT = "Items hinzufügen, indem du sie hierher ziehst/hier ablegst. Rechtsklick, um Kategorien hinzuzufügen!", + LONAutoSellMinusTT = "Wähle Items, die du entfernen willst. Dann klicke hier.", + LONAutoSellPromoteTT = "Klicke, um alle markierten Items in die globale Verkaufsliste zu übernehmen.", + LONAutoSellEmptyTT = "Klicke, um die lokale Verkaufsliste völlig zu leeren.\n|cffff0000Achtung!", + + -- LibPeriodicTable texts + PTCategoryTooltipHeader = "Kategorien hinzufügen", + PTCategoryTooltipText = "Füge Kategorien hinzu, indem du auf die entsprechenden Einträge clickst.", + + -- Loot Manager + CreatureTypeBeast = "Wildtier", + You = "Ihr", + + LMTitle = "Loot Manager", + LMSubTitle = "Der Loot Manager kann den gesamten Lootvorgang verwalten, wenn du ihn lässt.\nHalte SHIFT beim Plündern lange gedrückt, wenn du sonst Autoloot an hast, aber einmalig 'per Hand' plündern möchtest.", + + LMEnableTitle = "Loot Manager aktivieren", + LMEnableTooltip = "Aktiviert den Loot Manager.", + + LMSelectiveTitle = "Selektives Looten", + LMSelectiveTooltip = "Wenn ausgewählt, entscheidet Broker_Garbage von selbst, welche Items gelootet werden.", + + LMAutoLootTitle = "Autoloot", + LMAutoLootTooltip = "Wenn nicht ausgewählt, wird Broker_Garbage nur bei bestimmten Gelegenheiten looten.", + + LMAutoLootSkinningTitle = "Kürschnern", + LMAutoLootSkinningTooltip = "Wenn ausgewählt, wird Broker_Garbage versuchen, durch dich kürschnerbare Kreaturen zu looten.", + + LMAutoLootPickpocketTitle = "Taschendiebstahl", + LMAutoLootPickpocketTooltip = "Wenn ausgewählt, wird Broker_Garbage automatisch plündern, wenn du ein Schurke in Verstohlenheit bist.", + + LMAutoLootFishingTitle = "Angeln", + LMAutoLootFishingTooltip = "Wenn ausgewählt, wird Broker_Garbage automatisch plündern, wenn du gerade angelst.", + + LMAutoDestroyTitle = "Auto-Zerstören", + LMAutoDestroyTooltip = "Wenn ausgewählt, wird Broker_Garbage bei zu wenig Platz versuchen, welchen zu schaffen.", + + LMFreeSlotsTitle = "Min. freier Inventarplatz", + LMFreeSlotsTooltip = "Setze das Minimum an freien Taschenplätzen, bei dem Broker_Garbage automatisch Platz schaffen soll.", + + LMRestackTitle = "Automatisch stapeln", + LMRestackTooltip = "Wenn ausgewählt, wird Broker_Garbage automatisch die von dir beobachteten Gegenstände nach dem Plündern stapeln, um Platz zu schaffen.", + + LMFullRestackTitle = "Gesamtes Inventar", + LMFullRestackTooltip = "Wenn ausgewählt, wird Broker_Garbage dein gesamtes Inventar zum Restacken beobachten.", + + LMOpenContainersTitle = "Warne: Behälter", + LMOpenContainersTooltip = "Wenn ausgewählt, wird Broker_Garbage eine Warnung ausgeben, solltest du ungeöffnete Behälter bei dir haben.", + + LMOpenClamsTitle = "Warne: Muscheln", + LMOpenClamsTooltip = "Wenn ausgewählt, wird Broker_Garbage eine Warnung ausgeben, wenn du ungeöffnete Muscheln im Inventar hast. Da diese aber nun stapelbar sind, verlierst du durch deaktivieren dieser Option keinen Taschenplatz.", + + LMWarnLMTitle = "Warne: Plündermeister", + LMWarnLMTooltip = "Wenn ausgewählt, wird Broker_Garbage eine Meldung zeigen, die dich auffordert, die Beute zu verteilen.", + + LMItemMinValue = "Mindestwert zum Looten", +} + +end \ No newline at end of file diff --git a/enUS.lua b/enUS.lua new file mode 100644 index 0000000..a076769 --- /dev/null +++ b/enUS.lua @@ -0,0 +1,218 @@ +-- enUS / enGB / default localization file +_, BrokerGarbage = ... + + + +BrokerGarbage.locale = { + label = "Junk, be gone!", + + -- Chat Messages + sellAndRepair = "Sold trash for %1$s, repaired for %2$s. Change: %3$s.", + repair = "Repaired for %s.", + sell = "Sold trash for %s.", + + addedToSaveList = "%s has been added to the save list.", + addedToPriceList = "%s will only have its vendor price considered.", + addedToIncludeList = "%s has been added to the Include List.", + addedToSellList = "%s will be automatically sold when at a merchant.", + limitSet = "%s has been assigned a limit of %d.", + itemDeleted = "%s has been deleted.", + + openPlease = "Please open your %s. It's in your bags, stealing your space!", + openClams = "You own a %s. Maybe consider opening it.", + couldNotLootValue = "Did not loot %s because it's too cheap.", + couldNotLootLocked = "Could not loot %s because it is locked. Please loot manually.", + couldNotLootSpace = "Could not loot %s because your inventory is full.", + couldNotLootLM = "%s was not looted. You are the Loot Master so please distrivute the item manually.", + slashCommandHelp = "The following commands are available: |cffc0c0c0/garbage|r\n|cffc0c0c0 config|r opens the options panel.\n|cffc0c0c0format |cffc0c0ffformatstring|r lets you customize the LDB display text, |cffc0c0c0 format reset|r resets it.\n|cffc0c0c0stats|r returns some statistics.\n|cffc0c0c0limit |cffc0c0ffitemLink/ID count|r sets a limit for the given item on the current character.\n|cffc0c0c0globallimit |cffc0c0ffitemLink/ID count|r sets a limit for all characters.\n|cffc0c0c0value |cffc0c0ffvalueInCopper|r sets the minimum value for items to be looted.", + statistics = "Statistics:\nTotal earnings (all characters): %1$s\nTotal losses (all characters): %2$s", + minValueSet = "Items with a value less than %s will not be looted anymore.", + + -- Tooltip + headerRightClick = "Right-Click for options", + headerShiftClick = "SHIFT-Click: Destroy", + headerCtrlClick = "CTRL-Click: Keep", + moneyLost = "Money Lost:", + moneyEarned = "Money Earned:", + noItems = "No items to delete.", + increaseTreshold = "Increase quality treshold", + + autoSellTooltip = "Sell Items for %s", + reportNothingToSell = "Nothing to sell!", + + -- Statistics Frame + StatisticsHeading = "Statistics, everone needs them!\nTo delete any part of them, click the red x.", + + MemoryUsageText = "Please notice that especially after scanning your inventory the memory usage goes up a lot. It will automatically be reduced once the garbage collector kicks in.", + MemoryUsageTitle = "Memory Usage (kB)", + CollectMemoryUsageTooltip = "Click to start the garbage collection (Blizzard function).", + + GlobalStatisticsHeading = "Global Money statistics:", + AverageSellValueTitle = "Average sell value", + AverageDropValueTitle = "Average drop value", + + GlobalMoneyEarnedTitle = "Total amount earned", + ResetGlobalMoneyEarnedTooltip = "Click to reset your (global) money earned data.", + GlobalMoneyLostTitle = "Total amount lost", + ResetGlobalMoneyLostTooltip = "Click to reset your (global) money lost data.", + + GlobalItemsSoldTitle = "Items sold", + ResetGlobalItemsSoldTooltip = "Click to reset the number of items you sold so far.", + ItemsDroppedTitle = "Items dropped", + ResetGlobalItemsDroppedTooltip = "Click to reset the number of items you dropped so far.", + + LocalStatisticsHeading = "%s's statistics:", + StatisticsLocalAmountEarned = "Amount earned", + ResetLocalMoneyEarnedTooltip = "Click to reset your (local) money earned data.", + StatisticsLocalAmountLost = "Amount lost", + ResetLocalMoneyLostTooltip = "Click to reset your (local) money lost data.", + + ResetGlobalDataText = "Reset Global Statistics", + ResetGlobalDataTooltip = "Click here to reset alls global statistics.", + ResetLocalDataText = "Reset Local Statistics", + ResetLocalDataTooltip = "Click here to reset all local statistics.", + + -- Basic Options Frame + BasicOptionsTitle = "Basic Options", + BasicOptionsText = "Don't want to auto-sell/repair? \nHold Shift when adressing the merchant!", + autoSellTitle = "Auto Sell", + autoSellText = "Toggles whether to automatically sell your gray items when at a vendor.", + + showAutoSellIconTitle = "Show Icon", + showAutoSellIconText = "Toggles whether to show an icon to manually auto-sell when at a vendor.", + + showNothingToSellTitle = "'Nothing to sell'", + showNothingToSellText = "Toggles whether to show a notice when at a vendor and there is nothing to sell.", + + autoRepairTitle = "Auto Repair", + autoRepairText = "Toggles whether to automatically repair your gear when at a vendor.", + + autoRepairGuildTitle = "No Guild Repair", + autoRepairGuildText = "If selected, Broker_Garbage will never try to repair using the guild bank's money", + + showLostTitle = "Show Money Lost", + showLostText = "Toggles whether to show the tooltip line 'Money Lost'.", + + showSourceTitle = "Show Source", + showSourceText = "Toggles whether to show the last column in the tooltip, displaying the item value source.", + + showEarnedTitle = "Show Money Earned", + showEarnedText = "Toggles whether to show the tooltip line 'Money Earned'.", + + dropQualityTitle = "Drop Quality", + dropQualityText = "Select up to which treshold items may be listed as deletable. Default: Poor (0)", + + moneyFormatTitle = "Money Format", + moneyFormatText = "Change the way money (i.e. gold/silver/copper) is being displayed. Default: 2", + + maxItemsTitle = "Max. Items", + maxItemsText = "Set how many lines you would like to have displayed in the tooltip. Default: 9", + + maxHeightTitle = "Max. Height", + maxHeightText = "Set the height of the tooltip. Default: 220", + + enchanterTitle = "Enchanter", + enchanterTooltip = "Check this if you have/know an enchanter. When checked, Broker_Garbage will use disenchant values for disenchantable items, which are usually higher than vendor prices.", + + rescanInventory = "Rescan Inventory", + rescanInventoryText = "Click to manually rescan you inventory. Should generally not be needed.", + + emptyExcludeList = "Empty Exclude List", + emptyExcludeListText = "Click to clear your exclude list.", + + emptyIncludeList = "Empty Include List", + emptyIncludeListText = "Click to clear your include list.", + + LDBDisplayTextTitle = "LDB Display text:", + LDBDisplayTextHelpTooltip = "Format string help:\n%1$s - item link\n%2$s - item count\n%3$s - item value\n%4$d - free bag slots\n%5$d - total bag slots", + LDBDisplayTextResetTooltip = "Reset LDB string to default value.", + + -- List Options Panel + LOPTitle = "Positive Lists", + LOPSubTitle = "To add Items to lists, drag them over the corresponding '+' icon, to remove them select them and click the '-'. To add categories right-click on '+'.", + + -- Exclude List + LOPExcludeHeader = "Exclude List - these items will never be sold/deleted.", + LOPExcludePlusTT = "Add items to the Exclude List by dragging/placing them on me. Right click on me for categories!", + LOPExcludeMinusTT = "Select items you want to remove, then click here.", + LOPExcludePromoteTT = "Selected items will be written onto your global Exclude List, as seen by every character.", + LOPExcludeEmptyTT = "Click to fully empty your local Exclude List.\n|cffff0000Caution!", + + -- Force Vendor Price List + LOPForceHeader = "Vendor Price List - These items will only have their vendor price considered.", + LOPForcePlusTT = "Add items to the Exclude List by dragging/placing them on me. Right click on me for categories!", + LOPForceMinusTT = "Select items you want to remove, then click here.", + LOPForcePromoteTT = "The Vendor Price List is already global and effects every character.", + LOPForceEmptyTT = "Click to fully empty your Vendor Price List.\n|cffff0000Caution!", + + -- AutoSell Options Panel + LONTitle = "Negative Lists", + LONSubTitle = "Similar usage to Positive Lists. To set an item limit, use your mousewheel when over the item icon.", + + -- Include List + LONIncludeHeader = "Include List - items will be shown first and not be looted by the Loot Manager.", + LONIncludePlusTT = "Add items to the Exclude List by dragging/placing them on me. Right click on me for categories!", + LONIncludeMinusTT = "Select items you want to remove, then click here.", + LONIncludePromoteTT = "Selected items will be written onto your global Include List, as seen by every character.", + LONIncludeEmptyTT = "Click to fully empty your local Include List.\n|cffff0000Caution!", + + -- Auto Sell List + LONAutoSellHeader = "Sell List - These items will be sold automatically when at a vendor.", + LONAutoSellPlusTT = "Add items to the Exclude List by dragging/placing them on me. Right click on me for categories!", + LONAutoSellMinusTT = "Select items you want to remove, then click here.", + LONAutoSellPromoteTT = "Selected items will be written onto your global Sell List, as seen by every character.", + LONAutoSellEmptyTT = "Click to fully empty your local Sell List.\n|cffff0000Caution!", + + -- LibPeriodicTable texts + PTCategoryTooltipHeader = "Add Categories", + PTCategoryTooltipText = "Navigate through this menu and add any of these categories by clicking on them.", + + -- Loot Manager + CreatureTypeBeast = "Beast", + You = "You", -- as in "You receive ..." + + LMTitle = "Loot Manager", + LMSubTitle = "The Loot Manager takes control of your looting if you want it to do so.\nIf you usually autoloot, hold down SHIFT for a while when looting a corpse to disable it once.", + + LMEnableTitle = "Enable Loot Manager", + LMEnableTooltip = "Check to enable the Loot Manager.", + + LMSelectiveTitle = "Selective Looting", + LMSelectiveTooltip = "Check to let Broker_Garbage determine which items to loot.", + + LMAutoLootTitle = "Autoloot", + LMAutoLootTooltip = "If unchecked, Broker_Garbage will only loot on special occations.", + + LMAutoLootSkinningTitle = "Skinning", + LMAutoLootSkinningTooltip = "If checked, Broker_Garbage will loot if the creature is skinnable by you.", + + LMAutoLootPickpocketTitle = "Pickpocket", + LMAutoLootPickpocketTooltip = "If checked, Broker_Garbage will loot if you are a Rogue and stealthed.", + + LMAutoLootFishingTitle = "Fishing", + LMAutoLootFishingTooltip = "If checked, Broker_Garbage will loot if you are currently fishing.", + + LMAutoDestroyTitle = "Autodestroy", + LMAutoDestroyTooltip = "If checked, Broker_Garbage will take actions when your inventory space is (almost) full.", + + LMFreeSlotsTitle = "Minimum free slots", + LMFreeSlotsTooltip = "Set the minimum numer of free slots for autodestroy to take action.", + + LMRestackTitle = "Automatic restack", + LMRestackTooltip = "Check to automatically compress your watched inventory items after looting.", + + LMFullRestackTitle = "Full inventory", + LMFullRestackTooltip = "When checked will look at your whole inventory for restackable items, not just the watched items.", + + LMOpenContainersTitle = "Warn: Containers", + LMOpenContainersTooltip = "When checked, Broker_Garbage will warn you when you have unopened containers in you inventory.", + + LMOpenClamsTitle = "Warn: Clams", + LMOpenClamsTooltip = "When checked, Broker_Garbage will warn you when you have clams in you inventory. As these now do stack, you are not wasting any slots by unchecking this.", + + LMWarnLMTitle = "Warn: Loot Master", + LMWarnLMTooltip = "When checked, Broker_Garbage will print a notice reminding you to assign loot.", + + LMItemMinValue = "Minimum item value", +} + diff --git a/lootmanager.lua b/lootmanager.lua new file mode 100644 index 0000000..a821fe7 --- /dev/null +++ b/lootmanager.lua @@ -0,0 +1,494 @@ +-- This is BrokerGarbage's Loot Manager - inspired by KarniCrap +-- It allows you to manage auto looting and dropping of "too many" items +_, BrokerGarbage = ... + +-- register events +local function eventHandler(self, event, ...) + if not BG_GlobalDB.useLootManager then return end + + if event == "CHAT_MSG_LOOT" then + if BrokerGarbage.locale.You and strfind(arg1, BrokerGarbage.locale.You) and BG_GlobalDB.autoDestroy then + BrokerGarbage:AutoDestroy() + end + + elseif event == "LOOT_OPENED" then + local numSlots = 0 + -- restack (relevant) inventory + if BG_GlobalDB.restackIfNeeded then + local justStacked = {} + if BG_GlobalDB.restackFullInventory then + for container = 0, 4 do + numSlots = GetContainerNumSlots(container) + if numSlots then + for slot = 1, numSlots do + local itemID = GetContainerItemID(container,slot) + if itemID and not BrokerGarbage:Find(justStacked, itemID) then + BrokerGarbage:Restack(itemID) + table.insert(justStacked, itemID) + end + end + end + end + else + for i, itemTable in pairs(BrokerGarbage.inventory) do + if not BrokerGarbage:Find(justStacked, itemTable.itemID) then + BrokerGarbage:Restack(itemTable.itemID) + table.insert(justStacked, itemTable.itemID) + end + end + end + end + -- looting + if BG_LocalDB.selectiveLooting then + local autoloot = arg1 + if BrokerGarbage.currentRestackItems ~= nil then + BrokerGarbage.afterRestack = function() + BrokerGarbage:SelectiveLooting(autoloot) + end + else + BrokerGarbage:SelectiveLooting(autoloot) + end + end + + elseif event == "LOOT_CLOSED" then + if BG_LocalDB.selectiveLooting then + BrokerGarbage:CheckAndClearInv() + end + + if BG_GlobalDB.openContainers then + BrokerGarbage:OpenContainers() + end + + elseif event == "ITEM_UNLOCKED" then + -- keep restacking + if BrokerGarbage:RestackStep() then + -- wait for next update + BrokerGarbage:Debug("Still restacking...", BrokerGarbage.currentRestackItems) + else + -- we're done + frame:UnregisterEvent("ITEM_UNLOCKED") + BrokerGarbage.currentRestackItems = nil + BrokerGarbage:Debug("Unregistered ITEM_UNLOCKED") + + if BrokerGarbage.afterRestack ~= nil then + BrokerGarbage:afterRestack() + BrokerGarbage.afterRestack = nil + end + end + end +end + +local frame = CreateFrame("Frame") +frame:RegisterEvent("CHAT_MSG_LOOT") +frame:RegisterEvent("LOOT_OPENED") +frame:RegisterEvent("LOOT_CLOSED") +frame:SetScript("OnEvent", eventHandler) + +-- --------------------------------------------------------- +-- Helper functions +-- --------------------------------------------------------- +-- restacks items so when deleting you lose as few items as possible +function BrokerGarbage:Restack(itemID) + if BrokerGarbage.currentRestackItems then + tinsert(BrokerGarbage.currentRestackItems, itemID) + else + BrokerGarbage.currentRestackItems = { itemID } + if BrokerGarbage:RestackStep() then + -- wait for moved items + frame:RegisterEvent("ITEM_UNLOCKED") + else + -- nothing to restack + if BrokerGarbage.afterRestack ~= nil then + BrokerGarbage:afterRestack() + BrokerGarbage.afterRestack = nil + end + end + end +end + +local function NextRestackStep() + -- go to next item if there is one + tremove(BrokerGarbage.currentRestackItems, 1) + if #(BrokerGarbage.currentRestackItems) <= 0 then + BrokerGarbage.currentRestackItems = nil + return false + else + return BrokerGarbage:RestackStep() + end +end + +-- move 1 item for restacking +function BrokerGarbage:RestackStep() + if not BrokerGarbage.currentRestackItems then return false end + local itemID = BrokerGarbage.currentRestackItems[1] + if not itemID then return NextRestackStep() end + + local count = GetItemCount(itemID) + if not count or count <= 1 then return NextRestackStep() end + + local locations = BrokerGarbage:FindSlotToDelete(itemID, true) + local maxLoc = #locations + if maxLoc <= 1 then + return NextRestackStep() + end -- we're done, nothing to restack + + if GetContainerItemInfo(locations[1].bag, locations[1].slot) then + ClearCursor() + PickupContainerItem(locations[1].bag, locations[1].slot) + PickupContainerItem(locations[maxLoc].bag, locations[maxLoc].slot) + + BrokerGarbage:Debug("Restack from/to", locations[1].count, locations[maxLoc].count) + end + return true +end + +-- calls restack and deletes as many items as needed +function BrokerGarbage:DeletePartialStack(itemID, num) + local locations = BrokerGarbage:FindSlotToDelete(itemID) + local maxStack = select(8, GetItemInfo(itemID)) + + SplitContainerItem(locations[1].bag, locations[1].slot, num) + if CursorHasItem() then + BrokerGarbage:Debug("DeletePartialStack", select(2,GetItemInfo(itemID)), num, locations[1].bag, locations[1].slot) + DeleteCursorItem() + end +end + +-- checks the inventory for items that can and should be dropped/restacked +function BrokerGarbage:CheckAndClearInv() + local numSlots + -- restack + local justStacked = {} + if BG_GlobalDB.restackIfNeeded and BG_GlobalDB.restackFullInventory then + for container = 0, 4 do + numSlots = GetContainerNumSlots(container) + if numSlots then + for slot = 1, numSlots do + local itemID = GetContainerItemID(container,slot) + if itemID and not BrokerGarbage:Find(justStacked, itemID) then + BrokerGarbage:Restack(itemID) + table.insert(justStacked, itemID) + end + end + end + end + elseif BG_GlobalDB.restackIfNeeded then + for i, itemTable in pairs(BrokerGarbage.inventory) do + if not BrokerGarbage:Find(justStacked, itemTable.itemID) then + BrokerGarbage:Restack(itemTable.itemID) + table.insert(justStacked, itemTable.itemID) + end + end + end + + -- drop until conditions are met + --while BrokerGarbage.totalFreeSlots <= BG_GlobalDB.tooFewSlots do + -- BrokerGarbage:Delete(BrokerGarbage:GetCheapest()) -- automatically takes included items + -- BrokerGarbage:ScanInventory() + --end +end + +-- drops Include List (Blacklist) items +function BrokerGarbage:AntiCrap() + local numSlots, itemID + for bag = 0, 4 do + numSlots = GetContainerNumSlots(container) + if numSlots then + for slot = 1, numSlots do + itemID = GetContainerItemID(container,slot) + if not IsInteresting(select(2,GetItemInfo(itemID))) then + BrokerGarbage:Delete(select(2,GetItemInfo(itemID)), bag, slot) + end + end + end + end +end + +-- warns of container - clams and/or containers +function BrokerGarbage:OpenContainers() + --[[if BrokerGarbage.totalFreeSlots < 2 then + BrokerGarbage:Print("Too few slots to securely loot containers! Please make some room.") + return + end]]-- + + -- only containers + if BG_GlobalDB.openContainers then + local itemLink + + for i, itemTable in pairs(BrokerGarbage.unopened) do + if not itemTable.clam then + itemLink = select(2,GetItemInfo(itemTable.itemID)) + BrokerGarbage:Print(format(BrokerGarbage.locale.openPlease, itemLink)) + -- UseContainerItem(itemTable.container, itemTable.slot) + tremove(BrokerGarbage.unopened, i) + end + end + end + + -- only clams + if BG_GlobalDB.openClams then + -- opening clams + local auctionType = select(6,GetAuctionItemClasses()) + local auctionSubType = GetAuctionItemSubClasses(6) + local itemLink + + for i, itemTable in pairs(BrokerGarbage.unopened) do + if itemTable.clam then + -- UseContainerItem(itemTable.bag, itemTable.slot) + itemLink = select(2,GetItemInfo(itemTable.itemID)) + BrokerGarbage:Print(format(BrokerGarbage.locale.openClams, itemLink)) + tremove(BrokerGarbage.unopened, i) + end + end + end +end + +--[[ returns number of free inventory slots // currently unused +function BrokerGarbage:GetNumSlots() + local total = 0 + local free = 0 + local numSlots = 0 + local freeSlots = 0 + + for container = 0, 4 do + freeSlots = select(1,GetContainerFreeSlots(container)) or {} + free = free + #freeSlots + numSlots = GetContainerNumSlots(container) + if numSlots then + total = total + numSlots + end + end + return total, free +end ]]-- + +-- returns true if the requested mob is skinnable with our skill +function BrokerGarbage:CanSkin(mobLevel) + local isSkinner = IsUsableSpell(select(1,GetSpellInfo(8613))) and BrokerGarbage:GetTradeSkill(select(1,GetSpellInfo(8613))) + if not isSkinner then return false end + local maxLevel + if isSkinner < 100 then + maxLevel = floor(isSkinner/10) + 10 + else + maxLevel = floor(isSkinner/5) + end + + return maxLevel >= mobLevel +end + +-- determines if an item should be lootet +function BrokerGarbage:IsInteresting(itemLink) + local itemID = BrokerGarbage:GetItemID(itemLink) + local alwaysLoot = false + + -- items we don't want + local negativeList = BrokerGarbage:JoinTables(BG_GlobalDB.include, BG_LocalDB.include) + if negativeList[itemID] then + return false, false + else + -- check if the item belongs to a category + local inCategory + for setName,_ in pairs(negativeList) do + if type(setName) == "string" then + _, inCategory = BrokerGarbage.PT:ItemInSet(itemID, setName) + end + if inCategory then + return false, false + end + end + end + + -- items we always want + local positiveList = BrokerGarbage:JoinTables(BG_GlobalDB.exclude, BG_LocalDB.exclude) + if positiveList[itemID] then + alwaysLoot = true + else + -- check if the item belongs to a category + local inCategory + for setName,_ in pairs(positiveList) do + if type(setName) == "string" then + _, inCategory = BrokerGarbage.PT:ItemInSet(itemID, setName) + end + if inCategory then + alwaysLoot = true + end + end + end + + -- items we don't care about + return true, alwaysLoot + + --local sellList = BrokerGarbage:JoinTables(BG_GlobalDB.forceVendorPrice, BG_GlobalDB.autoSellList, BG_LocalDB.autoSellList) +end + +-- hook UpdateButton function for non-autoloot +local LootFrame_UpdateButton_orig = LootFrame_UpdateButton +function LootFrame_UpdateButton(index) + LootFrame_UpdateButton_orig(index) + if not BG_GlobalDB.useLootManager then return end + + local slot = (LOOTFRAME_NUMBUTTONS * (LootFrame.page - 1)) + index + _, itemName, quantity, quality, locked = GetLootSlotInfo(slot) + itemLink = GetLootSlotLink(slot) + if not itemLink then return end + if BrokerGarbage:IsInteresting(itemLink) then + _G["LootButton"..index.."IconTexture"]:SetDesaturated(false) + _G["LootButton"..index.."IconTexture"]:SetAlpha(1) + else + _G["LootButton"..index.."IconTexture"]:SetDesaturated(true) + _G["LootButton"..index.."IconTexture"]:SetAlpha(0.5) + end +end + +-- --------------------------------------------------------- +-- lootmanager functionality from here +-- --------------------------------------------------------- +-- for use in CHAT_MSG_LOOT event - destroys watched items as needed +function BrokerGarbage:AutoDestroy() + local count = GetItemCount(itemID) + if not count or count == 1 then return end + local location = {} + + for itemID,maxCount in pairs(BrokerGarbage:JoinTables(BG_LocalDB.include, BG_GlobalDB.include)) do + count = 0 + if type(itemID) == "number" and type(maxCount) == "number" then + -- delete excess items + location = BrokerGarbage:FindSlotToDelete(itemID) + for i = #location, 1, -1 do + if count >= maxCount then + BrokerGarbage:Delete(GetItemInfo(itemID), location[i].bag, location[i].slot) + else + count = count + location[i].count + end + end + end + end +end + +-- for use in LOOT_OPENED event +function BrokerGarbage:SelectiveLooting(autoloot) + if IsShiftKeyDown() then return end + local numItems = GetNumLootItems() + local texture, quantity, quality, locked, itemLink + local manage, loot, close = false, false, true + + local mobLevel = UnitExists("target") and UnitIsDead("target") and UnitLevel("target") + local mobType = UnitCreatureType("target") == BrokerGarbage.locale.CreatureTypeBeast + local autoLoot = autoloot ~= 0 or BG_GlobalDB.autoLoot + + if autoLoot + or (BG_GlobalDB.autoLootPickpocket and BrokerGarbage.playerClass == "ROGUE" and IsStealthed()) + or (BG_GlobalDB.autoLootFishing and IsFishingLoot()) + or (BG_GlobalDB.autoLootSkinning and mobType and CanSkin(mobLevel)) then + + BrokerGarbage:Debug("Clearing mob") + manage = true + + for slot = 1,numItems do + loot = false + if LootSlotIsCoin(slot) then + -- take money + loot = true + else + -- check items + _, _, quantity, quality, locked = GetLootSlotInfo(slot) + itemLink = GetLootSlotLink(slot) + local value = BrokerGarbage:GetItemValue(itemLink, quantity) + local isInteresting, alwaysLoot = BrokerGarbage:IsInteresting(itemLink) + + if isInteresting + and (not value or value >= BG_LocalDB.itemMinValue) then + + if BrokerGarbage.totalFreeSlots <= BG_GlobalDB.tooFewSlots then + -- try to compress and make room + BrokerGarbage:Debug("We're out of space!") + + local itemID = BrokerGarbage:GetItemID(itemLink) + local maxStack = select(8, GetItemInfo(itemID)) + local inBags = mod(GetItemCount(itemID), maxStack) + local compareTo = BrokerGarbage:GetCheapest() + + local prepareSkinning = (autoLoot or BG_GlobalDB.autoLootSkinning) and mobType and BrokerGarbage:CanSkin(mobLevel) + + if inBags > 0 and maxStack >= (inBags + quantity) then + -- this item fits without us doing anything + BrokerGarbage:Debug("Item stacks.", itemLink) + loot = true + + elseif BG_GlobalDB.autoDestroy and not alwaysLoot and inBags > 0 + and (inBags < maxStack or prepareSkinning) and inBags + quantity > maxStack then + + -- we can fit x more in ... *squeeze* + BrokerGarbage:Debug("Item can be made to fit.", itemLink) + + local amount = quantity + inBags - maxStack + if not compareTo[1] + or (BrokerGarbage:GetItemValue(itemLink, quantity) or 0) < compareTo[1].value then + + BrokerGarbage:DeletePartialStack(itemID, amount) + loot = true + end + + elseif BG_GlobalDB.autoDestroy and compareTo[1] then + -- delete cheaper item + BrokerGarbage:Debug("Check for items to throw away for", itemLink) + + if (BrokerGarbage:GetItemValue(itemLink, quantity) or 0) > compareTo[1].value + or select(6,GetItemInfo(itemLink)) == select(12, GetAuctionItemClasses()) then + + -- this item is worth more or it is a quest item + BrokerGarbage:Debug("Delete item to make room.", itemLink) + + BrokerGarbage:Delete(select(2,GetItemInfo(compareTo[1].itemID)), + compareTo[1].bag, compareTo[1].slot) + loot = true + + elseif prepareSkinning and compareTo[1] then + -- we are skinning + BrokerGarbage:Debug("Looting for skinning", itemLink) + + BrokerGarbage:Delete(select(2,GetItemInfo(compareTo[1].itemID)), + compareTo[1].bag, compareTo[1].slot) + loot = true + end + end + else + -- enough bag space + loot = true + end + end + end + + -- take loot if we can + if locked and quality < GetLootThreshold() then + BrokerGarbage:Print(format(BrokerGarbage.locale.couldNotLootLocked, itemLink)) + elseif not loot and not BG_GlobalDB.autoDestroy then + BrokerGarbage:Print(format(BrokerGarbage.locale.couldNotLootSpace, itemLink)) + elseif not loot then + BrokerGarbage:Print(format(BrokerGarbage.locale.couldNotLootValue, itemLink)) + else + -- check if we are allowed to loot this + if not LootSlotIsCoin(slot) and (GetNumPartyMembers() > 0 or GetNumRaidMembers() > 1) + and GetLootMethod() ~= "freeforall" and GetLootThreshold() <= quality then + + -- ignore item as it is still being rolled for / loot master's job + if GetNumRaidMembers() > 1 and select(3,GetLootMethod()) + and UnitIsUnit("raid"..select(3,GetLootMethod()), "player") then + + if BG_GlobalDB.warnLM then + BrokerGarbage:Print(format(BrokerGarbage.locale.couldNotLootLM, itemLink)) + end + close = false + end + else + -- loot normally + LootSlot(slot) + end + end + end + end + + if manage and (close or GetNumLootItems() == 0) then + CloseLoot() + end +end +BrokerGarbage.lootManager = true \ No newline at end of file diff --git a/lootmanager_options.lua b/lootmanager_options.lua new file mode 100644 index 0000000..9f042af --- /dev/null +++ b/lootmanager_options.lua @@ -0,0 +1,251 @@ +_, BrokerGarbage = ... + +BrokerGarbage:CheckSettings() + +local function Update(self) + BrokerGarbage:lootManagerOptionsUpdate(self) +end + +local function ShowOptions(frame) + local title = LibStub("tekKonfig-Heading").new(BrokerGarbage.lootManagerOptions, "Broker_Garbage - " .. BrokerGarbage.locale.LMTitle) + + local subtitle = BrokerGarbage.lootManagerOptions:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") + subtitle:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8) + subtitle:SetPoint("RIGHT", BrokerGarbage.lootManagerOptions, -32, 0) + subtitle:SetHeight(45) + subtitle:SetNonSpaceWrap(true) + subtitle:SetJustifyH("LEFT") + subtitle:SetJustifyV("TOP") + subtitle:SetText(BrokerGarbage.locale.LMSubTitle) + + local enable = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMEnableTitle, "TOPLEFT", subtitle, "BOTTOMLEFT", -2, -4) + enable.tiptext = BrokerGarbage.locale.LMEnableTooltip + enable:SetChecked(BG_GlobalDB.useLootManager) + local checksound = enable:GetScript("OnClick") + enable:SetScript("OnClick", function(enable) + checksound(enable) + BG_GlobalDB.useLootManager = not BG_GlobalDB.useLootManager + Update() + end) + + -- -- Selective Looting ------------------------------------------------------- + local selective = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMSelectiveTitle, "TOPLEFT", enable, "BOTTOMLEFT", 14, -20) + selective.tiptext = BrokerGarbage.locale.LMSelectiveTooltip + selective:SetChecked(BG_LocalDB.selectiveLooting) + selective:SetScript("OnClick", function(selective) + checksound(selective) + BG_LocalDB.selectiveLooting = not BG_LocalDB.selectiveLooting + Update() + end) + + + local autoLoot = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMAutoLootTitle, "TOPLEFT", selective, "BOTTOMLEFT", 14, 0) + autoLoot.tiptext = BrokerGarbage.locale.LMAutoLootTooltip + autoLoot:SetChecked(BG_GlobalDB.autoLoot) + autoLoot:SetScript("OnClick", function(autoLoot) + checksound(autoLoot) + BG_GlobalDB.autoLoot = not BG_GlobalDB.autoLoot + Update() + end) + + local autoLoot_skinning = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMAutoLootSkinningTitle, "TOPLEFT", autoLoot, "BOTTOMLEFT", 14, 0) + autoLoot_skinning.tiptext = BrokerGarbage.locale.LMAutoLootSkinningTooltip + autoLoot_skinning:SetChecked(BG_GlobalDB.autoLootSkinning) + autoLoot_skinning:SetScript("OnClick", function(autoLoot_skinning) + checksound(autoLoot_skinning) + BG_GlobalDB.autoLootSkinning = not BG_GlobalDB.autoLootSkinning + end) + + local autoLoot_pickpocket = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMAutoLootPickpocketTitle, "TOPLEFT", autoLoot_skinning, "BOTTOMLEFT", 0, 0) + autoLoot_pickpocket.tiptext = BrokerGarbage.locale.LMAutoLootPickpocketTooltip + autoLoot_pickpocket:SetChecked(BG_GlobalDB.autoLootPickpocket) + autoLoot_pickpocket:SetScript("OnClick", function(autoLoot_pickpocket) + checksound(autoLoot_pickpocket) + BG_GlobalDB.autoLootPickpocket = not BG_GlobalDB.autoLootPickpocket + end) + + local autoLoot_fishing = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMAutoLootFishingTitle, "TOPLEFT", autoLoot_pickpocket, "BOTTOMLEFT", 0, 0) + autoLoot_fishing.tiptext = BrokerGarbage.locale.LMAutoLootFishingTooltip + autoLoot_fishing:SetChecked(BG_GlobalDB.autoLootPickpocket) + autoLoot_fishing:SetScript("OnClick", function(autoLoot_fishing) + checksound(autoLoot_fishing) + BG_GlobalDB.autoLootFishing = not BG_GlobalDB.autoLootFishing + end) + + + local autoDestroy = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMAutoDestroyTitle, "TOPLEFT", autoLoot_fishing, "BOTTOMLEFT", -14, 0) + autoDestroy.tiptext = BrokerGarbage.locale.LMAutoDestroyTooltip + autoDestroy:SetChecked(BG_GlobalDB.autoDestroy) + autoDestroy:SetScript("OnClick", function(autoDestroy) + checksound(autoDestroy) + BG_GlobalDB.autoDestroy = not BG_GlobalDB.autoDestroy + Update() + end) + + local minFreeSlots = LibStub("tekKonfig-Slider").new(BrokerGarbage.lootManagerOptions, BrokerGarbage.locale.LMFreeSlotsTitle, 0, 30, "TOPLEFT", autoDestroy, "BOTTOMLEFT", 0, -20) + minFreeSlots.tiptext = BrokerGarbage.locale.LMFreeSlotsTooltip + minFreeSlots:SetWidth(200) + minFreeSlots:SetValueStep(1) + minFreeSlots:SetValue(BG_GlobalDB.tooFewSlots) + minFreeSlots.text = minFreeSlots:CreateFontString("$parentCenterText", "ARTWORK", "GameFontHighlightSmall") + minFreeSlots.text:SetPoint("TOP", minFreeSlots, "BOTTOM", 0, 3) + minFreeSlots.text:SetText(BG_GlobalDB.tooFewSlots) + minFreeSlots:SetScript("OnValueChanged", function(minFreeSlots) + BG_GlobalDB.tooFewSlots = minFreeSlots:GetValue() + minFreeSlots.text:SetText(BG_GlobalDB.tooFewSlots) + BrokerGarbage:ScanInventory() + end) + + + -- -- Restack ----------------------------------------------------------------- + local restack = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMRestackTitle, "TOPLEFT", selective, "TOPLEFT", 200, 0) + restack.tiptext = BrokerGarbage.locale.LMRestackTooltip + restack:SetChecked(BG_GlobalDB.restackIfNeeded) + restack:SetScript("OnClick", function(restack) + checksound(restack) + BG_GlobalDB.restackIfNeeded = not BG_GlobalDB.restackIfNeeded + Update() + end) + + local fullRestack = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMFullRestackTitle, "TOPLEFT", restack, "BOTTOMLEFT", 14, 0) + fullRestack.tiptext = BrokerGarbage.locale.LMFullRestackTooltip + fullRestack:SetChecked(BG_GlobalDB.restackFullInventory) + fullRestack:SetScript("OnClick", function(fullRestack) + checksound(fullRestack) + BG_GlobalDB.restackFullInventory = not BG_GlobalDB.restackFullInventory + end) + + -- -- Opening Items ----------------------------------------------------------- + local openContainers = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMOpenContainersTitle, "TOPLEFT", fullRestack, "BOTTOMLEFT", -14, 0) + openContainers.tiptext = BrokerGarbage.locale.LMOpenContainersTooltip + openContainers:SetChecked(BG_GlobalDB.openContainers) + openContainers:SetScript("OnClick", function(openContainers) + checksound(openContainers) + BG_GlobalDB.openContainers = not BG_GlobalDB.openContainers + end) + + local openClams = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMOpenClamsTitle, "TOPLEFT", openContainers, "BOTTOMLEFT", 0, 0) + openClams.tiptext = BrokerGarbage.locale.LMOpenClamsTooltip + openClams:SetChecked(BG_GlobalDB.openClams) + openClams:SetScript("OnClick", function(openClams) + checksound(openClams) + BG_GlobalDB.openClams = not BG_GlobalDB.openClams + end) + + local warnLM = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.lootManagerOptions, nil, BrokerGarbage.locale.LMWarnLMTitle, "TOPLEFT", openClams, "BOTTOMLEFT", 0, 0) + warnLM.tiptext = BrokerGarbage.locale.LMWarnLMTooltip + warnLM:SetChecked(BG_GlobalDB.warnLM) + warnLM:SetScript("OnClick", function(warnLM) + checksound(warnLM) + BG_GlobalDB.warnLM = not BG_GlobalDB.warnLM + end) + + -- -- Loot Treshold ----------------------------------------------------------- + local editbox = CreateFrame("EditBox", nil, BrokerGarbage.lootManagerOptions) + editbox:SetAutoFocus(false) + editbox:SetWidth(100); editbox:SetHeight(32) + editbox:SetFontObject("GameFontHighlightSmall") + editbox:SetText(BrokerGarbage:FormatMoney(BG_LocalDB.itemMinValue)) + local left = editbox:CreateTexture(nil, "BACKGROUND") + left:SetWidth(8) left:SetHeight(20) + left:SetPoint("LEFT", -5, 0) + left:SetTexture("Interface\\Common\\Common-Input-Border") + left:SetTexCoord(0, 0.0625, 0, 0.625) + local right = editbox:CreateTexture(nil, "BACKGROUND") + right:SetWidth(8) right:SetHeight(20) + right:SetPoint("RIGHT", 0, 0) + right:SetTexture("Interface\\Common\\Common-Input-Border") + right:SetTexCoord(0.9375, 1, 0, 0.625) + local center = editbox:CreateTexture(nil, "BACKGROUND") + center:SetHeight(20) + center:SetPoint("RIGHT", right, "LEFT", 0, 0) + center:SetPoint("LEFT", left, "RIGHT", 0, 0) + center:SetTexture("Interface\\Common\\Common-Input-Border") + center:SetTexCoord(0.0625, 0.9375, 0, 0.625) + + local minvalue = editbox:CreateFontString(nil, "ARTWORK", "GameFontHighlight") + minvalue:SetPoint("TOPLEFT", warnLM, "BOTTOMLEFT", 0, -20) + minvalue:SetText(BrokerGarbage.locale.LMItemMinValue) + editbox:SetPoint("TOP", minvalue, "BOTTOM", 0, 0) + local function ResetEditBox(self) + self:SetText(BrokerGarbage:FormatMoney(BG_LocalDB.itemMinValue)) + self:ClearFocus() + end + local function UnFormatEditBox(self) + self:SetText(BG_LocalDB.itemMinValue) + end + local function SubmitEditBox() + BG_LocalDB.itemMinValue = tonumber(editbox:GetText()) + editbox:SetText(BrokerGarbage:FormatMoney(BG_LocalDB.itemMinValue)) + editbox:ClearFocus() + end + editbox:SetScript("OnEscapePressed", ResetEditBox) + editbox:SetScript("OnEnterPressed", SubmitEditBox) + editbox:SetScript("OnEditFocusGained", UnFormatEditBox) + + + function BrokerGarbage.lootManagerOptionsUpdate(self) + if BG_GlobalDB.useLootManager then + restack:Enable() + if BG_GlobalDB.restackIfNeeded then + fullRestack:Enable() + else + fullRestack:Disable() + end + + openContainers:Enable() + openClams:Enable() + warnLM:Enable() + + selective:Enable() + if BG_LocalDB.selectiveLooting then + autoLoot:Enable() + autoDestroy:Enable() + + if not BG_GlobalDB.autoLoot then + autoLoot_skinning:Enable() + autoLoot_pickpocket:Enable() + autoLoot_fishing:Enable() + else + autoLoot_skinning:Disable() + autoLoot_pickpocket:Disable() + autoLoot_fishing:Disable() + end + + if BG_GlobalDB.autoDestroy then + minFreeSlots:Enable() + else + minFreeSlots:Disable() + end + else + autoLoot:Disable() + autoDestroy:Disable() + autoLoot_skinning:Disable() + autoLoot_pickpocket:Disable() + autoLoot_fishing:Disable() + minFreeSlots:Disable() + end + + else + restack:Disable() + fullRestack:Disable() + + openContainers:Disable() + openClams:Disable() + warnLM:Disable() + + selective:Disable() + autoLoot:Disable() + autoLoot_skinning:Disable() + autoLoot_pickpocket:Disable() + autoLoot_fishing:Disable() + autoDestroy:Disable() + minFreeSlots:Disable() + end + end + + BrokerGarbage:lootManagerOptionsUpdate() + BrokerGarbage.lootManagerOptions:SetScript("OnShow", BrokerGarbage.lootManagerOptionsUpdate) +end + +BrokerGarbage.lootManagerOptions:SetScript("OnShow", ShowOptions) \ No newline at end of file