private string GetEntry(int value, bool sjis, bool SaveLoad) { foreach (var text in Source.Entries) { if (value.ToString() == text.Context) { string replaced = string.IsNullOrEmpty(text.Translated) ? text.Original : text.Translated; if (PB.BP.DictionaryEnabled && !SaveLoad) { replaced = PB.BP.ReplaceText(replaced, false); } if (sjis) { return(ReplaceText(PB.ToFullWidth(replaced), true)); } if (DictionarySaveLoadEnabled && SaveLoad) { replaced = ReplaceSaveLoadText(replaced, true); } return(ReplaceText(replaced, true)); } } return(null); }
private byte[][] ParseString(string line) { byte[][] result; string[] linesplitted = line.Split('\n'); result = new byte[linesplitted.Length][]; for (int i = 0; i < linesplitted.Length; i++) { string lineresult = PB.ToFullWidth(PB.BP.ReplaceText(linesplitted[i], false)); byte[] linesjis = Binary2Po.SJIS.GetBytes(lineresult + '\0'); result[i] = new byte[linesjis.Length + 2]; result[i][0] = 0x32; result[i][1] = (byte)linesjis.Length; for (int e = 0; e < linesjis.Length; e++) { result[i][e + 2] = linesjis[e]; } } return(result); }