fix(vendors): Adds an option to turn OPL off for vendor buying. Defaults to on. (#721)

This commit is contained in:
Kamron Batman 2021-08-23 11:36:26 -07:00 committed by GitHub
parent 9729b5a7b0
commit dd62e17693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,17 @@ namespace Server.Mobiles
private readonly List<IBuyItemInfo> _buyInfo = new(); private readonly List<IBuyItemInfo> _buyInfo = new();
private readonly List<IShopSellInfo> _sellInfo = new(); private readonly List<IShopSellInfo> _sellInfo = new();
private static bool EnableVendorBuyOPL;
public static void Configure()
{
// Turn off to remove tooltips while buying items
// CUO is not compatible with this turned off
// Also items may require a string description for their name to show up properly.
// See SBAnimalTrainer for an example
EnableVendorBuyOPL = ServerConfiguration.GetSetting("opl.enableForVendorBuy", true);
}
public static void Initialize() public static void Initialize()
{ {
// This is technically more work than making timers, but we don't to deplete the timer pool immediately. // This is technically more work than making timers, but we don't to deplete the timer pool immediately.
@ -865,9 +876,7 @@ namespace Server.Mobiles
var list = new List<BuyItemState>(buyInfo.Length); var list = new List<BuyItemState>(buyInfo.Length);
var cont = BuyPack; var cont = BuyPack;
// If OPL is disabled and the item being purchased has the wrong name, then you must specify the name manually. var opls = EnableVendorBuyOPL ? new List<ObjectPropertyList>(buyInfo.Length) : null;
// Check SBAnimalTrainer for an example.
var opls = ObjectPropertyList.Enabled ? new List<ObjectPropertyList>(buyInfo.Length) : null;
for (var idx = 0; idx < buyInfo.Length; idx++) for (var idx = 0; idx < buyInfo.Length; idx++)
{ {