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

Changing language no longer requires hard reloading to apply on songs

This commit is contained in:
0auBSQ 2024-07-10 20:53:23 +09:00
parent dafe4b9881
commit 1c50822197
24 changed files with 159 additions and 153 deletions

View File

@ -95,7 +95,7 @@ namespace TJAPlayer3
// とじる
itemBack.strタイトル = CLangManager.LangInstance.GetString("SONGSELECT_RETURN_PATH", path);
itemBack.ldTitle = CLangManager.GetAllStringsAsLocalizationDataWithArgs("SONGSELECT_RETURN_PATH", path, path);
itemBack.BackColor = ColorTranslator.FromHtml("#513009");
itemBack.BoxColor = Color.White;
@ -119,11 +119,11 @@ namespace TJAPlayer3
}
itemBack.strBreadcrumbs = (itemBack.rParentNode == null) ?
itemBack.strタイトル : itemBack.rParentNode.strBreadcrumbs + " > " + itemBack.strタイトル;
itemBack.ldTitle.GetString("") : itemBack.rParentNode.strBreadcrumbs + " > " + itemBack.ldTitle.GetString("");
itemBack.arスコア[0] = new Cスコア();
itemBack.arスコア[0].. = "";
itemBack.arスコア[0].. = itemBack.strタイトル;
itemBack.arスコア[0].. = itemBack.ldTitle.GetString("");
itemBack.arスコア[0].. = "";
return (itemBack);
@ -134,13 +134,13 @@ namespace TJAPlayer3
CSongListNode itemRandom = new CSongListNode();
itemRandom.eード種別 = CSongListNode.ENodeType.RANDOM;
itemRandom.strタイトル = CLangManager.LangInstance.GetString("SONGSELECT_RANDOM_PATH", path);
itemRandom.ldTitle = CLangManager.GetAllStringsAsLocalizationDataWithArgs("SONGSELECT_RANDOM_PATH", path, path);
itemRandom.nスコア数 = (int)Difficulty.Total;
itemRandom.rParentNode = parent;
itemRandom.strBreadcrumbs = (itemRandom.rParentNode == null) ?
itemRandom.strタイトル : itemRandom.rParentNode.strBreadcrumbs + " > " + itemRandom.strタイトル;
itemRandom.ldTitle.GetString("") : itemRandom.rParentNode.strBreadcrumbs + " > " + itemRandom.ldTitle.GetString("");
itemRandom.arスコア[0] = new Cスコア();
@ -208,7 +208,7 @@ namespace TJAPlayer3
// Generate back buttons
string favPath = "./" + parent.strタイトル + "/";
string favPath = "./" + parent.ldTitle.GetString("") + "/";
tReinsertBackButtons(parent, childList, favPath);
@ -232,7 +232,7 @@ namespace TJAPlayer3
// Generate back buttons
string favPath = "./" + parent.strタイトル + "/";
string favPath = "./" + parent.ldTitle.GetString("") + "/";
tReinsertBackButtons(parent, childList, favPath);
@ -268,7 +268,7 @@ namespace TJAPlayer3
// Generate back buttons
string favPath = "./" + parent.strタイトル + "/";
string favPath = "./" + parent.ldTitle.GetString("") + "/";
tReinsertBackButtons(parent, childList, favPath);

View File

