@@ -24,7 +24,7 @@ internal class LanguageSupport : Mod
2424
2525 public LanguageSupport ( ) : base ( "Language Support" )
2626 {
27- Log ( "!OnChangeFontByLanguageSetFont " ) ;
27+ Log ( "!LanguageSupport " ) ;
2828 Instance = this ;
2929
3030 _dir = Path . Combine ( Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ?? throw new DirectoryNotFoundException ( "I have no idea how you did this, but good luck figuring it out." ) , _folder ) ;
@@ -42,7 +42,7 @@ public LanguageSupport() : base("Language Support")
4242
4343 public override string GetVersion ( )
4444 {
45- Log ( "!OnChangeFontByLanguageSetFont " ) ;
45+ Log ( "!GetVersion " ) ;
4646 var asm = Assembly . GetExecutingAssembly ( ) ;
4747 var ver = asm . GetName ( ) . Version . ToString ( ) ;
4848 var sha1 = SHA1 . Create ( ) ;
@@ -56,7 +56,7 @@ public override string GetVersion()
5656
5757 public override void Initialize ( )
5858 {
59- Log ( "!OnChangeFontByLanguageSetFont " ) ;
59+ Log ( "!Initialize " ) ;
6060 Instance = this ;
6161
6262 foreach ( var t in Object . FindObjectsOfType < UnityEngine . UI . MenuLanguageSetting > ( ) ) t . RefreshControls ( ) ;
@@ -136,83 +136,10 @@ private void OnChangeFontByLanguageSetFont(On.ChangeFontByLanguage.orig_SetFont
136136 var tmp = ReflectionHelper . GetField < ChangeFontByLanguage , TextMeshPro > ( self , "tmpro" ) ;
137137 var tmpMat = _fa . material ;
138138 tmpMat . shader = tmp . font . material . shader ;
139- //tmpMat.SetTexture("_BumpMap", null);
140- //tmpMat.SetTexture("_Cube", null);
141- //tmpMat.SetTexture("_FaceTex", null);
142- //tmpMat.SetTexture("_MainTex", _fa.atlas);
143- //tmpMat.SetTexture("_OutlineTex", null);
144- //tmpMat.SetFloat("_Ambient", 0.5f);
145- //tmpMat.SetFloat("_Bevel", 0.5f);
146- //tmpMat.SetFloat("_BevelClamp", 0);
147- //tmpMat.SetFloat("_BevelOffset", 0);
148- //tmpMat.SetFloat("_BevelRoundness", 0);
149- //tmpMat.SetFloat("_BevelWidth", 0);
150- //tmpMat.SetFloat("_BumpFace", 0);
151- //tmpMat.SetFloat("_BumpOutline", 0);
152- //tmpMat.SetFloat("_ColorMask", 15);
153- //tmpMat.SetFloat("_Diffuse", 0.5f);
154- //tmpMat.SetFloat("_FaceDilate", 0);
155- //tmpMat.SetFloat("_FaceUVSpeedX", 0);
156- //tmpMat.SetFloat("_FaceUVSpeedY", 0);
157- //tmpMat.SetFloat("_GlowInner", 0.05f);
158- //tmpMat.SetFloat("_GlowOffset", 0);
159- //tmpMat.SetFloat("_GlowOuter", 0.05f);
160- //tmpMat.SetFloat("_GlowPower", 0.75f);
161- //tmpMat.SetFloat("_GradientScale", 5);
162- //tmpMat.SetFloat("_LightAngle", 3.1416f);
163- //tmpMat.SetFloat("_MaskID", 0);
164- //tmpMat.SetFloat("_MaskSoftnessX", 0);
165- //tmpMat.SetFloat("_MaskSoftnessY", 0);
166- //tmpMat.SetFloat("_OutlineSoftness", 0);
167- //tmpMat.SetFloat("_OutlineUVSpeedX", 0);
168- //tmpMat.SetFloat("_OutlineUVSpeedY", 0);
169- //tmpMat.SetFloat("_OutlineWidth", 0);
170- //tmpMat.SetFloat("_PerspectiveFilter", 0.875f);
171- //tmpMat.SetFloat("_Reflectivity", 10);
172- //tmpMat.SetFloat("_ScaleRatioA", 0.8f);
173- //tmpMat.SetFloat("_ScaleRatioB", 0.8f);
174- //tmpMat.SetFloat("_ScaleRatioC", 0.6504065f);
175- //tmpMat.SetFloat("_ScaleX", 1);
176- //tmpMat.SetFloat("_ScaleY", 1);
177- //tmpMat.SetFloat("_ShaderFlags", 0);
178- //tmpMat.SetFloat("_SpecularPower", 2);
179- //tmpMat.SetFloat("_Stencil", 0);
180- //tmpMat.SetFloat("_StencilComp", 8);
181- //tmpMat.SetFloat("_StencilOp", 0);
182- //tmpMat.SetFloat("_StencilReadMask", 255);
183- //tmpMat.SetFloat("_StencilWriteMask", 255);
184- //tmpMat.SetFloat("_TextureHeight", _fa.atlas.height);
185- //tmpMat.SetFloat("_TextureWidth", _fa.atlas.width);
186- //tmpMat.SetFloat("_UnderlayDilate", 0.23f);
187- //tmpMat.SetFloat("_UnderlayOffsetX", 0);
188- //tmpMat.SetFloat("_UnderlayOffsetY", 0);
189- //tmpMat.SetFloat("_UnderlaySoftness", 1);
190- //tmpMat.SetFloat("_VertexOffsetX", 0);
191- //tmpMat.SetFloat("_VertexOffsetY", 0);
192- //tmpMat.SetFloat("_WeightBold", 0.75f);
193- //tmpMat.SetFloat("_WeightNormal", 0);
194- //tmpMat.SetColor("_ClipRect", new Color(-10000, -10000, 10000, 10000));
195- //tmpMat.SetColor("_EnvMatrixRotation", new Color(0, 0, 0, 0));
196- //tmpMat.SetColor("_FaceColor", new Color(1, 1, 1, 1));
197- //tmpMat.SetColor("_GlowColor", new Color(0, 1, 0, 0.5f));
198- //tmpMat.SetColor("_MaskCoord", new Color(0, 0, 0, 0));
199- //tmpMat.SetColor("_OutlineCoord", new Color(0, 0, 0, 1));
200- //tmpMat.SetColor("_ReflectFaceColor", new Color(0, 0, 0, 1));
201- //tmpMat.SetColor("_ReflectOutlineColor", new Color(0, 0, 0, 1));
202- //tmpMat.SetColor("_SpecularColor", new Color(1, 1, 1, 1));
203- //tmpMat.SetColor("_UnderlayColor", new Color(0, 0, 0, 0.221f));
139+
204140 _fa . material = tmpMat ;
205141 tmp . font = _fa ;
206- //tmp.font.atlas = _fa.atlas;
207- //Dictionary<int, TMP_Glyph> tmpGlyphs = _fa.characterDictionary;
208- //foreach (var pair in tmpGlyphs)
209- //{
210- // pair.Value.y = (_fa.atlas.height - (pair.Value.y + (pair.Value.height / 2))) - (pair.Value.height / 2);
211- //}
212- //tmp.font.SetAttr("m_characterDictionary", tmpGlyphs);
213- //tmp.font.SetAttr("m_fontInfo", _fa.fontInfo);
214- //tmp.font.SetAttr("m_kerningDictionary", _fa.kerningDictionary);
215- //tmp.font.SetAttr("m_kerningInfo", _fa.kerningInfo);
142+
216143 ReflectionHelper . SetField < ChangeFontByLanguage , TextMeshPro > ( self , "tmpro" , tmp ) ;
217144 Log ( "~OnChangeFontByLanguageSetFont" ) ;
218145 }
0 commit comments