Disable add offer context menu for status reasons (level, banned, disabled)
This commit is contained in:
@@ -137,15 +137,23 @@ public static class AddOfferContextMenuPatches
|
|||||||
|
|
||||||
ISession session = PatchConstants.BackEndSession;
|
ISession session = PatchConstants.BackEndSession;
|
||||||
RagFairClass ragfair = session.RagFair;
|
RagFairClass ragfair = session.RagFair;
|
||||||
|
if (ragfair.Status != RagFairClass.ERagFairStatus.Available)
|
||||||
|
{
|
||||||
|
__result = new FailedResult(ragfair.GetFormattedStatusDescription());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ragfair.MyOffersCount >= ragfair.GetMaxOffersCount(ragfair.MyRating))
|
if (ragfair.MyOffersCount >= ragfair.GetMaxOffersCount(ragfair.MyRating))
|
||||||
{
|
{
|
||||||
__result = new FailedResult("ragfair/Reached maximum amount of offers");
|
__result = new FailedResult("ragfair/Reached maximum amount of offers");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RagfairOfferSellHelperClass ragfairHelper = new(session.Profile, session.Profile.Inventory.Stash.Grid);
|
RagfairOfferSellHelperClass ragfairHelper = new(session.Profile, session.Profile.Inventory.Stash.Grid);
|
||||||
if (!ragfairHelper.method_4(___item_0, out string error))
|
if (!ragfairHelper.method_4(___item_0, out string error))
|
||||||
{
|
{
|
||||||
__result = new FailedResult(error);
|
__result = new FailedResult(error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user