Upload from upload_mods.ps1
This commit is contained in:
43
Harmony/Harmony_XUiC_TraderItemEntry.cs
Normal file
43
Harmony/Harmony_XUiC_TraderItemEntry.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
namespace Harmony.XUiC_TraderItemEntryPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(XUiC_TraderItemEntry))]
|
||||
[HarmonyPatch("GetBindingValue")]
|
||||
public class GetBindingValuePatch
|
||||
{
|
||||
public static void Postfix(XUiC_TraderItemEntry __instance, bool __result, ref string value, string bindingName)
|
||||
{
|
||||
if (bindingName == "itemtypeicon")
|
||||
{
|
||||
if (RebirthUtilities.ScenarioSkip() && __instance.item != null && !__instance.item.IsEmpty())
|
||||
{
|
||||
ItemValue itemValue = __instance.item.itemValue;
|
||||
|
||||
if (itemValue != null &&
|
||||
itemValue.HasMetadata("bonus") &&
|
||||
itemValue.HasMetadata("level") &&
|
||||
itemValue.HasMetadata("type") &&
|
||||
itemValue.HasMetadata("active"))
|
||||
{
|
||||
value = (string)itemValue.GetMetadata("bonus");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bindingName == "hasitemtypeicon")
|
||||
{
|
||||
if (RebirthUtilities.ScenarioSkip() && __instance.item != null && !__instance.item.IsEmpty())
|
||||
{
|
||||
ItemValue itemValue = __instance.item.itemValue;
|
||||
|
||||
if (itemValue != null &&
|
||||
itemValue.HasMetadata("bonus") &&
|
||||
itemValue.HasMetadata("level") &&
|
||||
itemValue.HasMetadata("type") &&
|
||||
itemValue.HasMetadata("active"))
|
||||
{
|
||||
value = "true";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user