Skip to content

Commit b96ba23

Browse files
committed
Add custom font material for holograms
1 parent 4be7348 commit b96ba23

12 files changed

Lines changed: 259 additions & 13 deletions

plugin/FontManager.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ public class FontManager
1010
{
1111
public static AssetBundle assetBundle = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("Risk_of_Rain_2_Ukrainian.ukrainianfont"));
1212
public static TMP_FontAsset fontBomb;
13+
public static Material dropshadowMaterial;
14+
public static Material hologramMaterial;
1315
public static TMP_FontAsset fontBombDefault;
1416

1517
public FontManager()
1618
{
1719
fontBomb = assetBundle.LoadAsset<TMP_FontAsset>("Assets/BOMBARD+Ukrainian.asset");
20+
dropshadowMaterial = assetBundle.LoadAsset<Material>("Assets/BOMBARD+Ukrainian.dropshadow.mat");
21+
hologramMaterial = assetBundle.LoadAsset<Material>("Assets/BOMBARD+Ukrainian.hologram.mat");
22+
1823
fontBombDefault = Resources.Load<TMP_FontAsset>("TmpFonts/Bombardier/tmpBombDropShadow");
1924

2025
On.RoR2.UI.HGTextMeshProUGUI.OnCurrentLanguageChanged += HGTextMeshProUGUI_OnCurrentLanguageChanged;
@@ -26,7 +31,13 @@ public void OnLoadFontAsset(Action<TMP_Text> orig, TMP_Text self)
2631
{
2732
orig(self);
2833
if (self.font == fontBombDefault)
34+
{
2935
self.font = fontBomb;
36+
if (self is TextMeshProUGUI)
37+
self.fontMaterial = dropshadowMaterial;
38+
if (self is TextMeshPro)
39+
self.fontMaterial = hologramMaterial;
40+
}
3041
}
3142

3243
public void HGTextMeshProUGUI_OnCurrentLanguageChanged(On.RoR2.UI.HGTextMeshProUGUI.orig_OnCurrentLanguageChanged orig)

plugin/ukrainianfont

1.2 KB
Binary file not shown.
1 Byte
Binary file not shown.

unityproj-fonts/Assets/AssetBundles/AssetBundles.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ManifestFileVersion: 0
2-
CRC: 1124634493
2+
CRC: 953972895
33
AssetBundleManifest:
44
AssetBundleInfos:
55
Info_0:
1.2 KB
Binary file not shown.

unityproj-fonts/Assets/AssetBundles/ukrainianfont.manifest

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ManifestFileVersion: 0
2-
CRC: 1782708304
2+
CRC: 1051516356
33
Hashes:
44
AssetFileHash:
55
serializedVersion: 2
6-
Hash: a07df33085156070ef4f0c4c534ec3d7
6+
Hash: a8c1268b7c8ed8cb9000710a2a216bb1
77
TypeTreeHash:
88
serializedVersion: 2
99
Hash: cd2ce5d3fdd560e91e83cbea97e6d53a
@@ -41,5 +41,7 @@ SerializeReferenceClassIdentifiers:
4141
- AssemblyName: UnityEngine.TextCoreFontEngineModule
4242
ClassName: UnityEngine.TextCore.GlyphRect
4343
Assets:
44+
- Assets/BOMBARD+Ukrainian.hologram.mat
4445
- Assets/BOMBARD+Ukrainian.asset
46+
- Assets/BOMBARD+Ukrainian.dropshadow.mat
4547
Dependencies: []

unityproj-fonts/Assets/BOMBARD+Ukrainian.asset

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ Material:
5656
m_PrefabAsset: {fileID: 0}
5757
m_Name: BOMBARD+Ukrainian Material
5858
m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3}
59-
m_ValidKeywords:
60-
- UNDERLAY_ON
59+
m_ValidKeywords: []
6160
m_InvalidKeywords: []
6261
m_LightmapFlags: 4
6362
m_EnableInstancingVariants: 0
@@ -165,9 +164,9 @@ MonoBehaviour:
165164
m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3}
166165
m_Name: BOMBARD+Ukrainian
167166
m_EditorClassIdentifier:
168-
hashCode: 1007033042
167+
hashCode: -487129496
169168
material: {fileID: -5778575303752313196}
170-
materialHashCode: 1804558002
169+
materialHashCode: 1856997320
171170
m_Version: 1.1.0
172171
m_SourceFontFileGUID: 2066ceba018714649bfbdabe0977c39c
173172
m_SourceFontFile_EditorRef: {fileID: 12800000, guid: 2066ceba018714649bfbdabe0977c39c,
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!21 &2100000
4+
Material:
5+
serializedVersion: 8
6+
m_ObjectHideFlags: 0
7+
m_CorrespondingSourceObject: {fileID: 0}
8+
m_PrefabInstance: {fileID: 0}
9+
m_PrefabAsset: {fileID: 0}
10+
m_Name: BOMBARD+Ukrainian.dropshadow
11+
m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3}
12+
m_ValidKeywords:
13+
- UNDERLAY_ON
14+
m_InvalidKeywords: []
15+
m_LightmapFlags: 4
16+
m_EnableInstancingVariants: 0
17+
m_DoubleSidedGI: 0
18+
m_CustomRenderQueue: -1
19+
stringTagMap: {}
20+
disabledShaderPasses: []
21+
m_SavedProperties:
22+
serializedVersion: 3
23+
m_TexEnvs:
24+
- _BumpMap:
25+
m_Texture: {fileID: 0}
26+
m_Scale: {x: 1, y: 1}
27+
m_Offset: {x: 0, y: 0}
28+
- _Cube:
29+
m_Texture: {fileID: 0}
30+
m_Scale: {x: 1, y: 1}
31+
m_Offset: {x: 0, y: 0}
32+
- _FaceTex:
33+
m_Texture: {fileID: 0}
34+
m_Scale: {x: 1, y: 1}
35+
m_Offset: {x: 0, y: 0}
36+
- _MainTex:
37+
m_Texture: {fileID: -6360730533354102814, guid: c8e86082eb655b14ba9f1bdd57fb586f,
38+
type: 2}
39+
m_Scale: {x: 1, y: 1}
40+
m_Offset: {x: 0, y: 0}
41+
- _OutlineTex:
42+
m_Texture: {fileID: 0}
43+
m_Scale: {x: 1, y: 1}
44+
m_Offset: {x: 0, y: 0}
45+
m_Ints: []
46+
m_Floats:
47+
- _Ambient: 0.5
48+
- _Bevel: 0.5
49+
- _BevelClamp: 0
50+
- _BevelOffset: 0
51+
- _BevelRoundness: 0
52+
- _BevelWidth: 0
53+
- _BumpFace: 0
54+
- _BumpOutline: 0
55+
- _ColorMask: 15
56+
- _CullMode: 0
57+
- _Diffuse: 0.5
58+
- _FaceDilate: 0
59+
- _FaceUVSpeedX: 0
60+
- _FaceUVSpeedY: 0
61+
- _GlowInner: 0.05
62+
- _GlowOffset: 0
63+
- _GlowOuter: 0.05
64+
- _GlowPower: 0.75
65+
- _GradientScale: 11
66+
- _LightAngle: 3.1416
67+
- _MaskSoftnessX: 0
68+
- _MaskSoftnessY: 0
69+
- _OutlineSoftness: 0
70+
- _OutlineUVSpeedX: 0
71+
- _OutlineUVSpeedY: 0
72+
- _OutlineWidth: 0
73+
- _PerspectiveFilter: 0.875
74+
- _Reflectivity: 10
75+
- _ScaleRatioA: 0.90909094
76+
- _ScaleRatioB: 0.7386364
77+
- _ScaleRatioC: 0.3693182
78+
- _ScaleX: 1
79+
- _ScaleY: 1
80+
- _ShaderFlags: 0
81+
- _Sharpness: 0
82+
- _SpecularPower: 2
83+
- _Stencil: 0
84+
- _StencilComp: 8
85+
- _StencilOp: 0
86+
- _StencilReadMask: 255
87+
- _StencilWriteMask: 255
88+
- _TextureHeight: 1024
89+
- _TextureWidth: 1024
90+
- _UnderlayDilate: 1
91+
- _UnderlayOffsetX: 1
92+
- _UnderlayOffsetY: -1
93+
- _UnderlaySoftness: 0
94+
- _VertexOffsetX: 0
95+
- _VertexOffsetY: 0
96+
- _WeightBold: 0.75
97+
- _WeightNormal: 0
98+
m_Colors:
99+
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
100+
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
101+
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
102+
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5}
103+
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
104+
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
105+
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
106+
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
107+
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
108+
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
109+
m_BuildTextureStacks: []

