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

Modals base code, Characters and CDN base database files and few fixes

This commit is contained in:
0aubsq 2022-03-06 20:20:45 +01:00
parent 88cea16c2d
commit c4315e33da
13 changed files with 368 additions and 26 deletions

View File

@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FDK;
using System.Drawing;
namespace TJAPlayer3
{
internal class Modal
{
public Modal(EModalType mt, int ra, int re, EModalFormat mf, int p = 0)
{
modalType = mt;
modalFormat = mf;
rarity = ra;
reference = re;
player = p;
tSetupModal();
}
private void tSetupModal()
{
CTexture[] arrRef;
if (modalFormat == EModalFormat.Half)
arrRef = TJAPlayer3.Tx.Modal_Half;
else
arrRef = TJAPlayer3.Tx.Modal_Full;
if (modalType == EModalType.Coin)
_box = arrRef[arrRef.Length - 1];
else
{
int usedTex = Math.Max(0, Math.Min(arrRef.Length - 2, rarity));
_box = arrRef[usedTex];
}
_boxRect = new Rectangle(
(modalFormat == EModalFormat.Full || player == 0)
? 0
: 640,
0,
(modalFormat == EModalFormat.Full)
? 1280
: 640,
720);
}
public void tDisplayModal()
{
_box?.t2D描画(TJAPlayer3.app.Device, 0, 0, _boxRect);
}
public enum EModalType
{
Coin,
Puchichara,
Character,
Title,
Text,
Confirm,
}
public enum EModalFormat
{
Full,
Half,
}
// Coin number for coin; database/unlockable asset for puchichara, character and title; no effect on text, confirm
public int reference;
public int rarity;
public EModalType modalType;
public EModalFormat modalFormat;
// For modalFormat = Half only
public int player;
private CTexture _box;
private Rectangle _boxRect;
}
}

View File

@ -0,0 +1,80 @@
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace TJAPlayer3
{
class DBCDN
{
public void tDBCDN()
{
if (!File.Exists(@".\Databases\CDN.json"))
tSaveFile();
tLoadFile();
}
#region [Auxiliary classes]
public class CDNHooks
{
public string id = "id";
public Dictionary<string, string> title = new Dictionary<string, string>()
{
["default"] = "title",
};
public Dictionary<string, string> subtitle = new Dictionary<string, string>()
{
["default"] = "subtitle",
};
public string[] difficulties = { "easy", "normal", "hard", "extreme", "extra", "tower", "dan" };
public string life = "life";
public string updateDate = "updateDate";
public string creationDate = "creationDate";
public string uploadDate = "uploadDate";
public Dictionary<string, string> md5 = new Dictionary<string, string>()
{
["default"] = "md5",
};
public string charter = "charter";
}
public class CDNData
{
[JsonProperty("baseUrl")]
public string BaseUrl;
[JsonProperty("download")]
public Dictionary<string, string> Download = new Dictionary<string, string>()
{
["default"] = "download/",
};
[JsonProperty("songList")]
public string SongList;
[JsonProperty("hooks")]
public CDNHooks Hooks;
}
#endregion
public Dictionary<string, CDNData> data = new Dictionary<string, CDNData>();
#region [private]
private void tSaveFile()
{
ConfigManager.SaveConfig(data, @".\Databases\CDN.json");
}
private void tLoadFile()
{
data = ConfigManager.GetConfig<Dictionary<string, CDNData>>(@".\Databases\CDN.json");
}
#endregion
}
}

View File

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

View File

@ -9,12 +9,15 @@ namespace TJAPlayer3
{
DBPuchichara = new DBPuchichara();
DBUnlockables = new DBUnlockables();
DBCharacter = new DBCharacter();
DBPuchichara.tDBPuchichara();
DBUnlockables.tDBUnlockables();
DBCharacter.tDBCharacter();
}
public DBPuchichara DBPuchichara;
public DBUnlockables DBUnlockables;
public DBCharacter DBCharacter;
}
}

View File

