fix(vendors): Adds an option to turn OPL off for vendor buying. Defaults to on. (#721)
This commit is contained in:
parent
9729b5a7b0
commit
dd62e17693
1 changed files with 12 additions and 3 deletions
|
|
@ -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++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue