Add a file where you can set names for puchicharas which are now displayed in Heya
This commit is contained in:
parent
6c1700612c
commit
e8a3f28579
@ -6,12 +6,13 @@ Before using :
|
||||
|
||||
; フォントレンダリングに使用するフォント名
|
||||
; Font name used for font rendering.
|
||||
FontName=マキナス 4 Square
|
||||
FontName=廻想体 ネクスト UP B
|
||||
|
||||
; Boxの説明文のフォントレンダリングに使用するフォント名
|
||||
; Font name used for font rendering.
|
||||
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.
|
||||
; 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.
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace TJAPlayer3
|
||||
{
|
||||
ObjectCreationHandling = ObjectCreationHandling.Auto,
|
||||
DefaultValueHandling = DefaultValueHandling.Include,
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
// ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
Converters = new StringEnumConverter[] { new StringEnumConverter() }
|
||||
};
|
||||
|
||||
|
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace TJAPlayer3
|
||||
{
|
||||
@ -107,7 +108,10 @@ namespace TJAPlayer3
|
||||
clearStatus = cs;
|
||||
}
|
||||
|
||||
[JsonProperty("isGold")]
|
||||
public bool isGold;
|
||||
|
||||
[JsonProperty("clearStatus")]
|
||||
public int clearStatus;
|
||||
}
|
||||
|
||||
@ -118,6 +122,7 @@ namespace TJAPlayer3
|
||||
iType = type;
|
||||
}
|
||||
|
||||
[JsonProperty("iType")]
|
||||
public int iType;
|
||||
}
|
||||
|
||||
@ -134,23 +139,37 @@ namespace TJAPlayer3
|
||||
|
||||
public class Data
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string[] Name = { "プレイヤー1", "プレイヤー2" };
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string[] Title = { "初心者", "初心者" };
|
||||
|
||||
[JsonProperty("dan")]
|
||||
public string[] Dan = { "新人", "新人" };
|
||||
|
||||
[JsonProperty("danGold")]
|
||||
public bool[] DanGold = { false, false };
|
||||
|
||||
[JsonProperty("danType")]
|
||||
public int[] DanType = { 0, 0 };
|
||||
|
||||
[JsonProperty("titleType")]
|
||||
public int[] TitleType = { 0, 0 };
|
||||
|
||||
public int[] PuchiChara = { 2, 11 };
|
||||
[JsonProperty("puchiChara")]
|
||||
public int[] PuchiChara = { 0, 0 };
|
||||
|
||||
[JsonProperty("medals")]
|
||||
public int[] Medals = { 0, 0 };
|
||||
|
||||
[JsonProperty("character")]
|
||||
public int[] Character = { 0, 0 };
|
||||
|
||||
[JsonProperty("danTitles")]
|
||||
public Dictionary<string, CDanTitle>[] DanTitles = new Dictionary<string, CDanTitle>[2];
|
||||
|
||||
[JsonProperty("namePlateTitles")]
|
||||
public Dictionary<string, CNamePlateTitle>[] NamePlateTitles = new Dictionary<string, CNamePlateTitle>[2];
|
||||
}
|
||||
|
||||
|
@ -264,6 +264,12 @@ namespace TJAPlayer3
|
||||
private set;
|
||||
}
|
||||
|
||||
public static Databases Databases
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public static CStage起動 stage起動
|
||||
{
|
||||
get;
|
||||
@ -2040,6 +2046,10 @@ for (int i = 0; i < 3; i++) {
|
||||
//---------------------
|
||||
NamePlateConfig = new NamePlateConfig();
|
||||
NamePlateConfig.tNamePlateConfig();
|
||||
|
||||
Databases = new Databases();
|
||||
Databases.tDatabases();
|
||||
|
||||
ConfigIni = new CConfigIni();
|
||||
string path = strEXEのあるフォルダ + "Config.ini";
|
||||
if( File.Exists( path ) )
|
||||
|
54
TJAPlayer3/Databases/DBPuchichara.cs
Normal file
54
TJAPlayer3/Databases/DBPuchichara.cs
Normal 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
|
||||
}
|
||||
}
|
16
TJAPlayer3/Databases/Databases.cs
Normal file
16
TJAPlayer3/Databases/Databases.cs
Normal 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;
|
||||
}
|
||||
}
|
@ -486,7 +486,7 @@ namespace TJAPlayer3
|
||||
this.nEarnedMedalsCount[0] = 0;
|
||||
this.nEarnedMedalsCount[1] = 0;
|
||||
|
||||
// Medals (implement P2 later)
|
||||
// Medals
|
||||
|
||||
int nTotalHits = this.st演奏記録.Drums.nGreat数 + this.st演奏記録.Drums.nMiss数 + this.st演奏記録.Drums.nPerfect数;
|
||||
|
||||
|
@ -110,8 +110,41 @@ namespace TJAPlayer3
|
||||
iCurrentMenu = -1;
|
||||
iMainMenuCurrent = 0;
|
||||
|
||||
#region [PuchiChara stuff]
|
||||
|
||||
// Tmp variables
|
||||
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;
|
||||
|
||||
this.tResetOpts();
|
||||
@ -199,6 +232,13 @@ namespace TJAPlayer3
|
||||
TJAPlayer3.Skin.Game_PuchiChara[1]));
|
||||
|
||||
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 iPuchiCharaCurrent;
|
||||
|
||||
private TitleTextureKey[] ttkPuchiCharaNames;
|
||||
|
||||
private int iCharacterCurrent;
|
||||
private int iDanTitleCurrent;
|
||||
private int iTitleCurrent;
|
||||
|
@ -125,6 +125,8 @@
|
||||
<Compile Include="Common\Discord.cs" />
|
||||
<Compile Include="Common\Easing.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_fr.cs" />
|
||||
<Compile Include="I18N\CLang_en.cs" />
|
||||
|
26
Test/Databases/Puchichara.json
Normal file
26
Test/Databases/Puchichara.json
Normal 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",
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue
Block a user