1
0
mirror of synced 2024-11-30 18:24:32 +01:00

Main menu buttons are now displayed using text and translated in English/French (ModeSelect_Bar_Text.png files will be obsoleted as soon as menu details will be textified), fixed a small bug that reseted the lang setting while entering on the settings menu.

This commit is contained in:
0aubsq 2021-10-26 03:28:46 +02:00
parent f6cefc34c3
commit 400dd348c7
9 changed files with 154 additions and 27 deletions

View File

@ -21,4 +21,11 @@
15 : Score
16 : "Layout type" option title
17 : "Layout type" description
18 : Ensou main menu button
19 : Dan main menu button
20 : Tower main menu button
21 : Shop main menu button
22 : Bouken main menu button
23 : Settings main menu button
24 : Quit main menu button
```

View File

@ -737,9 +737,15 @@ namespace TJAPlayer3
public bool bAuto先生の連打;
public bool b大音符判定;
public int n両手判定の待ち時間;
public int nBranchAnime;
public bool bJudgeCountDisplay;
public int nBranchAnime;
// I18N choosen language
public string sLang;
// Song select screen layout type
public int nLayoutType;
public bool bJudgeCountDisplay;
public bool bEnableCountdownTimer;
@ -875,11 +881,7 @@ namespace TJAPlayer3
public bool FastRender; // 事前画像描画モード
public int MusicPreTimeMs; // 音源再生前の待機時間ms
// I18N choosen language
public string sLang = "jp";
// Song select screen layout type
public int nLayoutType = 0;
/// <summary>
/// DiscordのRitch Presenceに再生中の.tjaファイルの情報を送信するかどうか。
@ -2195,6 +2197,7 @@ namespace TJAPlayer3
else if( str3.Equals("Lang"))
{
this.sLang = str4;
CLangManager.langAttach(str4);
}

View File

@ -83,8 +83,8 @@ namespace TJAPlayer3
public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, int edgePt)
{
return DrawPrivateFont_E(drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White, edgePt);
}
}
/// <summary>
/// 文字列を描画したテクスチャを返す
/// </summary>
@ -92,11 +92,11 @@ namespace TJAPlayer3
/// <param name="fontColor">描画色</param>
/// <param name="edgeColor">縁取色</param>
/// <returns>描画済テクスチャ</returns>
public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor)
public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, Color? secondBorder = null)
{
return DrawPrivateFont(drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White);
}
return DrawPrivateFont(drawstr, (secondBorder == null) ? DrawMode.Edge : (DrawMode.Edge | DrawMode.DoubleEdge), fontColor, edgeColor, Color.White, Color.White, secondBorder);
}
/// <summary>
/// 文字列を描画したテクスチャを返す
/// </summary>
@ -270,7 +270,7 @@ namespace TJAPlayer3
}
}
protected new Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor)
protected new Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor, Color? secondBorder = null)
{
#region [ /? (?) ]
int index = listFontCache.FindIndex(
@ -293,7 +293,7 @@ namespace TJAPlayer3
// キャッシュにヒットせず。
#region [ ]
FontCache fc = new FontCache();
fc.bmp = base.DrawPrivateFont(drawstr, drawmode, fontColor, edgeColor, gradationTopColor, gradationBottomColor);
fc.bmp = base.DrawPrivateFont(drawstr, drawmode, fontColor, edgeColor, gradationTopColor, gradationBottomColor, secondBorder);
fc.drawstr = drawstr;
fc.drawmode = drawmode;
fc.fontColor = fontColor;

View File

@ -174,7 +174,8 @@ namespace TJAPlayer3
Normal,
Edge,
Gradation,
Vertical
Vertical,
DoubleEdge
}
#region [ DrawPrivateFontのオーバーロード群 ]
@ -391,7 +392,7 @@ namespace TJAPlayer3
/// <param name="gradationTopColor">グラデーション 上側の色</param>
/// <param name="gradationBottomColor">グラデーション 下側の色</param>
/// <returns>描画済テクスチャ</returns>
protected Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor)
protected Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor, Color? secondBorder = null)
{
int Interval = 5;
@ -411,10 +412,22 @@ namespace TJAPlayer3
bool bEdge = ((drawmode & DrawMode.Edge) == DrawMode.Edge);
bool bGradation = ((drawmode & DrawMode.Gradation) == DrawMode.Gradation);
bool bDoubleEdge = ((drawmode & DrawMode.DoubleEdge) == DrawMode.DoubleEdge);
// 縁取りの縁のサイズは、とりあえずフォントの大きさの1/4とする
//int nEdgePt = (bEdge)? _pt / 4 : 0;
//int nEdgePt = (bEdge) ? (_pt / 3) : 0; // 縁取りが少なすぎるという意見が多かったため変更。 (AioiLight)
int nEdgePt = (bEdge) ? (10 * _pt / TJAPlayer3.Skin.Font_Edge_Ratio) : 0; //SkinConfigにて設定可能に(rhimm)
int nFatEdgePt = 0;
if (bDoubleEdge)
{
nEdgePt = 4 * _pt / TJAPlayer3.Skin.Font_Edge_Ratio;
nFatEdgePt = 10 * _pt / TJAPlayer3.Skin.Font_Edge_Ratio;
}
int largest = Math.Max(nEdgePt, nFatEdgePt);
// 描画サイズを測定する
Size stringSize = System.Windows.Forms.TextRenderer.MeasureText(drawstr, this._font, new Size(int.MaxValue, int.MaxValue),
@ -425,7 +438,7 @@ namespace TJAPlayer3
stringSize.Height += 5;
//取得した描画サイズを基に、描画先のbitmapを作成する
Bitmap bmp = new Bitmap(stringSize.Width + nEdgePt * 2, stringSize.Height + nEdgePt * 2);
Bitmap bmp = new Bitmap(stringSize.Width + nEdgePt * 2, stringSize.Height + largest * 2);
bmp.MakeTransparent();
Graphics g = Graphics.FromImage(bmp);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
@ -436,7 +449,9 @@ namespace TJAPlayer3
sf.FormatFlags = StringFormatFlags.NoWrap; // どんなに長くて単語の区切りが良くても改行しない (AioiLight)
sf.Trimming = StringTrimming.None; // どんなに長くてもトリミングしない (AioiLight)
// レイアウト枠
Rectangle r = new Rectangle(0, 0, stringSize.Width + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_X * stringSize.Width / 100), stringSize.Height + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_Y * stringSize.Height / 100));
Rectangle r = new Rectangle(0, 0, stringSize.Width + largest * 2
+ (TJAPlayer3.Skin.Text_Correction_X * stringSize.Width / 100), stringSize.Height + largest * 2
+ (TJAPlayer3.Skin.Text_Correction_Y * stringSize.Height / 100));
if (bEdge) // 縁取り有りの描画
{
@ -447,7 +462,15 @@ namespace TJAPlayer3
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddString(drawstr, this._fontfamily, (int)this._font.Style, sizeInPixels, r, sf);
if (bDoubleEdge)
{
Pen fat = new Pen((Color)secondBorder, nFatEdgePt);
fat.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
g.DrawPath(fat, gp);
}
// 縁取りを描画する
// Edge drawn here
Pen p = new Pen(edgeColor, nEdgePt);
p.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
g.DrawPath(p, gp);

View File

@ -48,6 +48,13 @@ namespace TJAPlayer3
"2 : Down to up diagonal\n" +
"3 : Half-circle facing right\n" +
"4 : Half-circle facing left",
[18] = "Rhythm Game",
[19] = "Exam Dojo",
[20] = "Taiko towers",
[21] = "Shop",
[22] = "Taiko adventure",
[23] = "Settings",
[24] = "Exit",
};
}
}

View File

@ -48,6 +48,13 @@ namespace TJAPlayer3
"2 : Diagonale bas-haut\n" +
"3 : Demi-cercle orienté à droite\n" +
"4 : Demi-cercle orienté à gauche",
[18] = "Partie rapide",
[19] = "Défis du Dojo",
[20] = "Tours rhytmiques",
[21] = "Magasin",
[22] = "Aventure",
[23] = "Paramètres",
[24] = "Quitter le jeu",
};
}
}

View File

@ -48,6 +48,13 @@ namespace TJAPlayer3
"2=>下上斜\n" +
"3=>右向け半丸\n" +
"4=>左向け半丸",
[18] = "演奏ゲーム",
[19] = "段位道場",
[20] = "太鼓タワー",
[21] = "メダル商店",
[22] = "太鼓大冒険",
[23] = "設定",
[24] = "ゲーム終了",
};
}
}

View File

@ -6,6 +6,7 @@ using System.Diagnostics;
using System.Drawing;
using FDK;
using System.Reflection;
using static TJAPlayer3.CActSelect曲リスト;
namespace TJAPlayer3
{
@ -63,6 +64,9 @@ namespace TJAPlayer3
this.n現在の選択行プレイヤーエントリー = 1;
for (int i = 0; i < this.nbModes; i++)
{
this.stModeBar[i].BarTexture = TJAPlayer3.Tx.ModeSelect_Bar[i];
@ -99,11 +103,36 @@ namespace TJAPlayer3
}
public override void OnManagedリソースの作成()
{
if (base.b活性化してない)
return;
if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName))
{
this.pfMenuTitle = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 36);
}
else
{
this.pfMenuTitle = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 36);
}
this.ttkEnsou = new TitleTextureKey(CLangManager.LangInstance.GetString(18), this.pfMenuTitle, Color.White, Color.FromArgb(233, 53, 71), 700, Color.Black);
this.ttkDan = new TitleTextureKey(CLangManager.LangInstance.GetString(19), this.pfMenuTitle, Color.White, Color.FromArgb(71, 64, 135), 700, Color.Black);
this.ttkTower = new TitleTextureKey(CLangManager.LangInstance.GetString(20), this.pfMenuTitle, Color.White, Color.FromArgb(255, 180, 42), 700, Color.Black);
this.ttkShop = new TitleTextureKey(CLangManager.LangInstance.GetString(21), this.pfMenuTitle, Color.White, Color.FromArgb(16, 255, 255), 700, Color.Black);
this.ttkBouken = new TitleTextureKey(CLangManager.LangInstance.GetString(22), this.pfMenuTitle, Color.White, Color.FromArgb(128, 0, 128), 700, Color.Black);
this.ttkSettings = new TitleTextureKey(CLangManager.LangInstance.GetString(23), this.pfMenuTitle, Color.White, Color.FromArgb(128, 128, 128), 700, Color.Black);
this.ttkExit = new TitleTextureKey(CLangManager.LangInstance.GetString(24), this.pfMenuTitle, Color.White, Color.FromArgb(72, 72, 72), 700, Color.Black);
base.OnManagedリソースの作成();
}
public override void OnManagedリソースの解放()
{
if (!base.b活性化してない)
return;
TJAPlayer3.t安全にDisposeする(ref pfMenuTitle);
base.OnManagedリソースの解放();
}
public override int On進行描画()
{
@ -578,12 +607,17 @@ namespace TJAPlayer3
TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].t2D中心基準描画(TJAPlayer3.app.Device, 640 + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].szテクスチャサイズ.Width / 4 - 114 + anime, 360,
new Rectangle(TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].szテクスチャサイズ.Width / 2, 0, TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].szテクスチャサイズ.Width / 2, TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].szテクスチャサイズ.Height));
TJAPlayer3.Tx.ModeSelect_Bar_Text[i].Opacity = 255;
TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D中心基準描画(TJAPlayer3.app.Device, 640, 355 - BarAnimeCount / 1.5f, new Rectangle(0, 0, 642, 122));
// TJAPlayer3.Tx.ModeSelect_Bar_Text[i].Opacity = 255;
// TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D中心基準描画(TJAPlayer3.app.Device, 640, 355 - BarAnimeCount / 1.5f, new Rectangle(0, 0, 642, 122));
TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i))?.t2D中心基準描画(TJAPlayer3.app.Device, 631, 379 - BarAnimeCount / 1.5f);
TJAPlayer3.Tx.ModeSelect_Bar_Text[i].Opacity = (int)(BarAnimeCount * 2.55f);
TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D中心基準描画(TJAPlayer3.app.Device, 640, 355 + 132 / 2, new Rectangle(0, 122, 642, 148));
}
else
{
@ -615,8 +649,11 @@ namespace TJAPlayer3
TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].vc拡大縮小倍率.Y = 1.0f;
this.stModeBar[i].BarTexture.t2D描画(TJAPlayer3.app.Device, pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY);
TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].t2D描画(TJAPlayer3.app.Device, pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY);
TJAPlayer3.Tx.ModeSelect_Bar_Text[i].Opacity = 255;
TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D描画(TJAPlayer3.app.Device, pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY - 13, new Rectangle(0, 0, 642, 122));
// TJAPlayer3.Tx.ModeSelect_Bar_Text[i].Opacity = 255;
// TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D描画(TJAPlayer3.app.Device, pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY - 13, new Rectangle(0, 0, 642, 122));
TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i))?.t2D中心基準描画(TJAPlayer3.app.Device, pos.X + BarAnimeX - BarMoveX + 311, pos.Y + BarAnimeY - BarMoveY + 72);
}
}
}
@ -734,6 +771,15 @@ namespace TJAPlayer3
private PuchiChara PuchiChara;
private CPrivateFastFont pfMenuTitle;
private TitleTextureKey ttkEnsou;
private TitleTextureKey ttkDan;
private TitleTextureKey ttkTower;
private TitleTextureKey ttkShop;
private TitleTextureKey ttkBouken;
private TitleTextureKey ttkSettings;
private TitleTextureKey ttkExit;
private bool bバナパス読み込み;
private bool bバナパス読み込み失敗;
private bool bプレイヤーエントリー;
@ -785,6 +831,28 @@ namespace TJAPlayer3
return new Point(posX, posY);
}
private TitleTextureKey idxToTex(int idx)
{
switch (idx)
{
case 6:
return this.ttkExit;
case 5:
return this.ttkSettings;
case 4:
return this.ttkBouken;
case 3:
return this.ttkShop;
case 2:
return this.ttkTower;
case 1:
return this.ttkDan;
case 0:
default:
return this.ttkEnsou;
}
}
private bool b音声再生;
private CActFIFOBlack actFI;
private CActFIFOBlack actFIfromSetup;

View File

@ -2341,7 +2341,7 @@ namespace TJAPlayer3
private static CTexture GenerateTitleTexture(TitleTextureKey titleTextureKey)
{
using (var bmp = new Bitmap(titleTextureKey.cPrivateFastFont.DrawPrivateFont(
titleTextureKey.str文字, titleTextureKey.forecolor, titleTextureKey.backcolor)))
titleTextureKey.str文字, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge)))
{
CTexture tx文字テクスチャ = TJAPlayer3.tテクスチャの生成(bmp, false);
if (tx文字テクスチャ.szテクスチャサイズ.Width > titleTextureKey.maxWidth)
@ -2371,14 +2371,16 @@ namespace TJAPlayer3
public readonly Color forecolor;
public readonly Color backcolor;
public readonly int maxWidth;
public readonly Color? secondEdge;
public TitleTextureKey(string str文字, CPrivateFastFont cPrivateFastFont, Color forecolor, Color backcolor, int maxHeight)
public TitleTextureKey(string str文字, CPrivateFastFont cPrivateFastFont, Color forecolor, Color backcolor, int maxHeight, Color? secondEdge = null)
{
this.str文字 = str文字;
this.cPrivateFastFont = cPrivateFastFont;
this.forecolor = forecolor;
this.backcolor = backcolor;
this.maxWidth = maxHeight;
this.secondEdge = secondEdge;
}
private bool Equals(TitleTextureKey other)
@ -2387,6 +2389,7 @@ namespace TJAPlayer3
cPrivateFastFont.Equals(other.cPrivateFastFont) &&
forecolor.Equals(other.forecolor) &&
backcolor.Equals(other.backcolor) &&
secondEdge.Equals(other.secondEdge) &&
maxWidth == other.maxWidth;
}
@ -2406,6 +2409,8 @@ namespace TJAPlayer3
hashCode = (hashCode * 397) ^ forecolor.GetHashCode();
hashCode = (hashCode * 397) ^ backcolor.GetHashCode();
hashCode = (hashCode * 397) ^ maxWidth;
if (secondEdge != null)
hashCode = (hashCode * 397) ^ secondEdge.GetHashCode();
return hashCode;
}
}