1
0
mirror of synced 2024-11-14 10:57:36 +01:00

Add Character metadata (+Heya) and remove the 120 puchichara limit (The puchichara count is now automatically determined by your puchichara sheet size)

This commit is contained in:
0aubsq 2022-03-08 21:11:34 +01:00
parent 5f78d93159
commit 95c2eb21b5
14 changed files with 213 additions and 61 deletions

View File

@ -1253,6 +1253,11 @@ namespace FDK
protected Rectangle rc全画像; // テクスチャ作ったらあとは不変
public Color4 color4 = new Color4(1f, 1f, 1f, 1f); // アルファ以外は不変
public void tUpdateColor4(Color4 c4)
{
this.color4 = c4;
}
//-----------------
#endregion
}

View File

@ -2630,6 +2630,12 @@ namespace TJAPlayer3
#endregion
#region Puchichara
public int Puchichara_Ptn;
#endregion
#region Characters
public int Characters_Ptn;

View File

@ -658,9 +658,16 @@ namespace TJAPlayer3
DanC_ExamCymbol = TxC(GAME + DANC + @"ExamCymbol.png");
DanC_MiniNumber = TxC(GAME + DANC + @"MiniNumber.png");
#endregion
#region PuichiChara
PuchiChara = TxC(GAME + PUCHICHARA + @"0.png");
TJAPlayer3.Skin.Puchichara_Ptn = 5 * Math.Max(1, (PuchiChara.szテクスチャサイズ.Height / 256));
#endregion
#region Training
Tokkun_DownBG = TxC(GAME + TRAINING + @"Down.png");
Tokkun_BigTaiko = TxC(GAME + TRAINING + @"BigTaiko.png");

View File

@ -90,13 +90,7 @@ namespace TJAPlayer3
int p = TJAPlayer3.GetActualPlayer(player);
int puriChar = TJAPlayer3.NamePlateConfig.data.PuchiChara[p];
// To change later
if (puriChar < 0)
puriChar = 0;
else if (puriChar >= 120)
puriChar = 119;
int puriChar = Math.Max(0, Math.Min(TJAPlayer3.Skin.Puchichara_Ptn - 1, TJAPlayer3.NamePlateConfig.data.PuchiChara[p]));
int puriColumn = puriChar % 5;
int puriRow = puriChar / 5;

View File

