Skip to content

Commit d56a9c8

Browse files
Fix emission textures appearing stretched on Giant cards
1 parent 915d9ae commit d56a9c8

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Fixed Act 2 Tutor sequence softlocking when there are no cards to display
44
- Fixed Act 2 Tutor sequence not displaying cards when you have less than 7 cards remaining in your deck
55
- Fixed Gemify affecting Blood cost when it shouldn't
6+
- Fixed emission textures appearing stretched on Giant cards
67
- Added Gems Cost support for ExtendedActivatedAbilityBehaviour class
78
- Added extension AbilityManager.FullAbility.FlipYIfOpponent
89
- Add config option to prevent Act 1 card emissions from rendering above the play costs
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using DiskCardGame;
2+
using HarmonyLib;
3+
using InscryptionAPI.Card;
4+
using InscryptionAPI.Helpers;
5+
using UnityEngine;
6+
7+
namespace InscryptionCommunityPatch.Card;
8+
9+
[HarmonyPatch]
10+
internal class GiantCardEmissionAspectFix {
11+
/// <summary>
12+
/// Changes the emissioner render camera's aspect ratio for Giant cards so emission texture don't appear stretched.
13+
/// Aspect number taken from the base texture renderer's aspect ratio.
14+
/// </summary>
15+
[HarmonyPostfix, HarmonyPatch(typeof(CardRenderCamera), nameof(CardRenderCamera.TryCreateCameraForLiveRender))]
16+
private static void FixGiantEmissionCameraAspectRatio(CardRenderCamera __instance, RenderStatsLayer layer) {
17+
if (!__instance.liveRenderCameras.ContainsKey(layer) || layer is not RenderLiveStatsLayer live || !live.Giant) {
18+
return;
19+
}
20+
Transform emissionRenderCam = __instance.liveRenderCameras[layer].transform.Find("EmissionRenderCamera");
21+
emissionRenderCam.GetComponent<Camera>().aspect = 1.434f;
22+
emissionRenderCam.GetComponent<SetCameraAspect>().defaultAspect = 1.434f;
23+
}
24+
}

0 commit comments

Comments
 (0)