1
0
mirror of synced 2024-11-30 18:24:32 +01:00

More convenient save files management, few 5P bug fixes

This commit is contained in:
0auBSQ 2023-02-17 02:59:12 +09:00
parent cf9197af82
commit 2c0b60a6a3
24 changed files with 649 additions and 336 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@
/Test/RecentlyPlayedSongs.json
/Test/SongsIgnored/*
/Test/SongsIgnored2/*
/Test/Saves
/Test/xadec.dll
/Test/SoundDecoder.dll
/Test/msvcr90.dll

View File

@ -29,7 +29,7 @@ namespace TJAPlayer3
private static bool _usesSubstituteTexture(int player, ECharacterAnimation eca)
{
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn)
{
@ -73,7 +73,7 @@ namespace TJAPlayer3
public static CTexture[] _getReferenceArray(int player, ECharacterAnimation eca)
{
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn)
{
@ -216,7 +216,7 @@ namespace TJAPlayer3
public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterAnimation eca, int opacity = 255)
{
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
CTexture[] _ref = _getReferenceArray(player, eca);
CCounter[] _ctref = _getReferenceCounter(eca);
bool _substitute = _usesSubstituteTexture(player, eca);

View File

@ -44,7 +44,7 @@ namespace TJAPlayer3
private static bool _usesSubstituteTexture(int player, ECharacterResult eca)
{
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn)
{
@ -82,7 +82,7 @@ namespace TJAPlayer3
public static CTexture[] _getReferenceArray(int player, ECharacterResult eca)
{
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
if (_charaId >= 0 && _charaId < TJAPlayer3.Skin.Characters_Ptn)
{
@ -205,7 +205,7 @@ namespace TJAPlayer3
public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterResult eca, int pos = 0, int opacity = 255)
{
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
CTexture[] _ref = _getReferenceArray(player, eca);
CCounter[] _ctref = _getReferenceCounter(eca);
bool _substitute = _usesSubstituteTexture(player, eca);

View File

@ -36,7 +36,7 @@ namespace TJAPlayer3
public static int tGetPuchiCharaIndexByName(int p)
{
var _pc = TJAPlayer3.NamePlateConfig.data.PuchiChara[p];
var _pc = TJAPlayer3.SaveFileInstances[p].data.PuchiChara;
var _pcs = TJAPlayer3.Skin.Puchicharas_Name;
int puriChar = 0;
if (_pcs.Contains(_pc))

View File

@ -7,6 +7,7 @@ using System.IO;
using System.Diagnostics;
using FDK;
using FDK.ExtensionMethods;
using System.Linq;
namespace TJAPlayer3
{
@ -1184,7 +1185,7 @@ namespace TJAPlayer3
new CAIPerformances(800, 180, 20, 10, 70),
new CAIPerformances(850, 135, 15, 12, 50),
new CAIPerformances(900, 90, 10, 14, 30),
new CAIPerformances(910, 85, 5, 16, 20),
new CAIPerformances(920, 75, 5, 16, 20),
new CAIPerformances(950, 49, 1, 22, 10),
new CAIPerformances(975, 25, 0, 26, 5),
new CAIPerformances(1000, 0, 0, 30, 0)
@ -1241,6 +1242,15 @@ namespace TJAPlayer3
public int[] bJust = new int[5] { 0, 0, 0, 0, 0 };
public int[] nHitSounds = new int[5] { 0, 0, 0, 0, 0 };
public int[][] nPanning = new int[5][]
{
new int[1] { 0 },
new int[2] { -100, 100 },
new int[3] { -100, 0, 100 },
new int[4] { -75, -25, 25, 75 },
new int[5] { -100, -50, 0, 50, 100 },
};
public string[] sSaveFile = new string[5] { "1P", "2P", "3P", "4P", "5P" };
public bool bEndingAnime = false; // 2017.01.27 DD 「また遊んでね」画面の有効/無効オプション追加
@ -2066,6 +2076,14 @@ namespace TJAPlayer3
#endregion
#region [Save Files]
sw.WriteLine("; File paths on the Saves folder.");
sw.WriteLine("SaveFileName={0}", String.Join(",", this.sSaveFile));
sw.WriteLine();
#endregion
#region [ Window関連 ]
sw.WriteLine( "; 画面モード(0:ウィンドウ, 1:全画面)" );
sw.WriteLine( "; Screen mode. (0:Window, 1:Fullscreen)" );
@ -2843,6 +2861,20 @@ namespace TJAPlayer3
this.nLayoutType = int.Parse(str4);
}
else if (str3.Equals("SaveFileName"))
{
var _s = str4.Split(new char[] { ',' });
// Ignore custom save file names if duplicates
if (!_s.GroupBy(x => x).Any(g => g.Count() > 1))
{
for (int i = 0; i < Math.Min(5, _s.Length); i++)
{
this.sSaveFile[i] = _s[i];
}
}
}
#region [ skin関係 ]
else if ( str3.Equals( "SkinPath" ) )
{
@ -3256,8 +3288,6 @@ namespace TJAPlayer3
//-----------------------------
#endregion
#region [ [Log] ]
//-----------------------------
case Eセクション種別.Log:

View File

@ -305,7 +305,8 @@ namespace TJAPlayer3
if (song.eード種別 == C曲リストード.Eード種別.SCORE
&& song.strジャンル != "最近遊んだ曲"
&& song.strジャンル != "Favorite")
&& song.strジャンル != "Favorite"
&& song.strジャンル != "SearchD")
{
var score = song.arスコア[TJAPlayer3.stage選曲.act曲リスト.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)];

View File

@ -1,4 +1,5 @@
using System.Text;
using System.IO;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
@ -49,6 +50,7 @@ namespace TJAPlayer3
/// <param name="filePath">ファイル名。</param>
public static void SaveConfig(object obj, string filePath)
{
(new FileInfo(filePath)).Directory.Create();
using (var stream = new System.IO.StreamWriter(filePath, false, Encoding.UTF8))
{
stream.Write(JsonConvert.SerializeObject(obj, Formatting.Indented, Settings));

View File

@ -247,7 +247,7 @@ namespace TJAPlayer3
reference,
CLangManager.LangInstance.GetString(306),
CLangManager.LangInstance.GetString(307),
TJAPlayer3.NamePlateConfig.data.Medals[player]
TJAPlayer3.SaveFileInstances[player].data.Medals
);
}

View File

@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using radio42.Multimedia.Midi;
namespace TJAPlayer3
{
@ -13,8 +14,11 @@ namespace TJAPlayer3
{
public void tNamePlateConfig()
{
// Deprecated, only converts to new format
/*
if (!File.Exists("NamePlate.json"))
tSaveFile();
*/
tLoadFile();
}
@ -63,7 +67,7 @@ namespace TJAPlayer3
int cs = clearStatus;
if (TJAPlayer3.NamePlateConfig.data.DanTitles[player] == null)
TJAPlayer3.NamePlateConfig.data.DanTitles[player] = new Dictionary<string, CDanTitle>();
TJAPlayer3.NamePlateConfig.data.DanTitles[player] = new Dictionary<string, SaveFile.CDanTitle>();
if (TJAPlayer3.NamePlateConfig.data.DanTitles[player].ContainsKey(title))
{
@ -87,7 +91,7 @@ namespace TJAPlayer3
}
CDanTitle danTitle = new CDanTitle(iG, cs);
SaveFile.CDanTitle danTitle = new SaveFile.CDanTitle(iG, cs);
TJAPlayer3.NamePlateConfig.data.DanTitles[player][title] = danTitle;
@ -184,10 +188,10 @@ namespace TJAPlayer3
public string[] CharacterName = { "0", "0", "0", "0", "0" };
[JsonProperty("danTitles")]
public Dictionary<string, CDanTitle>[] DanTitles = new Dictionary<string, CDanTitle>[5];
public Dictionary<string, SaveFile.CDanTitle>[] DanTitles = new Dictionary<string, SaveFile.CDanTitle>[5];
[JsonProperty("namePlateTitles")]
public Dictionary<string, CNamePlateTitle>[] NamePlateTitles = new Dictionary<string, CNamePlateTitle>[5];
public Dictionary<string, SaveFile.CNamePlateTitle>[] NamePlateTitles = new Dictionary<string, SaveFile.CNamePlateTitle>[5];
[JsonProperty("unlockedPuchicharas")]
public List<string>[] UnlockedPuchicharas = new List<string>[5]
@ -212,7 +216,34 @@ namespace TJAPlayer3
private void tLoadFile()
{
data = ConfigManager.GetConfig<Data>(@"NamePlate.json");
//data = ConfigManager.GetConfig<Data>(@"NamePlate.json");
if (!File.Exists("NamePlate.json"))
return;
var _data = ConfigManager.GetConfig<Data>(@"NamePlate.json");
for (int i = 0; i < _data.Name.Length; i++)
{
var _sf = new SaveFile();
_sf.tSaveFile((i + 1) + "P");
_sf.data.Name = _data.Name[i];
_sf.data.Title = _data.Title[i];
_sf.data.Dan = _data.Dan[i];
_sf.data.DanGold = _data.DanGold[i];
_sf.data.DanType = _data.DanType[i];
_sf.data.TitleType = _data.TitleType[i];
_sf.data.PuchiChara = _data.PuchiChara[i];
_sf.data.Medals = _data.Medals[i];
_sf.data.Character = _data.Character[i];
_sf.data.CharacterName = _data.CharacterName[i];
_sf.data.DanTitles = _data.DanTitles[i];
_sf.data.NamePlateTitles = _data.NamePlateTitles[i];
_sf.data.UnlockedPuchicharas = _data.UnlockedPuchicharas[i];
_sf.tApplyHeyaChanges();
}
System.IO.File.Move(@"NamePlate.json", @"NamePlate_old.json");
}
#endregion

