1
0
mirror of synced 2025-02-07 06:41:24 +01:00

Improve extra plates for Dan Dojo select menu, allow all textures to be localized (#587)

* Improve extra plates for Dan Dojo select menu, allow all textures to be localized

* Add SENotes translations
This commit is contained in:
DragonRatTiger / リュウコ 2024-04-01 05:46:18 -05:00 committed by GitHub
parent c683d01c96
commit 194f29ab1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 164 additions and 17 deletions

View File

@ -23,8 +23,14 @@ DaniSelect_Soul_Number_Interval=24,0
DaniSelect_Soul_Number_Text_Width=120
DaniSelect_Exam_Number_Interval=21,0
DaniSelect_Exam_Number_Text_Width=67
;Font Stuff
DaniSelect_Font_DanFolder_Size=72,36
DaniSelect_FolderText_X=960,960,960,960
DaniSelect_FolderText_Y=360,600,670,740
DaniSelect_Font_DanSong_Size=36
DaniSelect_Font_Exam_Size=18
DaniSelect_Exam_Bloc_X=772,772,772
DaniSelect_Exam_Bloc_Y=618,750,881
DaniSelect_Exam_X=1000,1000,1000

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -57,11 +57,15 @@ DaniSelect_Exam_Number_Interval=16,0
DaniSelect_Exam_Number_Text_Width=45
;Font Stuff
DaniSelect_Font_DanFolder_Size=48,24
DaniSelect_FolderText_X=640,640,640,640
DaniSelect_FolderText_Y=270,413,460,507
DaniSelect_Font_DanSong_Size=24
DaniSelect_Font_Exam_Size=13
DaniSelect_Exam_Bloc_X=515,515,515
DaniSelect_Exam_Bloc_Y=412,500,588

View File

@ -3696,6 +3696,33 @@ namespace TJAPlayer3
DaniSelect_Exam_Number_Text_Width = int.Parse(strParam);
break;
}
case "DaniSelect_Font_DanFolder_Size":
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 2; i++)
{
DaniSelect_Font_DanFolder_Size[i] = int.Parse(strSplit[i]);
}
break;
}
case "DaniSelect_FolderText_X":
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 4; i++)
{
DaniSelect_FolderText_X[i] = int.Parse(strSplit[i]);
}
break;
}
case "DaniSelect_FolderText_Y":
{
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 4; i++)
{
DaniSelect_FolderText_Y[i] = int.Parse(strSplit[i]);
}
break;
}
case "DaniSelect_Font_DanSong_Size":
{
DaniSelect_Font_DanSong_Size = int.Parse(strParam);
@ -10027,7 +10054,10 @@ namespace TJAPlayer3
public int[] DaniSelect_Exam_Number_Interval = new int[] { 16, 0 };
public int DaniSelect_Exam_Number_Text_Width = 45;
public int[] DaniSelect_Font_DanFolder_Size = new int[] { 64, 32 };
public int[] DaniSelect_FolderText_X = new int[] { 640, 640, 640, 640 };
public int[] DaniSelect_FolderText_Y = new int[] { 320, 413, 460, 507 };
public int DaniSelect_Font_DanSong_Size = 24;
public int DaniSelect_Font_Exam_Size = 13;

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
namespace TJAPlayer3
{
public static class HLocalizedPath
{
public static string GetFullPathWithoutExtension(string path)
{
return System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), System.IO.Path.GetFileNameWithoutExtension(path));
}
public static String GetLocalizedPath(String ogPath, String langCode = null)
{
if (String.IsNullOrEmpty(langCode))
langCode = CLangManager.fetchLang();
String ext = System.IO.Path.GetExtension(ogPath);
String fp = HLocalizedPath.GetFullPathWithoutExtension(ogPath);
return (fp + "_" + langCode + ext);
}
public static String GetAvailableLocalizedPath(String ogPath, String langCode = null)
{
string path = GetLocalizedPath(ogPath, langCode);
if (File.Exists(path)) return path;
return ogPath;
}
}
}

View File

@ -76,7 +76,7 @@ namespace TJAPlayer3
[40] = "Toggle whether song information is shared with Discord.",
[41] = "When this is turned on, no inputs will be dropped\nbut the input poll rate will decrease.\nWhen this is turned off, inputs may be dropped\nbut they will be polled more often.",
[42] = "Toggle whether a TJAPlayer3.log file is generated\nwhen the game is closed.\nThis tracks the performance of the game\nand identifies errors.",
[43] = "ASIO:\n- Only works on sound devices that support asio playback\n- Has the least input delay\n\nWasapi:\n- Only compatible with Windows\n- Disables sound playback from any source except TJAP3\n- Has the second lowest input delay\n\nBASS:\n- Supported on all platforms" +
[43] = "ASIO:\n- Only works on sound devices that support asio playback\n- Has the least input delay\nWasapi:\n- Only compatible with Windows\n- Has the second lowest input delay\nBASS:\n- Supported on all platforms\n" +
"Note: Exit CONFIGURATION to make\n" +
" the setting take effect.",
[44] = "Change the sound buffer for wasapi sound playback mode.\nSet the number to be as low as possible\nwithout causing sound issues such as\nsong freezing and incorrect timing.\nSet it to 0 to use an estimated correct value,\nor use trial and error to find the correct value." +