@ -116,33 +116,20 @@ namespace TJAPlayer3
#region [PuchiChara stuff]
// Tmp variables
iPuchiCharaCount = 120;
iPuchiCharaCount = TJAPlayer3.Skin.Puchichara_Ptn;
ttkPuchiCharaNames = new TitleTextureKey[iPuchiCharaCount];
ttkPuchiCharaAuthors = new TitleTextureKey[iPuchiCharaCount];
var RarityToColor = new Dictionary<string, Color>
{
["Common"] = Color.White,
["Uncommon"] = Color.Lime,
["Rare"] = Color.Blue,
["Epic"] = Color.Purple,
["Legendary"] = Color.Orange,
};
var dbData = TJAPlayer3.Databases.DBPuchichara.data;
for (int i = 0; i < iPuchiCharaCount; i++)
{
if (dbData.ContainsKey(i))
{
Color textColor = Color.White;
string rarity = dbData[i].Rarity;
if (RarityToColor.ContainsKey(rarity))
textColor = RarityToColor[rarity];
var textColor = tRarityToColor(rarity);
ttkPuchiCharaNames[i] = new TitleTextureKey(dbData[i].Name, this.pfHeyaFont, textColor, Color.Black, 1000);
ttkPuchiCharaAuthors[i] = new TitleTextureKey(dbData[i].Author, this.pfHeyaFont, Color.White, Color.Black, 1000);
@ -151,8 +138,30 @@ namespace TJAPlayer3
#endregion
#region [Character stuff]
iCharacterCount = TJAPlayer3.Skin.Characters_Ptn;
ttkCharacterAuthors = new TitleTextureKey[iCharacterCount];
ttkCharacterNames = new TitleTextureKey[iCharacterCount];
var dbDataChara = TJAPlayer3.Databases.DBCharacter.data;
for (int i = 0; i < iCharacterCount; i++)
{
if (dbDataChara.ContainsKey(i))
{
string rarity = dbDataChara[i].Rarity;
var textColor = tRarityToColor(rarity);
ttkCharacterNames[i] = new TitleTextureKey(dbDataChara[i].Name, this.pfHeyaFont, textColor, Color.Black, 1000);
ttkCharacterAuthors[i] = new TitleTextureKey(dbDataChara[i].Author, this.pfHeyaFont, Color.White, Color.Black, 1000);
}
}
#endregion
this.tResetOpts();
this.PuchiChara.IdleAnimation();
@ -193,15 +202,15 @@ namespace TJAPlayer3
if (iCurrentMenu != -1 || iMainMenuCurrent != i)
{
tmpTex.color4 = C変換.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Side_Menu.color4 = C変換.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Side_Menu?.tUpdateColor4(C変換.ColorToColor4(Color.DarkGray));
}
else
{
tmpTex.color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Side_Menu.color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Side_Menu?.tUpdateColor4(C変換.ColorToColor4(Color.White));
}
TJAPlayer3.Tx.Heya_Side_Menu.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 164, 26 + 80 * i);
TJAPlayer3.Tx.Heya_Side_Menu?.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 164, 26 + 80 * i);
tmpTex.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 164, 40 + 80 * i);
}
@ -217,29 +226,29 @@ namespace TJAPlayer3
if (i != 0)
{
TJAPlayer3.Tx.PuchiChara.color4 = C変換.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = C変換.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Lock.color4 = C変換.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.PuchiChara?.tUpdateColor4(C変換.ColorToColor4(Color.DarkGray));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(C変換.ColorToColor4(Color.DarkGray));
TJAPlayer3.Tx.Heya_Lock?.tUpdateColor4(C変換.ColorToColor4(Color.DarkGray));
}
else
{
TJAPlayer3.Tx.PuchiChara.color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Lock.color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.PuchiChara?.tUpdateColor4(C変換.ColorToColor4(Color.White));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(C変換.ColorToColor4(Color.White));
TJAPlayer3.Tx.Heya_Lock?.tUpdateColor4(C変換.ColorToColor4(Color.White));
}
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 200);
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 200);
int puriColumn = pos % 5;
int puriRow = pos / 5;
TJAPlayer3.Tx.PuchiChara.t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 320 + (int)(PuchiChara.sineY),
TJAPlayer3.Tx.PuchiChara?.t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 320 + (int)(PuchiChara.sineY),
new Rectangle((PuchiChara.Counter.n現在の値 + 2 * puriColumn) * TJAPlayer3.Skin.Game_PuchiChara[0],
puriRow * TJAPlayer3.Skin.Game_PuchiChara[1],
TJAPlayer3.Skin.Game_PuchiChara[0],
TJAPlayer3.Skin.Game_PuchiChara[1]));
TJAPlayer3.Tx.PuchiChara.color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.PuchiChara?.tUpdateColor4(C変換.ColorToColor4(Color.White));
#region [Database related values]
@ -279,23 +288,38 @@ namespace TJAPlayer3
if (i != 0)
{
if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null)
TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = C変換.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = C変換.ColorToColor4(Color.DarkGray);
TJAPlayer3.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(C変換.ColorToColor4(Color.DarkGray));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(C変換.ColorToColor4(Color.DarkGray));
}
else
{
if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null)
TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(C変換.ColorToColor4(Color.White));
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(C変換.ColorToColor4(Color.White));
}
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 200);
TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot?.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 200);
TJAPlayer3.Tx.Characters_Heya_Preview[pos]?.t2D拡大率考慮中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 320);
if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null)
TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = C変換.ColorToColor4(Color.White);
TJAPlayer3.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(C変換.ColorToColor4(Color.White));
#region [Database related values]
if (ttkCharacterNames[pos] != null)
{
CTexture tmpTex = TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(ttkCharacterNames[pos]);
tmpTex.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 434);
}
if (ttkCharacterAuthors[pos] != null)
{
CTexture tmpTex = TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(ttkCharacterAuthors[pos]);
tmpTex.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 460);
}
#endregion
}
}
@ -634,6 +658,8 @@ namespace TJAPlayer3
private TitleTextureKey[] ttkPuchiCharaNames;
private TitleTextureKey[] ttkPuchiCharaAuthors;
private TitleTextureKey[] ttkCharacterNames;
private TitleTextureKey[] ttkCharacterAuthors;
private TitleTextureKey ttkInfoSection;
private int iCharacterCurrent;
@ -648,8 +674,30 @@ namespace TJAPlayer3
iTitleCurrent = 0;
iDanTitleCurrent = 0;
iCharacterCurrent = TJAPlayer3.NamePlateConfig.data.Character[this.iPlayer];
iPuchiCharaCurrent = TJAPlayer3.NamePlateConfig.data.PuchiChara[this.iPlayer];
iCharacterCurrent = Math.Max(0, Math.Min(TJAPlayer3.Skin.Characters_Ptn - 1, TJAPlayer3.NamePlateConfig.data.Character[this.iPlayer]));
iPuchiCharaCurrent = Math.Max(0, Math.Min(TJAPlayer3.Skin.Puchichara_Ptn - 1, TJAPlayer3.NamePlateConfig.data.PuchiChara[this.iPlayer]));
}
private Dictionary<string, Color> RarityToColor = new Dictionary<string, Color>
{
["Poor"] = Color.Gray,
["Common"] = Color.White,
["Uncommon"] = Color.Lime,
["Rare"] = Color.Blue,
["Epic"] = Color.Purple,
["Legendary"] = Color.Orange,
};
private Color tRarityToColor(string rarity)
{
Color textColor = Color.White;
if (RarityToColor.ContainsKey(rarity))
textColor = RarityToColor[rarity];
return textColor;
}
private bool tMove(int off)
@ -662,7 +710,10 @@ namespace TJAPlayer3
tUpdateUnlockableTextPuchi();
}
else if (iCurrentMenu == 1)
{
iCharacterCurrent = (iCharacterCount + iCharacterCurrent + off) % iCharacterCount;
}
else if (iCurrentMenu == 2)
iDanTitleCurrent = (this.ttkDanTitles.Length + iDanTitleCurrent + off) % this.ttkDanTitles.Length;
else if (iCurrentMenu == 3)
@ -673,6 +724,21 @@ namespace TJAPlayer3
return true;
}
#region [Unlockables]
/*
* FAILED : Selection/Purchase failed (failed condition)
* SUCCESS : Purchase succeed (without selection)
* SELECTED : Selection succeed
*/
private enum ESelectStatus
{
FAILED,
SUCCESS,
SELECTED
};
#region [Puchi unlockables]
private void tUpdateUnlockableTextPuchi()
{
@ -712,17 +778,9 @@ namespace TJAPlayer3
return ESelectStatus.SELECTED;
}
/*
* FAILED : Selection/Purchase failed (failed condition)
* SUCCESS : Purchase succeed (without selection)
* SELECTED : Selection succeed
*/
private enum ESelectStatus
{
FAILED,
SUCCESS,
SELECTED
};
#endregion
#endregion