@ -274,13 +274,17 @@ namespace TJAPlayer3
[90004] = "Not enough coins !",
[90005] = "The following condition : ",
[900] = "Resume",
[901] = "Restart",
[902] = "Quit",
[9000] = "Off",
[9001] = "On",
[9002] = "None",
[9003] = "きまぐれ",
[9004] = "でたらめ",
[9006] = "Special Training Mode",
[9007] = "Null",
[9003] = "Shuffle",
[9004] = "Chaos",
[9006] = "Training Mode",
[9007] = "-",
[9008] = "Speed",
[9009] = "DORON",
[9010] = "Flip Notes",

View File

@ -265,25 +265,25 @@ namespace TJAPlayer3
[90004] = "Nombre de pièces insuffisant !",
[90005] = "La condition suivante : ",
[900] = "Continuez",
[901] = "Redémarrage",
[902] = "Sortir",
[900] = "Reprendre",
[901] = "Recommencer",
[902] = "Quitter",
[9000] = "しない",
[9001] = "する",
[9002] = "なし",
[9003] = "きまぐれ",
[9004] = "でたらめ",
[9006] = "特訓モード",
[9007] = "使用不可",
[9008] = "はやさ",
[9009] = "ドロン",
[9010] = "あべこべ",
[9011] = "ランダム",
[9012] = "ゲームモード",
[9013] = "オート",
[9014] = "ボイス",
[9015] = "音色",
[9000] = "Non",
[9001] = "Oui",
[9002] = "Aucun",
[9003] = "Hasardeux",
[9004] = "Chaotique",
[9006] = "Mode entraînement",
[9007] = "-",
[9008] = "Vitesse",
[9009] = "DORON",
[9010] = "Inverse",
[9011] = "Hasard",
[9012] = "Mode de jeu",
[9013] = "Auto",
[9014] = "Voix",
[9015] = "Instrument",
};
}
}

View File

@ -329,7 +329,11 @@ namespace TJAPlayer3
[90004] = "コインが足りません !",
[90005] = "下記の条件 : ",
[9000] = "しない",
[900] = "もどる",
[901] = "やりなおす",
[902] = "演奏中止",
[9000] = "しない",
[9001] = "する",
[9002] = "なし",
[9003] = "きまぐれ",

View File