unityproj-fonts/Assets/BOMBARD+Ukrainian.dropshadow.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!21 &2100000
4+
Material:
5+
serializedVersion: 8
6+
m_ObjectHideFlags: 0
7+
m_CorrespondingSourceObject: {fileID: 0}
8+
m_PrefabInstance: {fileID: 0}
9+
m_PrefabAsset: {fileID: 0}
10+
m_Name: BOMBARD+Ukrainian.hologram
11+
m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3}
12+
m_ValidKeywords:
13+
- GLOW_ON
14+
- UNDERLAY_ON
15+
m_InvalidKeywords: []
16+
m_LightmapFlags: 4
17+
m_EnableInstancingVariants: 0
18+
m_DoubleSidedGI: 0
19+
m_CustomRenderQueue: -1
20+
stringTagMap: {}
21+
disabledShaderPasses: []
22+
m_SavedProperties:
23+
serializedVersion: 3
24+
m_TexEnvs:
25+
- _BumpMap:
26+
m_Texture: {fileID: 0}
27+
m_Scale: {x: 1, y: 1}
28+
m_Offset: {x: 0, y: 0}
29+
- _Cube:
30+
m_Texture: {fileID: 0}
31+
m_Scale: {x: 1, y: 1}
32+
m_Offset: {x: 0, y: 0}
33+
- _FaceTex:
34+
m_Texture: {fileID: 0}
35+
m_Scale: {x: 1, y: 1}
36+
m_Offset: {x: 0, y: 0}
37+
- _MainTex:
38+
m_Texture: {fileID: -6360730533354102814, guid: c8e86082eb655b14ba9f1bdd57fb586f,
39+
type: 2}
40+
m_Scale: {x: 1, y: 1}
41+
m_Offset: {x: 0, y: 0}
42+
- _OutlineTex:
43+
m_Texture: {fileID: 0}
44+
m_Scale: {x: 1, y: 1}
45+
m_Offset: {x: 0, y: 0}
46+
m_Ints: []
47+
m_Floats:
48+
- _Ambient: 0.5
49+
- _Bevel: 0.5
50+
- _BevelClamp: 0
51+
- _BevelOffset: 0
52+
- _BevelRoundness: 0
53+
- _BevelWidth: 0
54+
- _BumpFace: 0
55+
- _BumpOutline: 0
56+
- _ColorMask: 15
57+
- _CullMode: 0
58+
- _Diffuse: 0.5
59+
- _FaceDilate: 0
60+
- _FaceUVSpeedX: 0
61+
- _FaceUVSpeedY: 0
62+
- _GlowInner: 0.05
63+
- _GlowOffset: 0
64+
- _GlowOuter: 0.05
65+
- _GlowPower: 0.75
66+
- _GradientScale: 11
67+
- _LightAngle: 3.1416
68+
- _MaskSoftnessX: 0
69+
- _MaskSoftnessY: 0
70+
- _OutlineSoftness: 0
71+
- _OutlineUVSpeedX: 0
72+
- _OutlineUVSpeedY: 0
73+
- _OutlineWidth: 0
74+
- _PerspectiveFilter: 0.875
75+
- _Reflectivity: 10
76+
- _ScaleRatioA: 0.90909094
77+
- _ScaleRatioB: 0.7386364
78+
- _ScaleRatioC: 0.3693182
79+
- _ScaleX: 1
80+
- _ScaleY: 1
81+
- _ShaderFlags: 0
82+
- _Sharpness: 0
83+
- _SpecularPower: 2
84+
- _Stencil: 0
85+
- _StencilComp: 8
86+
- _StencilOp: 0
87+
- _StencilReadMask: 255
88+
- _StencilWriteMask: 255
89+
- _TextureHeight: 1024
90+
- _TextureWidth: 1024
91+
- _UnderlayDilate: 1
92+
- _UnderlayOffsetX: 1
93+
- _UnderlayOffsetY: -1
94+
- _UnderlaySoftness: 0
95+
- _VertexOffsetX: 0
96+
- _VertexOffsetY: 0
97+
- _WeightBold: 0.75
98+
- _WeightNormal: 0
99+
m_Colors:
100+
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
101+
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
102+
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
103+
- _GlowColor: {r: 1, g: 1, b: 1, a: 0.5}
104+
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
105+
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
106+
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
107+
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
108+
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
109+
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
110+
m_BuildTextureStacks: []

0 commit comments

Comments
 (0)