47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using static Unity.IO.LowLevel.Unsafe.AsyncReadManagerMetrics;
|
|
|
|
namespace Harmony.XUiC_EquipmentStackPatches
|
|
{
|
|
[HarmonyPatch(typeof(XUiC_EquipmentStack))]
|
|
[HarmonyPatch("Update")]
|
|
public class UpdatePatch
|
|
{
|
|
public static void Postfix(XUiC_EquipmentStack __instance, float _dt)
|
|
{
|
|
if (RebirthUtilities.ScenarioSkip())
|
|
{
|
|
if (__instance.stackValue != null)
|
|
{
|
|
XUiV_Label viewComponent = (XUiV_Label)__instance.stackValue.ViewComponent;
|
|
viewComponent.Text = "";
|
|
|
|
ItemValue itemValue = __instance.itemStack.itemValue;
|
|
|
|
XUiV_Sprite bonusTypeIconSprite = (XUiV_Sprite)__instance.GetChildById("bonusTypeIcon").ViewComponent;
|
|
|
|
if (itemValue != null &&
|
|
itemValue.HasMetadata("bonus") &&
|
|
itemValue.HasMetadata("level") &&
|
|
itemValue.HasMetadata("type") &&
|
|
itemValue.HasMetadata("active"))
|
|
{
|
|
bonusTypeIconSprite.SpriteName = "ui_game_symbol_" + (string)itemValue.GetMetadata("bonus");
|
|
}
|
|
else
|
|
{
|
|
if (!itemValue.IsMod)
|
|
{
|
|
bonusTypeIconSprite.SpriteName = "";
|
|
}
|
|
}
|
|
|
|
bonusTypeIconSprite.isDirty = true;
|
|
|
|
/*(__instance.lockTypeIcon.ViewComponent as XUiV_Sprite).SpriteName = "";
|
|
(__instance.lockTypeIcon.ViewComponent as XUiV_Sprite).isDirty = true;*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|