-- General --------------------------------------------------------------------------------------------------------------------------------------
general={
type="group",
name=L["General"],
order=newOrder(),
childGroups="tree",
args={
community={
type="group",
name=L["Community"],
order=newOrder(),
inline=true,
args={
github={
type="execute",
name=L["Contribute on GitHub"],
desc=L["You can follow the development process or contribute to the project on our public GitHub repository. What could be more fun than browsing a gigantic backlog of unresolved issues?"],
desc=L["You can ask questions, follow the latest Rarity news and share the excitement of finally getting that one elusive drop with your fellow collectors in our Discord server.\n\nPS: We have cookies."],
desc=L["Turns on a minimap icon for Rarity. Use this option if you don't have an LDB display add-on."],
get=function()
returnnotself.db.profile.minimap.hide
end,
set=function(info,val)
self.db.profile.minimap.hide=notval
ifvalthen
LibStub("LibDBIcon-1.0"):Show("Rarity")
else
LibStub("LibDBIcon-1.0"):Hide("Rarity")
end
self:Update("OPTIONS")
end,
},-- minimap
holidayReminder={
type="toggle",
order=newOrder(),
name=L["Holiday reminders"],
desc=L["When on, Rarity will remind you to go farm holiday items you're missing if the holiday is active and the item is set as Undefeated. (This only works for items that originate from holiday dungeons or daily quests.) The reminder occurs each time you log in or reload your UI, and stops for the day once you defeat the holiday dungeon or complete the quest."],
get=function()
returnself.db.profile.holidayReminder
end,
set=function(info,val)
self.db.profile.holidayReminder=val
Rarity.GUI:UpdateText()
end,
},
takeScreenshot={
type="toggle",
order=newOrder(),
name=L["Take screenshots"],
desc=L["When on, Rarity will take a screenshot when an item is found."],
get=function()
returnself.db.profile.takeScreenshot
end,
set=function(info,val)
self.db.profile.takeScreenshot=val
Rarity.GUI:UpdateText()
end,
},
feedText={
type="select",
name=L["Feed text"],
desc=L["Controls what type of text is shown in Rarity's LDB feed. Minimal shows just the number of attempts. Normal adds the likelihood percent, and verbose adds the item link."],
values={
[FEED_MINIMAL]=L["Minimal"],
[FEED_NORMAL]=L["Normal"],
[FEED_VERBOSE]=L["Verbose"],
},
get=function()
returnself.db.profile.feedText
end,
set=function(info,val)
self.db.profile.feedText=val
self:Update("OPTIONS")
end,
order=newOrder(),
},-- feedText
showAchievementToast={
type="toggle",
order=newOrder(),
name=L["Show achievement"],
desc=L["When on, Rarity will generate an achievement alert pop-up indicating that you obtained an item."],
get=function()
returnself.db.profile.showAchievementToast
end,
set=function(info,val)
self.db.profile.showAchievementToast=val
Rarity.GUI:UpdateText()
end,
},
debug={
type="toggle",
order=newOrder(),
name=L["Debug mode"],
get=function()
returnself.db.profile.debugMode
end,
set=function(info,val)
self.db.profile.debugMode=val
ifself.db.profile.debugModethen
self:Print(L["Debug mode ON"])
else
self:Print(L["Debug mode OFF"])
end
end,
},-- debug
enableProfiling={
type="toggle",
order=newOrder(),
name=L["Enable profiling"],
desc=L["When enabled, Rarity will print debug profiling messages to the chat window when certain things happen. This is used to determine which parts of the code are slow."],
get=function()
returnself.db.profile.enableProfiling
end,
set=function(info,val)
self.db.profile.enableProfiling=val
ifself.db.profile.enableProfilingthen
self:Print(L["Profiling ON"])
else
self:Print(L["Profiling OFF"])
end
end,
},-- enableProfiling
tooltipActivation={
type="select",
name=L["Tooltip activation"],
desc=L['If "On click" is selected, activating the tracker is done via CTRL + SHIFT + Click, otherwise it\'s activated with a simple click.'],
desc=L["When on, Rarity will show an icon next to each item in the tooltip indicating which expansion the item belongs to."],
get=function()
returnself.db.profile.showCategoryIcons
end,
set=function(info,val)
self.db.profile.showCategoryIcons=val
Rarity.GUI:UpdateText()
end,
},
hideHighChance={
type="toggle",
order=newOrder(),
name=L["Hide high chance items"],
desc=L["When on, this option hides any item with a drop chance of 1 in 49 or better. The item is merely hidden from the tooltip in order to keep it clean. Items hidden in this fashion are still tracked like normal."],
get=function()
returnself.db.profile.hideHighChance
end,
set=function(info,val)
self.db.profile.hideHighChance=val
Rarity.GUI:UpdateText()
end,
},
hideUnavailable={
type="toggle",
order=newOrder(),
name=L["Hide unavailable items"],
desc=L["When on, items marked as Unavailable will be hidden from the tooltip. This way, items requiring a certain holiday will automatically be hidden when the holiday is not active."],
get=function()
returnself.db.profile.hideUnavailable
end,
set=function(info,val)
self.db.profile.hideUnavailable=val
Rarity.GUI:UpdateText()
end,
},
hideDefeated={
type="toggle",
order=newOrder(),
name=L["Hide defeated items"],
desc=L["When on, items marked as Defeated will be hidden from the tooltip."],
get=function()
returnself.db.profile.hideDefeated
end,
set=function(info,val)
self.db.profile.hideDefeated=val
Rarity.GUI:UpdateText()
end,
},
onlyShowItemsWithAttempts={
type="toggle",
order=newOrder(),
name=L["Hide items with no attempts"],
desc=L["When on, items that have no attempts yet will be hidden from the tooltip."],
get=function()
returnself.db.profile.onlyShowItemsWithAttempts
end,
set=function(info,val)
self.db.profile.onlyShowItemsWithAttempts=val
Rarity.GUI:UpdateText()
end,
},
hideOutsideZone={
type="toggle",
order=newOrder(),
name=L["Hide items not in your zone"],
desc=L["When on, only items that can be obtained in your current zone will be shown in the tooltip. When this is on and you're in an instance, the instance difficulty is also checked to make sure it matches what the item supports."],
get=function()
returnself.db.profile.hideOutsideZone
end,
set=function(info,val)
self.db.profile.hideOutsideZone=val
Rarity.GUI:UpdateText()
end,
},
showTimeColumn={
type="toggle",
order=newOrder(),
name=L["Show Time column"],
desc=L["When on, the Time column will be shown in the main tooltip."],
get=function()
returnself.db.profile.showTimeColumn
end,
set=function(info,val)
self.db.profile.showTimeColumn=val
Rarity.GUI:UpdateText()
end,
},
showLuckinessColumn={
type="toggle",
order=newOrder(),
name=L["Show Luckiness column"],
desc=L["When on, the Luckiness column will be shown in the main tooltip."],
get=function()
returnself.db.profile.showLuckinessColumn
end,
set=function(info,val)
self.db.profile.showLuckinessColumn=val
Rarity.GUI:UpdateText()
end,
},
showZoneColumn={
type="toggle",
order=newOrder(),
name=L["Show Zone column"],
desc=L["When on, the Zone column will be shown in the main tooltip."],
get=function()
returnself.db.profile.showZoneColumn
end,
set=function(info,val)
self.db.profile.showZoneColumn=val
Rarity.GUI:UpdateText()
end,
},
showTSMColumn={
type="toggle",
order=newOrder(),
name=L["Show TSM column"],
desc=L["When on, the TSM Market Price will be shown in the main tooltip."],
desc=L["Adjusts the scale of the primary tooltip. This will take effect the next time the tooltip is shown."],
min=0.1,
max=5,
step=0.05,
get=function()
returnself.db.profile.tooltipScaleor1
end,
set=function(_,val)
self.db.profile.tooltipScale=val
end,
},
tooltipHideDelay={
order=newOrder(),
type="range",
width="double",
name=L["Primary tooltip hide delay"],
desc=L["When you move your mouse out of the Rarity tooltip, it will take this long before it automatically hides itself."],
min=0,
max=5,
step=0.1,
get=function()
returnself.db.profile.tooltipHideDelayor0.6
end,
set=function(_,val)
self.db.profile.tooltipHideDelay=val
end,
},
statusTip={
type="select",
name=L["Secondary tooltip display"],
desc=L["Controls on which side the secondary tooltip appears when you hover over an item in the main tooltip. If the main tooltip is on the right side of your screen, change this to Left. Otherwise, choose Right. You can also hide the status tooltip completely."],
values={
[TIP_LEFT]=L["Left"],
[TIP_RIGHT]=L["Right"],
[TIP_HIDDEN]=L["Hidden"],
},
get=function()
returnself.db.profile.statusTiporTIP_RIGHT
end,
set=function(info,val)
self.db.profile.statusTip=val
self:Update("OPTIONS")
end,
order=newOrder(),
},-- statusTip
tooltipShowDelay={
order=newOrder(),
type="range",
width="double",
name=L["Primary tooltip show delay"],
desc=L["When you move your mouse over the Rarity minimap icon, it will take this long before the GUI opens."],
min=0,
max=5,
step=0.1,
get=function()
returnself.db.profile.tooltipShowDelayor0.1
end,
set=function(_,val)
self.db.profile.tooltipShowDelay=val
end,
},
},-- args
},-- rarityTooltip
worldTooltips={
type="group",
name=L["World Tooltip Options"],
order=newOrder(),
inline=true,
args={
enableTooltipAdditions={
type="toggle",
order=newOrder(),
width="double",
name=L["Enable tooltip additions"],
desc=L["When enabled, Rarity will add obtainable items to game tooltips whenever possible."],
get=function()
returnself.db.profile.enableTooltipAdditions
end,
set=function(info,val)
self.db.profile.enableTooltipAdditions=val
Rarity.GUI:UpdateText()
end,
},
blankLineAfterRarity={
type="toggle",
order=newOrder(),
width="double",
name=L['Put "Rarity:" on a separate line'],
desc=L['When on, the text "Rarity:" will be put on its own line in world and item tooltips.'],
get=function()
returnself.db.profile.blankLineAfterRarity
end,
set=function(info,val)
self.db.profile.blankLineAfterRarity=val
Rarity.GUI:UpdateText()
end,
},
blankLineBeforeTooltipAdditions={
type="toggle",
order=newOrder(),
width="double",
name=L["Blank line before tooltip additions"],
desc=L["This causes Rarity to put a blank line above its tooltip additions."],
desc=L["When enabled, Rarity tooltips will include how many attempts you've made."],
get=function()
returnself.db.profile.tooltipAttempts
end,
set=function(info,val)
self.db.profile.tooltipAttempts=val
Rarity.GUI:UpdateText()
end,
},
hideKnownItemsInTooltip={
type="toggle",
order=newOrder(),
width="double",
name=L["Hide obtained items in tooltips"],
desc=L["When enabled, Rarity will not add tooltip information for items you've already obtained."],
get=function()
returnself.db.profile.hideKnownItemsInTooltip
end,
set=function(info,val)
self.db.profile.hideKnownItemsInTooltip=val
Rarity.GUI:UpdateText()
end,
},
},-- args
},-- worldTooltips
contentCategory={
type="group",
name=L["Content Category"],
order=newOrder(),
inline=true,
args={
desc={
type="description",
name=L["These toggles control which items appear in the main Rarity tooltip. Items are categorized by the expansion they were introduced in (although holiday items have a separate category). Turning off these checkboxes does not turn off tracking for any items within the category; it simply hides the item from the tooltip in order to help reduce the number of items in it."],
name=L["These toggles filter which items appear in the main Rarity tooltip. Items are categorized by their type (eg. Mounts, Battle Pets...). Turning off these checkboxes does not turn off tracking for any items within the category; it simply hides the item from the tooltip in order to help reduce the number of items in it."],
order=newOrder(),
},
mounts={
type="toggle",
order=newOrder(),
name=L["Mounts"],
get=function()
returnself.db.profile.collectionType[MOUNT]
end,
set=function(info,val)
self.db.profile.collectionType[MOUNT]=val
Rarity.GUI:UpdateText()
end,
},
pets={
type="toggle",
order=newOrder(),
name=L["Battle Pets"],
get=function()
returnself.db.profile.collectionType[PET]
end,
set=function(info,val)
self.db.profile.collectionType[PET]=val
Rarity.GUI:UpdateText()
end,
},
items={
type="toggle",
order=newOrder(),
name=L["Toys & Items"],
get=function()
returnself.db.profile.collectionType[ITEM]
end,
set=function(info,val)
self.db.profile.collectionType[ITEM]=val
Rarity.GUI:UpdateText()
end,
},
},-- args
},-- collectionType
bar={
type="group",
name=L["Progress Bar"],
order=newOrder(),
inline=true,
args={
anchor={
type="toggle",
order=newOrder(),
name=L["Show anchor"],
get=function()
returnself.db.profile.bar.anchor
end,
set=function(info,val)
self.db.profile.bar.anchor=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
locked={
type="toggle",
order=newOrder(),
name=L["Locked"],
get=function()
returnself.db.profile.bar.locked
end,
set=function(info,val)
self.db.profile.bar.locked=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
growUp={
type="toggle",
order=newOrder(),
name=L["Grow Up"],
get=function()
returnself.db.profile.bar.growUp
end,
set=function(info,val)
self.db.profile.bar.growUp=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
rightAligned={
type="toggle",
order=newOrder(),
name=L["Right-Aligned"],
get=function()
returnself.db.profile.bar.rightAligned
end,
set=function(info,val)
self.db.profile.bar.rightAligned=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
showIcon={
type="toggle",
order=newOrder(),
name=L["Show Icon"],
get=function()
returnself.db.profile.bar.showIcon
end,
set=function(info,val)
self.db.profile.bar.showIcon=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
showText={
type="toggle",
order=newOrder(),
name=L["Show Text"],
get=function()
returnself.db.profile.bar.showText
end,
set=function(info,val)
self.db.profile.bar.showText=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
width={
order=newOrder(),
type="range",
width="double",
name=L["Width"],
min=10,
max=1000,
step=1,
get=function()
returnself.db.profile.bar.widthor150
end,
set=function(_,val)
self.db.profile.bar.width=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
height={
order=newOrder(),
type="range",
width="double",
name=L["Height"],
min=1,
max=300,
step=1,
get=function()
returnself.db.profile.bar.heightor12
end,
set=function(_,val)
self.db.profile.bar.height=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
scale={
order=newOrder(),
type="range",
width="double",
name=L["Scale"],
min=0.1,
max=5,
step=0.05,
get=function()
returnself.db.profile.bar.scaleor1
end,
set=function(_,val)
self.db.profile.bar.scale=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
font={
order=newOrder(),
type="select",
dialogControl="LSM30_Font",
width="double",
name=L["Font"],
values=media:HashTable("font"),
get=function()
returnself.db.profile.bar.font
end,
set=function(_,key)
self.db.profile.bar.font=key
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
fontSize={
order=newOrder(),
type="range",
width="double",
name=L["Font Size"],
min=1,
max=100,
step=1,
get=function()
returnself.db.profile.bar.fontSizeor8
end,
set=function(_,val)
self.db.profile.bar.fontSize=val
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
texture={
order=newOrder(),
type="select",
dialogControl="LSM30_Statusbar",
width="double",
name=L["Texture"],
values=media:HashTable("statusbar"),
get=function()
returnself.db.profile.bar.texture
end,
set=function(_,key)
self.db.profile.bar.texture=key
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end,
},
},-- args
},-- bar
announcements={
type="group",
name=L["Announcements"],
order=newOrder(),
inline=true,
args={
onlyAnnounceFound={
type="toggle",
order=newOrder(),
name=L["Only announce when found"],
desc=L["Announcements will only be triggered when the item is found. When this is off, Rarity will announce every attempt and when the item is found."],
name=L["To import a group of items, paste a Rarity Item Pack string into the Import text box below and click the Import button. Rarity will tell you which items were imported (or which ones failed to import) in your chat window. You can find many Rarity Item Packs on the Curse web site, or elsewhere on the web."],
},
importPreview={
type="description",
order=newOrder(),
name=function()
self.db.profile.importIsError=false
locals
-- Validate the import (this also can disable the Import button, so we only do validation here)
name=L["To export a group of items, go through each item in your Custom tab and check or uncheck the Export checkbox. The checkbox will be disabled if you haven't yet filled out enough information for Rarity to detect the item. Once you've done that, return here and click the Export button. A Rarity Item Pack string will be generated that you can copy to the clipboard using Ctrl-C."],
L["Copy the generated Rarity Export String below using Ctrl-C. You can then paste it elsewhere using Ctrl-V.\n\nFeel free to post it on Curse, GitHub, or Discord to share your Item Pack. We will publish the best ones to the main add-on page."],
L["Run the verification routine automatically after logging in. It can always be run manually (by typing %s)."],
"/rarity validate"
),
get=function()
returnself.db.profile.verifyDatabaseOnLogin
end,
set=function(info,val)
self.db.profile.verifyDatabaseOnLogin=val
end,
},
disableCustomErrors={
type="toggle",
order=newOrder(),
name=L["Disable Rarity-specific error messages"],
width="full",
desc=L["Disables the detailed (red) error messages that are used by the addon to detect invalid states rather than allowing it to crash. Any detected errors will still be handled, but you won't see the notification."],
get=function()
returnself.db.profile.disableCustomErrors
end,
set=function(info,val)
self.db.profile.disableCustomErrors=val
end,
},
},
},
cacheManagement={
name=L["Cached Data"],
type="group",
order=newOrder(),
inline=true,
args={
clearAccountwideStatistics={
type="execute",
order=newOrder(),
width="full",
name=L["Clear accountwide statistics"],
desc=L["Clears the accountwide statistics saved for all characters. You can use this to remove the attempts stored for characters that no longer exist in their original form, e.g., after a server transfer, realm merge, or name change. After clearing this cached data, you will have to log into each character once so attempts can be updated from their statistics again."],
func=function(info,value)-- What are these parameters?
Rarity.db.profile.accountWideStatisticsBackup=Rarity.db.profile.accountWideStatistics-- There's no way to restore it automatically, for now, but it's still better to be safe rather than sorry
Rarity.db.profile.accountWideStatistics={}
Rarity:Print(L["Cleared accountwide statistics"])
end,
},
},
},
trackingOverrides={
name=L["Tracking Overrides"],
type="group",
order=newOrder(),
inline=true,
args={
trackPetsRepeatedly={
type="execute",
order=newOrder(),
-- width = "full",
name=L["Track pets repeatedly"],
desc=L["Set all battle pets to be tracked repeatedly."]
..""
..L["Note: Your existing settings will be overwritten."],
desc=L["To create a new item, enter a unique name for the item, and click Okay. The name will be used if the server does not return the item link or if the item is invalid.\n\nYou can't change this name after you create the item, so choose it well."],
-- name = function() return select(2, GetItemInfo(item.itemId or 0)) or item.name end,
-- fontSize = "large"
-- },
head={
type="description",
order=newOrder(),
name=colorize(L["Unable to retrieve item information from the server"],red),
fontSize="large",
hidden=function()
returnGetItemInfo(item.itemId)
end,
},
export={
order=newOrder(),
type="toggle",
name=L["Export this item"],
desc=L["Check this for every Custom item you wish to export. Then click on the Import/Export tab and click the Export button. This checkbox will be disabled until enough information has been filled in below to make it a detectable item."],
spacer1={type="header",name=L["Identify the Item"],order=newOrder()},
method={
type="select",
name=L["Method of obtaining"],
desc=L["Determines how this item is obtained."],
width="double",
values={
[NPC]=R.string_methods[NPC],
[BOSS]=R.string_methods[BOSS],
[ZONE]=R.string_methods[ZONE],
[USE]=R.string_methods[USE],
[FISHING]=R.string_methods[FISHING],
[ARCH]=R.string_methods[ARCH],
[COLLECTION]=R.string_methods[COLLECTION],
},
get=function()
returnitem.method
end,
set=function(info,val)
item.method=val
self:Update("OPTIONS")
end,
order=newOrder(),
disabled=notisUser,
},
type={
type="select",
name=L["Type of item"],
desc=L["Determines what type of item this is."],
values={[MOUNT]=L["Mount"],[PET]=L["Battle Pet"],[ITEM]=L["Toy or Item"]},
get=function()
returnitem.type
end,
set=function(info,val)
item.type=val
self:Update("OPTIONS")
end,
order=newOrder(),
hidden=notisUser,
},
itemId={
type="input",
order=newOrder(),
width="half",
name=L["Item ID"],
desc=L["The item ID to track. This is the item as it appears in your inventory or in a loot window. Use WowHead or a similar service to lookup item IDs. This must be a valid number and must be unique."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter an item ID."])
elseiftonumber(val)==nilthen
alert(L["You must enter a valid number."])
else
for_,vinpairs(allitems())do
ifv.itemId==tonumber(val)then
alert(L["You entered an item ID that is already being used by another item."])
return
end
end
iftonumber(val)<=0then
alert(L["You must enter a number larger than 0."])
else
item.itemId=tonumber(val)
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.itemIdthen
returntostring(item.itemId)
else
returnnil
end
end,
disabled=notisUser,
},
collectedItemId={
type="input",
order=newOrder(),
name=L["Item ID to Collect"],
desc=L["The item ID that you need to collect. Rarity uses the number of this item that you have in your bags as your progress. Use WowHead or a similar service to lookup item IDs. This must be a valid number and must not be used by another item."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter an item ID."])
else
locallist={strsplit(",",val)}
fork,vinpairs(list)do
ifstrtrim(v)==""then
alert(L["Please enter a comma-separated list of item IDs."])
desc=L["The spell ID of the item once you've learned it. This applies only to mounts and companions, and is the spell as it appears in your spell book after learning the item. Use WowHead or a similar service to lookup spell IDs. This must be a valid number and must be unique."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter a spell ID."])
elseiftonumber(val)==nilthen
alert(L["You must enter a valid number."])
else
for_,vinpairs(allitems())do
ifv.spellId==tonumber(val)then
alert(L["You entered a spell ID that is already being used by another item."])
return
end
end
iftonumber(val)<=0then
alert(L["You must enter a number larger than 0."])
else
item.spellId=tonumber(val)
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.spellIdthen
returntostring(item.spellId)
else
returnnil
end
end,
hidden=function()
ifitem.type==MOUNToritem.type==PETthen
returnfalse
else
returntrue
end
end,
disabled=notisUser,
},
creatureId={
type="input",
order=newOrder(),
width="half",
name=L["Creature ID"],
desc=L["The NPC ID of the creature that is spawned when you summon this pet. This is used to track account-wide battle pets."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter a creature ID."])
elseiftonumber(val)==nilthen
alert(L["You must enter a valid number."])
else
for_,vinpairs(allitems())do
ifv.creatureId==tonumber(val)then
alert(L["You entered a creature ID that is already being used by another item."])
return
end
end
iftonumber(val)<=0then
alert(L["You must enter a number larger than 0."])
else
item.creatureId=tonumber(val)
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.creatureIdthen
returntostring(item.creatureId)
else
returnnil
end
end,
hidden=function()
ifitem.type==PETthen
returnfalse
else
returntrue
end
end,
disabled=notisUser,
},
raceId={
type="select",
name=L["Archaeology race"],
desc=L["Determines which race includes this archaeology project."],
values=R.string_archraces,
get=function()
returnitem.raceId
end,
set=function(info,val)
item.raceId=val
self:Update("OPTIONS")
end,
order=newOrder(),
disabled=notisUser,
hidden=function()
returnitem.method~=ARCH
end,
},
zones={
type="input",
order=newOrder(),
width="double",
name=L["Zones"],
desc=L["A comma-separated list of the zones or sub-zones this item can be found in. For zones, you can enter either the Map ID (i.e. 811 is Vale of Eternal Blossoms), or the full name of the zone. For sub-zones, you must enter the full name of the sub-zone.\n\nEnter zone names with proper spelling, capitalization, and punctuation. They can be entered either in US English or your client's local language. Use WowHead or a similar service to make sure you're entering the zone names perfectly.\n\nPLEASE NOTE: Zone translations may not be correct. For zones, it is highly recommended that you use the Map ID instead of the name. For sub-zones, you must enter the name. If sub-zone detection isn't working for you, please visit the LibBabble-SubZone-3.0 library page on wowace.com and update the translations for your language."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter at least one zone."])
else
locallist={strsplit(",",val)}
fork,vinpairs(list)do
ifstrtrim(v)==""then
alert(L["Please enter a comma-separated list of zones."])
return
else
iftonumber(v)==nilthen
if
lbz:GetUnstrictLookupTable()[v]==nil
andlbz:GetReverseLookupTable()[v]==nil
andlbsz:GetUnstrictLookupTable()[v]==nil
andlbsz:GetReverseLookupTable()[v]==nil
then
alert(
format(
L["One of the zones or sub-zones you entered (%s) cannot be found. Check that it is spelled correctly, and is either US English or your client's local language."],
v
)
)
return
end
else
localmapID=tonumber(v)
ifmapID<=0then
alert(
format(
L["One of the Map IDs you entered (%s) is incorrect. Please enter numbers larger than zero."],
v
)
)
return
end
end
end
end
item.zones={}
fork,vinpairs(list)do
table.insert(item.zones,strtrim(v))
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.zonesandtype(item.zones)=="table"then
locals=""
fork,vinpairs(item.zones)do
ifstrlen(s)>0then
s=s..","
end
s=s..v
end
returns
else
return""
end
end,
hidden=function()
ifitem.method==ZONEoritem.method==FISHINGthen
returnfalse
else
returntrue
end
end,
disabled=notisUser,
},
items={
type="input",
order=newOrder(),
width="double",
name=L["Items to Use"],
desc=L["A comma-separated list of item IDs which, when used or opened, can give you this item. Use WowHead or a similar service to lookup item IDs."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter at least one item ID."])
else
locallist={strsplit(",",val)}
fork,vinpairs(list)do
ifstrtrim(v)==""ortonumber(strtrim(v))==nilthen
alert(L["Please enter a comma-separated list of item IDs."])
return
elseiftonumber(strtrim(v))<=0then
alert(L["Every item ID must be a number greater than 0."])
return
end
end
item.items={}
fork,vinpairs(list)do
table.insert(item.items,tonumber(strtrim(v)))
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.itemsandtype(item.items)=="table"then
locals=""
fork,vinpairs(item.items)do
ifstrlen(s)>0then
s=s..","
end
s=s..tostring(v)
end
returns
else
return""
end
end,
hidden=function()
ifitem.method==USEthen
returnfalse
else
returntrue
end
end,
disabled=notisUser,
},
npcs={
type="input",
order=newOrder(),
width="double",
name=L["NPCs"],
desc=L["A comma-separated list of NPC IDs who drop this item. Use WowHead or a similar service to lookup NPC IDs."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter at least one NPC ID."])
else
locallist={strsplit(",",val)}
fork,vinpairs(list)do
ifstrtrim(v)==""ortonumber(strtrim(v))==nilthen
alert(L["Please enter a comma-separated list of NPC IDs."])
return
elseiftonumber(strtrim(v))<=0then
alert(L["Every NPC ID must be a number greater than 0."])
return
end
end
item.npcs={}
fork,vinpairs(list)do
table.insert(item.npcs,tonumber(strtrim(v)))
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.npcsandtype(item.npcs)=="table"then
locals=""
fork,vinpairs(item.npcs)do
ifstrlen(s)>0then
s=s..","
end
s=s..tostring(v)
end
returns
else
return""
end
end,
hidden=function()
ifitem.method==NPCoritem.method==BOSSthen
returnfalse
else
returntrue
end
end,
disabled=notisUser,
},
statistics={
type="input",
order=newOrder(),
width="double",
name=L["Kill Statistic IDs"],
desc=L["A comma-separated list of Statistic IDs that track the number of kills toward obtaining this item. These statistics will be added together. Use WowHead or a similar service to locate statistic IDs."],
set=function(info,val)
ifstrtrim(val)==""then
item.statisticId={}
else
locallist={strsplit(",",val)}
fork,vinpairs(list)do
ifstrtrim(v)==""ortonumber(strtrim(v))==nilthen
alert(L["Please enter a comma-separated list of Statistic IDs."])
return
elseiftonumber(strtrim(v))<=0then
alert(L["Every Statistic ID must be a number greater than 0."])
desc=L["Determines whether the item can only be obtained from fishing in pools. In order for this option to work, the fishing pools must have all been translated into your client's language."],
desc=L["Determines whether tracking should be enabled for this item. Items that are disabled will not appear in the tooltip."],
get=function()
ifitem.enabled==falsethen
returnfalse
else
returntrue
end
end,
set=function(info,val)
item.enabled=val
self:Update("OPTIONS")
end,
},
found={
order=newOrder(),
type="toggle",
name="Found",
get=function()
ifitem.found==truethen
returntrue
else
returnfalse
end
end,
set=function(info,val)
item.found=val
self:Update("OPTIONS")
end,
hidden=function()
returnnotR.db.profile.debugMode
end,
},
repeatable={
order=newOrder(),
type="toggle",
name=L["Repeatable"],
desc=L["Determines whether you want to repeatedly farm this item. If you turn this on and find the item, Rarity will mark the item as un-found after a few seconds."],
get=function()
ifitem.repeatable==truethen
returntrue
else
returnfalse
end
end,
set=function(info,val)
item.repeatable=val
ifvalthen
item.enabled=true
end
self:Update("OPTIONS")
end,
},
enableAnnouncements={
order=newOrder(),
type="toggle",
name=L["Announce"],
desc=L["Enables announcements whenever you complete a new attempt toward this item."],
returnL["How likely the item is to appear, expressed as 1 in X, where X is the number you enter here."]
end,
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter an amount."])
elseiftonumber(val)==nilthen
alert(L["You must enter a valid number."])
else
localn=tonumber(val)
ifn<=1then
alert(L["You must enter a number larger than 1."])
else
item.chance=n
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.chancethen
returntostring(item.chance)
else
returnnil
end
end,
},
enableCoin={
order=newOrder(),
type="toggle",
name=L["Enable Coins"],
desc=L["When any good-luck coin is used within about 90 seconds of an attempt on this item, another attempt will be counted for this item. Only enable this for items which can legitimately be obtained from coin rolls."],
get=function()
ifitem.enableCoin==truethen
returntrue
else
returnfalse
end
end,
set=function(info,val)
item.enableCoin=val
self:Update("OPTIONS")
end,
hidden=function()
returnitem.method==COLLECTION
end,
},
holidayReminder={
order=newOrder(),
type="toggle",
name=L["Holiday reminders"],
desc=L["When on, Rarity will remind you to go farm holiday items you're missing if the holiday is active and the item is set as Undefeated. (This only works for items that originate from holiday dungeons or daily quests.) The reminder occurs each time you log in or reload your UI, and stops for the day once you defeat the holiday dungeon or complete the quest."],
desc=L["A dungeon ID which, when marked as completed by the game client, will cause this item to be considered Defeated. This is primarily used for holiday items which have unique dungeon IDs."],
set=function(info,val)
ifstrtrim(val)==""then
item.lockDungeonId=nil
elseiftonumber(val)==nilthen
alert(L["You must enter a valid number."])
else
localn=tonumber(val)
ifn<0then
alert(L["You must enter a number larger than or equal to 0."])
else
item.lockDungeonId=n
end
end
self:Update("OPTIONS")
end,
get=function(into)
returntostring(item.lockDungeonIdor"")
end,
disabled=notisUser,
},
lockBossName={
type="input",
order=newOrder(),
width="full",
name=L["Boss Name"],
desc=L["The boss name, in English (enUS), which appears in the instance lock inside the Raid Info panel. The name will be translated to your local language automatically using the LibBoss library (if detection fails, check that the translation exists in this library). IMPORTANT: This method of defeat detection only works when the boss exists in one place at a time. Certain bosses, such as Ragnaros and Kael'thas Sunstrider, exist in two instances at once. Those bosses can be used here, but killing them in either of their instances will result in this Defeat Detection triggering."],
desc=L["When enabled, the item can only be obtained by pickpocketing. The item will be marked Unavailable for non-rogues."],
get=function()
ifitem.pickpocket==truethen
returntrue
else
returnfalse
end
end,
set=function(info,val)
item.pickpocket=val
self:Update("OPTIONS")
end,
hidden=function()
returnitem.method~=NPC
end,
},
groupSize={
type="input",
order=newOrder(),
name=L["Group size"],
desc=L["The number of players it takes to obtain the item. This will lower your chances of obtaining the item."]
..""
..L["Enter 1 or leave this blank to mark the item as soloable."],
set=function(info,val)
ifstrtrim(val)==""then
alert(L["You must enter an amount."])
elseiftonumber(val)==nilthen
alert(L["You must enter a valid number."])
else
localn=tonumber(val)
ifn<=0then
alert(L["You must enter a number larger than 0."])
else
item.groupSize=n
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.groupSizethen
returntostring(item.groupSize)
else
returnnil
end
end,
hidden=function()
returnitem.method~=BOSSanditem.method~=USE
end,
},
equalOdds={
order=newOrder(),
type="toggle",
name=L["Equal odds"],
desc=L["Turn this on if the item requires a group to obtain, but every player gets an equal chance to obtain the item. This currently only applies to some of the holiday mounts. When you turn this on, Rarity will stop lowering your chance to obtain based on the group size."],
get=function()
ifitem.equalOdds==truethen
returntrue
else
returnfalse
end
end,
set=function(info,val)
item.equalOdds=val
self:Update("OPTIONS")
end,
hidden=function()
returnitem.method~=BOSSanditem.method~=USE
end,
},
instanceDifficulty={
order=newOrder(),
type="multiselect",
width="double",
name=L["Instance Difficulty"],
desc=L["Determines which instance difficulties this item may be obtained in. Leave everything unchecked if the instance difficulty doesn't matter.\n\nIf you specified a Statistic ID for this item, the Instance Difficulty is probably meaningless, because all modern statistics already incorporate the difficulty.\n\nYou can check multiple items in this list at once."],
values={
[0]=L["None (not in an instance)"],
[1]=L["5-player instance"],
[2]=L["5-player Heroic instance"],
[3]=L["10-player Raid instance (legacy content; not flexible)"],
[4]=L["25-player Raid instance (legacy content; not flexible)"],
[5]=L["10-player Heroic Raid instance (legacy content; not flexible)"],
[6]=L["25-player Heroic Raid instance (legacy content; not flexible)"],
[7]=L["Raid Finder instance (legacy content; fixed at 25 players)"],
[8]=L["Challenge Mode instance"],
[9]=L["40-player Raid instance (legacy content; not flexible)"],
[11]=L["Heroic Scenario instance"],
[12]=L["Scenario instance"],
[14]=L["Normal Raid (10-30 players)"],
[15]=L["Heroic Raid (10-30 players)"],
[16]=L["Mythic Raid (20 player)"],
[17]=L["Looking For Raid (10-30 players)"],
[18]=L["40-player Event raid"],
[19]=L["5-player Event instance"],
[20]=L["25-player Event scenario"],
[23]=L["Mythic 5-player instance"],
[24]=L["Timewalker 5-player instance"],
},
get=function(s,key)
ifitem.instanceDifficultiesthen
returnitem.instanceDifficulties[key]orfalse
end
returnfalse
end,
set=function(s,key,state)
ifitem.instanceDifficulties==nilthen
item.instanceDifficulties={}
end
item.instanceDifficulties[key]=state
self:Update("OPTIONS")
end,
},
disableForClass={
order=newOrder(),
type="multiselect",
name=L["Disable for classes"],
desc=L["Choose which classes this item should be disabled for. Checking a class below hides the item from the Rarity tooltip and prevents it from being tracked. You can still toggle Track This, but the item will not track for any classes specified here."],
values=classes,
get=function(s,key)
ifitem.disableForClassthen
returnitem.disableForClass[key]orfalse
end
returnfalse
end,
set=function(s,key,state)
ifitem.disableForClass==nilthen
item.disableForClass={}
end
item.disableForClass[key]=state
end,
},
requiresHorde={
order=newOrder(),
type="toggle",
name=L["Horde only"],
desc=L["This item is only available to Horde players."],
get=function()
ifitem.requiresHorde==truethen
returntrue
else
returnfalse
end
end,
set=function(info,val)
item.requiresHorde=val
ifvalthen
item.requiresAlliance=false
end
self:Update("OPTIONS")
end,
},
requiresAlliance={
order=newOrder(),
type="toggle",
name=L["Alliance only"],
desc=L["This item is only available to Alliance players."],
desc=L["Certain items, such as Illusions in your wardrobe, flag a completed Quest ID when you learn them. Rarity can automatically stop tracking this item if you enter that Quest ID here. (Only one ID, not a list.)"],
set=function(info,val)
ifstrtrim(val)==""then
item.obtainedQuestId=nil
elseiftonumber(val)==nilthen
item.obtainedQuestId=nil
else
localn=tonumber(val)
ifn<=0then
alert(L["You must enter a number larger than 0."])
else
item.obtainedQuestId=n
end
end
self:Update("OPTIONS")
end,
get=function(into)
ifitem.obtainedQuestIdthen
returntostring(item.obtainedQuestId)
else
returnnil
end
end,
},
achievementId={
type="input",
order=newOrder(),
name=L["Obtained Achievement ID"],
desc=L["Set this to the achievement ID which indicates this item has been obtained. This is useful for items which do not yield mounts or pets, but which do grant an achievement when obtained, such as Old Crafty or Old Ironjaw. Leave this blank for mounts and pets. Use WowHead to find achievement IDs."],
set=function(info,val)
ifstrtrim(val)==""then
item.achievementId=nil
elseiftonumber(val)==nilthen
alert(L["You must enter a valid number."])
else
for_,vinpairs(allitems())do
ifv.achievementId==tonumber(val)then
alert(L["You entered a achievement ID that is already being used by another item."])
return
end
end
iftonumber(val)<=0then
alert(L["You must enter a number larger than 0."])