1
0
mirror of synced 2025-01-18 09:04:47 +01:00

複数の踊り子に対応 (#216)

* 複数の踊り子に対応

* 無駄なコメントの削除
This commit is contained in:
Takkkom 2022-06-01 11:34:20 +09:00 committed by GitHub
parent de79490113
commit 753fb6ec5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 115 additions and 67 deletions

View File

@ -1552,43 +1552,6 @@ namespace TJAPlayer3
}
#endregion
#region Dancer
else if (strCommand == "Game_Dancer_X")
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 5; i++)
{
Game_Dancer_X[i] = int.Parse(strSplit[i]);
}
}
else if (strCommand == "Game_Dancer_Y")
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 5; i++)
{
Game_Dancer_Y[i] = int.Parse(strSplit[i]);
}
}
else if (strCommand == "Game_Dancer_Motion")
{
Game_Dancer_Motion = strParam;
}
// Game_Dancer_PtnはTextrueLoader.csで反映されます。
else if (strCommand == "Game_Dancer_Beat")
{
ParseInt32(value => Game_Dancer_Beat = value);
}
else if (strCommand == "Game_Dancer_Gauge")
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 5; i++)
{
Game_Dancer_Gauge[i] = int.Parse(strSplit[i]);
}
}
#endregion
#region Mob
else if (strCommand == "Game_Mob_Beat")
{

View File

@ -34,7 +34,7 @@ namespace TJAPlayer3
const string TOWERSELECT = @"13_TowerSelect\";
// InGame
const string DANCER = @"2_Dancer\";
public const string DANCER = @"2_Dancer\";
const string MOB = @"3_Mob\";
const string COURSESYMBOL = @"4_CourseSymbol\";
public const string BACKGROUND = @"5_Background\";
@ -366,24 +366,6 @@ namespace TJAPlayer3
Bar = TxC(GAME + @"Bar.png");
Bar_Branch = TxC(GAME + @"Bar_Branch.png");
#endregion
#region Dancer
TJAPlayer3.Skin.Game_Dancer_Ptn = TJAPlayer3.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + DANCER + @"1\"));
if (TJAPlayer3.Skin.Game_Dancer_Ptn != 0)
{
Dancer = new CTexture[5][];
for (int i = 0; i < 5; i++)
{
Dancer[i] = new CTexture[TJAPlayer3.Skin.Game_Dancer_Ptn];
for (int p = 0; p < TJAPlayer3.Skin.Game_Dancer_Ptn; p++)
{
Dancer[i][p] = TxC(GAME + DANCER + (i + 1) + @"\" + p.ToString() + ".png");
}
}
}
#endregion
#region Mob
@ -1725,9 +1707,6 @@ namespace TJAPlayer3
#endregion
#region
public CTexture[][] Dancer;
#endregion
#region
public CTexture[] Mob;
#endregion

View File

@ -15,13 +15,13 @@ namespace TJAPlayer3
public void Render()
{
for (int i = 0; i < 5; i++)
/*for (int i = 0; i < 5; i++)
{
for (int k = 0; k < TJAPlayer3.Skin.Game_Dancer_Ptn; k++)
{
NullCheckAndRender(ref TJAPlayer3.Tx.Dancer[i][k]);
}
}
}*/
NullCheckAndRender(ref TJAPlayer3.Tx.Effects_GoGoSplash);
NullCheckAndRender(ref TJAPlayer3.Tx.Runner);

View File

@ -4,7 +4,8 @@ using System.Text;
using System.Drawing;
using System.Runtime.InteropServices;
using FDK;
using System.Diagnostics;
namespace TJAPlayer3
{
internal class CAct演奏DrumsDancer : CActivity
@ -30,7 +31,34 @@ namespace TJAPlayer3
}
public override void OnManagedリソースの作成()
{
{
Random random = new Random();
Dancer = new CTexture[5][];
var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.DANCER}");
if (System.IO.Directory.Exists($@"{dancerOrigindir}"))
{
var dirs = System.IO.Directory.GetDirectories($@"{dancerOrigindir}");
if (dirs.Length > 0)
{
var path = dirs[random.Next(0, dirs.Length)];
LoadDancerConifg(path);
TJAPlayer3.Skin.Game_Dancer_Ptn = TJAPlayer3.t連番画像の枚数を数える($@"{path}\1\");
if (TJAPlayer3.Skin.Game_Dancer_Ptn != 0)
{
for (int i = 0; i < 5; i++)
{
Dancer[i] = new CTexture[TJAPlayer3.Skin.Game_Dancer_Ptn];
for (int p = 0; p < TJAPlayer3.Skin.Game_Dancer_Ptn; p++)
{
Dancer[i][p] = TJAPlayer3.tテクスチャの生成($@"{path}\{(i + 1)}\{p}.png");
}
}
}
}
}
this.ar踊り子モーション番号 = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Game_Dancer_Motion);
if(this.ar踊り子モーション番号 == null) ar踊り子モーション番号 = C変換.ar配列形式のstringをint配列に変換して返す("0,0");
this.ct踊り子モーション = new CCounter(0, this.ar踊り子モーション番号.Length - 1, 0.01, CSound管理.rc演奏用タイマ);
@ -38,7 +66,12 @@ namespace TJAPlayer3
}
public override void OnManagedリソースの解放()
{
{
for (int i = 0; i < 5; i++)
{
TJAPlayer3.t安全にDisposeする(ref Dancer[i]);
}
base.OnManagedリソースの解放();
}
@ -57,10 +90,10 @@ namespace TJAPlayer3
{
for (int i = 0; i < 5; i++)
{
if (TJAPlayer3.Tx.Dancer[i][this.ar踊り子モーション番号[(int)this.ct踊り子モーション.n現在の値]] != null)
if (this.Dancer[i] != null && this.Dancer[i][this.ar踊り子モーション番号[(int)this.ct踊り子モーション.n現在の値]] != null)
{
if ((int)TJAPlayer3.stage演奏ドラム画面.actGauge.db現在のゲージ値[0] >= TJAPlayer3.Skin.Game_Dancer_Gauge[i])
TJAPlayer3.Tx.Dancer[i][this.ar踊り子モーション番号[(int)this.ct踊り子モーション.n現在の値]].t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.Skin.Game_Dancer_Y[i]);
this.Dancer[i][this.ar踊り子モーション番号[(int)this.ct踊り子モーション.n現在の値]].t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.Skin.Game_Dancer_Y[i]);
}
}
}
@ -72,7 +105,80 @@ namespace TJAPlayer3
#region[ private ]
//-----------------
public int[] ar踊り子モーション番号;
public CCounter ct踊り子モーション;
public CCounter ct踊り子モーション;
private CTexture[][] Dancer;
private void LoadDancerConifg(string dancerPath)
{
var _str = "";
TJAPlayer3.Skin.LoadSkinConfigFromFile(dancerPath + @"\DancerConfig.txt", ref _str);
string[] delimiter = { "\n" };
string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
foreach (string s in strSingleLine)
{
string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' });
if ((str.Length != 0) && (str[0] != ';'))
{
try
{
string strCommand;
string strParam;
string[] strArray = str.Split(new char[] { '=' });
if (strArray.Length == 2)
{
strCommand = strArray[0].Trim();
strParam = strArray[1].Trim();
if (strCommand == "Game_Dancer_X")
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 5; i++)
{
TJAPlayer3.Skin.Game_Dancer_X[i] = int.Parse(strSplit[i]);
}
}
else if (strCommand == "Game_Dancer_Y")
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 5; i++)
{
TJAPlayer3.Skin.Game_Dancer_Y[i] = int.Parse(strSplit[i]);
}
}
else if (strCommand == "Game_Dancer_Motion")
{
TJAPlayer3.Skin.Game_Dancer_Motion = strParam;
}
// Game_Dancer_PtnはTextrueLoader.csで反映されます。
else if (strCommand == "Game_Dancer_Beat")
{
TJAPlayer3.Skin.Game_Dancer_Beat = int.Parse(strParam);
}
else if (strCommand == "Game_Dancer_Gauge")
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 5; i++)
{
TJAPlayer3.Skin.Game_Dancer_Gauge[i] = int.Parse(strSplit[i]);
}
}
}
continue;
}
catch (Exception exception)
{
Trace.TraceError(exception.ToString());
Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)");
continue;
}
}
}
}
//-----------------
#endregion
}