Fix role screenshots for combined spritesheets

This commit is contained in:
Atony committed 2026-08-15 16:27:49 -05:00
1 parent 57d2a6a9b5
commit 411340d9e9
2 files changed
+14 -10

No files matched your search

@@ -545,11 +545,8 @@ public static class RoleSettingMenuPatches
__instance.roleDescriptionText.transform.parent.localScale = new Vector3(0.0675f, 0.1494f, 0.5687f);
labelBg.transform.localPosition = new Vector3(1.082f, 0.1054f, -2.5f);
__instance.roleScreenshot.sprite = Sprite.Create(
role.RoleScreenshot.texture,
new Rect(0, 0, 370, 230),
Vector2.one / 2,
100);
__instance.roleScreenshot.sprite = role.RoleScreenshot;
__instance.roleScreenshot.drawMode = SpriteDrawMode.Simple;
}
__instance.roleHeaderSprite.color = customRole.OptionsMenuColor;
+12 -5
View File
@@ -141,11 +141,18 @@ public static class CustomRoleManager
roleBehaviour.CanVent = customRole.Configuration.CanUseVent || customRole.Configuration.GetsVentData;
roleBehaviour.DefaultGhostRole = customRole.Configuration.GhostRole;
roleBehaviour.MaxCount = customRole.Configuration.MaxRoleCount;
roleBehaviour.RoleScreenshot = Sprite.Create(
customRole.Configuration.OptionsScreenshot?.LoadAsset().texture,
new Rect(0, 0, 370, 230),
Vector2.one / 2,
100);
if (customRole.Configuration.OptionsScreenshot != null)
{
roleBehaviour.RoleScreenshot = customRole.Configuration.OptionsScreenshot.LoadAsset();
}
else
{
roleBehaviour.RoleScreenshot = Sprite.Create(
null,
new Rect(0, 0, 370, 230),
Vector2.one / 2,
100);
}
_emptySettings ??= new(0);
_emptyKillAnimations ??= new(0);