@ -7,6 +7,7 @@ using Newtonsoft.Json;
namespace TJAPlayer3
{
[Serializable]
internal class CLocalizationData
{
[JsonProperty("strings")]

View File

@ -70,7 +70,7 @@ namespace TJAPlayer3
command.CommandText = $@"INSERT INTO dan_titles(DanTitleText,DanClearStatus,DanIsGold,SaveId)
VALUES(
'{DanTitle.Replace(@"'", @"''")}',
'{DanTitle.EscapeSingleQuotes()}',
{DanClearStatus},
{Convert.ToInt64(DanIsGold)},
{SaveId}
@ -143,7 +143,7 @@ namespace TJAPlayer3
if (connection == null) return;
var command = connection.CreateCommand();
command.CommandText = @$"INSERT INTO {table}(Asset,SaveId) VALUES('{asset.Replace(@"'", @"''")}', {SaveId});";
command.CommandText = @$"INSERT INTO {table}(Asset,SaveId) VALUES('{asset.EscapeSingleQuotes()}', {SaveId});";
command.ExecuteNonQuery();
}
@ -225,15 +225,15 @@ namespace TJAPlayer3
var command = connection.CreateCommand();
command.CommandText = $@" UPDATE saves SET
PlayerName = '{SaveData.Name.Replace(@"'", @"''")}',
PlayerNameplateTitle = '{SaveData.Title.Replace(@"'", @"''")}',
PlayerDanTitle = '{SaveData.Dan.Replace(@"'", @"''")}',
PlayerName = '{SaveData.Name.EscapeSingleQuotes()}',
PlayerNameplateTitle = '{SaveData.Title.EscapeSingleQuotes()}',
PlayerDanTitle = '{SaveData.Dan.EscapeSingleQuotes()}',
PlayerDanGold = {SaveData.DanGold},
PlayerDanType = {SaveData.DanType},
PlayerNameplateType = {SaveData.TitleType},
PlayerPuchichara = '{SaveData.PuchiChara.Replace(@"'", @"''")}',
PlayerPuchichara = '{SaveData.PuchiChara.EscapeSingleQuotes()}',
PlayerCharacter = {SaveData.Character},
PlayerCharacterName = '{SaveData.CharacterName.Replace(@"'", @"''")}'
PlayerCharacterName = '{SaveData.CharacterName.EscapeSingleQuotes()}'
WHERE SaveId = {SaveData.SaveId};
;";
command.ExecuteNonQuery();
@ -317,7 +317,7 @@ namespace TJAPlayer3
currentPlay.ChartUniqueId = choosenSong.uniqueId.data.id;
currentPlay.ChartGenre = choosenSong.strジャンル;
currentPlay.Charter = choosenSong.strNotesDesigner[choosenDifficulty];
currentPlay.Artist = choosenSong.strサブタイトル; // There is no direct Artist tag on the .tja format, so we directly use the subtitle as a guess
currentPlay.Artist = choosenSong.ldSubtitle.GetString(""); // There is no direct Artist tag on the .tja format, so we directly use the subtitle as a guess
currentPlay.PlayMods = ModIcons.tModsToPlayModsFlags(player);
currentPlay.ChartDifficulty = choosenDifficulty;
currentPlay.ChartLevel = choosenSong.arスコア[choosenDifficulty]..nレベル[choosenDifficulty];
@ -447,10 +447,10 @@ namespace TJAPlayer3
cmd.CommandText = $@"
INSERT INTO best_plays(ChartUniqueId,ChartGenre,Charter,Artist,PlayMods,ChartDifficulty,ChartLevel,ClearStatus,ScoreRank,HighScore,SaveId,TowerBestFloor,DanExam1,DanExam2,DanExam3,DanExam4,DanExam5,DanExam6,DanExam7,PlayCount,HighScoreGoodCount,HighScoreOkCount,HighScoreBadCount,HighScoreMaxCombo,HighScoreRollCount,HighScoreADLibCount,HighScoreBoomCount)
VALUES(
'{currentPlay.ChartUniqueId.Replace(@"'", @"''")}',
'{currentPlay.ChartGenre.Replace(@"'", @"''")}',
'{currentPlay.Charter.Replace(@"'", @"''")}',
'{currentPlay.Artist.Replace(@"'", @"''")}',
'{currentPlay.ChartUniqueId.EscapeSingleQuotes()}',
'{currentPlay.ChartGenre.EscapeSingleQuotes()}',
'{currentPlay.Charter.EscapeSingleQuotes()}',
'{currentPlay.Artist.EscapeSingleQuotes()}',
{currentPlay.PlayMods},
{currentPlay.ChartDifficulty},
{currentPlay.ChartLevel},

View File

@ -80,8 +80,8 @@ namespace TJAPlayer3
foreach (KeyValuePair<string, SongUnlockable> item in data)
{
string _npvKey = item.Key;
string? _songName = CSongDict.tGetNodeFromID(_npvKey)?.strタイトル;
string _songSubtitle = CSongDict.tGetNodeFromID(_npvKey)?.strサブタイトル ?? "";
string? _songName = CSongDict.tGetNodeFromID(_npvKey)?.ldTitle.GetString("");
string _songSubtitle = CSongDict.tGetNodeFromID(_npvKey)?.ldSubtitle.GetString("") ?? "";
if (!_sf.Contains(_npvKey) && _songName != null)
{

View File

@ -355,7 +355,7 @@ namespace TJAPlayer3
var diffString = CLangManager.LangInstance.GetDifficulty(_aimedDifficulty);
var statusString = GetRequiredClearStatus(_aimedStatus);
var _songName = CSongDict.tGetNodeFromID(_songId)?.strタイトル ?? "[Not found]";
var _songName = CSongDict.tGetNodeFromID(_songId)?.ldTitle.GetString("") ?? "[Not found]";
_rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYDIFF", statusString, _songName, diffString));

View File

@ -147,6 +147,11 @@ namespace System
return Regex.Replace(input, TagRegex, "");
}
public static string EscapeSingleQuotes(this string input)
{
return input.Replace(@"'", @"''");
}
public static string SafeFormat(this string format, params object?[] args)
{
try

View File

@ -83,6 +83,7 @@ namespace TJAPlayer3
{
return (Entries.TryGetValue(key, out string? value)) ? value.SafeFormat(values) : InvalidKey.SafeFormat(key);
}
public string GetDifficulty(int diff)
{
switch (diff)

View File

@ -103,8 +103,46 @@ namespace TJAPlayer3
}
}
public static CLocalizationData GetAllStringsAsLocalizationData(string key)
{
if (_cachedLocs.ContainsKey(key)) return _cachedLocs[key];
CLocalizationData loc = new CLocalizationData();
loc.SetString("default", "?");
foreach (string lang in Langcodes)
{
CLang _inst = CLang.GetCLang(lang);
loc.SetString(lang, _inst.GetString(key));
}
_cachedLocs[key] = loc;
return loc;
}
public static CLocalizationData GetAllStringsAsLocalizationDataWithArgs(string key, string keySalt, params object?[] values)
{
if (_cachedLocs.ContainsKey(key + keySalt)) return _cachedLocs[key + keySalt];
CLocalizationData loc = new CLocalizationData();
loc.SetString("default", "?");
foreach (string lang in Langcodes)
{
CLang _inst = CLang.GetCLang(lang);
loc.SetString(lang, _inst.GetString(key, values));
}
_cachedLocs[key + keySalt] = loc;
return loc;
}
private static string[] _langCodes;
private static string[] _languages;
private static Dictionary<string, CLocalizationData> _cachedLocs = new Dictionary<string, CLocalizationData>();
//public static ILang LangInstance { get; private set; } = new CLang_jp();
}
}

View File

@ -14,8 +14,8 @@ namespace TJAPlayer3
public Color Color;
public string SelectBG;
public string Genre;
public string Title;
public string[] strBoxText = new string[3];
public CLocalizationData Title = new CLocalizationData();
public CLocalizationData[] strBoxText = new CLocalizationData[3] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData() };
public Color ForeColor;
public Color BackColor;
public bool IsChangedForeColor;
@ -33,16 +33,10 @@ namespace TJAPlayer3
public string DefaultPreimage;
public string ScenePreset;
private readonly string langTITLE = "#TITLE" + CLangManager.fetchLang().ToUpper();
private readonly string langBOXEXPLANATION = "#BOXEXPLANATION" + CLangManager.fetchLang().ToUpper();
// コンストラクタ
public CBoxDef()
{
for (int i = 0; i < 3; i++)
this.strBoxText[i] = "";
this.Title = "";
this.Genre = "";
ForeColor = Color.White;
BackColor = Color.Black;
@ -90,14 +84,15 @@ namespace TJAPlayer3
string key = split[0];
string value = split[1];
if (key == langTITLE)
if (key == "#TITLE")
{
this.Title = value.Trim(ignoreChars);
this.Title.SetString("default", value.Trim(ignoreChars));
}
else if (key == "#TITLE")
else if (key.StartsWith("#TITLE"))
{
if (this.Title == "") this.Title = value.Trim(ignoreChars);
}
string _lang = key.Substring(6).ToLowerInvariant();
this.Title.SetString(_lang, value.Trim(ignoreChars));
}
else if (key == "#GENRE")
{
this.Genre = value.Trim(ignoreChars);
@ -157,14 +152,15 @@ namespace TJAPlayer3
{
for (int i = 0; i < 3; i++)
{
if (key == langBOXEXPLANATION + (i + 1).ToString())
if (key == "#BOXEXPLANATION" + (i + 1).ToString())
{
this.strBoxText[i] = value.Trim(ignoreChars);
this.strBoxText[i].SetString("default", value.Trim(ignoreChars));
}
else if (key == "#BOXEXPLANATION" + (i + 1).ToString())
else if (key.StartsWith("#BOXEXPLANATION") && key.EndsWith((i + 1).ToString()))
{
if (this.strBoxText[i] == "") this.strBoxText[i] = value.Trim(ignoreChars);
}
string _lang = key.Substring(15)[..^1].ToLowerInvariant();
this.strBoxText[i].SetString(_lang, value.Trim(ignoreChars));
}
}
}
}

