1
0
mirror of synced 2024-11-24 07:30:21 +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")
{
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]);
}
@ -2208,7 +2208,7 @@ namespace TJAPlayer3
else if (strCommand == "SongSelect_Search_Bar_Y")
{
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]);
}
@ -7603,8 +7603,8 @@ namespace TJAPlayer3
public int[] SongSelect_SongNumber_Y = new int[] { 167, 167 };
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_Y = new int[] { 320, 420, 520, 620 };
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, 720 };
public int[] SongSelect_Difficulty_Back = new int[] { 640, 290 };
public int[] SongSelect_Level_Offset = new int[] { 610, 40 };

View File

@ -2082,14 +2082,14 @@ namespace TJAPlayer3
}
}
// Context vars :
// 0~3 - Selected difficulty (1~4P)
// 4 - Current menu (0~3 for each player)
// 0~4 - Selected difficulty (1~5P)
// 5 - Current menu (0~4 for each player)
else if (emc == eMenuContext.Random)
{
// To change with a new texture
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)
{
@ -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]);
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]);
}
}
@ -2120,22 +2120,22 @@ namespace TJAPlayer3
if ((TJAPlayer3.Pad.b押されたDGB(Eパッド.Decide)) ||
((TJAPlayer3.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.Return))))
{
{
if (emc == eMenuContext.SearchByDifficulty)
{
{
TJAPlayer3.Skin.sound決定音.t再生する();
_contextVars[2]++;
if (_contextVars[2] >= 2)
{
{
//tMenuContextDisable();
return true;
}
else if (_contextVars[2] == 1)
{
{
// Set default level for each difficulty
switch (_contextVars[0])
{
{
case (int)Difficulty.Easy:
_contextVars[1] = 1;
break;
@ -2149,17 +2149,22 @@ namespace TJAPlayer3
_contextVars[1] = 8;
break;
}
}
}
}
}
else if (emc == eMenuContext.Random)
{
{
TJAPlayer3.Skin.sound決定音.t再生する();
_contextVars[4]++;
if (_contextVars[4] >= TJAPlayer3.ConfigIni.nPlayerCount)
_contextVars[5]++;
if (_contextVars[5] >= TJAPlayer3.ConfigIni.nPlayerCount)
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再生する();
_contextVars[_contextVars[4]]--;
_contextVars[_contextVars[5]]--;
// 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再生する();
_contextVars[_contextVars[4]]++;
_contextVars[_contextVars[5]]++;
// 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()
{
var usedDiffs = new int[] { -1, -1, -1, -1 };
var usedDiffs = new int[] { -1, -1, -1, -1, -1 };
var mandatoryDiffs = new List<int>();
#region [Fetch context informations]

View File

@ -1413,7 +1413,7 @@ namespace TJAPlayer3
// Display medals debug
// 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());