View File

@ -79,9 +79,11 @@ namespace TJAPlayer3
// コンストラクタ
}
internal CTexture TxC(string FileName)
internal CTexture TxC(string FileName, bool localize = true)
{
var tex = TJAPlayer3.tテクスチャの生成(CSkin.Path(BASE + FileName), false);
var texpath = (localize) ? HLocalizedPath.GetAvailableLocalizedPath(CSkin.Path(BASE + FileName)) : CSkin.Path(BASE + FileName);
var tex = TJAPlayer3.tテクスチャの生成(texpath, false);
listTexture.Add(tex);
return tex;
}
@ -400,7 +402,12 @@ namespace TJAPlayer3
Dani_Soul_Number = TxC(DANISELECT + "SoulNumber.png");
Dani_Exam_Number = TxC(DANISELECT + "ExamNumber.png");
Dani_Bar_Center = TxC(DANISELECT + "Bar_Center.png");
Dani_Bar_Back = TxC(DANISELECT + "Bar_Back.png");
Dani_Bar_Folder = TxC(DANISELECT + "Bar_Folder.png");
Dani_Bar_Folder_Back = TxC(DANISELECT + "Bar_Folder_Back.png");
Dani_Bar_Random = TxC(DANISELECT + "Bar_Random.png");
Dani_Plate = TxC(DANISELECT + "Plate.png");
Dani_Plate_Extra = TxC(DANISELECT + "Plate_Extra.png");
for (int i = 0; i < Challenge_Select.Length; i++)
Challenge_Select[i] = TxC(DANISELECT + "Challenge_Select_" + i.ToString() + ".png");
@ -2682,7 +2689,12 @@ namespace TJAPlayer3
public CTexture Dani_Soul_Number;
public CTexture Dani_Exam_Number;
public CTexture Dani_Bar_Center;
public CTexture Dani_Bar_Back;
public CTexture Dani_Bar_Folder;
public CTexture Dani_Bar_Folder_Back;
public CTexture Dani_Bar_Random;
public CTexture Dani_Plate;
public CTexture Dani_Plate_Extra;
public CTexture[] Challenge_Select = new CTexture[3];

View File