View File

@ -0,0 +1,211 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
namespace TJAPlayer3
{
internal class SaveFile
{
public void tSaveFile(string filename)
{
path = @"Saves/" + filename + @".json";
name = filename;
if (!File.Exists(path))
{
this.data.Name = filename;
tSaveFile();
}
tLoadFile();
}
#region [Medals]
public void tEarnCoins(int amount)
{
data.Medals += amount;
tSaveFile();
}
// Return false if the current amount of coins is to low
public bool tSpendCoins(int amount)
{
if (data.Medals < amount)
return false;
data.Medals -= amount;
tSaveFile();
return true;
}
#endregion
#region [Dan titles]
public bool tUpdateDanTitle(string title, bool isGold, int clearStatus)
{
bool changed = false;
bool iG = isGold;
int cs = clearStatus;
if (this.data.DanTitles == null)
this.data.DanTitles = new Dictionary<string, CDanTitle>();
if (this.data.DanTitles.ContainsKey(title))
{
if (this.data.DanTitles[title].clearStatus > cs)
cs = this.data.DanTitles[title].clearStatus;
if (this.data.DanTitles[title].isGold)
iG = true;
}
// Automatically set the dan to nameplate if new
// Add a function within the NamePlate.cs file to update the title texture
if (!this.data.DanTitles.ContainsKey(title) || cs != clearStatus || iG != isGold)
{
changed = true;
/*
TJAPlayer3.NamePlateConfig.data.Dan[player] = title;
TJAPlayer3.NamePlateConfig.data.DanGold[player] = iG;
TJAPlayer3.NamePlateConfig.data.DanType[player] = cs;
*/
}
CDanTitle danTitle = new CDanTitle(iG, cs);
this.data.DanTitles[title] = danTitle;
tSaveFile();
return changed;
}
#endregion
#region [Auxilliary classes]
public class CDanTitle
{
public CDanTitle(bool iG, int cs)
{
isGold = iG;
clearStatus = cs;
}
[JsonProperty("isGold")]
public bool isGold;
[JsonProperty("clearStatus")]
public int clearStatus;
}
public class CNamePlateTitle
{
public CNamePlateTitle(int type)
{
iType = type;
}
[JsonProperty("iType")]
public int iType;
}
#endregion
#region [Heya]
public void tReindexCharacter(string[] characterNamesList)
{
string character = this.data.CharacterName;
if (characterNamesList.Contains(character))
this.data.Character = characterNamesList.ToList().IndexOf(character);
}
public void tUpdateCharacterName(string newChara)
{
this.data.CharacterName = newChara;
}
public void tApplyHeyaChanges()
{
this.tSaveFile();
}
#endregion
public class Data
{
[JsonProperty("name")]
public string Name = "プレイヤー1";
[JsonProperty("title")]
public string Title = "初心者";
[JsonProperty("dan")]
public string Dan = "新人";
[JsonProperty("danGold")]
public bool DanGold = false;
[JsonProperty("danType")]
public int DanType = 0;
[JsonProperty("titleType")]
public int TitleType = 0;
[JsonProperty("puchiChara")]
public string PuchiChara = "0";
[JsonProperty("medals")]
public int Medals = 0;
[JsonProperty("character")]
public int Character = 0;
[JsonProperty("characterName")]
public string CharacterName = "0";
[JsonProperty("danTitles")]
public Dictionary<string, CDanTitle> DanTitles = new Dictionary<string, CDanTitle>();
[JsonProperty("namePlateTitles")]
public Dictionary<string, CNamePlateTitle> NamePlateTitles = new Dictionary<string, CNamePlateTitle>();
[JsonProperty("unlockedPuchicharas")]
public List<string> UnlockedPuchicharas = new List<string>();
}
public Data data = new Data();
public string path = "Save.json";
public string name = "Save";
#region [private]
private void tSaveFile()
{
ConfigManager.SaveConfig(data, path);
}
private void tLoadFile()
{
data = ConfigManager.GetConfig<Data>(path);
}
#endregion
}
}