View File

@ -1147,8 +1147,8 @@ namespace TJAPlayer3
public string strファイル名;
public string strファイル名の絶対パス;
public string strフォルダ名;
public string SUBTITLE;
public string TITLE;
public CLocalizationData SUBTITLE = new CLocalizationData();
public CLocalizationData TITLE = new CLocalizationData();
public double dbDTXVPlaySpeed;
public double dbScrollSpeed;
public int nデモBGMオフセット;
@ -1233,12 +1233,6 @@ namespace TJAPlayer3
private string[] dlmtEnter = { "\n" };
private string[] dlmtCOURSE = { "COURSE:" };
private readonly string langTITLE = "TITLE" + CLangManager.fetchLang().ToUpper();
private readonly string langSUBTITLE = "SUBTITLE" + CLangManager.fetchLang().ToUpper();
private bool titleIsLocalized = false;
private bool subtitleIsLocalized = false;
private int nスクロール方向 = 0;
//2015.09.18 kairera0467
//バタフライスライドみたいなアレをやりたいがために実装。
@ -1292,8 +1286,8 @@ namespace TJAPlayer3
public CDTX()
{
this.nPlayerSide = 0;
this.TITLE = "";
this.SUBTITLE = "";
this.TITLE.SetString("default", "");
this.SUBTITLE.SetString("default", "");
this.ARTIST = "";
this.COMMENT = "";
this.SIDE = ESide.eEx;
@ -7238,7 +7232,7 @@ namespace TJAPlayer3
private void t入力_行解析ヘッダ(string InputText)
{
//やべー。先頭にコメント行あったらやばいやん。
string[] strArray = InputText.Split(new char[] { ':' });
string[] strArray = InputText.Split(new char[] { ':' }, 2);
string strCommandName = "";
string strCommandParam = "";
@ -7266,7 +7260,7 @@ namespace TJAPlayer3
//strArrayが2じゃない場合、ヘッダのSplitを通していない可能性がある。
//この処理自体は「t入力」を改造したもの。STARTでSplitしていない等、一部の処理が異なる。
#region[]
#region [Header]
InputText = InputText.Replace(Environment.NewLine, "\n"); //改行文字を別の文字列に差し替え。
InputText = InputText.Replace('\t', ' '); //何の文字か知らないけどスペースに差し替え。
InputText = InputText + "\n";
@ -7291,55 +7285,26 @@ namespace TJAPlayer3
}
//パラメータを分別、そこから割り当てていきます。
if (strCommandName.Equals("TITLE") && !titleIsLocalized)
if (strCommandName.Equals("TITLE"))
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.TITLE = subTitle.Substring(5);
this.TITLE.SetString("default", strCommandParam);
}
else if (strCommandName.Equals(langTITLE))
else if (strCommandName.StartsWith("TITLE"))
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.TITLE = subTitle.Substring(7);
titleIsLocalized = true;
string _lang = strCommandName.Substring(5).ToLowerInvariant();
this.TITLE.SetString(_lang, strCommandParam);
}
else if (strCommandName.Equals("SUBTITLE") && !subtitleIsLocalized)
else if (strCommandName.Equals("SUBTITLE"))
{
if (strCommandParam.StartsWith("--") || strCommandParam.StartsWith("++"))
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.SUBTITLE = subTitle.Substring(10);
}
this.SUBTITLE.SetString("default", strCommandParam.Substring(2));
else
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.SUBTITLE = subTitle.Substring(8);
}
this.SUBTITLE.SetString("default", strCommandParam);
}
else if (strCommandName.Equals(langSUBTITLE))
else if (strCommandName.StartsWith("SUBTITLE"))
{
var subTitle = "";
for (int i = 0; i < strArray.Length; i++)
{
subTitle += strArray[i];
}
this.SUBTITLE = subTitle.Substring(10);
subtitleIsLocalized = true;
string _lang = strCommandName.Substring(8).ToLowerInvariant();
this.SUBTITLE.SetString(_lang, strCommandParam);
}
else if (strCommandName.Equals("LEVEL"))
{

View File

@ -212,7 +212,7 @@ namespace TJAPlayer3
INSERT INTO best_plays(ChartUniqueId,ChartGenre,Charter,Artist,PlayMods,ChartDifficulty,ChartLevel,ClearStatus,ScoreRank,HighScore,SaveId,TowerBestFloor,DanExam1,DanExam2,DanExam3,DanExam4,DanExam5,DanExam6,DanExam7,PlayCount,HighScoreGoodCount,HighScoreOkCount,HighScoreBadCount,HighScoreMaxCombo,HighScoreRollCount,HighScoreADLibCount,HighScoreBoomCount)
VALUES(
'{UniqueId.data.id.Replace(@"'", @"''")}',
'{boxdef.Title.Replace(@"'", @"''")}',
'{boxdef.Genre}',
'{(!string.IsNullOrEmpty(Charters[i + 1]) ? Charters[i + 1] : Charters[0]).Replace(@"'", @"''")}',
'{Artist.Replace(@"'", @"''")}',
8925478921,

View File

@ -67,10 +67,10 @@ namespace TJAPlayer3
public Stack<int> stackランダム演奏番号 = new Stack<int>();
public string strジャンル = "";
public string str本当のジャンル = "";
public string strタイトル = "";
public CLocalizationData ldTitle = new CLocalizationData();
public List<CDTX.DanSongs> DanSongs;
public Dan_C[] Dan_C;
public string strサブタイトル = "";
public CLocalizationData ldSubtitle = new CLocalizationData();
public string strMaker = "";
public string[] strNotesDesigner = new string[(int)Difficulty.Total] { "", "", "", "", "", "", "" };
public CDTX.ESide nSide = CDTX.ESide.eEx;
@ -93,7 +93,7 @@ namespace TJAPlayer3
public int nDanTick = 0;
public Color cDanTickColor = Color.White;
public string[] strBoxText = new string[3];
public CLocalizationData[] strBoxText = new CLocalizationData[3] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData() };
public string strSelectBGPath;

View File

@ -150,8 +150,8 @@ namespace TJAPlayer3
}
t曲を検索してリストを作成する(path, true, downloadBox.list子リスト, downloadBox);
this.t曲リストへ後処理を適用する(downloadBox.list子リスト, $"/{downloadBox.strタイトル}/");
downloadBox.list子リスト.Insert(0, CSongDict.tGenerateBackButton(downloadBox, $"/{downloadBox.strタイトル}/"));
this.t曲リストへ後処理を適用する(downloadBox.list子リスト, $"/{downloadBox.ldTitle.GetString("")}/");
downloadBox.list子リスト.Insert(0, CSongDict.tGenerateBackButton(downloadBox, $"/{downloadBox.ldTitle.GetString("")}/"));
}
}
@ -218,8 +218,8 @@ namespace TJAPlayer3
c曲リストード.strBreadcrumbs = ( c曲リストード.rParentNode == null ) ?
str基点フォルダ + fileinfo.Name : c曲リストード.rParentNode.strBreadcrumbs + " > " + str基点フォルダ + fileinfo.Name;
c曲リストード.strタイトル = dtx.TITLE;
c曲リストード.strサブタイトル = dtx.SUBTITLE;
c曲リストード.ldTitle = dtx.TITLE;
c曲リストード.ldSubtitle = dtx.SUBTITLE;
c曲リストード.strジャンル = dtx.GENRE;
c曲リストード.strMaker = dtx.MAKER;
@ -408,8 +408,8 @@ namespace TJAPlayer3
c曲リストード.strBreadcrumbs = ( c曲リストード.rParentNode == null ) ?
str基点フォルダ + fileinfo.Name : c曲リストード.rParentNode.strBreadcrumbs + " > " + str基点フォルダ + fileinfo.Name;
c曲リストード.strタイトル = dtx.TITLE;
c曲リストード.strサブタイトル = dtx.SUBTITLE;
c曲リストード.ldTitle = dtx.TITLE;
c曲リストード.ldSubtitle = dtx.SUBTITLE;
c曲リストード.strMaker = dtx.MAKER;
c曲リストード.strNotesDesigner = dtx.NOTESDESIGNER.Select(x => x.Equals("") ? c曲リストード.strMaker : x).ToArray();
c曲リストード.nSide = dtx.SIDE;
@ -615,7 +615,7 @@ namespace TJAPlayer3
CSongListNode c曲リストード = new CSongListNode();
c曲リストード.eード種別 = CSongListNode.ENodeType.BOX;
c曲リストード.bDTXFilesで始まるフォルダ名のBOXである = false;
c曲リストード.strタイトル = boxdef.Title;
c曲リストード.ldTitle = boxdef.Title;
c曲リストード.strジャンル = boxdef.Genre;
c曲リストード.strScenePreset = boxdef.ScenePreset;
c曲リストード.strSelectBGPath = infoDir.FullName + Path.DirectorySeparatorChar + boxdef.SelectBG;
@ -661,7 +661,7 @@ namespace TJAPlayer3
for (int i = 0; i < 3; i++)
{
if ((boxdef.strBoxText[i] != null) && (boxdef.strBoxText[i].Length > 0))
if ((boxdef.strBoxText[i] != null))
{
c曲リストード.strBoxText[i] = boxdef.strBoxText[i];
}
@ -709,7 +709,7 @@ namespace TJAPlayer3
c曲リストード.nスコア数 = 1;
c曲リストード.arスコア[ 0 ] = new Cスコア();
c曲リストード.arスコア[ 0 ].. = infoDir.FullName + Path.DirectorySeparatorChar;
c曲リストード.arスコア[ 0 ].. = boxdef.Title;
c曲リストード.arスコア[ 0 ].. = boxdef.Title.GetString("");
c曲リストード.arスコア[ 0 ].. = boxdef.Genre;
if (!String.IsNullOrEmpty(boxdef.DefaultPreimage))
c曲リストード.arスコア[0]..Preimage = boxdef.DefaultPreimage;
@ -717,7 +717,7 @@ namespace TJAPlayer3
c曲リストード.strBreadcrumbs = ( c曲リストード.rParentNode == null ) ?
c曲リストード.strタイトル : c曲リストード.rParentNode.strBreadcrumbs + " > " + c曲リストード.strタイトル;
c曲リストード.ldTitle.GetString("") : c曲リストード.rParentNode.strBreadcrumbs + " > " + c曲リストード.ldTitle.GetString("");
c曲リストード.list子リスト = new List<CSongListNode>();
@ -738,7 +738,7 @@ namespace TJAPlayer3
{
sb.Append( "(onRoot):" );
}
sb.Append( "BOX, Title=" + c曲リストード.strタイトル );
sb.Append( "BOX, Title=" + c曲リストード.ldTitle.GetString(""));
if( ( c曲リストード.strジャンル != null ) && ( c曲リストード.strジャンル.Length > 0 ) )
{
sb.Append( ", Genre=" + c曲リストード.strジャンル );
@ -810,7 +810,7 @@ namespace TJAPlayer3
{
try
{
c曲リストード.arスコア[ i ].. = cdtx.TITLE;
c曲リストード.arスコア[ i ].. = cdtx.TITLE.GetString("");
c曲リストード.arスコア[ i ].. = cdtx.ARTIST;
@ -833,7 +833,7 @@ namespace TJAPlayer3
c曲リストード.arスコア[ i ]..SongVol = cdtx.SongVol;
c曲リストード.arスコア[ i ]..SongLoudnessMetadata = cdtx.SongLoudnessMetadata;
c曲リストード.arスコア[ i ]..nデモBGMオフセット = cdtx.nデモBGMオフセット;
c曲リストード.arスコア[ i ]..strサブタイトル = cdtx.SUBTITLE;
c曲リストード.arスコア[ i ]..strサブタイトル = cdtx.SUBTITLE.GetString("");
for (int k = 0; k < (int)Difficulty.Total; k++)
{
c曲リストード.arスコア[i]..b譜面分岐[k] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[k];
@ -1116,7 +1116,7 @@ namespace TJAPlayer3
#endregion
string newPath = parentName + c曲リストード.strタイトル + "/";
string newPath = parentName + c曲リストード.ldTitle.GetString("") + "/";
CSongDict.tReinsertBackButtons(c曲リストード, c曲リストード.list子リスト, newPath, listStrBoxDefSkinSubfolderFullName);
@ -1131,16 +1131,16 @@ namespace TJAPlayer3
#region [ If no node title found, try to fetch it within the score objects ]
//-----------------------------
if ( string.IsNullOrEmpty( c曲リストード.strタイトル ) )
if ( string.IsNullOrEmpty( c曲リストード.ldTitle.GetString("")) )
{
for( int j = 0; j < (int)Difficulty.Total; j++ )
{
if( ( c曲リストード.arスコア[ j ] != null ) && !string.IsNullOrEmpty( c曲リストード.arスコア[ j ].. ) )
{
c曲リストード.strタイトル = c曲リストード.arスコア[ j ]..;
c曲リストード.ldTitle = new CLocalizationData();
if( TJAPlayer3.ConfigIni.bLog曲検索ログ出力 )
Trace.TraceInformation( "タイトルを設定しました。(nID#{0:D3}, title={1})", c曲リストード.nID, c曲リストード.strタイトル );
Trace.TraceInformation( "タイトルを設定しました。(nID#{0:D3}, title={1})", c曲リストード.nID, c曲リストード.ldTitle.GetString(""));
break;
}

View File

@ -13,7 +13,7 @@ namespace TJAPlayer3.C曲リストードComparers
public int Compare(CSongListNode n1, CSongListNode n2)
{
return _order * n1.strサブタイトル.CompareTo(n2.strサブタイトル);
return _order * n1.ldSubtitle.GetString("").CompareTo(n2.ldSubtitle.GetString(""));
}
}
}

View File

@ -13,7 +13,7 @@ namespace TJAPlayer3.C曲リストードComparers
public int Compare(CSongListNode n1, CSongListNode n2)
{
return _order * n1.strタイトル.CompareTo( n2.strタイトル );
return _order * n1.ldTitle.GetString("").CompareTo( n2.ldTitle.GetString(""));
}
}
}

View File

@ -373,7 +373,7 @@ namespace TJAPlayer3
string titleTmp = "";
if (TJAPlayer3.stageSongSelect.r確定されたスコア != null)
titleTmp = TJAPlayer3.stageSongSelect.rChoosenSong.strタイトル;
titleTmp = TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("");
if (songNode != null)
{
STバー情報 stNode = (STバー情報)songNode;
@ -805,7 +805,7 @@ namespace TJAPlayer3
}
// Two char header, will be used for grade unlocking too
string tmp = song.strタイトル.Substring(0, 2);
string tmp = song.ldTitle.GetString("").Substring(0, 2);
stバー情報[i].ttkタイトル[listSongs[i].DanSongs.Count] = new TitleTextureKey(tmp, pfDanSong, Color.Black, Color.Transparent, 700);
@ -844,10 +844,10 @@ namespace TJAPlayer3
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]);
stバー情報[i].ttkタイトル[0] = new TitleTextureKey(song.ldTitle.GetString(""), 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]);
stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey(song.strBoxText[boxdesc].GetString(""), 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;

View File

@ -276,7 +276,7 @@ namespace TJAPlayer3
foreach (CSongListNode node in list)
{
if (node.eード種別 != CSongListNode.ENodeType.BOX) continue;
string newPath = parentName + node.strタイトル + "/";
string newPath = parentName + node.ldTitle.GetString("") + "/";
CSongDict.tReinsertBackButtons(node, node.list子リスト, newPath, TJAPlayer3.Songs管理.listStrBoxDefSkinSubfolderFullName);
addBackBox(node.list子リスト, newPath);
@ -463,7 +463,7 @@ namespace TJAPlayer3
var song = this.rGetSideSong(barCenterNum);
int index = (this.n現在の選択行 + barCenterNum) % TJAPlayer3.Skin.SongSelect_Bar_Count; // 新しく最下部に表示されるパネルのインデックス012
this.stバー情報[index].strタイトル文字列 = song.strタイトル;
this.stバー情報[index].strタイトル文字列 = song.ldTitle.GetString("");
this.stバー情報[index].ForeColor = song.ForeColor;
this.stバー情報[index].BackColor = song.BackColor;
this.stバー情報[index].BoxColor = song.BoxColor;
@ -480,7 +480,7 @@ namespace TJAPlayer3
this.stバー情報[index].BoxCharaChanged = song.isChangedBoxChara;
this.stバー情報[index].strジャンル = song.strジャンル;
this.stバー情報[index].strサブタイトル = song.strサブタイトル;
this.stバー情報[index].strサブタイトル = song.ldSubtitle.GetString("");
this.stバー情報[index].ar難易度 = song.nLevel;
this.stバー情報[index].nLevelIcon = song.nLevelIcon;
@ -591,7 +591,7 @@ namespace TJAPlayer3
var song = this.rGetSideSong(-barCenterNum);
int index = ((this.n現在の選択行 - barCenterNum) + TJAPlayer3.Skin.SongSelect_Bar_Count) % TJAPlayer3.Skin.SongSelect_Bar_Count; // 新しく最上部に表示されるパネルのインデックス012
this.stバー情報[index].strタイトル文字列 = song.strタイトル;
this.stバー情報[index].strタイトル文字列 = song.ldTitle.GetString("");
this.stバー情報[index].ForeColor = song.ForeColor;
this.stバー情報[index].BackColor = song.BackColor;
this.stバー情報[index].BoxColor = song.BoxColor;
@ -607,7 +607,7 @@ namespace TJAPlayer3
this.stバー情報[index].BoxChara = song.BoxChara;
this.stバー情報[index].BoxCharaChanged = song.isChangedBoxChara;
this.stバー情報[index].strサブタイトル = song.strサブタイトル;
this.stバー情報[index].strサブタイトル = song.ldSubtitle.GetString("");
this.stバー情報[index].strジャンル = song.strジャンル;
this.stバー情報[index].ar難易度 = song.nLevel;
this.stバー情報[index].nLevelIcon = song.nLevelIcon;
@ -987,9 +987,9 @@ namespace TJAPlayer3
string[] boxText = new string[3]
{
rCurrentlySelectedSong.strBoxText[0],
rCurrentlySelectedSong.strBoxText[1],
rCurrentlySelectedSong.strBoxText[2] + _append
rCurrentlySelectedSong.strBoxText[0].GetString(""),
rCurrentlySelectedSong.strBoxText[1].GetString(""),
rCurrentlySelectedSong.strBoxText[2].GetString("") + _append
};
if (strBoxText != boxText[0] + boxText[1] + boxText[2])
@ -1202,9 +1202,9 @@ namespace TJAPlayer3
string[] boxText = new string[3]
{
rCurrentlySelectedSong.strBoxText[0],
rCurrentlySelectedSong.strBoxText[1],
rCurrentlySelectedSong.strBoxText[2] + _append
rCurrentlySelectedSong.strBoxText[0].GetString(""),
rCurrentlySelectedSong.strBoxText[1].GetString(""),
rCurrentlySelectedSong.strBoxText[2].GetString("") + _append
};
if (strBoxText != boxText[0] + boxText[1] + boxText[2])
@ -2146,10 +2146,10 @@ namespace TJAPlayer3
// Fonts here
//-----------------
if (rCurrentlySelectedSong.strタイトル != "" && this.ttk選択している曲の曲名 == null)
this.ttk選択している曲の曲名 = this.ttk曲名テクスチャを生成する(rCurrentlySelectedSong.strタイトル, rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor, rCurrentlySelectedSong.eード種別 == CSongListNode.ENodeType.BOX ? this.pfBoxName : this.pfMusicName);
if (rCurrentlySelectedSong.strサブタイトル != "" && this.ttk選択している曲のサブタイトル == null)
this.ttk選択している曲のサブタイトル = this.ttkサブタイトルテクスチャを生成する(rCurrentlySelectedSong.strサブタイトル, rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor);
if (rCurrentlySelectedSong.ldTitle.GetString("") != "" && this.ttk選択している曲の曲名 == null)
this.ttk選択している曲の曲名 = this.ttk曲名テクスチャを生成する(rCurrentlySelectedSong.ldTitle.GetString(""), rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor, rCurrentlySelectedSong.eード種別 == CSongListNode.ENodeType.BOX ? this.pfBoxName : this.pfMusicName);
if (rCurrentlySelectedSong.ldSubtitle.GetString("") != "" && this.ttk選択している曲のサブタイトル == null)
this.ttk選択している曲のサブタイトル = this.ttkサブタイトルテクスチャを生成する(rCurrentlySelectedSong.ldSubtitle.GetString(""), rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor);
if (rCurrentlySelectedSong.strMaker != "" && this.ttkSelectedSongMaker == null)
this.ttkSelectedSongMaker = this.ttkGenerateMakerTexture(rCurrentlySelectedSong.strMaker, rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor);
if (this.ttkSelectedSongBPM == null)
@ -2905,7 +2905,7 @@ namespace TJAPlayer3
{
CSongListNode song = this.rGetSideSong(i - barCenterNum);
if (song == null) continue;
this.stバー情報[ i ].strタイトル文字列 = song.strタイトル;
this.stバー情報[ i ].strタイトル文字列 = song.ldTitle.GetString("");
this.stバー情報[ i ].strジャンル = song.strジャンル;
this.stバー情報[ i ].col文字色 = song.col文字色;
this.stバー情報[i].ForeColor = song.ForeColor;
@ -2924,7 +2924,7 @@ namespace TJAPlayer3
this.stバー情報[i].BoxCharaChanged = song.isChangedBoxChara;
this.stバー情報[ i ].eバー種別 = this.e曲のバー種別を返す( song );
this.stバー情報[ i ].strサブタイトル = song.strサブタイトル;
this.stバー情報[ i ].strサブタイトル = song.ldSubtitle.GetString("");
this.stバー情報[ i ].ar難易度 = song.nLevel;
this.stバー情報[i].nLevelIcon = song.nLevelIcon;

View File

@ -110,8 +110,8 @@ namespace TJAPlayer3
public void t選択画面初期化()
{
this.txTitle = TJAPlayer3.tテクスチャの生成(pfTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.strタイトル, Color.White, Color.Black, null, 30 ));
this.txSubTitle = TJAPlayer3.tテクスチャの生成(pfSubTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.strサブタイトル, Color.White, Color.Black, null, 30));
this.txTitle = TJAPlayer3.tテクスチャの生成(pfTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.ldTitle.GetString(""), Color.White, Color.Black, null, 30 ));
this.txSubTitle = TJAPlayer3.tテクスチャの生成(pfSubTitle.DrawText(TJAPlayer3.stageSongSelect.rNowSelectedSong.ldSubtitle.GetString(""), Color.White, Color.Black, null, 30));
this.n現在の選択行 = new int[5];
this.bSelect[0] = false;

View File

@ -59,8 +59,8 @@ namespace TJAPlayer3
if( File.Exists( cdtx.strフォルダ名 + @"set.def" ) )
cdtx = new CDTX( strDTXファイルパス, true, 1.0, 0, 1 );
this.str曲タイトル = cdtx.TITLE;
this.strサブタイトル = cdtx.SUBTITLE;
this.str曲タイトル = cdtx.TITLE.GetString("");
this.strサブタイトル = cdtx.SUBTITLE.GetString("");
cdtx.DeActivate();
}
@ -74,8 +74,8 @@ namespace TJAPlayer3
{
var cdtx = new CDTX(strDTXファイルパス, true, 1.0, 0, 1);
this.str曲タイトル = cdtx.TITLE;
this.strサブタイトル = cdtx.SUBTITLE;
this.str曲タイトル = cdtx.TITLE.GetString("");
this.strサブタイトル = cdtx.SUBTITLE.GetString("");
cdtx.DeActivate();
}
@ -510,7 +510,7 @@ namespace TJAPlayer3
}
Trace.TraceInformation( "---- Song information -----------------" );
Trace.TraceInformation( "TITLE: {0}", TJAPlayer3.DTX.TITLE );
Trace.TraceInformation( "TITLE: {0}", TJAPlayer3.DTX.TITLE.GetString("") );
Trace.TraceInformation( "FILE: {0}", TJAPlayer3.DTX.strファイル名の絶対パス );
Trace.TraceInformation( "---------------------------" );

