@@ -68,11 +68,23 @@ private string Serialize(ChuChart chart, List<Alert> alerts)
6868 return sb . ToString ( ) ;
6969 }
7070
71- private static readonly List < string > allowedAirColors = [ "DEF" , "I" ] ; // TODO 搞清楚UGC里的'I'颜色,在C2S里,对应的字符串是什么
72- private static string AirColorTag ( ChuNote n )
71+ private static string AirColorTag ( ChuNote n , List < Alert > alerts )
7372 {
74- if ( allowedAirColors . Contains ( n . Tag ) ) return n . Tag ;
75- else return "DEF" ;
73+ if ( C2sAllowedColors . Contains ( n . Tag ) ) return n . Tag ;
74+ else
75+ {
76+ if ( n . Tag != "" ) alerts . Add ( new Alert ( Alert . LEVEL . Warning , string . Format ( Locale . C2SUnsupportedAirColor , "C2S Generator" , n . Type , n . Tag ) , n . Time ) ) ;
77+ return "DEF" ;
78+ }
79+ }
80+ private static string AirCrushColorTag ( ChuNote n , List < Alert > alerts )
81+ {
82+ if ( C2sAllowedCrushColors . Contains ( n . Tag ) ) return n . Tag ;
83+ else
84+ {
85+ if ( n . Tag != "" ) alerts . Add ( new Alert ( Alert . LEVEL . Warning , string . Format ( Locale . C2SUnsupportedAirColor , "C2S Generator" , n . Type , n . Tag ) , n . Time ) ) ;
86+ return "DEF" ;
87+ }
7688 }
7789
7890 private static string FLKTag ( ChuNote n ) => n . Tag is "L" or "R" ? n . Tag : "L" ;
@@ -97,10 +109,10 @@ private static bool IsSlideContinueSegments(ChuNote n) // Air Slide的前驱只
97109 "SLD" or "SLC" or "SXD" or "SXC" => $ "{ n . Type } \t { m } \t { o } \t { n . Cell } \t { n . Width } \t { durTicks } \t { n . EndCell } \t { n . EndWidth } ",
98110 "FLK" => $ "FLK\t { m } \t { o } \t { n . Cell } \t { n . Width } \t { FLKTag ( n ) } ",
99111 "AIR" or "AUR" or "AUL" or "ADW" or "ADR" or "ADL" =>
100- $ "{ n . Type } \t { m } \t { o } \t { n . Cell } \t { n . Width } \t { n . TargetNote } \t { AirColorTag ( n ) } ",
101- "AHD" or "AHX" => $ "{ n . Type } \t { m } \t { o } \t { n . Cell } \t { n . Width } \t { n . TargetNote } \t { durTicks } \t { AirColorTag ( n ) } ",
102- "ASD" or "ASC" => FormatAsdAsc ( n , m , o , durTicks ) ,
103- "ALD" => FormatAld ( n , m , o , durTicks ) ,
112+ $ "{ n . Type } \t { m } \t { o } \t { n . Cell } \t { n . Width } \t { n . TargetNote } \t { AirColorTag ( n , alerts ) } ",
113+ "AHD" or "AHX" => $ "{ n . Type } \t { m } \t { o } \t { n . Cell } \t { n . Width } \t { n . TargetNote } \t { durTicks } \t { AirColorTag ( n , alerts ) } ",
114+ "ASD" or "ASC" => FormatAsdAsc ( n , m , o , durTicks , alerts ) ,
115+ "ALD" => FormatAld ( n , m , o , durTicks , alerts ) ,
104116 "MNE" => $ "MNE\t { m } \t { o } \t { n . Cell } \t { n . Width } ",
105117 _ => alert ( ) ,
106118 } ;
@@ -112,13 +124,13 @@ private static bool IsSlideContinueSegments(ChuNote n) // Air Slide的前驱只
112124 }
113125 }
114126
115- private static string FormatAsdAsc ( ChuNote n , int m , int o , int durTicks )
127+ private static string FormatAsdAsc ( ChuNote n , int m , int o , int durTicks , List < Alert > alerts )
116128 {
117- return FormattableString . Invariant ( $ "{ n . Type } \t { m } \t { o } \t { n . Cell } \t { n . Width } \t { n . TargetNote } \t { n . Height : 0.#} \t { durTicks } \t { n . EndCell } \t { n . EndWidth } \t { n . EndHeight : 0.#} \t { AirColorTag ( n ) } ") ;
129+ return FormattableString . Invariant ( $ "{ n . Type } \t { m } \t { o } \t { n . Cell } \t { n . Width } \t { n . TargetNote } \t { n . Height : 0.#} \t { durTicks } \t { n . EndCell } \t { n . EndWidth } \t { n . EndHeight : 0.#} \t { AirColorTag ( n , alerts ) } ") ;
118130 }
119131
120- private static string FormatAld ( ChuNote n , int m , int o , int durTicks )
132+ private static string FormatAld ( ChuNote n , int m , int o , int durTicks , List < Alert > alerts )
121133 {
122- return FormattableString . Invariant ( $ "ALD\t { m } \t { o } \t { n . Cell } \t { n . Width } \t { Utils . Tick ( n . CrushInterval , RSL ) } \t { n . Height : 0.#} \t { durTicks } \t { n . EndCell } \t { n . EndWidth } \t { n . EndHeight : 0.#} ") ;
134+ return FormattableString . Invariant ( $ "ALD\t { m } \t { o } \t { n . Cell } \t { n . Width } \t { Utils . Tick ( n . CrushInterval , RSL ) } \t { n . Height : 0.#} \t { durTicks } \t { n . EndCell } \t { n . EndWidth } \t { n . EndHeight : 0.#} \t { AirCrushColorTag ( n , alerts ) } ") ;
123135 }
124136}
0 commit comments