View File

@ -488,12 +488,14 @@ namespace TJAPlayer3
// 0 : 1P, 1 : 2P
public static int SaveFile = 0;
public static SaveFile[] SaveFileInstances = new SaveFile[5];
// 0 : Hidari, 1 : Migi (1P only)
public static int PlayerSide = 0;
public static int GetActualPlayer(int player)
{
if (SaveFile == 0)
if (SaveFile == 0 || player > 1)
return player;
if (player == 0)
return 1;
@ -2226,6 +2228,12 @@ for (int i = 0; i < 3; i++) {
Trace.TraceError( "例外が発生しましたが処理を継続します。 (b8d93255-bbe4-4ca3-8264-7ee5175b19f3)" );
}
}
for (int i = 0; i < 5; i++)
{
SaveFileInstances[i] = new SaveFile();
SaveFileInstances[i].tSaveFile(TJAPlayer3.ConfigIni.sSaveFile[i]);
}
this.Window.EnableSystemMenu = TJAPlayer3.ConfigIni.bIsEnabledSystemMenu; // #28200 2011.5.1 yyagi
// 2012.8.22 Config.iniが無いときに初期値が適用されるよう、この設定行をifブロック外に移動

View File

@ -1766,8 +1766,13 @@ Debug.WriteLine( dBPM + ":" + c曲リストード.strタイトル );
// New format
string[] fp =
{
strScoreIniファイルパス + "1P.score.ini",
strScoreIniファイルパス + "2P.score.ini",
//strScoreIniファイルパス + "1P.score.ini",
//strScoreIniファイルパス + "2P.score.ini",
strScoreIniファイルパス + TJAPlayer3.SaveFileInstances[0].name + @".score.ini",
strScoreIniファイルパス + TJAPlayer3.SaveFileInstances[1].name + @".score.ini",
strScoreIniファイルパス + TJAPlayer3.SaveFileInstances[2].name + @".score.ini",
strScoreIniファイルパス + TJAPlayer3.SaveFileInstances[3].name + @".score.ini",
strScoreIniファイルパス + TJAPlayer3.SaveFileInstances[4].name + @".score.ini"
};
// Load legacy format if new doesn't exist yet
@ -1781,14 +1786,16 @@ Debug.WriteLine( dBPM + ":" + c曲リストード.strタイトル );
*/
// Select the main file for the common informations
/*
int mainFile = 0;
if (!File.Exists(fp[0]))
mainFile = 1;
if (!File.Exists(fp[1]) && mainFile == 1)
return;
*/
// Only the necessary scores are read from the auxilliary score file
int auxFile = mainFile ^ 1;
//int auxFile = mainFile ^ 1;
try
{
@ -1796,8 +1803,13 @@ Debug.WriteLine( dBPM + ":" + c曲リストード.strタイトル );
CScoreIni[] csi =
{
new CScoreIni(fp[mainFile]),
File.Exists(fp[auxFile]) ? new CScoreIni(fp[auxFile]) : null,
//new CScoreIni(fp[mainFile]),
//File.Exists(fp[auxFile]) ? new CScoreIni(fp[auxFile]) : null,
new CScoreIni(fp[0]),
new CScoreIni(fp[1]),
new CScoreIni(fp[2]),
new CScoreIni(fp[3]),
new CScoreIni(fp[4])
};
var ini = csi[0];
@ -1851,7 +1863,7 @@ Debug.WriteLine( dBPM + ":" + c曲リストード.strタイトル );
}
// Load GPInfo for each save file
for (int i = 0; i < 2; i++)
for (int i = 0; i < 5; i++)
{
if (csi[i] == null)
continue;

View File

@ -1131,8 +1131,8 @@ namespace TJAPlayer3
for (int i = 0; i < 5; i++)
{
TJAPlayer3.NamePlateConfig.tReindexCharacter(i, TJAPlayer3.Skin.Characters_DirName);
this.ReloadCharacter(-1, TJAPlayer3.NamePlateConfig.data.Character[i], i, true);
TJAPlayer3.SaveFileInstances[i].tReindexCharacter(TJAPlayer3.Skin.Characters_DirName);
this.ReloadCharacter(-1, TJAPlayer3.SaveFileInstances[i].data.Character, i, true);
}
@ -1208,14 +1208,12 @@ namespace TJAPlayer3
if (old == newC)
return;
int other = (player == 0) ? 1 : 0;
if (old >= 0 &&
(TJAPlayer3.NamePlateConfig.data.Character[0] != old || player == 0) &&
(TJAPlayer3.NamePlateConfig.data.Character[1] != old || player == 1) &&
(TJAPlayer3.NamePlateConfig.data.Character[2] != old || player == 2) &&
(TJAPlayer3.NamePlateConfig.data.Character[3] != old || player == 3) &&
(TJAPlayer3.NamePlateConfig.data.Character[4] != old || player == 4))
(TJAPlayer3.SaveFileInstances[0].data.Character != old || player == 0) &&
(TJAPlayer3.SaveFileInstances[1].data.Character != old || player == 1) &&
(TJAPlayer3.SaveFileInstances[2].data.Character != old || player == 2) &&
(TJAPlayer3.SaveFileInstances[3].data.Character != old || player == 3) &&
(TJAPlayer3.SaveFileInstances[4].data.Character != old || player == 4))
{
int i = old;
@ -1305,11 +1303,11 @@ namespace TJAPlayer3
string charaPath = TJAPlayer3.strEXEのあるフォルダ + GLOBAL + CHARACTERS + TJAPlayer3.Skin.Characters_DirName[newC];
if ((newC >= 0 &&
TJAPlayer3.NamePlateConfig.data.Character[0] != newC &&
TJAPlayer3.NamePlateConfig.data.Character[1] != newC &&
TJAPlayer3.NamePlateConfig.data.Character[2] != newC &&
TJAPlayer3.NamePlateConfig.data.Character[3] != newC &&
TJAPlayer3.NamePlateConfig.data.Character[4] != newC) || primary)
TJAPlayer3.SaveFileInstances[0].data.Character != newC &&
TJAPlayer3.SaveFileInstances[1].data.Character != newC &&
TJAPlayer3.SaveFileInstances[2].data.Character != newC &&
TJAPlayer3.SaveFileInstances[3].data.Character != newC &&
TJAPlayer3.SaveFileInstances[4].data.Character != newC) || primary)
{
int i = newC;

View File

@ -595,7 +595,7 @@ namespace TJAPlayer3
int _actual = TJAPlayer3.GetActualPlayer(0);
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[_actual];
int _charaId = TJAPlayer3.SaveFileInstances[_actual].data.Character;
int chara_x = TJAPlayer3.Skin.Title_Entry_NamePlate[0] + TJAPlayer3.Tx.NamePlateBase.szテクスチャサイズ.Width / 2;
int chara_y = TJAPlayer3.Skin.Title_Entry_NamePlate[1];
@ -695,7 +695,7 @@ namespace TJAPlayer3
DonchanY = ((float)Math.Sin((90 + (ctどんちゃんイン.n現在の値 / 2)) * (Math.PI / 180)) * 150f);
if (player == 1) DonchanX *= -1;
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
//int chara_x = (int)(TJAPlayer3.Skin.Characters_Title_Normal_X[_charaId][player] + DonchanX);
//int chara_y = (int)(TJAPlayer3.Skin.Characters_Title_Normal_Y[_charaId][player] - DonchanY);

View File

@ -510,7 +510,7 @@ namespace TJAPlayer3
{
CCounter ___cc = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.SELECT)[player];
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(player)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(player)].data.Character;
//int chara_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player];
//int chara_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player];
@ -624,8 +624,8 @@ namespace TJAPlayer3
int p = TJAPlayer3.GetActualPlayer(i);
if (TJAPlayer3.NamePlateConfig.data.Medals[p] >= 0)
tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][10], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][10], TJAPlayer3.NamePlateConfig.data.Medals[p]);
if (TJAPlayer3.SaveFileInstances[p].data.Medals >= 0)
tBoardNumberDraw(TJAPlayer3.Skin.SongSelect_BoardNumber_X[i][10], TJAPlayer3.Skin.SongSelect_BoardNumber_Y[i][10], TJAPlayer3.SaveFileInstances[p].data.Medals);
#region [HiScore plate]

