1
0
mirror of synced 2024-11-28 09:20:53 +01:00

Add a file where you can set names for puchicharas which are now displayed in Heya

This commit is contained in:
0aubsq 2022-02-05 16:25:58 +01:00
parent 6c1700612c
commit e8a3f28579
10 changed files with 175 additions and 4 deletions

View File

@ -6,12 +6,13 @@ Before using :
; フォントレンダリングに使用するフォント名 ; フォントレンダリングに使用するフォント名
; Font name used for font rendering. ; Font name used for font rendering.
FontName=マキナス 4 Square FontName=廻想体 ネクスト UP B
; Boxの説明文のフォントレンダリングに使用するフォント名 ; Boxの説明文のフォントレンダリングに使用するフォント名
; Font name used for font rendering. ; Font name used for font rendering.
BoxFontName=廻想体 ネクスト UP B BoxFontName=廻想体 ネクスト UP B
; Use " マキナス 4 Square " if you want to use the font used on the skin assets (but letters are wider and more blocky on it)
; Feel free to use only one of those fonts if you don't like one of them (both are blocky, the second one is more standard for English), Kaisoutai contains less kanji than Makinas. ; Feel free to use only one of those fonts if you don't like one of them (both are blocky, the second one is more standard for English), Kaisoutai contains less kanji than Makinas.
; If you don't like both fonts, keep the default ones (MS Gothic), but keep in mind that the skin is built around the given fonts. ; If you don't like both fonts, keep the default ones (MS Gothic), but keep in mind that the skin is built around the given fonts.

View File

@ -15,7 +15,7 @@ namespace TJAPlayer3
{ {
ObjectCreationHandling = ObjectCreationHandling.Auto, ObjectCreationHandling = ObjectCreationHandling.Auto,
DefaultValueHandling = DefaultValueHandling.Include, DefaultValueHandling = DefaultValueHandling.Include,
ContractResolver = new CamelCasePropertyNamesContractResolver(), // ContractResolver = new CamelCasePropertyNamesContractResolver(),
Converters = new StringEnumConverter[] { new StringEnumConverter() } Converters = new StringEnumConverter[] { new StringEnumConverter() }
}; };

View File

@ -5,6 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using Newtonsoft.Json;
namespace TJAPlayer3 namespace TJAPlayer3
{ {
@ -107,7 +108,10 @@ namespace TJAPlayer3
clearStatus = cs; clearStatus = cs;
} }
[JsonProperty("isGold")]
public bool isGold; public bool isGold;
[JsonProperty("clearStatus")]
public int clearStatus; public int clearStatus;
} }
@ -118,6 +122,7 @@ namespace TJAPlayer3
iType = type; iType = type;
} }
[JsonProperty("iType")]
public int iType; public int iType;
} }
@ -134,23 +139,37 @@ namespace TJAPlayer3
public class Data public class Data
{ {
[JsonProperty("name")]
public string[] Name = { "プレイヤー1", "プレイヤー2" }; public string[] Name = { "プレイヤー1", "プレイヤー2" };
[JsonProperty("title")]
public string[] Title = { "初心者", "初心者" }; public string[] Title = { "初心者", "初心者" };
[JsonProperty("dan")]
public string[] Dan = { "新人", "新人" }; public string[] Dan = { "新人", "新人" };
[JsonProperty("danGold")]
public bool[] DanGold = { false, false }; public bool[] DanGold = { false, false };
[JsonProperty("danType")]
public int[] DanType = { 0, 0 }; public int[] DanType = { 0, 0 };
[JsonProperty("titleType")]
public int[] TitleType = { 0, 0 }; public int[] TitleType = { 0, 0 };
public int[] PuchiChara = { 2, 11 }; [JsonProperty("puchiChara")]
public int[] PuchiChara = { 0, 0 };
[JsonProperty("medals")]
public int[] Medals = { 0, 0 }; public int[] Medals = { 0, 0 };
[JsonProperty("character")]
public int[] Character = { 0, 0 }; public int[] Character = { 0, 0 };
[JsonProperty("danTitles")]
public Dictionary<string, CDanTitle>[] DanTitles = new Dictionary<string, CDanTitle>[2]; public Dictionary<string, CDanTitle>[] DanTitles = new Dictionary<string, CDanTitle>[2];
[JsonProperty("namePlateTitles")]
public Dictionary<string, CNamePlateTitle>[] NamePlateTitles = new Dictionary<string, CNamePlateTitle>[2]; public Dictionary<string, CNamePlateTitle>[] NamePlateTitles = new Dictionary<string, CNamePlateTitle>[2];
} }

View File

