private void CreateText(string name, string text, BurikoTextModes textMode) { isFading = !gameSystem.IsSkipping; string text2 = string.Format(NameFormat, name); if (appendNext) { int length = txt.Length; txt += text; string text3 = txt; string str = text3.Substring(length); AddText(str, 0, isFading, addToTime: true); txt = text3; } else { charList.Clear(); int length2 = text2.Length; AddText(text, length2, isFading, addToTime: true); txt = text; } if (isFading) { switch (textMode) { case BurikoTextModes.Normal: case BurikoTextModes.WaitForInput: case BurikoTextModes.ContinueAftertyping: case BurikoTextModes.WaitThenContinue: gameSystem.AddWait(new Wait(textTimeRemaining, WaitTypes.WaitForText, FinishedTyping)); break; } } else { UpdateTextArea(); } bool flag = false; switch (textMode) { case BurikoTextModes.Normal: gameSystem.AddWait(new Wait(0f, WaitTypes.WaitForInput, ClearText)); flag = true; break; case BurikoTextModes.WaitForInput: gameSystem.AddWait(new Wait(0f, WaitTypes.WaitForInput, null)); flag = true; break; } lastMode = textMode; if (gameSystem.IsAuto && flag) { SetAutoTextWait(); } }
public string Preprocessor(string[] lines) { string text = string.Empty; int num = 0; foreach (string text2 in lines) { text += "\r\n"; if (!(text2 == string.Empty) && !text2.StartsWith("//") && (num != 0 || !text2.StartsWith("#"))) { num += text2.Count((char f) => f == '{'); num -= text2.Count((char f) => f == '}'); if (num > 0 && text2.Length > 0 && !text2.StartsWith("\t") && !text2.StartsWith("{") && !text2.StartsWith("}")) { string text3 = text2.Replace("\"", "\\\""); text3 = text3.Replace(", )", " )"); if (text3.StartsWith("..")) { text3 = text3.Substring(2); } BurikoTextModes burikoTextModes = BurikoTextModes.Normal; if (text3.EndsWith(">")) { burikoTextModes = BurikoTextModes.Continue; text3 = text3.Substring(0, text3.Length - 1); } if (text3.EndsWith("<")) { burikoTextModes = BurikoTextModes.WaitThenContinue; text3 = text3.Substring(0, text3.Length - 1); } if (text3.EndsWith("@") || text3.EndsWith("&")) { burikoTextModes = BurikoTextModes.WaitForInput; text3 = text3.Substring(0, text3.Length - 1); } text += string.Format("\tOutputLine(NULL, \"{0}\", NULL, \"{0}\", {1});", text3, (int)burikoTextModes); } else { string text4 = text2.Replace(", )", " )"); text4 = text4.Replace(",)", " )"); text4 = text4.Replace("Line_Normal", "0"); text4 = text4.Replace("Line_ContinueAfterTyping", "3"); text4 = text4.Replace("Line_WaitForInput", "2"); text4 = text4.Replace("Line_Continue", "1"); text += text4; } } } return(text); }
public void SetText(string name, string text, BurikoTextModes textMode, int language) { if (!appendNext) { text = string.Format(NameFormat, name) + text; } if (language == 1 && GameSystem.Instance.UseEnglishText) { japaneseprev = japanesetext; if (appendNext) { japanesetext += text; } else { japanesetext = text; } } else if (language == 2 && !GameSystem.Instance.UseEnglishText) { if (englishprev.EndsWith(",") || englishprev.EndsWith(".") || englishprev.EndsWith("!") || englishprev.EndsWith("?")) { text += " "; } if (englishprev.Length > 0 && englishprev[englishprev.Length - 1] > 'a' && englishprev[englishprev.Length - 1] < 'Z') { text += " "; } englishprev = englishtext; if (prevAppendState) { englishtext += text; } else { englishtext = text; } } else { if (textTimeRemaining < 0f) { textTimeRemaining = 0f; isFading = false; } if (GameSystem.Instance.UseEnglishText) { englishprev = txt; englishtext += text; } else { japaneseprev = txt; japanesetext += text; } prevAppendState = appendNext; if (language == 0) { if (!GameSystem.Instance.UseEnglishText) { englishprev = englishtext; } else { japaneseprev = japanesetext; } if (appendNext) { englishtext += text; japanesetext += text; } else { englishtext = text; japanesetext = text; } } if (!gameSystem.MessageBoxVisible) { if (gameSystem.IsSkipping) { gameSystem.MainUIController.ShowMessageBox(); CreateText(name, text, textMode); appendNext = (textMode != BurikoTextModes.Normal); gameSystem.ExecuteActions(); } else { gameSystem.MainUIController.FadeIn(0.2f); gameSystem.AddWait(new Wait(0.2f, WaitTypes.WaitForMove, delegate { CreateText(name, text, textMode); appendNext = (textMode != BurikoTextModes.Normal); })); } } else { CreateText(name, text, textMode); appendNext = (textMode != BurikoTextModes.Normal); } gameSystem.ExecuteActions(); } }
private void CreateText(string name, string text, BurikoTextModes textMode) { if (textMode == BurikoTextModes.Continue) { MODTextController.MODLineContinueDetect = true; } bool mODLineContinueDetect = MODTextController.MODLineContinueDetect; int mODCurrentVoiceLayerDetect = MODTextController.MODCurrentVoiceLayerDetect; isFading = !gameSystem.IsSkipping; string text2 = string.Format(NameFormat, name); if (appendNext) { int length = txt.Length; txt += text; string text3 = txt; string str = text3.Substring(length); AddText(str, 0, isFading, addToTime: true); txt = text3; } else { charList.Clear(); int length2 = text2.Length; AddText(text, length2, isFading, addToTime: true); txt = text; } if (isFading) { if ((uint)textMode <= 4u) { gameSystem.AddWait(new Wait(textTimeRemaining, WaitTypes.WaitForText, FinishedTyping)); } } else { UpdateTextArea(); } bool flag = false; switch (textMode) { case BurikoTextModes.Normal: gameSystem.AddWait(new Wait(0f, WaitTypes.WaitForInput, ClearText)); flag = true; break; case BurikoTextModes.WaitForInput: gameSystem.AddWait(new Wait(0f, WaitTypes.WaitForInput, null)); flag = true; break; } lastMode = textMode; if (gameSystem.IsAuto && flag) { SetAutoTextWait(); } if (gameSystem.IsAuto && mODLineContinueDetect && GameSystem.Instance.AudioController.IsVoicePlaying(mODCurrentVoiceLayerDetect)) { switch (textMode) { case BurikoTextModes.Continue: break; case BurikoTextModes.Normal: case BurikoTextModes.WaitForInput: case BurikoTextModes.ContinueAftertyping: case BurikoTextModes.WaitThenContinue: GameSystem.Instance.AddWait(new Wait(GameSystem.Instance.AudioController.GetRemainingVoicePlayTime(mODCurrentVoiceLayerDetect), WaitTypes.WaitForVoice, null)); MODTextController.MODLineContinueDetect = false; break; } } }