View File

@ -81,7 +81,7 @@ namespace TJAPlayer3
{
#region [Combo voices]
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(i)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].data.Character;
var currentDir = ($@"{TJAPlayer3.strEXEのあるフォルダ}Global\Characters\{TJAPlayer3.Skin.Characters_DirName[_charaId]}\Sounds\Combo\");
if (Directory.Exists(currentDir))
@ -93,6 +93,7 @@ namespace TJAPlayer3
comboVoice.nPlayer = i;
comboVoice.strFilePath = item;
comboVoice.soundComboVoice = TJAPlayer3.Sound管理.tサウンドを生成する(item, ESoundGroup.Voice);
/*
if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) //2020.05.06 Mr-Ojii 左右に出したかったから追加。
{
if (i == 0)
@ -100,6 +101,8 @@ namespace TJAPlayer3
else
comboVoice.soundComboVoice.n位置 = 100;
}
*/
comboVoice.soundComboVoice.n位置 = TJAPlayer3.ConfigIni.nPanning[TJAPlayer3.ConfigIni.nPlayerCount - 1][i];
comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item));
ListCombo[i].Add(comboVoice);
}

View File

@ -3531,7 +3531,7 @@ namespace TJAPlayer3
int p = TJAPlayer3.GetActualPlayer(nPlayer);
int chara = Math.Max(0, Math.Min(TJAPlayer3.NamePlateConfig.data.Character[p], TJAPlayer3.Skin.Characters_Ptn - 1));
int chara = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[p].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1));
if (TJAPlayer3.Skin.Characters_Normal_Ptn[chara] != 0)
{
@ -3758,7 +3758,7 @@ namespace TJAPlayer3
int p = TJAPlayer3.GetActualPlayer(nPlayer);
int chara = Math.Max(0, Math.Min(TJAPlayer3.NamePlateConfig.data.Character[p], TJAPlayer3.Skin.Characters_Ptn - 1));
int chara = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[p].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1));
if (TJAPlayer3.Skin.Characters_Normal_Ptn[chara] != 0)
{
@ -4090,12 +4090,15 @@ namespace TJAPlayer3
#region[ f1: ]
case 0xF1:
if (!pChip.bHit && (pChip.nバーからの距離dot.Drums < 0))
{
if (TJAPlayer3.ConfigIni.nPlayerCount == 1)
{
if (dTX.listLyric.Count > ShownLyric[nPlayer] && dTX.nPlayerSide == nPlayer)
{
this.actPanel.t歌詞テクスチャを生成する(dTX.listLyric[ShownLyric[nPlayer]]);
ShownLyric[nPlayer]++;
}
}
pChip.bHit = true;
}
break;

View File

@ -51,7 +51,7 @@ namespace TJAPlayer3
// Currently used character
int p = TJAPlayer3.GetActualPlayer(i);
this.iCurrentCharacter[i] = Math.Max(0, Math.Min(TJAPlayer3.NamePlateConfig.data.Character[p], TJAPlayer3.Skin.Characters_Ptn - 1));
this.iCurrentCharacter[i] = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[p].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1));
this.b風船連打中[i] = false;

View File