@ -264,6 +264,12 @@ namespace TJAPlayer3
private set; private set;
} }
public static Databases Databases
{
get;
private set;
}
public static CStage起動 stage起動 public static CStage起動 stage起動
{ {
get; get;
@ -2040,6 +2046,10 @@ for (int i = 0; i < 3; i++) {
//--------------------- //---------------------
NamePlateConfig = new NamePlateConfig(); NamePlateConfig = new NamePlateConfig();
NamePlateConfig.tNamePlateConfig(); NamePlateConfig.tNamePlateConfig();
Databases = new Databases();
Databases.tDatabases();
ConfigIni = new CConfigIni(); ConfigIni = new CConfigIni();
string path = strEXEのあるフォルダ + "Config.ini"; string path = strEXEのあるフォルダ + "Config.ini";
if( File.Exists( path ) ) if( File.Exists( path ) )

View File

@ -0,0 +1,54 @@
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace TJAPlayer3
{
class DBPuchichara
{
public void tDBPuchichara()
{
if (!File.Exists(@".\Databases\Puchichara.json"))
tSaveFile();
tLoadFile();
}
#region [Auxiliary classes]
public class PuchicharaData
{
public PuchicharaData(string pcn, string pcr)
{
Name = pcn;
Rarity = pcr;
}
[JsonProperty("name")]
public string Name;
[JsonProperty("rarity")]
public string Rarity;
}
#endregion
public Dictionary<int, PuchicharaData> data = new Dictionary<int, PuchicharaData>();
#region [private]
private void tSaveFile()
{
ConfigManager.SaveConfig(data, @".\Databases\Puchichara.json");
}
private void tLoadFile()
{
data = ConfigManager.GetConfig<Dictionary<int, PuchicharaData>>(@".\Databases\Puchichara.json");
}
#endregion
}
}

View File

@ -0,0 +1,16 @@
using System.Collections.Generic;
using System.IO;
namespace TJAPlayer3
{
class Databases
{
public void tDatabases()
{
DBPuchichara = new DBPuchichara();
DBPuchichara.tDBPuchichara();
}
public DBPuchichara DBPuchichara;
}
}

View File

@ -486,7 +486,7 @@ namespace TJAPlayer3
this.nEarnedMedalsCount[0] = 0; this.nEarnedMedalsCount[0] = 0;
this.nEarnedMedalsCount[1] = 0; this.nEarnedMedalsCount[1] = 0;
// Medals (implement P2 later) // Medals
int nTotalHits = this.st演奏記録.Drums.nGreat数 + this.st演奏記録.Drums.nMiss数 + this.st演奏記録.Drums.nPerfect数; int nTotalHits = this.st演奏記録.Drums.nGreat数 + this.st演奏記録.Drums.nMiss数 + this.st演奏記録.Drums.nPerfect数;

View File

@ -110,8 +110,41 @@ namespace TJAPlayer3
iCurrentMenu = -1; iCurrentMenu = -1;
iMainMenuCurrent = 0; iMainMenuCurrent = 0;
#region [PuchiChara stuff]
// Tmp variables // Tmp variables
iPuchiCharaCount = 120; iPuchiCharaCount = 120;
ttkPuchiCharaNames = 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];
ttkPuchiCharaNames[i] = new TitleTextureKey(dbData[i].Name, this.pfHeyaFont, textColor, Color.Black, 1000);
}
}
#endregion
iCharacterCount = TJAPlayer3.Skin.Characters_Ptn; iCharacterCount = TJAPlayer3.Skin.Characters_Ptn;
this.tResetOpts(); this.tResetOpts();
@ -199,6 +232,13 @@ namespace TJAPlayer3
TJAPlayer3.Skin.Game_PuchiChara[1])); TJAPlayer3.Skin.Game_PuchiChara[1]));
TJAPlayer3.Tx.PuchiChara.color4 = Color.White; TJAPlayer3.Tx.PuchiChara.color4 = Color.White;
if (ttkPuchiCharaNames[pos] != null)
{
CTexture tmpTex = TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(ttkPuchiCharaNames[pos]);
tmpTex.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, 620 + 302 * i, 448);
}
} }
} }
@ -530,6 +570,9 @@ namespace TJAPlayer3
private int iMainMenuCurrent; private int iMainMenuCurrent;
private int iPuchiCharaCurrent; private int iPuchiCharaCurrent;
private TitleTextureKey[] ttkPuchiCharaNames;
private int iCharacterCurrent; private int iCharacterCurrent;
private int iDanTitleCurrent; private int iDanTitleCurrent;
private int iTitleCurrent; private int iTitleCurrent;

View File

@ -125,6 +125,8 @@
<Compile Include="Common\Discord.cs" /> <Compile Include="Common\Discord.cs" />
<Compile Include="Common\Easing.cs" /> <Compile Include="Common\Easing.cs" />
<Compile Include="Common\NamePlateConfig.cs" /> <Compile Include="Common\NamePlateConfig.cs" />
<Compile Include="Databases\Databases.cs" />
<Compile Include="Databases\DBPuchichara.cs" />
<Compile Include="I18N\CLang_es.cs" /> <Compile Include="I18N\CLang_es.cs" />
<Compile Include="I18N\CLang_fr.cs" /> <Compile Include="I18N\CLang_fr.cs" />
<Compile Include="I18N\CLang_en.cs" /> <Compile Include="I18N\CLang_en.cs" />

View File

@ -0,0 +1,26 @@
{
0: {
"name" : "Empty0",
"rarity": "Common",
},
1: {
"name" : "Empty1",
"rarity": "Common",
},
2: {
"name" : "Empty2",
"rarity": "Uncommon",
},
3: {
"name" : "Empty3",
"rarity": "Rare",
},
4: {
"name" : "Empty4",
"rarity": "Epic",
},
5: {
"name" : "Empty5",
"rarity": "Legendary",
},
}