@ -73,6 +73,8 @@ namespace TJAPlayer3
public override void CreateManagedResource()
{
this.pfDanFolder = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanFolder_Size[0]);
this.pfDanFolderDesc = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanFolder_Size[1]);
this.pfDanSong = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_DanSong_Size);
this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(TJAPlayer3.Skin.DaniSelect_Font_Exam_Size);
@ -81,6 +83,8 @@ namespace TJAPlayer3
public override void ReleaseManagedResource()
{
TJAPlayer3.tDisposeSafely(ref pfDanFolder);
TJAPlayer3.tDisposeSafely(ref pfDanFolderDesc);
TJAPlayer3.tDisposeSafely(ref pfDanSong);
TJAPlayer3.tDisposeSafely(ref pfExamFont);
@ -152,6 +156,8 @@ namespace TJAPlayer3
int tickWidth = TJAPlayer3.Tx.Dani_Plate.szTextureSize.Width / 7;
int tickHeight = TJAPlayer3.Tx.Dani_Plate.szTextureSize.Height;
int tickExtraWidth = TJAPlayer3.Tx.Dani_Plate_Extra.szTextureSize.Width / 3;
int tickExtraHeight = TJAPlayer3.Tx.Dani_Plate_Extra.szTextureSize.Height;
for (int idx = -13; idx < 14; idx++)
{
@ -176,17 +182,45 @@ namespace TJAPlayer3
int tick = Math.Max(0, Math.Min(5, stバー情報[currentSong].nDanTick));
Color tickColor = stバー情報[currentSong].cDanTickColor;
TJAPlayer3.Tx.Dani_Plate.Opacity = 255;
TJAPlayer3.Tx.Dani_Plate.color4 = CConversion.ColorToColor4(tickColor);
TJAPlayer3.Tx.Dani_Plate.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight));
switch (stバー情報[currentSong].eード種別)
{
case CSongListNode.ENodeType.BACKBOX:
{
TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255);
TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor));
TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(0, 0, tickExtraWidth, tickExtraHeight));
break;
}
case CSongListNode.ENodeType.BOX:
{
TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255);
TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor));
TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth, 0, tickExtraWidth, tickExtraHeight));
break;
}
case CSongListNode.ENodeType.RANDOM:
{
TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateOpacity(255);
TJAPlayer3.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor));
TJAPlayer3.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth * 2, 0, tickExtraWidth, tickExtraHeight));
break;
}
default:
{
TJAPlayer3.Tx.Dani_Plate?.tUpdateOpacity(255);
TJAPlayer3.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(tickColor));
TJAPlayer3.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight));
break;
}
}
// Reset color for plate flash
TJAPlayer3.Tx.Dani_Plate.color4 = CConversion.ColorToColor4(Color.White);
TJAPlayer3.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(Color.White));
#endregion
#region [Dan grade title]
if (stバー情報[currentSong].eード種別 == CSongListNode.ENodeType.SCORE)
TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTextureTate(stバー情報[currentSong].ttkタイトル[stバー情報[currentSong].ttkタイトル.Length - 1])
.t2D拡大率考慮上中央基準描画(xPos + TJAPlayer3.Skin.DaniSelect_Plate_Title_Offset[0], yPos + TJAPlayer3.Skin.DaniSelect_Plate_Title_Offset[1]);
@ -197,8 +231,8 @@ namespace TJAPlayer3
if (idx == 0)
{
TJAPlayer3.Tx.Dani_Plate.Opacity = Math.Abs(255 - ctDanTick.CurrentValue);
TJAPlayer3.Tx.Dani_Plate.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * 6, 0, tickWidth, tickHeight));
TJAPlayer3.Tx.Dani_Plate?.tUpdateOpacity(Math.Abs(255 - ctDanTick.CurrentValue));
TJAPlayer3.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * 6, 0, tickWidth, tickHeight));
}
#endregion
@ -240,9 +274,7 @@ namespace TJAPlayer3
private bool bLeftMove;
private CCachedFontRenderer pfDanSong;
public CCachedFontRenderer pfExamFont;
private CCachedFontRenderer pfDanFolder, pfDanFolderDesc, pfDanSong, pfExamFont;
public TitleTextureKey[] ttkExams;
private CStage選曲.STNumber[] stLevel = new CStage選曲.STNumber[10];
@ -706,6 +738,27 @@ namespace TJAPlayer3
#endregion
}
break;
case CSongListNode.ENodeType.BACKBOX:
{
TJAPlayer3.Tx.Dani_Bar_Back?.t2D描画(scroll + Anime, 0);
break;
}
case CSongListNode.ENodeType.BOX:
{
TJAPlayer3.Tx.Dani_Bar_Folder_Back?.t2D描画(scroll + Anime, 0);
TJAPlayer3.Tx.Dani_Bar_Folder?.t2D描画(scroll + Anime, 0);
TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[0])
.t2D拡大率考慮上中央基準描画((int)(scroll + Anime + TJAPlayer3.Skin.DaniSelect_FolderText_X[0]), TJAPlayer3.Skin.DaniSelect_FolderText_Y[0]);
for (int desc = 1; desc < 4; desc++)
TJAPlayer3.stageSongSelect.actSongList.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[desc])
.t2D拡大率考慮上中央基準描画((int)(scroll + Anime + TJAPlayer3.Skin.DaniSelect_FolderText_X[desc]), TJAPlayer3.Skin.DaniSelect_FolderText_Y[desc]);
break;
}
case CSongListNode.ENodeType.RANDOM:
{
TJAPlayer3.Tx.Dani_Bar_Random?.t2D描画(scroll + Anime, 0);
break;
}
}
}
@ -787,8 +840,15 @@ namespace TJAPlayer3
break;
case CSongListNode.ENodeType.BOX:
{
stバー情報[i].ttkタイトル = new TitleTextureKey[1];
stバー情報[i].ttkタイトル[0] = new TitleTextureKey(song.strタイトル, pfDanSong, Color.White, Color.Black, 700);
TJAPlayer3.Tx.Dani_Bar_Folder?.tUpdateColor4(CConversion.ColorToColor4(song.BoxColor));
stバー情報[i].ttkタイトル = new TitleTextureKey[4];
stバー情報[i].ttkタイトル[0] = new TitleTextureKey(song.strタイトル, pfDanFolder, Color.White, Color.Black, TJAPlayer3.Skin.Resolution[0]);
for (int boxdesc = 0; boxdesc < 3; boxdesc++)
if (song.strBoxText[boxdesc] != null)
stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey(song.strBoxText[boxdesc], pfDanFolderDesc, song.ForeColor, song.BackColor, TJAPlayer3.Skin.Resolution[0]);
else
stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey("", pfDanFolderDesc, Color.White, Color.Black, TJAPlayer3.Skin.Resolution[0]);
stバー情報[i].cDanTickColor = song.BoxColor;
}
break;