@ -238,7 +238,7 @@ namespace TJAPlayer3
{
int p = TJAPlayer3.GetActualPlayer(nPlayer);
int chara = Math.Max(0, Math.Min(TJAPlayer3.NamePlateConfig.data.Character[p], TJAPlayer3.Skin.Characters_Ptn - 1));
int chara = Math.Max(0, Math.Min(TJAPlayer3.SaveFileInstances[p].data.Character, TJAPlayer3.Skin.Characters_Ptn - 1));
if (TJAPlayer3.Skin.Characters_Normal_Ptn[chara] != 0)
{
@ -368,6 +368,12 @@ namespace TJAPlayer3
this.soundBlue[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.ka[actual]), ESoundGroup.SoundEffect);
this.soundAdlib[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.adlib[actual]), ESoundGroup.SoundEffect);
this.soundClap[i] = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(hs.clap[actual]), ESoundGroup.SoundEffect);
int _panning = TJAPlayer3.ConfigIni.nPanning[TJAPlayer3.ConfigIni.nPlayerCount - 1][i];
this.soundRed[i].n位置 = _panning;
this.soundBlue[i].n位置 = _panning;
this.soundAdlib[i].n位置 = _panning;
this.soundClap[i].n位置 = _panning;
}
/*
this.soundRed = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path( @"Sounds\Taiko\dong.ogg" ), ESoundGroup.SoundEffect );
@ -379,7 +385,7 @@ namespace TJAPlayer3
this.soundAdlib2 = TJAPlayer3.Sound管理.tサウンドを生成する(CSkin.Path(@"Sounds\Taiko\Adlib.ogg"), ESoundGroup.SoundEffect);
*/
/*
if (TJAPlayer3.ConfigIni.nPlayerCount == 2)//2020.05.06 Mr-Ojii左右に出したかったから、追加。
{
this.soundRed[0].n位置 = -100;
@ -389,6 +395,7 @@ namespace TJAPlayer3
this.soundBlue[1].n位置 = 100;
this.soundAdlib[1].n位置 = 100;
}
*/
}
base.OnManagedリソースの作成();

View File

@ -880,7 +880,7 @@ namespace TJAPlayer3
#region [Character Animations]
int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(p)];
int _charaId = TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(p)].data.Character;
//int chara_x = TJAPlayer3.Skin.Characters_Result_X[_charaId][pos];
//int chara_y = TJAPlayer3.Skin.Characters_Result_Y[_charaId][pos];

View File

@ -213,15 +213,15 @@ namespace TJAPlayer3
#region [ .score.ini file output ]
//---------------------
int currentSaveFile = TJAPlayer3.SaveFile + 1;
int secondSaveFile = (currentSaveFile == 1) ? 2 : 1;
//int currentSaveFile = TJAPlayer3.SaveFile + 1;
//int secondSaveFile = (currentSaveFile == 1) ? 2 : 1;
string[] str = {
TJAPlayer3.DTX.strファイル名の絶対パス + currentSaveFile.ToString() + "P.score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + secondSaveFile.ToString() + "P.score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + 3.ToString() + "P.score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + 4.ToString() + "P.score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + 5.ToString() + "P.score.ini"
TJAPlayer3.DTX.strファイル名の絶対パス + TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(0)].name + @".score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(1)].name + @".score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(2)].name + @".score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(3)].name + @".score.ini",
TJAPlayer3.DTX.strファイル名の絶対パス + TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(4)].name + @".score.ini"
};
#region [Transfer legacy file format to new file format (P1)]
@ -269,16 +269,8 @@ namespace TJAPlayer3
#region [Regular saves]
CScoreIni.C演奏記録[] baseScores =
{
ini[0].stセクション[0],
ini[1].stセクション[0]
};
for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++)
{
var ccf = TJAPlayer3.stage演奏ドラム画面.CChartScore[i];
int diff = TJAPlayer3.stage選曲.n確定された曲の難易度[i];
var clear = Math.Max(ini[i].stセクション[0].nクリア[diff], this.nクリア[i]);
@ -394,10 +386,16 @@ namespace TJAPlayer3
// Unlock dan grade
if (clearValue > 0 && !TJAPlayer3.ConfigIni.b太鼓パートAutoPlay[0])
{
/*
this.newGradeGranted = TJAPlayer3.NamePlateConfig.tUpdateDanTitle(TJAPlayer3.stage選曲.r確定された曲.strタイトル.Substring(0, 2),
clearValue % 2 == 0,
(clearValue - 1) / 2,
TJAPlayer3.SaveFile);
*/
this.newGradeGranted = TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].tUpdateDanTitle(TJAPlayer3.stage選曲.r確定された曲.strタイトル.Substring(0, 2),
clearValue % 2 == 0,
(clearValue - 1) / 2);
}
#endregion
@ -635,10 +633,12 @@ namespace TJAPlayer3
this.nEarnedMedalsCount[i] = 0;
if ((TJAPlayer3.ConfigIni.b太鼓パートAutoPlay[i] || TJAPlayer3.ConfigIni.bAIBattleMode) && i == 1)
this.nEarnedMedalsCount[i] = 0;
TJAPlayer3.SaveFileInstances[TJAPlayer3.GetActualPlayer(i)].tEarnCoins(this.nEarnedMedalsCount[i]);
}
TJAPlayer3.NamePlateConfig.tEarnCoins(this.nEarnedMedalsCount);
//TJAPlayer3.NamePlateConfig.tEarnCoins(this.nEarnedMedalsCount);
#endregion

View File