View File

@ -3365,7 +3365,7 @@ namespace TJAPlayer3
var panelString = TJAPlayer3.IsPerformingCalibration
? "Calibrating input..."
: string.IsNullOrEmpty( TJAPlayer3.DTX.PANEL ) ? TJAPlayer3.DTX.TITLE: TJAPlayer3.DTX.PANEL;
: string.IsNullOrEmpty( TJAPlayer3.DTX.PANEL ) ? TJAPlayer3.DTX.TITLE.GetString(""): TJAPlayer3.DTX.PANEL;
this.actPanel.SetPanelString( panelString,
TJAPlayer3.stageSongSelect.rChoosenSong.str本当のジャンル,

View File

@ -271,8 +271,8 @@ namespace TJAPlayer3
}
// Discord Presence の更新
string details = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stageSongSelect.rChoosenSong.strタイトル
+ diffToString(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]) : "";
string details = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("")
+ diffToString(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]) : "";
// Byte count must be used instead of String.Length.
// The byte count is what Discord is concerned with. Some chars are greater than one byte.

View File

@ -37,7 +37,7 @@ namespace TJAPlayer3
var title = TJAPlayer3.IsPerformingCalibration
? $"Calibration complete. InputAdjustTime is now {TJAPlayer3.ConfigIni.nInputAdjustTimeMs}ms (Note : InputAdjust is deprecated, please transfer the value to GlobalOffset and reload the songs"
: TJAPlayer3.DTX.TITLE;
: TJAPlayer3.DTX.TITLE.GetString("");
using (var bmpSongTitle = pfMusicName.DrawText(title, TJAPlayer3.Skin.Result_MusicName_ForeColor, TJAPlayer3.Skin.Result_MusicName_BackColor, null, 30))

