Mercurial > wow > inventory
comparison Modules/Config.lua @ 155:5081056cade1
Moved prefered addon selection to the bottom of the config frames. This really is optional and advanced; you shouldn?t pay attention to it.
author | Zerotorescue |
---|---|
date | Sat, 22 Jan 2011 01:46:17 +0100 |
parents | 39df534c9856 |
children | 314943963155 |
comparison
equal
deleted
inserted
replaced
154:39df534c9856 | 155:5081056cade1 |
---|---|
282 name = function(info) | 282 name = function(info) |
283 local groupName = groupIdToName[info[2]]; | 283 local groupName = groupIdToName[info[2]]; |
284 | 284 |
285 local t = ""; | 285 local t = ""; |
286 if not addon.db.profile.defaults.hideHelp then | 286 if not addon.db.profile.defaults.hideHelp then |
287 t = "Here you can set general settings for the currently selected group. If you do not wish to override a setting, the default setting specified in the general group will be used.\n\n"; | 287 t = "Here you can set general settings for the currently selected group. If you do not wish to override a setting, the default setting specified in the general group will be used."; |
288 end | |
289 | |
290 return t; | |
291 end, | |
292 }, | |
293 header = { | |
294 order = 5, | |
295 type = "header", | |
296 name = "", | |
297 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
298 }, | |
299 overrideTrackAtCharacters = { | |
300 order = 19, | |
301 type = "toggle", | |
302 name = "Override track at", | |
303 desc = "Allows you to override at which characters items in this group should appear in the summary and generate alerts.", | |
304 arg = "trackAtCharacters", | |
305 }, | |
306 trackAtCharacters = { | |
307 order = 20, | |
308 type = "multiselect", | |
309 name = "Track at", | |
310 desc = "Select at which characters this should appear in the summary and generate alerts.", | |
311 values = function() | |
312 local temp = {}; | |
313 for charName in pairs(addon.db.factionrealm.characters) do | |
314 temp[charName] = charName; | |
315 end | |
316 | |
317 return temp; | |
318 end, | |
319 get = GetMultiOption, | |
320 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
321 arg = "overrideTrackAtCharacters", | |
322 }, | |
323 overrideLocalItemData = { | |
324 order = 39, | |
325 type = "toggle", | |
326 name = "Override local item data", | |
327 desc = "Allows you to override the local item data setting for this group.", | |
328 arg = "localItemData", | |
329 }, | |
330 localItemData = { | |
331 order = 40, | |
332 type = "multiselect", | |
333 name = "Include in local item data", | |
334 desc = "Select which data should be included in the local item data.", | |
335 values = { | |
336 ["Bag"] = "Bag", | |
337 ["Bank"] = "Bank", | |
338 ["Auction House"] = "Auction House", | |
339 ["Mailbox"] = "Mailbox", | |
340 }, | |
341 get = GetMultiOption, | |
342 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
343 arg = "overrideLocalItemData", | |
344 }, | |
345 virtualGroup = { | |
346 order = 50, | |
347 type = "select", | |
348 name = "Use virtual group settings", | |
349 desc = "Use the settings from a virtual group before using the general defaults.\n\n|cffff9933This is an advanced option, you will probably not need it unless you manage a lot of groups.|r\n\n|cfffed000Off|r: Use the overridden options in this group and then the defaults.\n\n|cfffed000On|r: Use the overridden options in this group, then the ones in the selected virtual group and then the defaults.", | |
350 values = function(info) | |
351 local groupName = groupIdToName[info[2]]; | |
352 | |
353 local temp = {}; | |
354 | |
355 temp[""] = ""; | |
356 for name, values in pairs(addon.db.profile.groups) do | |
357 if values.isVirtual and name ~= groupName then | |
358 temp[name] = name; | |
359 end | |
360 end | |
361 | |
362 return temp; | |
363 end, | |
364 set = function(info, value) | |
365 local groupName = groupIdToName[info[2]]; | |
366 local optionName = info[#info]; | |
367 | |
368 addon.db.profile.groups[groupName][optionName] = value ~= "" and value; | |
369 end, | |
370 disabled = false, | |
371 }, | |
372 }, | |
373 }, | |
374 minimumStock = { | |
375 order = 10, | |
376 type = "group", | |
377 inline = true, | |
378 name = "Minimum stock", | |
379 set = SetOption, | |
380 get = GetOption, | |
381 disabled = GetDisabled, | |
382 args = { | |
383 description = { | |
384 order = 0, | |
385 type = "description", | |
386 name = "Here you can specify the minimum amount of items you wish to keep in stock and related settings for the currently selected group. Please note the values entered here do not affect the queued quantities, you must set settings for that in the area below.", | |
387 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
388 }, | |
389 header = { | |
390 order = 5, | |
391 type = "header", | |
392 name = "", | |
393 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
394 }, | |
395 | |
396 overrideMinLocalStock = { | |
397 order = 10, | |
398 type = "toggle", | |
399 name = "Override min local stock", | |
400 desc = "Allows you to override the minimum local stock setting for this group.", | |
401 arg = "minLocalStock", | |
402 }, | |
403 minLocalStock = { | |
404 order = 11, | |
405 type = "range", | |
406 min = 0, | |
407 max = 100000, | |
408 softMax = 100, | |
409 step = 1, | |
410 name = "Minimum local stock", | |
411 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.", | |
412 arg = "overrideMinLocalStock", | |
413 }, | |
414 overrideAlertBelowLocalMinimum = { | |
415 order = 15, | |
416 type = "toggle", | |
417 name = "Override local minimum alert", | |
418 desc = "Allows you to override wether an alert should be shown when an item in this group gets below the local minimum stock threshold.", | |
419 arg = "alertBelowLocalMinimum", | |
420 }, | |
421 alertBelowLocalMinimum = { | |
422 order = 16, | |
423 type = "toggle", | |
424 name = "Alert when below local minimum (NYI)", | |
425 desc = "Show an alert when an item in this group gets below the local minimum stock threshold.", | |
426 arg = "overrideAlertBelowLocalMinimum", | |
427 }, | |
428 overrideAutoRefill = { | |
429 order = 17, | |
430 type = "toggle", | |
431 name = "Override auto refill", | |
432 desc = "Allows you to override wether you want to automatically refill items when below the minimum local stock.", | |
433 arg = "autoRefill", | |
434 }, | |
435 autoRefill = { | |
436 order = 18, | |
437 type = "toggle", | |
438 name = "Auto refill from storage", | |
439 desc = "Automatically refill items from your storage (bank/mailbox - unless this is included in the local count - or the guild bank) when below the minimum local stock.", | |
440 arg = "overrideAutoRefill", | |
441 }, | |
442 | |
443 overrideMinGlobalStock = { | |
444 order = 20, | |
445 type = "toggle", | |
446 name = "Override min global stock", | |
447 desc = "Allows you to override the minimum global stock setting for this group.", | |
448 arg = "minGlobalStock", | |
449 }, | |
450 minGlobalStock = { | |
451 order = 21, | |
452 type = "range", | |
453 min = 0, | |
454 max = 100000, | |
455 softMax = 100, | |
456 step = 1, | |
457 name = "Minimum global stock", | |
458 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.", | |
459 arg = "overrideMinGlobalStock", | |
460 }, | |
461 overrideAlertBelowGlobalMinimum = { | |
462 order = 25, | |
463 type = "toggle", | |
464 name = "Override global minimum alert", | |
465 desc = "Allows you to override wether an alert should be shown when an item in this group gets below the global minimum stock threshold.", | |
466 arg = "alertBelowGlobalMinimum", | |
467 }, | |
468 alertBelowGlobalMinimum = { | |
469 order = 26, | |
470 type = "toggle", | |
471 name = "Alert when below global minimum (NYI)", | |
472 desc = "Show an alert when an item in this group gets below the global minimum stock threshold.", | |
473 arg = "overrideAlertBelowGlobalMinimum", | |
474 }, | |
475 | |
476 overrideSummaryThresholdShow = { | |
477 order = 34, | |
478 type = "toggle", | |
479 name = "Override summary showing", | |
480 desc = "Allows you to override when this group should appear in the summary.", | |
481 arg = "summaryThresholdShow", | |
482 }, | |
483 summaryThresholdShow = { | |
484 order = 35, | |
485 type = "range", | |
486 min = 0, | |
487 max = 10, | |
488 softMax = 100, | |
489 step = 0.05, | |
490 isPercent = true, | |
491 name = "Show in summary when below", | |
492 desc = "Show items in the summary when below the specified percentage of the minimum stock.\n\nYou can manually enter a value between 1.000% and 10.000% in the edit box if the provided range is insufficient.", | |
493 arg = "overrideSummaryThresholdShow", | |
494 }, | |
495 }, | |
496 }, | |
497 refill = { | |
498 order = 20, | |
499 type = "group", | |
500 inline = true, | |
501 name = "Replenishing stock", | |
502 set = SetOption, | |
503 get = GetOption, | |
504 disabled = GetDisabled, | |
505 args = { | |
506 description = { | |
507 order = 0, | |
508 type = "description", | |
509 name = function(info) | |
510 local groupName = groupIdToName[info[2]]; | |
511 local r = "Here you can specify the amount of items to which you wish to restock when you are collecting new items for the currently selected group. This may be higher than the minimum stock.\n\n"; | |
512 | |
513 r = r .. "When restocking the target amount is |cfffed000" .. addon:GetOptionByKey(groupName, "restockTarget") .. "|r of every item. Not queueing craftable items when only missing |cfffed000" .. floor( addon:GetOptionByKey(groupName, "minCraftingQueue") * addon:GetOptionByKey(groupName, "restockTarget") ) .. "|r (|cfffed000" .. ( addon:GetOptionByKey(groupName, "minCraftingQueue") * 100 ) .. "%|r) of the restock target and making |cfffed000" .. floor( ( addon:GetOptionByKey(groupName, "bonusQueue") * addon:GetOptionByKey(groupName, "restockTarget") ) + .5 ) .. "|r (|cfffed000" .. ( addon:GetOptionByKey(groupName, "bonusQueue") * 100 ) .. "%|r) extra items when you completely ran out. "; | |
514 | |
515 if addon:GetOptionByKey(groupName, "priceThreshold") == 0 then | |
516 r = r .. "Queueing items at |cfffed000any|r auction value."; | |
517 else | |
518 r = r .. "Queueing items worth |cfffed000" .. addon:ReadableMoney(addon:GetOptionByKey(groupName, "priceThreshold")) .. "|r or more."; | |
519 end | |
520 | |
521 return r; | |
522 end, | |
523 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
524 }, | |
525 header = { | |
526 order = 5, | |
527 type = "header", | |
528 name = "", | |
529 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
530 }, | |
531 overrideRestockTarget = { | |
532 order = 9, | |
533 type = "toggle", | |
534 name = "Override restock target", | |
535 desc = "Allows you to override the restock target setting for this group.", | |
536 arg = "restockTarget", | |
537 }, | |
538 restockTarget = { | |
539 order = 10, | |
540 type = "range", | |
541 min = 0, | |
542 max = 100000, | |
543 softMax = 100, | |
544 step = 1, | |
545 name = "Restock target", | |
546 desc = "You can manually enter a value between 100 and 100.000 in the edit box if the provided range is insufficient.", | |
547 arg = "overrideRestockTarget", | |
548 }, | |
549 overrideMinCraftingQueue = { | |
550 order = 19, | |
551 type = "toggle", | |
552 name = "Override min queue", | |
553 desc = "Allows you to override the minimum craftable items queue setting for this group.", | |
554 arg = "minCraftingQueue", | |
555 }, | |
556 minCraftingQueue = { | |
557 order = 20, | |
558 type = "range", | |
559 min = 0, | |
560 max = 1, | |
561 step = 0.01, | |
562 isPercent = true, | |
563 name = "Don't queue when only missing...", | |
564 desc = "Don't add a craftable item to the queue when only missing this much or less of the restock target.\n\nExample: if your restock target is set to 60 and this is set to 5%, an item won't be queued unless you are missing more than 3 of it.", | |
565 arg = "overrideMinCraftingQueue", | |
566 }, | |
567 overrideBonusQueue = { | |
568 order = 29, | |
569 type = "toggle", | |
570 name = "Override bonus queue", | |
571 desc = "Allows you to override the bonus craftable items queue setting for this group.", | |
572 arg = "bonusQueue", | |
573 }, | |
574 bonusQueue = { | |
575 order = 30, | |
576 type = "range", | |
577 min = 0, | |
578 max = 10, -- 1000% | |
579 step = 0.01, -- 1% | |
580 isPercent = true, | |
581 name = "Bonus queue", | |
582 desc = "Get additional items when there are none left.\n\nExample: if your restock target is set to 60 and this is set to 10%, you will get 66 items instead of just 60 if you end up with none left while queueing.", | |
583 arg = "overrideBonusQueue", | |
584 }, | |
585 overridePriceThreshold = { | |
586 order = 39, | |
587 type = "toggle", | |
588 name = "Override price threshold", | |
589 desc = "Allows you to override the price threshold setting for this group.", | |
590 arg = "priceThreshold", | |
591 }, | |
592 priceThreshold = { | |
593 order = 40, | |
594 type = "input", | |
595 name = "Price threshold", | |
596 desc = "Only queue craftable items when they are worth at least this much according to your auction house addon.\n\nSet to 0 to ignore auction prices.", | |
597 validate = function(info, value) return addon:ValidateReadableMoney(info, value); end, | |
598 get = function(i) return addon:ReadableMoney(GetOption(i)); end, | |
599 set = function(i, v) SetOption(i, addon:ReadableMoneyToCopper(v)); end, | |
600 arg = "overridePriceThreshold", | |
601 }, | |
602 overrideSummaryHidePriceThreshold = { | |
603 order = 49, | |
604 type = "toggle", | |
605 name = "Override summary showing", | |
606 desc = "Allows you to override if items in this group should be hidden from the summary while their value is below the price threshold.", | |
607 arg = "summaryHidePriceThreshold", | |
608 }, | |
609 summaryHidePriceThreshold = { | |
610 order = 50, | |
611 type = "toggle", | |
612 name = "Hide when below threshold", | |
613 desc = "Hide items from the summary when their value is below the set price threshold.", | |
614 arg = "overrideSummaryHidePriceThreshold", | |
615 }, | |
616 overrideAlwaysGetAuctionValue = { | |
617 order = 59, | |
618 type = "toggle", | |
619 name = "Override auction value showing", | |
620 desc = "Allows you to override if the auction value of items in this group should be cached and displayed even when the price threshold is set to 0|cffeda55fc|r.", | |
621 arg = "alwaysGetAuctionValue", | |
622 }, | |
623 alwaysGetAuctionValue = { | |
624 order = 60, | |
625 type = "toggle", | |
626 name = "Always show auction value", | |
627 desc = "Always cache and show the auction value of items in this group, even if the price threshold is set to 0|cffeda55fc|r.", | |
628 arg = "overrideAlwaysGetAuctionValue", | |
629 }, | |
630 }, | |
631 }, | |
632 addons = { | |
633 order = 30, | |
634 type = "group", | |
635 inline = true, | |
636 name = "Prefered addons", | |
637 set = SetOption, | |
638 get = GetOption, | |
639 disabled = GetDisabled, | |
640 args = { | |
641 description = { | |
642 order = 0, | |
643 type = "description", | |
644 name = function(info) | |
645 local groupName = groupIdToName[info[2]]; | |
646 | |
647 local t = ""; | |
648 if not addon.db.profile.defaults.hideHelp then | |
649 t = "Selecting your prefered addons is optional, the first working addon will be used if the selected addon doesn't exist. You only need to set this when you are running multiple addons of a kind and wish to specify which addons to use for what groups.\n\n"; | |
288 end | 650 end |
289 | 651 |
290 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); | 652 local currentAddon, selectedAddonName = addon:GetItemCountAddon(groupName); |
291 local preferedAddon = addon:GetOptionByKey(groupName, "itemCountAddon"); | 653 local preferedAddon = addon:GetOptionByKey(groupName, "itemCountAddon"); |
292 | 654 |
410 if addon.supportedAddons.crafting[value].OnSelect then | 772 if addon.supportedAddons.crafting[value].OnSelect then |
411 addon.supportedAddons.crafting[value].OnSelect(); | 773 addon.supportedAddons.crafting[value].OnSelect(); |
412 end | 774 end |
413 end, | 775 end, |
414 arg = "overrideCraftingAddon", | 776 arg = "overrideCraftingAddon", |
415 }, | |
416 overrideLocalItemData = { | |
417 order = 39, | |
418 type = "toggle", | |
419 name = "Override local item data", | |
420 desc = "Allows you to override the local item data setting for this group.", | |
421 arg = "localItemData", | |
422 }, | |
423 localItemData = { | |
424 order = 40, | |
425 type = "multiselect", | |
426 name = "Include in local item data", | |
427 desc = "Select which data should be included in the local item data.", | |
428 values = { | |
429 ["Bag"] = "Bag", | |
430 ["Bank"] = "Bank", | |
431 ["Auction House"] = "Auction House", | |
432 ["Mailbox"] = "Mailbox", | |
433 }, | |
434 get = GetMultiOption, | |
435 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
436 arg = "overrideLocalItemData", | |
437 }, | |
438 virtualGroup = { | |
439 order = 50, | |
440 type = "select", | |
441 name = "Use virtual group settings", | |
442 desc = "Use the settings from a virtual group before using the general defaults.\n\n|cffff9933This is an advanced option, you will probably not need it unless you manage a lot of groups.|r\n\n|cfffed000Off|r: Use the overridden options in this group and then the defaults.\n\n|cfffed000On|r: Use the overridden options in this group, then the ones in the selected virtual group and then the defaults.", | |
443 values = function(info) | |
444 local groupName = groupIdToName[info[2]]; | |
445 | |
446 local temp = {}; | |
447 | |
448 temp[""] = ""; | |
449 for name, values in pairs(addon.db.profile.groups) do | |
450 if values.isVirtual and name ~= groupName then | |
451 temp[name] = name; | |
452 end | |
453 end | |
454 | |
455 return temp; | |
456 end, | |
457 set = function(info, value) | |
458 local groupName = groupIdToName[info[2]]; | |
459 local optionName = info[#info]; | |
460 | |
461 addon.db.profile.groups[groupName][optionName] = value ~= "" and value; | |
462 end, | |
463 disabled = false, | |
464 }, | |
465 }, | |
466 }, | |
467 minimumStock = { | |
468 order = 10, | |
469 type = "group", | |
470 inline = true, | |
471 name = "Minimum stock", | |
472 set = SetOption, | |
473 get = GetOption, | |
474 disabled = GetDisabled, | |
475 args = { | |
476 description = { | |
477 order = 0, | |
478 type = "description", | |
479 name = "Here you can specify the minimum amount of items you wish to keep in stock and related settings for the currently selected group. Please note the values entered here do not affect the queued quantities, you must set settings for that in the area below.", | |
480 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
481 }, | |
482 header = { | |
483 order = 5, | |
484 type = "header", | |
485 name = "", | |
486 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
487 }, | |
488 | |
489 overrideMinLocalStock = { | |
490 order = 10, | |
491 type = "toggle", | |
492 name = "Override min local stock", | |
493 desc = "Allows you to override the minimum local stock setting for this group.", | |
494 arg = "minLocalStock", | |
495 }, | |
496 minLocalStock = { | |
497 order = 11, | |
498 type = "range", | |
499 min = 0, | |
500 max = 100000, | |
501 softMax = 100, | |
502 step = 1, | |
503 name = "Minimum local stock", | |
504 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.", | |
505 arg = "overrideMinLocalStock", | |
506 }, | |
507 overrideAlertBelowLocalMinimum = { | |
508 order = 15, | |
509 type = "toggle", | |
510 name = "Override local minimum alert", | |
511 desc = "Allows you to override wether an alert should be shown when an item in this group gets below the local minimum stock threshold.", | |
512 arg = "alertBelowLocalMinimum", | |
513 }, | |
514 alertBelowLocalMinimum = { | |
515 order = 16, | |
516 type = "toggle", | |
517 name = "Alert when below local minimum (NYI)", | |
518 desc = "Show an alert when an item in this group gets below the local minimum stock threshold.", | |
519 arg = "overrideAlertBelowLocalMinimum", | |
520 }, | |
521 overrideAutoRefill = { | |
522 order = 17, | |
523 type = "toggle", | |
524 name = "Override auto refill", | |
525 desc = "Allows you to override wether you want to automatically refill items when below the minimum local stock.", | |
526 arg = "autoRefill", | |
527 }, | |
528 autoRefill = { | |
529 order = 18, | |
530 type = "toggle", | |
531 name = "Auto refill from storage", | |
532 desc = "Automatically refill items from your storage (bank/mailbox - unless this is included in the local count - or the guild bank) when below the minimum local stock.", | |
533 arg = "overrideAutoRefill", | |
534 }, | |
535 | |
536 overrideMinGlobalStock = { | |
537 order = 20, | |
538 type = "toggle", | |
539 name = "Override min global stock", | |
540 desc = "Allows you to override the minimum global stock setting for this group.", | |
541 arg = "minGlobalStock", | |
542 }, | |
543 minGlobalStock = { | |
544 order = 21, | |
545 type = "range", | |
546 min = 0, | |
547 max = 100000, | |
548 softMax = 100, | |
549 step = 1, | |
550 name = "Minimum global stock", | |
551 desc = "You can manually enter a value between 100 and 100.000 in the text box below if the provided range is insufficient.", | |
552 arg = "overrideMinGlobalStock", | |
553 }, | |
554 overrideAlertBelowGlobalMinimum = { | |
555 order = 25, | |
556 type = "toggle", | |
557 name = "Override global minimum alert", | |
558 desc = "Allows you to override wether an alert should be shown when an item in this group gets below the global minimum stock threshold.", | |
559 arg = "alertBelowGlobalMinimum", | |
560 }, | |
561 alertBelowGlobalMinimum = { | |
562 order = 26, | |
563 type = "toggle", | |
564 name = "Alert when below global minimum (NYI)", | |
565 desc = "Show an alert when an item in this group gets below the global minimum stock threshold.", | |
566 arg = "overrideAlertBelowGlobalMinimum", | |
567 }, | |
568 | |
569 overrideSummaryThresholdShow = { | |
570 order = 34, | |
571 type = "toggle", | |
572 name = "Override summary showing", | |
573 desc = "Allows you to override when this group should appear in the summary.", | |
574 arg = "summaryThresholdShow", | |
575 }, | |
576 summaryThresholdShow = { | |
577 order = 35, | |
578 type = "range", | |
579 min = 0, | |
580 max = 10, | |
581 softMax = 100, | |
582 step = 0.05, | |
583 isPercent = true, | |
584 name = "Show in summary when below", | |
585 desc = "Show items in the summary when below the specified percentage of the minimum stock.\n\nYou can manually enter a value between 1.000% and 10.000% in the edit box if the provided range is insufficient.", | |
586 arg = "overrideSummaryThresholdShow", | |
587 }, | |
588 overrideTrackAtCharacters = { | |
589 order = 39, | |
590 type = "toggle", | |
591 name = "Override track at", | |
592 desc = "Allows you to override at which characters items in this group should appear in the summary and generate alerts.", | |
593 arg = "trackAtCharacters", | |
594 }, | |
595 trackAtCharacters = { | |
596 order = 40, | |
597 type = "multiselect", | |
598 name = "Track at", | |
599 desc = "Select at which characters this should appear in the summary and generate alerts.", | |
600 values = function() | |
601 local temp = {}; | |
602 for charName in pairs(addon.db.factionrealm.characters) do | |
603 temp[charName] = charName; | |
604 end | |
605 | |
606 return temp; | |
607 end, | |
608 get = GetMultiOption, | |
609 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
610 arg = "overrideTrackAtCharacters", | |
611 }, | |
612 }, | |
613 }, | |
614 refill = { | |
615 order = 20, | |
616 type = "group", | |
617 inline = true, | |
618 name = "Replenishing stock", | |
619 set = SetOption, | |
620 get = GetOption, | |
621 disabled = GetDisabled, | |
622 args = { | |
623 description = { | |
624 order = 0, | |
625 type = "description", | |
626 name = function(info) | |
627 local groupName = groupIdToName[info[2]]; | |
628 local r = "Here you can specify the amount of items to which you wish to restock when you are collecting new items for the currently selected group. This may be higher than the minimum stock.\n\n"; | |
629 | |
630 r = r .. "When restocking the target amount is |cfffed000" .. addon:GetOptionByKey(groupName, "restockTarget") .. "|r of every item. Not queueing craftable items when only missing |cfffed000" .. floor( addon:GetOptionByKey(groupName, "minCraftingQueue") * addon:GetOptionByKey(groupName, "restockTarget") ) .. "|r (|cfffed000" .. ( addon:GetOptionByKey(groupName, "minCraftingQueue") * 100 ) .. "%|r) of the restock target and making |cfffed000" .. floor( ( addon:GetOptionByKey(groupName, "bonusQueue") * addon:GetOptionByKey(groupName, "restockTarget") ) + .5 ) .. "|r (|cfffed000" .. ( addon:GetOptionByKey(groupName, "bonusQueue") * 100 ) .. "%|r) extra items when you completely ran out. "; | |
631 | |
632 if addon:GetOptionByKey(groupName, "priceThreshold") == 0 then | |
633 r = r .. "Queueing items at |cfffed000any|r auction value."; | |
634 else | |
635 r = r .. "Queueing items worth |cfffed000" .. addon:ReadableMoney(addon:GetOptionByKey(groupName, "priceThreshold")) .. "|r or more."; | |
636 end | |
637 | |
638 return r; | |
639 end, | |
640 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
641 }, | |
642 header = { | |
643 order = 5, | |
644 type = "header", | |
645 name = "", | |
646 hidden = function() return addon.db.profile.defaults.hideHelp; end, | |
647 }, | |
648 overrideRestockTarget = { | |
649 order = 9, | |
650 type = "toggle", | |
651 name = "Override restock target", | |
652 desc = "Allows you to override the restock target setting for this group.", | |
653 arg = "restockTarget", | |
654 }, | |
655 restockTarget = { | |
656 order = 10, | |
657 type = "range", | |
658 min = 0, | |
659 max = 100000, | |
660 softMax = 100, | |
661 step = 1, | |
662 name = "Restock target", | |
663 desc = "You can manually enter a value between 100 and 100.000 in the edit box if the provided range is insufficient.", | |
664 arg = "overrideRestockTarget", | |
665 }, | |
666 overrideMinCraftingQueue = { | |
667 order = 19, | |
668 type = "toggle", | |
669 name = "Override min queue", | |
670 desc = "Allows you to override the minimum craftable items queue setting for this group.", | |
671 arg = "minCraftingQueue", | |
672 }, | |
673 minCraftingQueue = { | |
674 order = 20, | |
675 type = "range", | |
676 min = 0, | |
677 max = 1, | |
678 step = 0.01, | |
679 isPercent = true, | |
680 name = "Don't queue when only missing...", | |
681 desc = "Don't add a craftable item to the queue when only missing this much or less of the restock target.\n\nExample: if your restock target is set to 60 and this is set to 5%, an item won't be queued unless you are missing more than 3 of it.", | |
682 arg = "overrideMinCraftingQueue", | |
683 }, | |
684 overrideBonusQueue = { | |
685 order = 29, | |
686 type = "toggle", | |
687 name = "Override bonus queue", | |
688 desc = "Allows you to override the bonus craftable items queue setting for this group.", | |
689 arg = "bonusQueue", | |
690 }, | |
691 bonusQueue = { | |
692 order = 30, | |
693 type = "range", | |
694 min = 0, | |
695 max = 10, -- 1000% | |
696 step = 0.01, -- 1% | |
697 isPercent = true, | |
698 name = "Bonus queue", | |
699 desc = "Get additional items when there are none left.\n\nExample: if your restock target is set to 60 and this is set to 10%, you will get 66 items instead of just 60 if you end up with none left while queueing.", | |
700 arg = "overrideBonusQueue", | |
701 }, | |
702 overridePriceThreshold = { | |
703 order = 39, | |
704 type = "toggle", | |
705 name = "Override price threshold", | |
706 desc = "Allows you to override the price threshold setting for this group.", | |
707 arg = "priceThreshold", | |
708 }, | |
709 priceThreshold = { | |
710 order = 40, | |
711 type = "input", | |
712 name = "Price threshold", | |
713 desc = "Only queue craftable items when they are worth at least this much according to your auction house addon.\n\nSet to 0 to ignore auction prices.", | |
714 validate = function(info, value) return addon:ValidateReadableMoney(info, value); end, | |
715 get = function(i) return addon:ReadableMoney(GetOption(i)); end, | |
716 set = function(i, v) SetOption(i, addon:ReadableMoneyToCopper(v)); end, | |
717 arg = "overridePriceThreshold", | |
718 }, | |
719 overrideSummaryHidePriceThreshold = { | |
720 order = 49, | |
721 type = "toggle", | |
722 name = "Override summary showing", | |
723 desc = "Allows you to override if items in this group should be hidden from the summary while their value is below the price threshold.", | |
724 arg = "summaryHidePriceThreshold", | |
725 }, | |
726 summaryHidePriceThreshold = { | |
727 order = 50, | |
728 type = "toggle", | |
729 name = "Hide when below threshold", | |
730 desc = "Hide items from the summary when their value is below the set price threshold.", | |
731 arg = "overrideSummaryHidePriceThreshold", | |
732 }, | |
733 overrideAlwaysGetAuctionValue = { | |
734 order = 59, | |
735 type = "toggle", | |
736 name = "Override auction value showing", | |
737 desc = "Allows you to override if the auction value of items in this group should be cached and displayed even when the price threshold is set to 0|cffeda55fc|r.", | |
738 arg = "alwaysGetAuctionValue", | |
739 }, | |
740 alwaysGetAuctionValue = { | |
741 order = 60, | |
742 type = "toggle", | |
743 name = "Always show auction value", | |
744 desc = "Always cache and show the auction value of items in this group, even if the price threshold is set to 0|cffeda55fc|r.", | |
745 arg = "overrideAlwaysGetAuctionValue", | |
746 }, | 777 }, |
747 }, | 778 }, |
748 }, | 779 }, |
749 }, | 780 }, |
750 }, | 781 }, |
1350 order = 0, | 1381 order = 0, |
1351 type = "description", | 1382 type = "description", |
1352 name = function() | 1383 name = function() |
1353 local t = ""; | 1384 local t = ""; |
1354 if not addon.db.profile.defaults.hideHelp then | 1385 if not addon.db.profile.defaults.hideHelp then |
1355 t = "Here you can set general settings. The settings entered here will be used when you choose not to override the settings within an individual group.\n\n"; | 1386 t = "Here you can set general settings. The settings entered here will be used when you choose not to override the settings within an individual group."; |
1356 end | |
1357 | |
1358 local currentAddon, selectedAddonName = addon:GetItemCountAddon(); | |
1359 local preferedAddon = addon.db.profile.defaults.itemCountAddon; | |
1360 | |
1361 if currentAddon then | |
1362 t = t .. "Currently using |cfffed000" .. selectedAddonName .. "|r as your item count addon. This addon is " .. ((currentAddon.IsEnabled() and "|cff00ff00enabled|r") or "|cffff0000disabled|r") .. "."; | |
1363 | |
1364 if currentAddon.GetTotalCount and currentAddon.GetCharacterCount then | |
1365 t = t .. " This addon supports |cfffed000both total as local|r item counts."; | |
1366 elseif currentAddon.GetTotalCount then | |
1367 t = t .. " This addon supports |cfffed000only total|r item counts."; | |
1368 elseif currentAddon.GetCharacterCount then | |
1369 t = t .. " This addon supports |cfffed000only local|r item counts."; | |
1370 end | |
1371 | |
1372 if preferedAddon ~= selectedAddonName then | |
1373 t = t .. "\n\n|cffff0000You have selected |cfffed000" .. preferedAddon .. "|r|cffff0000 as your item count addon, but this appears to be disabled and thus a random alternative was selected.|r"; | |
1374 end | |
1375 end | 1387 end |
1376 | 1388 |
1377 return t; | 1389 return t; |
1378 end, | 1390 end, |
1379 }, | 1391 }, |
1380 header = { | 1392 header = { |
1381 order = 5, | 1393 order = 5, |
1382 type = "header", | 1394 type = "header", |
1383 name = "", | 1395 name = "", |
1384 }, | 1396 }, |
1385 auctionPricingAddon = { | 1397 trackAtCharacters = { |
1386 order = 10, | 1398 order = 10, |
1387 type = "select", | 1399 type = "multiselect", |
1388 name = "Prefered pricing addon", | 1400 width = "double", |
1389 desc = "Select the addon you prefer data to be retrieved from. A random supported addon will be used if the selected addon can not be found.", | 1401 name = "Track at these characters:", |
1402 desc = "Select at which characters this should appear in the summary and generate alerts.", | |
1390 values = function() | 1403 values = function() |
1391 local temp = {}; | 1404 local temp = {}; |
1392 for name, value in pairs(addon.supportedAddons.auctionPricing) do | 1405 for charName in pairs(addon.db.factionrealm.characters) do |
1393 temp[name] = name; | 1406 temp[charName] = charName; |
1394 end | 1407 end |
1395 | 1408 |
1396 return temp; | 1409 return temp; |
1397 end, | 1410 end, |
1398 get = function() return addon.db.profile.defaults.auctionPricingAddon; end, | 1411 get = function(i, v) |
1399 set = function(i, v) | 1412 return addon.db.profile.defaults.trackAtCharacters[v]; |
1400 addon.db.profile.defaults.auctionPricingAddon = v; | |
1401 | |
1402 if addon.supportedAddons.auctionPricing[v].OnSelect then | |
1403 addon.supportedAddons.auctionPricing[v].OnSelect(); | |
1404 end | |
1405 end, | 1413 end, |
1406 }, | 1414 set = function(i, v, e) |
1407 itemCountAddon = { | 1415 addon.db.profile.defaults.trackAtCharacters[v] = e or nil; |
1416 end, | |
1417 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
1418 }, | |
1419 localItemData = { | |
1408 order = 20, | 1420 order = 20, |
1409 type = "select", | |
1410 name = "Prefered item count addon", | |
1411 desc = "Select the addon you prefer data to be retrieved from. A random supported addon will be used if the selected addon can not be found.", | |
1412 values = function() | |
1413 local temp = {}; | |
1414 for name, value in pairs(addon.supportedAddons.itemCount) do | |
1415 temp[name] = name; | |
1416 end | |
1417 | |
1418 return temp; | |
1419 end, | |
1420 get = function() return addon.db.profile.defaults.itemCountAddon; end, | |
1421 set = function(i, v) | |
1422 addon.db.profile.defaults.itemCountAddon = v; | |
1423 | |
1424 if addon.supportedAddons.itemCount[v].OnSelect then | |
1425 addon.supportedAddons.itemCount[v].OnSelect(); | |
1426 end | |
1427 end, | |
1428 }, | |
1429 craftingAddon = { | |
1430 order = 30, | |
1431 type = "select", | |
1432 name = "Prefered crafting addon", | |
1433 desc = "Select the addon you prefer data to be queued into. A random supported addon will be used if the selected addon can not be found.", | |
1434 values = function() | |
1435 local temp = {}; | |
1436 for name, value in pairs(addon.supportedAddons.crafting) do | |
1437 temp[name] = name; | |
1438 end | |
1439 | |
1440 return temp; | |
1441 end, | |
1442 get = function() return addon.db.profile.defaults.craftingAddon; end, | |
1443 set = function(i, v) | |
1444 addon.db.profile.defaults.craftingAddon = v; | |
1445 | |
1446 if addon.supportedAddons.crafting[v].OnSelect then | |
1447 addon.supportedAddons.crafting[v].OnSelect(); | |
1448 end | |
1449 end, | |
1450 }, | |
1451 localItemData = { | |
1452 order = 40, | |
1453 type = "multiselect", | 1421 type = "multiselect", |
1422 width = "double", | |
1454 name = "Include in local item data", | 1423 name = "Include in local item data", |
1455 desc = "Select which data should be included in the local item data.", | 1424 desc = "Select which data should be included in the local item data.", |
1456 values = { | 1425 values = { |
1457 ["Bag"] = "Bag", | 1426 ["Bag"] = "Bag", |
1458 ["Bank"] = "Bank", | 1427 ["Bank"] = "Bank", |
1542 name = "Show in summary when below", | 1511 name = "Show in summary when below", |
1543 desc = "Show items in the summary when below this percentage of the minimum stock. This can be either below the minimum or the global stock.", | 1512 desc = "Show items in the summary when below this percentage of the minimum stock. This can be either below the minimum or the global stock.", |
1544 get = function() return addon.db.profile.defaults.summaryThresholdShow; end, | 1513 get = function() return addon.db.profile.defaults.summaryThresholdShow; end, |
1545 set = function(i, v) addon.db.profile.defaults.summaryThresholdShow = v; end, | 1514 set = function(i, v) addon.db.profile.defaults.summaryThresholdShow = v; end, |
1546 }, | 1515 }, |
1547 trackAtCharacters = { | |
1548 order = 40, | |
1549 type = "multiselect", | |
1550 name = "Track at", | |
1551 desc = "Select at which characters this should appear in the summary and generate alerts.", | |
1552 values = function() | |
1553 local temp = {}; | |
1554 for charName in pairs(addon.db.factionrealm.characters) do | |
1555 temp[charName] = charName; | |
1556 end | |
1557 | |
1558 return temp; | |
1559 end, | |
1560 get = function(i, v) | |
1561 return addon.db.profile.defaults.trackAtCharacters[v]; | |
1562 end, | |
1563 set = function(i, v, e) | |
1564 addon.db.profile.defaults.trackAtCharacters[v] = e or nil; | |
1565 end, | |
1566 dialogControl = "Dropdown", -- this is not standard, normal multiselect control gives us a list of all chars with toggle-boxes. UGLY! We want a multiselect-box instead. | |
1567 }, | |
1568 }, | 1516 }, |
1569 }, | 1517 }, |
1570 refill = { | 1518 refill = { |
1571 order = 20, | 1519 order = 20, |
1572 type = "group", | 1520 type = "group", |
1649 type = "toggle", | 1597 type = "toggle", |
1650 name = "Always show auction value", | 1598 name = "Always show auction value", |
1651 desc = "Always cache and show the auction value of items, even if the price threshold is set to 0|cffeda55fc|r.", | 1599 desc = "Always cache and show the auction value of items, even if the price threshold is set to 0|cffeda55fc|r.", |
1652 get = function() return addon.db.profile.defaults.alwaysGetAuctionValue; end, | 1600 get = function() return addon.db.profile.defaults.alwaysGetAuctionValue; end, |
1653 set = function(i, v) addon.db.profile.defaults.alwaysGetAuctionValue = v; end, | 1601 set = function(i, v) addon.db.profile.defaults.alwaysGetAuctionValue = v; end, |
1602 }, | |
1603 }, | |
1604 }, | |
1605 addon = { | |
1606 order = 30, | |
1607 type = "group", | |
1608 inline = true, | |
1609 name = "Prefered addons", | |
1610 args = { | |
1611 description = { | |
1612 order = 0, | |
1613 type = "description", | |
1614 name = function() | |
1615 local t = ""; | |
1616 if not addon.db.profile.defaults.hideHelp then | |
1617 t = "Selecting your prefered addons is optional, the first working addon will be used if the selected addon doesn't exist. You only need to set this when you are running multiple addons of a kind and wish to specify which addons to use for what groups.\n\n"; | |
1618 end | |
1619 | |
1620 local currentAddon, selectedAddonName = addon:GetItemCountAddon(); | |
1621 local preferedAddon = addon.db.profile.defaults.itemCountAddon; | |
1622 | |
1623 if currentAddon then | |
1624 t = t .. "Currently using |cfffed000" .. selectedAddonName .. "|r as your item count addon. This addon is " .. ((currentAddon.IsEnabled() and "|cff00ff00enabled|r") or "|cffff0000disabled|r") .. "."; | |
1625 | |
1626 if currentAddon.GetTotalCount and currentAddon.GetCharacterCount then | |
1627 t = t .. " This addon supports |cfffed000both total as local|r item counts."; | |
1628 elseif currentAddon.GetTotalCount then | |
1629 t = t .. " This addon supports |cfffed000only total|r item counts."; | |
1630 elseif currentAddon.GetCharacterCount then | |
1631 t = t .. " This addon supports |cfffed000only local|r item counts."; | |
1632 end | |
1633 | |
1634 if preferedAddon ~= selectedAddonName then | |
1635 t = t .. "\n\n|cffff0000You have selected |cfffed000" .. preferedAddon .. "|r|cffff0000 as your item count addon, but this appears to be disabled and thus a random alternative was selected.|r"; | |
1636 end | |
1637 end | |
1638 | |
1639 return t; | |
1640 end, | |
1641 }, | |
1642 header = { | |
1643 order = 5, | |
1644 type = "header", | |
1645 name = "", | |
1646 }, | |
1647 auctionPricingAddon = { | |
1648 order = 10, | |
1649 type = "select", | |
1650 name = "Prefered pricing addon", | |
1651 desc = "Select the addon you prefer data to be retrieved from. A random supported addon will be used if the selected addon can not be found.", | |
1652 values = function() | |
1653 local temp = {}; | |
1654 for name, value in pairs(addon.supportedAddons.auctionPricing) do | |
1655 temp[name] = name; | |
1656 end | |
1657 | |
1658 return temp; | |
1659 end, | |
1660 get = function() return addon.db.profile.defaults.auctionPricingAddon; end, | |
1661 set = function(i, v) | |
1662 addon.db.profile.defaults.auctionPricingAddon = v; | |
1663 | |
1664 if addon.supportedAddons.auctionPricing[v].OnSelect then | |
1665 addon.supportedAddons.auctionPricing[v].OnSelect(); | |
1666 end | |
1667 end, | |
1668 }, | |
1669 itemCountAddon = { | |
1670 order = 20, | |
1671 type = "select", | |
1672 name = "Prefered item count addon", | |
1673 desc = "Select the addon you prefer data to be retrieved from. A random supported addon will be used if the selected addon can not be found.", | |
1674 values = function() | |
1675 local temp = {}; | |
1676 for name, value in pairs(addon.supportedAddons.itemCount) do | |
1677 temp[name] = name; | |
1678 end | |
1679 | |
1680 return temp; | |
1681 end, | |
1682 get = function() return addon.db.profile.defaults.itemCountAddon; end, | |
1683 set = function(i, v) | |
1684 addon.db.profile.defaults.itemCountAddon = v; | |
1685 | |
1686 if addon.supportedAddons.itemCount[v].OnSelect then | |
1687 addon.supportedAddons.itemCount[v].OnSelect(); | |
1688 end | |
1689 end, | |
1690 }, | |
1691 craftingAddon = { | |
1692 order = 30, | |
1693 type = "select", | |
1694 name = "Prefered crafting addon", | |
1695 desc = "Select the addon you prefer data to be queued into. A random supported addon will be used if the selected addon can not be found.", | |
1696 values = function() | |
1697 local temp = {}; | |
1698 for name, value in pairs(addon.supportedAddons.crafting) do | |
1699 temp[name] = name; | |
1700 end | |
1701 | |
1702 return temp; | |
1703 end, | |
1704 get = function() return addon.db.profile.defaults.craftingAddon; end, | |
1705 set = function(i, v) | |
1706 addon.db.profile.defaults.craftingAddon = v; | |
1707 | |
1708 if addon.supportedAddons.crafting[v].OnSelect then | |
1709 addon.supportedAddons.crafting[v].OnSelect(); | |
1710 end | |
1711 end, | |
1654 }, | 1712 }, |
1655 }, | 1713 }, |
1656 }, | 1714 }, |
1657 }, | 1715 }, |
1658 }; | 1716 }; |