@ -67,8 +67,8 @@ namespace TJAPlayer3
#region [Dan title]
int amount = 1;
if (TJAPlayer3.NamePlateConfig.data.DanTitles[iPlayer] != null)
amount += TJAPlayer3.NamePlateConfig.data.DanTitles[iPlayer].Count;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles != null)
amount += TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles.Count;
this.ttkDanTitles = new TitleTextureKey[amount];
@ -76,9 +76,9 @@ namespace TJAPlayer3
this.ttkDanTitles[0] = new TitleTextureKey("新人", this.pfHeyaFont, Color.White, Color.Black, 1000);
int idx = 1;
if (TJAPlayer3.NamePlateConfig.data.DanTitles[iPlayer] != null)
if (TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles != null)
{
foreach (var item in TJAPlayer3.NamePlateConfig.data.DanTitles[iPlayer])
foreach (var item in TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles)
{
if (item.Value.isGold == true)
this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.pfHeyaFont, Color.Gold, Color.Black, 1000);
@ -93,8 +93,8 @@ namespace TJAPlayer3
#region [Plate title]
amount = 1;
if (TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer] != null)
amount += TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer].Count;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles != null)
amount += TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles.Count;
this.ttkTitles = new TitleTextureKey[amount];
@ -102,9 +102,9 @@ namespace TJAPlayer3
this.ttkTitles[0] = new TitleTextureKey("初心者", this.pfHeyaFont, Color.Black, Color.Transparent, 1000);
idx = 1;
if (TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer] != null)
if (TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles != null)
{
foreach (var item in TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer])
foreach (var item in TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles)
{
this.ttkTitles[idx] = new TitleTextureKey(item.Key, this.pfHeyaFont, Color.Black, Color.Transparent, 1000);
idx++;
@ -280,7 +280,7 @@ namespace TJAPlayer3
}
if (TJAPlayer3.Tx.Puchichara[pos].unlock != null
&& !TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Contains(TJAPlayer3.Skin.Puchicharas_Name[pos]))
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[pos]))
TJAPlayer3.Tx.Heya_Lock?.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, scroll.Item1, scroll.Item2);
#endregion
@ -367,7 +367,7 @@ namespace TJAPlayer3
int danGrade = 0;
if (pos > 0)
{
danGrade = TJAPlayer3.NamePlateConfig.data.DanTitles[iPlayer][this.ttkDanTitles[pos].str文字].clearStatus;
danGrade = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles[this.ttkDanTitles[pos].str文字].clearStatus;
}
var scroll = DrawSide_Menu(i + (TJAPlayer3.Skin.Heya_Side_Menu_Count / 2));
@ -411,9 +411,9 @@ namespace TJAPlayer3
int iType = -1;
if (TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer] != null &&
TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer].ContainsKey(this.ttkTitles[pos].str文字))
iType = TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer][this.ttkTitles[pos].str文字].iType;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles != null &&
TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles.ContainsKey(this.ttkTitles[pos].str文字))
iType = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles[this.ttkTitles[pos].str文字].iType;
else if (pos == 0)
iType = 0;
@ -546,8 +546,10 @@ namespace TJAPlayer3
if (ess == ESelectStatus.SELECTED)
{
//PuchiChara.tGetPuchiCharaIndexByName(p);
TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent;
TJAPlayer3.NamePlateConfig.tApplyHeyaChanges();
//TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent;
//TJAPlayer3.NamePlateConfig.tApplyHeyaChanges();
TJAPlayer3.SaveFileInstances[iPlayer].data.PuchiChara = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent;
TJAPlayer3.SaveFileInstances[iPlayer].tApplyHeyaChanges();
TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].welcome.t再生する();
iCurrentMenu = -1;
@ -555,8 +557,11 @@ namespace TJAPlayer3
}
else if (ess == ESelectStatus.SUCCESS)
{
TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]);
TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer);
//TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]);
//TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer);
TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]);
TJAPlayer3.SaveFileInstances[iPlayer].tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0]);
}
}
@ -565,18 +570,18 @@ namespace TJAPlayer3
//TJAPlayer3.Tx.Loading?.t2D描画(TJAPlayer3.app.Device, 18, 7);
// Reload character, a bit time expensive but with a O(N) memory complexity instead of O(N * M)
TJAPlayer3.Tx.ReloadCharacter(TJAPlayer3.NamePlateConfig.data.Character[iPlayer], iCharacterCurrent, iPlayer);
TJAPlayer3.NamePlateConfig.data.Character[iPlayer] = iCharacterCurrent;
TJAPlayer3.Tx.ReloadCharacter(TJAPlayer3.SaveFileInstances[iPlayer].data.Character, iCharacterCurrent, iPlayer);
TJAPlayer3.SaveFileInstances[iPlayer].data.Character = iCharacterCurrent;
// Update the character
TJAPlayer3.NamePlateConfig.tUpdateCharacterName(iPlayer, TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent]);
TJAPlayer3.SaveFileInstances[iPlayer].tUpdateCharacterName(TJAPlayer3.Skin.Characters_DirName[iCharacterCurrent]);
// Welcome voice using Sanka
TJAPlayer3.Skin.voiceTitleSanka[iPlayer]?.t再生する();
CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL);
TJAPlayer3.NamePlateConfig.tApplyHeyaChanges();
TJAPlayer3.SaveFileInstances[iPlayer].tApplyHeyaChanges();
iCurrentMenu = -1;
this.tResetOpts();
@ -589,17 +594,17 @@ namespace TJAPlayer3
if (iDanTitleCurrent > 0)
{
iG = TJAPlayer3.NamePlateConfig.data.DanTitles[iPlayer][this.ttkDanTitles[iDanTitleCurrent].str文字].isGold;
cs = TJAPlayer3.NamePlateConfig.data.DanTitles[iPlayer][this.ttkDanTitles[iDanTitleCurrent].str文字].clearStatus;
iG = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles[this.ttkDanTitles[iDanTitleCurrent].str文字].isGold;
cs = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles[this.ttkDanTitles[iDanTitleCurrent].str文字].clearStatus;
}
TJAPlayer3.NamePlateConfig.data.Dan[iPlayer] = this.ttkDanTitles[iDanTitleCurrent].str文字;
TJAPlayer3.NamePlateConfig.data.DanGold[iPlayer] = iG;
TJAPlayer3.NamePlateConfig.data.DanType[iPlayer] = cs;
TJAPlayer3.SaveFileInstances[iPlayer].data.Dan = this.ttkDanTitles[iDanTitleCurrent].str文字;
TJAPlayer3.SaveFileInstances[iPlayer].data.DanGold = iG;
TJAPlayer3.SaveFileInstances[iPlayer].data.DanType = cs;
TJAPlayer3.NamePlate.tNamePlateRefreshTitles(iPlayer);
TJAPlayer3.NamePlateConfig.tApplyHeyaChanges();
TJAPlayer3.SaveFileInstances[iPlayer].tApplyHeyaChanges();
iCurrentMenu = -1;
this.tResetOpts();
@ -607,19 +612,19 @@ namespace TJAPlayer3
else if (iCurrentMenu == 3)
{
TJAPlayer3.NamePlateConfig.data.Title[iPlayer] = this.ttkTitles[iTitleCurrent].str文字;
TJAPlayer3.SaveFileInstances[iPlayer].data.Title = this.ttkTitles[iTitleCurrent].str文字;
if (TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer] != null
&& TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer].ContainsKey(this.ttkTitles[iTitleCurrent].str文字))
TJAPlayer3.NamePlateConfig.data.TitleType[iPlayer] = TJAPlayer3.NamePlateConfig.data.NamePlateTitles[iPlayer][this.ttkTitles[iTitleCurrent].str文字].iType;
if (TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles != null
&& TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles.ContainsKey(this.ttkTitles[iTitleCurrent].str文字))
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleType = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles[this.ttkTitles[iTitleCurrent].str文字].iType;
else if (iTitleCurrent == 0)
TJAPlayer3.NamePlateConfig.data.TitleType[iPlayer] = 0;
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleType = 0;
else
TJAPlayer3.NamePlateConfig.data.TitleType[iPlayer] = -1;
TJAPlayer3.SaveFileInstances[iPlayer].data.TitleType = -1;
TJAPlayer3.NamePlate.tNamePlateRefreshTitles(iPlayer);
TJAPlayer3.NamePlateConfig.tApplyHeyaChanges();
TJAPlayer3.SaveFileInstances[iPlayer].tApplyHeyaChanges();
iCurrentMenu = -1;
this.tResetOpts();
@ -709,10 +714,10 @@ namespace TJAPlayer3
private void tResetOpts()
{
// Retrieve titles if they exist
var _titles = TJAPlayer3.NamePlateConfig.data.NamePlateTitles[this.iPlayer];
var _title = TJAPlayer3.NamePlateConfig.data.Title[this.iPlayer];
var _dans = TJAPlayer3.NamePlateConfig.data.DanTitles[this.iPlayer];
var _dan = TJAPlayer3.NamePlateConfig.data.Dan[this.iPlayer];
var _titles = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles;
var _title = TJAPlayer3.SaveFileInstances[iPlayer].data.Title;
var _dans = TJAPlayer3.SaveFileInstances[iPlayer].data.DanTitles;
var _dan = TJAPlayer3.SaveFileInstances[iPlayer].data.Dan;
iTitleCurrent = 0;
@ -724,7 +729,7 @@ namespace TJAPlayer3
if (_dans != null && _dans.ContainsKey(_dan))
iDanTitleCurrent = _dans.Keys.ToList().IndexOf(_dan) + 1;
iCharacterCurrent = Math.Max(0, Math.Min(TJAPlayer3.Skin.Characters_Ptn - 1, TJAPlayer3.NamePlateConfig.data.Character[this.iPlayer]));
iCharacterCurrent = Math.Max(0, Math.Min(TJAPlayer3.Skin.Characters_Ptn - 1, TJAPlayer3.SaveFileInstances[iPlayer].data.Character));
//iPuchiCharaCurrent = Math.Max(0, Math.Min(TJAPlayer3.Skin.Puchichara_Ptn - 1, TJAPlayer3.NamePlateConfig.data.PuchiChara[this.iPlayer]));
iPuchiCharaCurrent = PuchiChara.tGetPuchiCharaIndexByName(this.iPlayer);
@ -834,7 +839,7 @@ namespace TJAPlayer3
#region [Check unlockable]
if (TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock != null
&& !TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]))
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]))
{
this.ttkInfoSection = new TitleTextureKey(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMessage()
, this.pfHeyaFont, Color.White, Color.Black, 1000);
@ -850,10 +855,10 @@ namespace TJAPlayer3
// Add "If unlocked" to select directly
if (TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock != null
&& !TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]))
&& !TJAPlayer3.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]))
{
(bool, string) response = TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMet(
new int[] { TJAPlayer3.NamePlateConfig.data.Medals[TJAPlayer3.SaveFile] });
new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals });
Color responseColor = (response.Item1) ? Color.Lime : Color.Red;
// Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu

