update to unity 6 and fix line breaker

This commit is contained in:
2024-11-23 22:33:24 -05:00
parent 2b79f78b43
commit 01adfad8f5
47 changed files with 48648 additions and 497 deletions
+15 -13
View File
@@ -172,17 +172,17 @@ public class CMessageText
this.m_LineTop.bFlag = false;
this.m_isOver = false;
this.m_KeyCursor.Reset(true);
this.testWidth = 0;
}
// Token: 0x06000533 RID: 1331 RVA: 0x00014174 File Offset: 0x00012374
public void AddMessage(string szMsg, Color32 color, MSGFONTSIZE nFontType = MSGFONTSIZE.NORMAL, int nKeywordNo = -1)
{
int testWidth = 0;
// formatting for non-Japanese languages
if (UnityApp.Instance.locale != LocaleEnum.Japanese)
{
CMessageText.m_isHyphenation = true;
CMessageText.m_isHyphenation = false;
for (int i = 0; i < szMsg.Length; i++)
{
@@ -197,20 +197,20 @@ public class CMessageText
int nSize = FontDef.GetFontInfo(nFontType).nSize;
float num = (float)glyph.advance / (float)this.font.Font.charSize;
int num2 = (int)((float)nSize * num);
int num3 = (int)((float)nSize * ((float)glyph.height / (float)this.font.Font.charSize));
//int num3 = (int)((float)nSize * ((float)glyph.height / (float)this.font.Font.charSize));
num2 = (int)((float)num2 * FontDef.GetFontInfo(nFontType).fStretch);
num3 = (int)((float)num3 * FontDef.GetFontInfo(nFontType).fStretch);
//num3 = (int)((float)num3 * FontDef.GetFontInfo(nFontType).fStretch);
//Increase line width with each character added
testWidth += num2;
this.testWidth += num2;
//If there is a line break reset count
if (szMsg[i] == '\n')
{
testWidth = 0;
this.testWidth = 0;
}
if (testWidth > this.m_Clip.nCx)
if (this.testWidth > this.m_Clip.nCx)
{
for (int j = i; j >= 0; j--)
{
@@ -218,7 +218,7 @@ public class CMessageText
{
szMsg = szMsg.Remove(j, 1).Insert(j, "\n");
i = j;
testWidth = 0;
this.testWidth = 0;
break;
@@ -516,9 +516,9 @@ public class CMessageText
int nSize = FontDef.GetFontInfo(nFontType).nSize;
float num = (float)glyph.advance / (float)this.font.Font.charSize;
int num2 = (int)((float)nSize * num);
int num3 = (int)((float)nSize * ((float)glyph.height / (float)this.font.Font.charSize));
//int num3 = (int)((float)nSize * ((float)glyph.height / (float)this.font.Font.charSize));
num2 = (int)((float)num2 * FontDef.GetFontInfo(nFontType).fStretch);
num3 = (int)((float)num3 * FontDef.GetFontInfo(nFontType).fStretch);
//num3 = (int)((float)num3 * FontDef.GetFontInfo(nFontType).fStretch);
if (this.m_CurPos.nY >= this.m_ChNum.nCy)
{
this.m_isOver = true;
@@ -848,8 +848,10 @@ public class CMessageText
// Token: 0x040003ED RID: 1005
private static bool m_isHyphenation;
// Token: 0x020000B3 RID: 179
private struct INT_POS
private int testWidth = 0;
// Token: 0x020000B3 RID: 179
private struct INT_POS
{
// Token: 0x06000556 RID: 1366 RVA: 0x00015154 File Offset: 0x00013354
public void SetPos(int x, int y)
@@ -278,7 +278,7 @@ public class EffectManager : MonoBehaviour
}
//byte[] data = System.IO.File.ReadAllBytes(path + ".png");
Texture2D tex = new Texture2D(0, 0, TextureFormat.RGBA32, false, true);
Texture2D tex = new Texture2D(1, 1, TextureFormat.RGBA32, false, true);
tex.LoadImage(data);
tex.wrapMode = TextureWrapMode.Clamp;
EffectManager.Instance.PatternTexture = tex;
+2 -2
View File
@@ -17,7 +17,7 @@ public class ManTexture : MonoBehaviour
this.array[name].IncCount();
return this.array[name];
}
Texture2D texture_ = new Texture2D(0, 0, TextureFormat.ARGB32, false, false);
Texture2D texture_ = new Texture2D(1, 1, TextureFormat.ARGB32, false, false);
UnityFile file = Singleton<UnityFileLoader>.Instance.LoadImageFile(name);
SizeF size = DirScaleTable.GetSize(Nmb.GetFileInfo(name).DirName);
this.array.Add(name, new UnityTexture(name, texture_, file, size));
@@ -33,7 +33,7 @@ public class ManTexture : MonoBehaviour
this.array[name].IncCount();
return this.array[name];
}
Texture2D texture_ = new Texture2D(0, 0, TextureFormat.ARGB32, false, false);
Texture2D texture_ = new Texture2D(1, 1, TextureFormat.ARGB32, false, false);
this.array.Add(name, new UnityTexture(name, texture_, data, null));
return this.array[name];
}
+11 -4
View File
@@ -313,7 +313,7 @@ public class MsgWnd : Singleton<MsgWnd>
// Token: 0x06000572 RID: 1394 RVA: 0x00015998 File Offset: 0x00013B98
public void AddMessage(string msg)
{
this.m_MsgText.AddMessage(msg, this.m_Color, this.m_Size, -1);
this.m_MsgText.AddMessage(msg, this.m_Color, this.m_Size, -1);
this.m_Phase = MsgWnd.MSG_PHASE.MESANIM;
this.m_nAutoSkipTime = 0;
}
@@ -381,7 +381,14 @@ public class MsgWnd : Singleton<MsgWnd>
case MSGWND_STYLE.KYARA:
case MSGWND_STYLE.HEROINE:
case MSGWND_STYLE.MONOLOGUE:
this.m_MsgText.EnableLineTopProc(true);
if (UnityApp.instance.locale != Assets.Scripts.LocaleEnum.Japanese)
{
this.m_MsgText.EnableLineTopProc(false);
}
else
{
this.m_MsgText.EnableLineTopProc(true);
}
goto IL_236;
}
this.m_MsgText.EnableLineTopProc(false);
@@ -598,8 +605,8 @@ public class MsgWnd : Singleton<MsgWnd>
// Token: 0x0400040C RID: 1036
public static bool g_isAnimPosOuter = true;
// Token: 0x020000B9 RID: 185
private enum MSG_PHASE
// Token: 0x020000B9 RID: 185
private enum MSG_PHASE
{
// Token: 0x04000411 RID: 1041
NULL,
@@ -42,7 +42,7 @@ public class effect_sample_main : MonoBehaviour
yield return www;
AssetBundle ab = www.assetBundle;
TextAsset ta = ab.mainAsset as TextAsset;
Texture2D tex = new Texture2D(0, 0, TextureFormat.RGBA32, false, true);
Texture2D tex = new Texture2D(1, 1, TextureFormat.RGBA32, false, true);
tex.LoadImage(ta.bytes);
tex.wrapMode = TextureWrapMode.Clamp;
ab.Unload(true);