View File

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using Newtonsoft.Json;
namespace TJAPlayer3
{
internal class API
{
public API(int selectedCDN)
{
}
public async Task<object> PostCallAPI(string url, object jsonObject)
{
try
{
using (HttpClient client = new HttpClient())
{
var content = new StringContent(jsonObject.ToString(), Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
if (response != null)
{
var jsonString = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<object>(jsonString);
}
}
}
catch (Exception e)
{
}
return null;
}
public async Task<object> GetCallAPI(string url)
{
try
{
using (HttpClient client = new HttpClient())
{
var response = await client.GetAsync(url);
if (response != null)
{
var jsonString = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<object>(jsonString);
}
}
}
catch (Exception e)
{
}
return null;
}
}
}

View File

@ -284,6 +284,7 @@
<Compile Include="Stages\09.Ending\CStage終了.cs" />
<Compile Include="Stages\10.ChangeSkin\CStageChangeSkin.cs" />
<Compile Include="Stages\11.Heya\CStageHeya.cs" />
<Compile Include="Stages\12.OnlineLounge\API.cs" />
<Compile Include="Stages\CActDFPFont.cs" />
<Compile Include="Stages\CActFIFOBlack.cs" />
<Compile Include="Stages\CActFIFOStart.cs" />
@ -379,6 +380,9 @@
<PackageReference Include="SharpDX.Mathematics">
<Version>4.2.0</Version>
</PackageReference>
<PackageReference Include="System.Net.Http">
<Version>4.3.4</Version>
</PackageReference>
<PackageReference Include="System.ValueTuple">
<Version>4.5.0</Version>
</PackageReference>
@ -394,19 +398,35 @@
-->
<PropertyGroup>
<PostBuildEvent>move /y "$(TargetDir)FDK.dll" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)FDK.pdb" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)Hnx8.ReadJEnc.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)Newtonsoft.Json.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)SharpDX.Direct3D9.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)SharpDX.DirectInput.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)SharpDX.DirectInput.*" "$(SolutionDir)Test\dll"
move /y "$(TargetDir)SharpDX.DirectSound.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)SharpDX.DXGI.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)SharpDX.Mathematics.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)SharpDX.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)Bass.Net.dll" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)DirectShowLib-2005.dll" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)SlimDX.dll" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)CSharpTest.Net.Collections.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)System.*" "$(SolutionDir)Test\dll\"
copy /y "$(SolutionDir)Readme.txt" "$(SolutionDir)Test\"</PostBuildEvent>
</PropertyGroup>
<Import Project="packages\SharpDX.2.6.3\build\SharpDX.targets" Condition="Exists('packages\SharpDX.2.6.3\build\SharpDX.targets')" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.