1
0
mirror of synced 2024-11-24 15:40:22 +01:00

Fix #353 + 5P random box crash

This commit is contained in:
0auBSQ 2023-02-17 04:59:51 +09:00
parent 6de628b1ba
commit 07482f377b
4 changed files with 32 additions and 27 deletions

View File

@ -2200,7 +2200,7 @@ namespace TJAPlayer3
else if (strCommand == "SongSelect_Search_Bar_X") else if (strCommand == "SongSelect_Search_Bar_X")
{ {
string[] strSplit = strParam.Split(','); string[] strSplit = strParam.Split(',');
for (int i = 0; i < 4; i++) for (int i = 0; i < 5; i++)
{ {
SongSelect_Search_Bar_X[i] = int.Parse(strSplit[i]); SongSelect_Search_Bar_X[i] = int.Parse(strSplit[i]);
} }
@ -2208,7 +2208,7 @@ namespace TJAPlayer3
else if (strCommand == "SongSelect_Search_Bar_Y") else if (strCommand == "SongSelect_Search_Bar_Y")
{ {
string[] strSplit = strParam.Split(','); string[] strSplit = strParam.Split(',');
for (int i = 0; i < 4; i++) for (int i = 0; i < 5; i++)
{ {
SongSelect_Search_Bar_Y[i] = int.Parse(strSplit[i]); SongSelect_Search_Bar_Y[i] = int.Parse(strSplit[i]);
} }
@ -7603,8 +7603,8 @@ namespace TJAPlayer3
public int[] SongSelect_SongNumber_Y = new int[] { 167, 167 }; public int[] SongSelect_SongNumber_Y = new int[] { 167, 167 };
public int[] SongSelect_SongNumber_Interval = new int[] { 16, 0 }; public int[] SongSelect_SongNumber_Interval = new int[] { 16, 0 };
public int[] SongSelect_Search_Bar_X = new int[] { 640, 640, 640, 640 }; public int[] SongSelect_Search_Bar_X = new int[] { 640, 640, 640, 640, 640 };
public int[] SongSelect_Search_Bar_Y = new int[] { 320, 420, 520, 620 }; public int[] SongSelect_Search_Bar_Y = new int[] { 320, 420, 520, 620, 720 };
public int[] SongSelect_Difficulty_Back = new int[] { 640, 290 }; public int[] SongSelect_Difficulty_Back = new int[] { 640, 290 };
public int[] SongSelect_Level_Offset = new int[] { 610, 40 }; public int[] SongSelect_Level_Offset = new int[] { 610, 40 };

View File

@ -2082,14 +2082,14 @@ namespace TJAPlayer3
} }
} }
// Context vars : // Context vars :
// 0~3 - Selected difficulty (1~4P) // 0~4 - Selected difficulty (1~5P)
// 4 - Current menu (0~3 for each player) // 5 - Current menu (0~4 for each player)
else if (emc == eMenuContext.Random) else if (emc == eMenuContext.Random)
{ {
// To change with a new texture // To change with a new texture
TJAPlayer3.Tx.SongSelect_Search_Window?.t2D描画(TJAPlayer3.app.Device, 0, 0); TJAPlayer3.Tx.SongSelect_Search_Window?.t2D描画(TJAPlayer3.app.Device, 0, 0);
for (int i = 0; i <= _contextVars[4]; i++) for (int i = 0; i <= _contextVars[5]; i++)
{ {
if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null) if (TJAPlayer3.Tx.Dani_Difficulty_Cymbol != null)
{ {
@ -2102,9 +2102,9 @@ namespace TJAPlayer3
} }
if (i < _contextVars[4]) if (i < _contextVars[5])
TJAPlayer3.Tx.SongSelect_Search_Arrow?.t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongSelect_Search_Bar_X[i], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[i]); TJAPlayer3.Tx.SongSelect_Search_Arrow?.t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongSelect_Search_Bar_X[i], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[i]);
else if (i == _contextVars[4]) else if (i == _contextVars[5])
TJAPlayer3.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongSelect_Search_Bar_X[i], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[i]); TJAPlayer3.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongSelect_Search_Bar_X[i], TJAPlayer3.Skin.SongSelect_Search_Bar_Y[i]);
} }
} }
@ -2156,10 +2156,15 @@ namespace TJAPlayer3
{ {
TJAPlayer3.Skin.sound決定音.t再生する(); TJAPlayer3.Skin.sound決定音.t再生する();
_contextVars[4]++; _contextVars[5]++;
if (_contextVars[4] >= TJAPlayer3.ConfigIni.nPlayerCount) if (_contextVars[5] >= TJAPlayer3.ConfigIni.nPlayerCount)
return true; return true;
_contextVars[_contextVars[4]] = Math.Min((int)Difficulty.Oni, TJAPlayer3.ConfigIni.nDefaultCourse); if (_contextVars[5] >= 1 && TJAPlayer3.ConfigIni.bAIBattleMode)
{
_contextVars[1] = _contextVars[0];
return true;
}
_contextVars[_contextVars[5]] = Math.Min((int)Difficulty.Oni, TJAPlayer3.ConfigIni.nDefaultCourse);
} }
} }
@ -2184,9 +2189,9 @@ namespace TJAPlayer3
{ {
TJAPlayer3.Skin.sound変更音.t再生する(); TJAPlayer3.Skin.sound変更音.t再生する();
_contextVars[_contextVars[4]]--; _contextVars[_contextVars[5]]--;
// Clamp values // Clamp values
_contextVars[_contextVars[4]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[4]])); _contextVars[_contextVars[5]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[5]]));
} }
} }
@ -2210,9 +2215,9 @@ namespace TJAPlayer3
{ {
TJAPlayer3.Skin.sound変更音.t再生する(); TJAPlayer3.Skin.sound変更音.t再生する();
_contextVars[_contextVars[4]]++; _contextVars[_contextVars[5]]++;
// Clamp values // Clamp values
_contextVars[_contextVars[4]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[4]])); _contextVars[_contextVars[5]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[5]]));
} }
} }

View File

@ -1533,7 +1533,7 @@ namespace TJAPlayer3
private void tSelectSongRandomly() private void tSelectSongRandomly()
{ {
var usedDiffs = new int[] { -1, -1, -1, -1 }; var usedDiffs = new int[] { -1, -1, -1, -1, -1 };
var mandatoryDiffs = new List<int>(); var mandatoryDiffs = new List<int>();
#region [Fetch context informations] #region [Fetch context informations]

View File

@ -1413,7 +1413,7 @@ namespace TJAPlayer3
// Display medals debug // Display medals debug
// TJAPlayer3.act文字コンソール.tPrint(0, 12, C文字コンソール.Eフォント種別.白, this.nEarnedMedalsCount[0].ToString()); // TJAPlayer3.act文字コンソール.tPrint(0, 12, C文字コンソール.Eフォント種別.白, this.nEarnedMedalsCount[0].ToString());
TJAPlayer3.act文字コンソール.tPrint(0, 25, C文字コンソール.Eフォント種別., this.nEarnedMedalsCount[1].ToString()); //TJAPlayer3.act文字コンソール.tPrint(0, 25, C文字コンソール.Eフォント種別.白, this.nEarnedMedalsCount[1].ToString());