public static object GetPokemonName(int index) { object getPokemonNameRet = default; int offvar; string b = default; offvar = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "PokemonNames", ""), System.Globalization.NumberStyles.HexNumber); if (MainObject.Header3 == "J") { MainObject.FileNum = FileSystem.FreeFile(); FileSystem.FileOpen(MainObject.FileNum, MainObject.LoadedRom, OpenMode.Binary); var japPokeName = "xxxxxx"; FileSystem.FileGet(MainObject.FileNum, ref japPokeName, offvar + 1 + 6 * index); b = modTextSapp.Sapp2Asc(japPokeName, true); while (Strings.InStr(1, b, @"\x") != 0) { b = Strings.LSet(b, Strings.Len(b) - 1); } b = Strings.LSet(b, Strings.Len(b) - 1); } else { MainObject.FileNum = FileSystem.FreeFile(); FileSystem.FileOpen(MainObject.FileNum, MainObject.LoadedRom, OpenMode.Binary); var pokeName = "xxxxxxxxxxx"; FileSystem.FileGet(MainObject.FileNum, ref pokeName, offvar + 1 + 11 * index); b = modTextSapp.Sapp2Asc(pokeName, false); while (Strings.InStr(1, b, @"\x") != 0) { b = Strings.LSet(b, Strings.Len(b) - 1); } b = Strings.LSet(b, Strings.Len(b) - 1); } FileSystem.FileClose(MainObject.FileNum); getPokemonNameRet = b; return(getPokemonNameRet); }
public static string GetBattleFrontierTrainerName(int index) { string getBattleFrontierTrainerNameRet = default; var stringvar = string.Empty; var offvar = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "BattleFrontierTrainers", ""), System.Globalization.NumberStyles.HexNumber); if (MainObject.Header2 == "BPE") { if (MainObject.Header3 == "J") { } else { offvar = offvar + 4 + index * 52; MainObject.FileNum = FileSystem.FreeFile(); FileSystem.FileOpen(MainObject.FileNum, MainObject.LoadedRom, OpenMode.Binary); var labelName = "xxxxxxxx"; FileSystem.FileGet(MainObject.FileNum, ref labelName, offvar + 1); stringvar = modTextSapp.Sapp2Asc(labelName, false); while (Strings.InStr(1, stringvar, @"\x") != 0) { stringvar = Strings.LSet(stringvar, Strings.Len(stringvar) - 1); } stringvar = Strings.LSet(stringvar, Strings.Len(stringvar) - 1); } FileSystem.FileClose(MainObject.FileNum); } else { ////Interaction.MsgBox("What did you do?"); Environment.Exit(0); } getBattleFrontierTrainerNameRet = stringvar; return(getBattleFrontierTrainerNameRet); }
private static void Flush(string thing) { Ini.FlushPrivateProfileString(0, 0, 0, thing); }