@ -24,6 +24,9 @@ namespace TJAPlayer3
const string TOWERRESULT = @"8_TowerResult\";
const string HEYA = @"10_Heya\";
const string CHARACTERS = @"11_Characters\";
const string MODALS = @"11_Modals\";
const string ONLINELOUNGE = @"12_OnlineLounge\";
const string TOWERSELECT = @"13_TowerSelect\";
// InGame
const string CHARA = @"1_Chara\";
@ -935,12 +938,40 @@ namespace TJAPlayer3
#endregion
#region [11_Modals]
Modal_Full = new CTexture[6];
Modal_Half = new CTexture[6];
for (int i = 0; i < 5; i++)
{
Modal_Full[i] = TxC(MODALS + i.ToString() + @"_full.png");
Modal_Half[i] = TxC(MODALS + i.ToString() + @"_half.png");
}
Modal_Full[Modal_Full.Length - 1] = TxC(MODALS + @"Coin_full.png");
Modal_Half[Modal_Full.Length - 1] = TxC(MODALS + @"Coin_half.png");
#endregion
#region [12_OnlineLounge]
OnlineLounge_Background = TxC(ONLINELOUNGE + @"Background.png");
OnlineLounge_Box = TxC(ONLINELOUNGE + @"Box.png");
OnlineLounge_Center_Menu_Bar = TxC(ONLINELOUNGE + @"Center_Menu_Bar.png");
OnlineLounge_Center_Menu_Box_Slot = TxC(ONLINELOUNGE + @"Center_Menu_Box_Slot.png");
OnlineLounge_Side_Menu = TxC(ONLINELOUNGE + @"Side_Menu.png");
OnlineLounge_Song_Box = TxC(ONLINELOUNGE + @"Song_Box.png");
#endregion
#region [13_TowerSelect]
#endregion
}
public void ReloadCharacter(int old, int newC, int player, bool primary = false)
public void ReloadCharacter(int old, int newC, int player, bool primary = false)
{
if (old == newC)
return;
@ -1720,6 +1751,28 @@ namespace TJAPlayer3
#endregion
#region [11_Modals]
public CTexture[] Modal_Full,
Modal_Half;
#endregion
#region [12_OnlineLounge]
public CTexture OnlineLounge_Background,
OnlineLounge_Box,
OnlineLounge_Center_Menu_Bar,
OnlineLounge_Center_Menu_Box_Slot,
OnlineLounge_Side_Menu,
OnlineLounge_Song_Box;
#endregion
#region [13_TowerSelect]
#endregion
#region [ ]
public List<CTexture> listTexture = new List<CTexture>();

View File

@ -121,15 +121,18 @@
<Compile Include="Animations\IAnimatable.cs" />
<Compile Include="Animations\Linear.cs" />
<Compile Include="Common\CCrypto.cs" />
<Compile Include="Common\Modal.cs" />
<Compile Include="Common\CSongDict.cs" />
<Compile Include="Common\Favorites.cs" />
<Compile Include="Common\ConfigManager.cs" />
<Compile Include="Common\Discord.cs" />
<Compile Include="Common\Easing.cs" />
<Compile Include="Common\NamePlateConfig.cs" />
<Compile Include="Databases\DBCDN.cs" />
<Compile Include="Databases\DBPuchichara.cs" />
<Compile Include="Databases\DBUnlockables.cs" />
<Compile Include="Databases\Databases.cs" />
<Compile Include="Databases\DBPuchichara.cs" />
<Compile Include="Databases\DBCharacter.cs" />
<Compile Include="I18N\CLang_es.cs" />
<Compile Include="I18N\CLang_fr.cs" />
<Compile Include="I18N\CLang_en.cs" />

41
Test/Databases/CDN.json Normal file
View File

@ -0,0 +1,41 @@
{
"Pidgey's TJADB CDN" : {
"baseUrl": "https://dev.pidgey.net:8443/",
"download": {
"en": "download/en/",
"default": "download/orig/",
},
"songList": "api/browse",
"hooks": {
"id": "_id",
"title": {
"en": "title_en",
"default": "title_orig",
},
"subtitle": {
"en": "subtitle_en",
"default": "subtitle_orig",
},
"difficulties": [
"d_kantan",
"d_futsuu",
"d_muzukashii",
"d_oni",
"d_ura",
"d_tower",
"d_dan",
],
"life": "d_tower_lives",
"updateDate": "last_updated",
"creationDate": "created",
"uploadDate": "uploaded",
"md5": {
"en": "tja_en_md5",
"default": "tja_orig_md5",
},
"charter": "charter",
}
}
}

View File

@ -0,0 +1,7 @@
{
0: {
"name" : "None",
"rarity": "Common",
"author": "",
},
}

View File

@ -66,6 +66,7 @@ Discord: https://discord.gg/aA8scTvZ6B
[funnym0th/OpenTaiko Spanish Translation](https://github.com/funnym0th) (@funnym0th)
[basketballsmash/English README Translation](https://twitter.com/basketballsmash)(@basketballsmash)
[Meowgister/OpenTaiko English Translation](https://www.youtube.com/channel/UCDi5puZaJLMUA6OgIAb7rmQ)
[WHMHammer/OpenTaiko Chinese Translation](https://github.com/whmhammer)(@WHMHammer)
[Aioilight/TJAPlayer3](https://github.com/aioilight/TJAPlayer3)(@aioilight)
[TwoPointZero/TJAPlayer3](https://github.com/twopointzero/TJAPlayer3)(@twopointzero)
[KabanFriends/TJAPlayer3](https://github.com/KabanFriends/TJAPlayer3/tree/features)(@KabanFriends)

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB