Skip to content

Commit d7a7183

Browse files
Fix rulebook icon scaling in Act 3
1 parent e3d3144 commit d7a7183

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

InscryptionAPI/Slots/SlotModificationManager.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ private static void AddSlotModificationsToRuleBook(AbilityMetaCategory metaCateg
566566
}
567567

568568
public const string SLOT_PAGEID = "SlotModification_";
569+
private static Vector3 PART_3_SCALE = new(0.7f, 0.7f, 1f);
569570

570571
[HarmonyPrefix, HarmonyPatch(typeof(ItemPage), nameof(ItemPage.FillPage))]
571572
private static bool OverrideWithSlotInfo(ItemPage __instance, string headerText, params object[] otherArgs)
@@ -574,7 +575,7 @@ private static bool OverrideWithSlotInfo(ItemPage __instance, string headerText,
574575
return true;
575576

576577
// Slot modification pages use ItemPage format in Act 1
577-
__instance.iconRenderer.transform.localScale = Vector3.one;
578+
__instance.iconRenderer.transform.localScale = SaveManager.SaveFile.IsPart3 ? PART_3_SCALE : Vector3.one;
578579
if (otherArgs[0] is string pageId && pageId.StartsWith(SLOT_PAGEID))
579580
{
580581
string modString = pageId.Replace(SLOT_PAGEID, "");
@@ -588,20 +589,21 @@ private static bool OverrideWithSlotInfo(ItemPage __instance, string headerText,
588589
__instance.nameTextMesh.text = Localization.Translate(info.RulebookName);
589590
__instance.descriptionTextMesh.text = Localization.Translate(info.RulebookDescription);
590591
__instance.iconRenderer.sprite = info.RulebookSprite;
591-
__instance.iconRenderer.transform.localScale = new(0.8f, 0.8f, 0.8f);
592+
__instance.iconRenderer.transform.localScale = new(0.8f, 0.8f, 1f);
592593
InscryptionAPIPlugin.Logger.LogDebug($"Create rulebook page for slot modification [{info.ModificationType}] ({info.RulebookName}).");
593594
return false;
594595
}
595596
}
596597
return true;
597598
}
599+
598600
[HarmonyPrefix, HarmonyPatch(typeof(AbilityPage), nameof(AbilityPage.FillPage))]
599601
private static bool OverrideWithSlotInfo(AbilityPage __instance, string headerText, params object[] otherArgs)
600602
{
601603
if (SaveManager.SaveFile.IsPart1)
602604
return true;
603605

604-
__instance.mainAbilityGroup.iconRenderer.transform.localScale = Vector3.one;
606+
__instance.mainAbilityGroup.iconRenderer.transform.localScale = SaveManager.SaveFile.IsPart3 ? PART_3_SCALE : Vector3.one;
605607
Transform slotRendererObj = __instance.mainAbilityGroup.transform.Find("SlotRenderer");
606608
slotRendererObj?.gameObject.SetActive(false);
607609
__instance.mainAbilityGroup.iconRenderer.transform.parent.gameObject.SetActive(true);
@@ -638,7 +640,7 @@ private static bool OverrideWithSlotInfo(AbilityPage __instance, string headerTe
638640
Debug.Log("Help");
639641
}
640642

641-
__instance.mainAbilityGroup.iconRenderer.transform.localScale = new(0.8f, 0.8f, 0.8f);
643+
__instance.mainAbilityGroup.iconRenderer.transform.localScale = new(0.8f, 0.8f, 1f);
642644
//InscryptionAPIPlugin.Logger.LogDebug($"Create rulebook page for slot modification [{info.ModificationType}] ({info.RulebookName}).");
643645
return false;
644646
}

0 commit comments

Comments
 (0)