View File

@ -19,14 +19,14 @@ namespace TJAPlayer3
if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName))
{
if (TJAPlayer3.NamePlateConfig.data.Title[player] == "" || TJAPlayer3.NamePlateConfig.data.Title[player] == null)
if (TJAPlayer3.SaveFileInstances[player].data.Title == "" || TJAPlayer3.SaveFileInstances[player].data.Title == null)
this.pfName[player] = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), TJAPlayer3.Skin.NamePlate_Font_Name_Size_Normal);
else
this.pfName[player] = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), TJAPlayer3.Skin.NamePlate_Font_Name_Size_WithTitle);
}
else
{
if (TJAPlayer3.NamePlateConfig.data.Title[player] == "" || TJAPlayer3.NamePlateConfig.data.Title[player] == null)
if (TJAPlayer3.SaveFileInstances[player].data.Title == "" || TJAPlayer3.SaveFileInstances[player].data.Title == null)
this.pfName[player] = new CPrivateFastFont(new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.NamePlate_Font_Name_Size_Normal);
else
this.pfName[player] = new CPrivateFastFont(new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.NamePlate_Font_Name_Size_WithTitle);
@ -54,10 +54,10 @@ namespace TJAPlayer3
for (int player = 0; player < 5; player++)
{
if (TJAPlayer3.NamePlateConfig.data.DanType[player] < 0) TJAPlayer3.NamePlateConfig.data.DanType[player] = 0;
else if (TJAPlayer3.NamePlateConfig.data.DanType[player] > 2) TJAPlayer3.NamePlateConfig.data.DanType[player] = 2;
if (TJAPlayer3.SaveFileInstances[player].data.DanType < 0) TJAPlayer3.SaveFileInstances[player].data.DanType = 0;
else if (TJAPlayer3.SaveFileInstances[player].data.DanType > 2) TJAPlayer3.SaveFileInstances[player].data.DanType = 2;
if (TJAPlayer3.NamePlateConfig.data.TitleType[player] < 0) TJAPlayer3.NamePlateConfig.data.TitleType[player] = 0;
if (TJAPlayer3.SaveFileInstances[player].data.TitleType < 0) TJAPlayer3.SaveFileInstances[player].data.TitleType = 0;
tNamePlateRefreshTitles(player);
}
@ -96,9 +96,9 @@ namespace TJAPlayer3
if (!TJAPlayer3.ConfigIni.bAIBattleMode || actualPlayer == 0)
{
name = TJAPlayer3.NamePlateConfig.data.Name[player];
title = TJAPlayer3.NamePlateConfig.data.Title[player];
dan = TJAPlayer3.NamePlateConfig.data.Dan[player];
name = TJAPlayer3.SaveFileInstances[player].data.Name;
title = TJAPlayer3.SaveFileInstances[player].data.Title;
dan = TJAPlayer3.SaveFileInstances[player].data.Dan;
}
txTitle[player] = TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(new TitleTextureKey(title, pfTitle, Color.Black, Color.Empty, 1000));
@ -131,9 +131,9 @@ namespace TJAPlayer3
tNamePlateDisplayNamePlateBase(x, y, 3);
// Upper (title) plate
if (TJAPlayer3.NamePlateConfig.data.Title[player] != "" && TJAPlayer3.NamePlateConfig.data.Title[player] != null)
if (TJAPlayer3.SaveFileInstances[player].data.Title != "" && TJAPlayer3.SaveFileInstances[player].data.Title != null)
{
int tt = TJAPlayer3.NamePlateConfig.data.TitleType[player];
int tt = TJAPlayer3.SaveFileInstances[player].data.TitleType;
if (tt >= 0 && tt < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title)
{
var _tex = TJAPlayer3.Tx.NamePlate_Title[tt][ctAnimatedNamePlateTitle.n現在の値 % TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[tt]];
@ -147,10 +147,10 @@ namespace TJAPlayer3
}
// Dan plate
if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null)
if (TJAPlayer3.SaveFileInstances[player].data.Dan != "" && TJAPlayer3.SaveFileInstances[player].data.Dan != null)
{
tNamePlateDisplayNamePlateBase(x, y, 7);
tNamePlateDisplayNamePlateBase(x, y, (8 + TJAPlayer3.NamePlateConfig.data.DanType[player]));
tNamePlateDisplayNamePlateBase(x, y, (8 + TJAPlayer3.SaveFileInstances[player].data.DanType));
}
// Glow
@ -172,7 +172,7 @@ namespace TJAPlayer3
tNamePlateDisplayNamePlateBase(x, y, 1);
// Name text squash (to add to skin config)
if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null)
if (TJAPlayer3.SaveFileInstances[player].data.Dan != "" && TJAPlayer3.SaveFileInstances[player].data.Dan != null)
{
if (txName[player].szテクスチャサイズ.Width >= 120.0f)
txName[player].vc拡大縮小倍率.X = 120.0f / txName[player].szテクスチャサイズ.Width;
@ -188,11 +188,11 @@ namespace TJAPlayer3
txdan[player].vc拡大縮小倍率.X = 66.0f / txdan[player].szテクスチャサイズ.Width;
// Dan text
if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null)
if (TJAPlayer3.SaveFileInstances[player].data.Dan != "" && TJAPlayer3.SaveFileInstances[player].data.Dan != null)
{
this.txdan[player].t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.NamePlate_Dan_Offset[0], y + TJAPlayer3.Skin.NamePlate_Dan_Offset[1]);
if (TJAPlayer3.NamePlateConfig.data.DanGold[player])
if (TJAPlayer3.SaveFileInstances[player].data.DanGold)
{
TJAPlayer3.Tx.NamePlateBase.b乗算合成 = true;
tNamePlateDisplayNamePlateBase(x, y, 11);
@ -201,7 +201,7 @@ namespace TJAPlayer3
}
// Title text
if (TJAPlayer3.NamePlateConfig.data.Title[player] != "" && TJAPlayer3.NamePlateConfig.data.Title[player] != null)
if (TJAPlayer3.SaveFileInstances[player].data.Title != "" && TJAPlayer3.SaveFileInstances[player].data.Title != null)
{
if (txTitle[player].szテクスチャサイズ.Width >= 160)
{
@ -212,7 +212,7 @@ namespace TJAPlayer3
txTitle[player].t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.NamePlate_Title_Offset[0], y + TJAPlayer3.Skin.NamePlate_Title_Offset[1]);
// Name text
if (TJAPlayer3.NamePlateConfig.data.Dan[player] == "" || TJAPlayer3.NamePlateConfig.data.Dan[player] == null)
if (TJAPlayer3.SaveFileInstances[player].data.Dan == "" || TJAPlayer3.SaveFileInstances[player].data.Dan == null)
this.txName[player].t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.NamePlate_Name_Offset_WithTitle[0], y + TJAPlayer3.Skin.NamePlate_Name_Offset_WithTitle[1]);
else
this.txName[player].t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.NamePlate_Name_Offset_Full[0], y + TJAPlayer3.Skin.NamePlate_Name_Offset_Full[1]);
@ -230,9 +230,9 @@ namespace TJAPlayer3
if (Opacity == 0)
return;
if(TJAPlayer3.NamePlateConfig.data.TitleType[player] != 0)
if(TJAPlayer3.SaveFileInstances[player].data.TitleType != 0)
{
int Type = TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1;
int Type = TJAPlayer3.SaveFileInstances[player].data.TitleType - 1;
if (this.ctNamePlateEffect.n現在の値 <= 10)
{
tNamePlateStarDraw(player, 1.0f - (ctNamePlateEffect.n現在の値 / 10f * 1.0f), x + 63, y + 25);
@ -365,7 +365,7 @@ namespace TJAPlayer3
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, x + 193, y + 6);
*/
int tt = TJAPlayer3.NamePlateConfig.data.TitleType[player];
int tt = TJAPlayer3.SaveFileInstances[player].data.TitleType;
if (tt >= 0 && tt < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title && TJAPlayer3.Tx.NamePlate_Title_Big[tt] != null) {
TJAPlayer3.Tx.NamePlate_Title_Big[tt].Opacity = this.ctNamePlateEffect.n現在の値 >= 112 ? (int)(255 - (this.ctNamePlateEffect.n現在の値 - 112) * 31.875f) : 255;
TJAPlayer3.Tx.NamePlate_Title_Big[tt].vc拡大縮小倍率.X = this.ctNamePlateEffect.n現在の値 >= 112 ? 1.0f : (this.ctNamePlateEffect.n現在の値 - 105) / 8f;
@ -384,7 +384,7 @@ namespace TJAPlayer3
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].vc拡大縮小倍率.Y = Scale;
TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, x, y);
*/
int tt = TJAPlayer3.NamePlateConfig.data.TitleType[player];
int tt = TJAPlayer3.SaveFileInstances[player].data.TitleType;
if (tt >= 0 && tt < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title && TJAPlayer3.Tx.NamePlate_Title_Small[tt] != null)
{
TJAPlayer3.Tx.NamePlate_Title_Small[tt].vc拡大縮小倍率.X = Scale;

View File

@ -137,6 +137,7 @@
<Compile Include="Common\Discord.cs" />
<Compile Include="Common\Easing.cs" />
<Compile Include="Common\NamePlateConfig.cs" />
<Compile Include="Common\SaveFile.cs" />
<Compile Include="Databases\DBCDN.cs" />
<Compile Include="Databases\DBEncyclopediaMenus.cs" />
<Compile Include="Databases\DBPuchichara.cs" />