shader ID update

This commit is contained in:
XtraCube committed 2024-08-20 00:04:35 -04:00
1 parent ca828ea388
commit 05bc3561d9
3 files changed
+47 -47

No files matched your search

@@ -51,8 +51,8 @@ public static class GameOptionsMenuPatch
foreach (TextMeshPro textMeshPro in newOpt.GetComponentsInChildren<TextMeshPro>(true))
{
if (group.GroupColor != Color.clear) textMeshPro.color = group.GroupColor.DarkenColor();
textMeshPro.fontMaterial.SetFloat(ShaderID._StencilComp, 3f);
textMeshPro.fontMaterial.SetFloat(ShaderID._Stencil, 20);
textMeshPro.fontMaterial.SetFloat(ShaderID.StencilComp, 3f);
textMeshPro.fontMaterial.SetFloat(ShaderID.Stencil, 20);
}
__instance.Children.Add(newOpt);
@@ -83,8 +83,8 @@ public static class GameOptionsMenuPatch
}
foreach (TextMeshPro textMeshPro in newOpt.GetComponentsInChildren<TextMeshPro>(true))
{
textMeshPro.fontMaterial.SetFloat(ShaderID._StencilComp, 3f);
textMeshPro.fontMaterial.SetFloat(ShaderID._Stencil, 20);
textMeshPro.fontMaterial.SetFloat(ShaderID.StencilComp, 3f);
textMeshPro.fontMaterial.SetFloat(ShaderID.Stencil, 20);
}
__instance.Children.Add(newOpt);
@@ -145,8 +145,8 @@ public static class RoleSettingMenuPatches
}
foreach (TextMeshPro textMeshPro in newOpt.GetComponentsInChildren<TextMeshPro>(true))
{
textMeshPro.fontMaterial.SetFloat(ShaderID._StencilComp, 3f);
textMeshPro.fontMaterial.SetFloat(ShaderID._Stencil, 20);
textMeshPro.fontMaterial.SetFloat(ShaderID.StencilComp, 3f);
textMeshPro.fontMaterial.SetFloat(ShaderID.Stencil, 20);
}
newOpt.LabelBackground.enabled = false;
+41 -41
View File
@@ -5,96 +5,96 @@ namespace MiraAPI.Utilities;
public static class ShaderID
{
private static readonly Dictionary<string, int> _cache = new();
private static readonly Dictionary<string, int> Cache = new();
public static int Get(string name)
{
if (_cache.TryGetValue(name, out var id))
if (Cache.TryGetValue(name, out var id))
{
return id;
}
id = Shader.PropertyToID(name);
_cache[name] = id;
Cache[name] = id;
return id;
}
// For player shader
public static readonly int _BodyColor = Shader.PropertyToID("_BodyColor");
public static readonly int _BackColor = Shader.PropertyToID("_BackColor");
public static readonly int _VisorColor = Shader.PropertyToID("_VisorColor");
public static readonly int BodyColor = Shader.PropertyToID("_BodyColor");
public static readonly int BackColor = Shader.PropertyToID("_BackColor");
public static readonly int VisorColor = Shader.PropertyToID("_VisorColor");
// Main texture, very obviously used in any shader with a texture
public static readonly int _MainTex = Shader.PropertyToID("_MainTex");
public static readonly int MainTex = Shader.PropertyToID("_MainTex");
// Any masking stuff, like MeetingHud bubbles
public static readonly int _Mask = Shader.PropertyToID("_Mask");
public static readonly int _MaskComp = Shader.PropertyToID("_MaskComp");
public static readonly int _MaskLayer = Shader.PropertyToID("_MaskLayer");
public static readonly int _Stencil = Shader.PropertyToID("_Stencil");
public static readonly int _StencilComp = Shader.PropertyToID("_StencilComp");
public static readonly int Mask = Shader.PropertyToID("_Mask");
public static readonly int MaskComp = Shader.PropertyToID("_MaskComp");
public static readonly int MaskLayer = Shader.PropertyToID("_MaskLayer");
public static readonly int Stencil = Shader.PropertyToID("_Stencil");
public static readonly int StencilComp = Shader.PropertyToID("_StencilComp");
// Used in many tasks
public static readonly int _Color = Shader.PropertyToID("_Color");
public static readonly int Color = Shader.PropertyToID("_Color");
// Has 2 uses in the game, provided for convenience
public static readonly int _Opacity = Shader.PropertyToID("_Opacity");
public static readonly int Opacity = Shader.PropertyToID("_Opacity");
// Used once in CooldownHelpers, once in PowerBarMining
public static readonly int _NormalizedUvs = Shader.PropertyToID("_NormalizedUvs");
public static readonly int NormalizedUvs = Shader.PropertyToID("_NormalizedUvs");
// Used in many consoles
public static readonly int _Outline = Shader.PropertyToID("_Outline");
public static readonly int _OutlineColor = Shader.PropertyToID("_OutlineColor");
public static readonly int Outline = Shader.PropertyToID("_Outline");
public static readonly int OutlineColor = Shader.PropertyToID("_OutlineColor");
// Used in some consoles
public static readonly int _AddColor = Shader.PropertyToID("_AddColor");
public static readonly int AddColor = Shader.PropertyToID("_AddColor");
// Has some uses in various locations
public static readonly int _Percent = Shader.PropertyToID("_Percent");
public static readonly int _PercentY = Shader.PropertyToID("_PercentY");
public static readonly int _Desat = Shader.PropertyToID("_Desat");
public static readonly int Percent = Shader.PropertyToID("_Percent");
public static readonly int PercentY = Shader.PropertyToID("_PercentY");
public static readonly int Desat = Shader.PropertyToID("_Desat");
// Used in LightSource
public static readonly int _PlayerRadius = Shader.PropertyToID("_PlayerRadius");
public static readonly int _LightRadius = Shader.PropertyToID("_LightRadius");
public static readonly int _LightOffset = Shader.PropertyToID("_LightOffset");
public static readonly int _FlashlightSize = Shader.PropertyToID("_FlashlightSize");
public static readonly int _FlashlightAngle = Shader.PropertyToID("_FlashlightAngle");
public static readonly int PlayerRadius = Shader.PropertyToID("_PlayerRadius");
public static readonly int LightRadius = Shader.PropertyToID("_LightRadius");
public static readonly int LightOffset = Shader.PropertyToID("_LightOffset");
public static readonly int FlashlightSize = Shader.PropertyToID("_FlashlightSize");
public static readonly int FlashlightAngle = Shader.PropertyToID("_FlashlightAngle");
// Used once for LightSourceGpuRenderer
public static readonly int _DepthCompressionValue = Shader.PropertyToID("_DepthCompressionValue");
public static readonly int DepthCompressionValue = Shader.PropertyToID("_DepthCompressionValue");
// Used in ProgressTracker
public static readonly int _Buckets = Shader.PropertyToID("_Buckets");
public static readonly int _FullBuckets = Shader.PropertyToID("_FullBuckets");
public static readonly int Buckets = Shader.PropertyToID("_Buckets");
public static readonly int FullBuckets = Shader.PropertyToID("_FullBuckets");
// Used once in IntroCutscene and EndGameManager
public static readonly int _Rad = Shader.PropertyToID("_Rad");
public static readonly int Rad = Shader.PropertyToID("_Rad");
// Used only once for Quick Chat
public static readonly int _FaceColor = Shader.PropertyToID("_FaceColor");
public static readonly int FaceColor = Shader.PropertyToID("_FaceColor");
// Used for NavigationMinigame
public static readonly int _CrossHair = Shader.PropertyToID("_CrossHair");
public static readonly int _CrossColor = Shader.PropertyToID("_CrossColor");
public static readonly int CrossHair = Shader.PropertyToID("_CrossHair");
public static readonly int CrossColor = Shader.PropertyToID("_CrossColor");
// Used for both SurveillanceMinigame (Planet and Normal)
public static readonly int _Center = Shader.PropertyToID("_Center");
public static readonly int _Color2 = Shader.PropertyToID("_Color2");
public static readonly int Center = Shader.PropertyToID("_Center");
public static readonly int Color2 = Shader.PropertyToID("_Color2");
// Used in ReactorShipRoom
public static readonly int _Speed = Shader.PropertyToID("_Speed");
public static readonly int Speed = Shader.PropertyToID("_Speed");
// Used only once in CourseMinigame
public static readonly int _AltTex = Shader.PropertyToID("_AltTex");
public static readonly int _Perc = Shader.PropertyToID("_Perc");
public static readonly int AltTex = Shader.PropertyToID("_AltTex");
public static readonly int Perc = Shader.PropertyToID("_Perc");
// Used once in TextMarquee
public static readonly int _VertexOffsetX = Shader.PropertyToID("_VertexOffsetX");
public static readonly int _VertexOffsetY = Shader.PropertyToID("_VertexOffsetY");
public static readonly int VertexOffsetX = Shader.PropertyToID("_VertexOffsetX");
public static readonly int VertexOffsetY = Shader.PropertyToID("_VertexOffsetY");
// Used in VertLineBehaviour
public static readonly int _Fade = Shader.PropertyToID("_Fade");
public static readonly int Fade = Shader.PropertyToID("_Fade");
}