View File

@ -302,7 +302,7 @@ namespace TJAPlayer3
TJAPlayer3.SaveFile);
*/
this.newGradeGranted = TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].tUpdateDanTitle(TJAPlayer3.stageSongSelect.rChoosenSong.strタイトル.Substring(0, 2),
this.newGradeGranted = TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].tUpdateDanTitle(TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("").Substring(0, 2),
clearValue % 2 == 0,
(clearValue - 1) / 2);
}
@ -360,8 +360,8 @@ namespace TJAPlayer3
return (diffArr[Math.Min(diff, 6)] + "Lv." + level + diffArrIcon[(int)levelIcon]);
}
string details = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stageSongSelect.rChoosenSong.strタイトル
+ diffToString(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]) : "";
string details = TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stageSongSelect.rChoosenSong.ldTitle.GetString("")
+ diffToString(TJAPlayer3.stageSongSelect.nChoosenSongDifficulty[0]) : "";
// Byte count must be used instead of String.Length.
// The byte count is what Discord is concerned with. Some chars are greater than one byte.

View File

@ -371,8 +371,8 @@ namespace TJAPlayer3
BarInfo bar = BarInfos[i];
CSongListNode song = listSongs[i];
bar.strTitle = song.strタイトル;
bar.strSubTitle = song.strサブタイトル;
bar.strTitle = song.ldTitle.GetString("");
bar.strSubTitle = song.ldSubtitle.GetString("");
bar.eード種別 = song.eード種別;
bar.ttkTitle = new CActSelect曲リスト.TitleTextureKey(bar.strTitle, pfTitleFont, Color.Black, Color.Transparent, TJAPlayer3.Skin.TowerSelect_Title_MaxWidth);