From b365d5a519fb593627dd65195e2062db1833ac8e Mon Sep 17 00:00:00 2001 From: 0aubsq <0aubsq@gmail.com> Date: Sun, 31 Oct 2021 23:21:52 +0100 Subject: [PATCH] (Pre. v0.5.1) Added DANTICK and DANTICKCOLOR options within the .tja files to change the color of the small bar on the dan song select screen --- TJAPlayer3/Songs/CDTX.cs | 15 ++++++++++++++- TJAPlayer3/Songs/CSong管理.cs | 6 ++++++ TJAPlayer3/Songs/Cスコア.cs | 4 ++++ TJAPlayer3/Songs/C曲リストノード.cs | 3 +++ .../05.DaniSelect/CActSelect段位リスト.cs | 18 ++++++++++++++++-- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/TJAPlayer3/Songs/CDTX.cs b/TJAPlayer3/Songs/CDTX.cs index 188d25ad..3d966869 100644 --- a/TJAPlayer3/Songs/CDTX.cs +++ b/TJAPlayer3/Songs/CDTX.cs @@ -1190,6 +1190,9 @@ namespace TJAPlayer3 public int LIFE; public int TOWERTYPE; + + public int DANTICK = 0; + public Color DANTICKCOLOR = Color.White; public Dictionary listAVI; public Dictionary listAVIPAN; @@ -3027,7 +3030,7 @@ namespace TJAPlayer3 private static readonly Regex regexForPrefixingCommaStartingLinesWithZero = new Regex(@"^,", RegexOptions.Multiline | RegexOptions.Compiled); private static readonly Regex regexForStrippingHeadingLines = new Regex( - @"^(?!(TITLE|LEVEL|BPM|WAVE|OFFSET|BALLOON|EXAM1|EXAM2|EXAM3|EXAM4|EXAM5|EXAM6|EXAM7|RENREN22|RENREN23|RENREN32|RENREN33|RENREN42|RENREN43|BALLOONNOR|BALLOONEXP|BALLOONMAS|SONGVOL|SEVOL|SCOREINIT|SCOREDIFF|COURSE|STYLE|TOWERTYPE|GAME|LIFE|DEMOSTART|SIDE|SUBTITLE|SCOREMODE|GENRE|MOVIEOFFSET|BGIMAGE|BGMOVIE|HIDDENBRANCH|GAUGEINCR|LYRICFILE|#HBSCROLL|#BMSCROLL)).+\n", + @"^(?!(TITLE|LEVEL|BPM|WAVE|OFFSET|BALLOON|EXAM1|EXAM2|EXAM3|EXAM4|EXAM5|EXAM6|EXAM7|DANTICK|DANTICKCOLOR|RENREN22|RENREN23|RENREN32|RENREN33|RENREN42|RENREN43|BALLOONNOR|BALLOONEXP|BALLOONMAS|SONGVOL|SEVOL|SCOREINIT|SCOREDIFF|COURSE|STYLE|TOWERTYPE|GAME|LIFE|DEMOSTART|SIDE|SUBTITLE|SCOREMODE|GENRE|MOVIEOFFSET|BGIMAGE|BGMOVIE|HIDDENBRANCH|GAUGEINCR|LYRICFILE|#HBSCROLL|#BMSCROLL)).+\n", RegexOptions.Multiline | RegexOptions.Compiled); /// @@ -4901,6 +4904,16 @@ namespace TJAPlayer3 var tt = (int)Convert.ToDouble(strCommandParam); this.TOWERTYPE = tt; } + else if (strCommandName.Equals("DANTICK")) + { + var tick = (int)Convert.ToDouble(strCommandParam); + this.DANTICK = tick; + } + else if (strCommandName.Equals("DANTICKCOLOR")) + { + var tickcolor = ColorTranslator.FromHtml(strCommandParam); + this.DANTICKCOLOR = tickcolor; + } else if (strCommandName.Equals("BPM")) { if (strCommandParam.IndexOf(",") != -1) diff --git a/TJAPlayer3/Songs/CSong管理.cs b/TJAPlayer3/Songs/CSong管理.cs index 12432ca1..ab94b827 100644 --- a/TJAPlayer3/Songs/CSong管理.cs +++ b/TJAPlayer3/Songs/CSong管理.cs @@ -210,6 +210,9 @@ namespace TJAPlayer3 c曲リストノード.nTowerType = dtx.TOWERTYPE; + c曲リストノード.nDanTick = dtx.DANTICK; + c曲リストノード.cDanTickColor = dtx.DANTICKCOLOR; + // Total count of floors for a tower chart c曲リストノード.nTotalFloor = 0; @@ -1064,6 +1067,9 @@ namespace TJAPlayer3 c曲リストノード.arスコア[i].譜面情報.nTowerType = cdtx.TOWERTYPE; + c曲リストノード.arスコア[i].譜面情報.nDanTick = cdtx.DANTICK; + c曲リストノード.arスコア[i].譜面情報.cDanTickColor = cdtx.DANTICKCOLOR; + c曲リストノード.arスコア[i].譜面情報.nTotalFloor = 0; for (int k = 0; k < cdtx.listChip.Count; k++) { diff --git a/TJAPlayer3/Songs/Cスコア.cs b/TJAPlayer3/Songs/Cスコア.cs index 2faa2638..41141668 100644 --- a/TJAPlayer3/Songs/Cスコア.cs +++ b/TJAPlayer3/Songs/Cスコア.cs @@ -4,6 +4,7 @@ using System.Text; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; using FDK; +using System.Drawing; namespace TJAPlayer3 { @@ -86,6 +87,9 @@ namespace TJAPlayer3 public int nTotalFloor; public int nTowerType; + public int nDanTick; + public Color cDanTickColor; + [Serializable] [StructLayout( LayoutKind.Sequential )] public struct STHISTORY diff --git a/TJAPlayer3/Songs/C曲リストノード.cs b/TJAPlayer3/Songs/C曲リストノード.cs index 5b35259f..68e593db 100644 --- a/TJAPlayer3/Songs/C曲リストノード.cs +++ b/TJAPlayer3/Songs/C曲リストノード.cs @@ -76,6 +76,9 @@ namespace TJAPlayer3 public int nLife = 5; public int nTotalFloor = 140; public int nTowerType = 0; + + public int nDanTick = 0; + public Color cDanTickColor = Color.White; public string[] strBoxText = new string[3]; public Eジャンル eジャンル = Eジャンル.None; diff --git a/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs b/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs index 9e6394af..1647888c 100644 --- a/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs +++ b/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs @@ -157,8 +157,15 @@ namespace TJAPlayer3 #region [Plate background] + 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.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, xPos, yPos, new Rectangle(0, 0, tickWidth, tickHeight)); + TJAPlayer3.Tx.Dani_Plate.color4 = tickColor; + TJAPlayer3.Tx.Dani_Plate.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight)); + + // Reset color for plate flash + TJAPlayer3.Tx.Dani_Plate.color4 = Color.White; #endregion @@ -231,7 +238,11 @@ namespace TJAPlayer3 public List List_DanSongs; public CTexture txBarCenter; public CTexture txDanPlate; + + // Extra parameters public int clearGrade; + public int nDanTick; + public Color cDanTickColor; } private void tDrawDanSelectedLevel(float Anime, int modifier = 0) @@ -382,10 +393,13 @@ namespace TJAPlayer3 stバー情報[i].List_DanSongs = song.DanSongs; } - + // Two char header, will be used for grade unlocking too string tmp = song.strタイトル.Substring(0, 2); stバー情報[i].ttkタイトル[TJAPlayer3.Songs管理.list曲ルート_Dan[i].DanSongs.Count] = new TitleTextureKey(tmp, pfDanSong, Color.Black, Color.Transparent, 700); + stバー情報[i].nDanTick = song.arスコア[6].譜面情報.nDanTick; + stバー情報[i].cDanTickColor = song.arスコア[6].譜面情報.cDanTickColor; + stバー情報[i].clearGrade = song.arスコア[6].譜面情報.nクリア[0]; stバー情報[i].txBarCenter = TJAPlayer3.tテクスチャの生成(Path.GetDirectoryName(song.arスコア[6].ファイル情報.ファイルの絶対パス) + @"\Bar_Center.png"); stバー情報[i].txDanPlate = TJAPlayer3.tテクスチャの生成(Path.GetDirectoryName(song.arスコア[6].ファイル情報.ファイルの絶対パス) + @"\Dan_Plate.png");