@@ -20,24 +20,56 @@ public class ChuUtils
2020 [ "U" ] = "UP" ,
2121 [ "D" ] = "DW" ,
2222 [ "C" ] = "CE" ,
23+ [ "L" ] = "LS" ,
24+ [ "R" ] = "RS" ,
25+ [ "A" ] = "RC" ,
26+ [ "W" ] = "LC" ,
27+ [ "I" ] = "BS" ,
2328 } ;
2429 public static readonly Dictionary < string , string > C2U_ChrExtras = Utils . ReverseDict ( U2C_ChrExtras ) ;
2530
26- public static readonly Dictionary < string , string > U2C_AirColor = new ( )
31+ public static bool Try_U2C_AirColor ( ChuNote n , string rawColorStr , out string color )
2732 {
28- [ "N" ] = "DEF" ,
29- // ["I"] = "I", // TODO 搞清楚UGC里的'I'颜色,在C2S里,对应的字符串是什么
30- } ;
31- public static readonly Dictionary < string , string > C2U_AirColor = Utils . ReverseDict ( U2C_AirColor ) ;
32- public static readonly HashSet < string > C2sAllowedColors = C2U_AirColor . Keys . ToHashSet ( ) ;
33+ color = rawColorStr switch
34+ {
35+ "N" => "DEF" ,
36+ "I" => IsAirDown ( n ) ? "GRN" : "PPL" ,
37+ _ => "" ,
38+ } ;
39+ return color != "" ;
40+ }
41+ public static bool Try_C2U_AirColor ( ChuNote n , out string color )
42+ {
43+ color = n . Tag switch
44+ {
45+ "DEF" => "N" ,
46+ "" => "N" ,
47+ "GRN" => IsAirDown ( n ) ? "I" : "N" ,
48+ "PPL" => IsAirDown ( n ) ? "N" : "I" ,
49+ _ => "" ,
50+ } ;
51+ return color != "" ;
52+ }
53+ public static readonly HashSet < string > C2sAllowedColors = [ "DEF" , "GRN" , "PPL" ] ;
3354
3455 public static readonly Dictionary < string , string > U2C_AirCrushColor = new ( )
3556 {
36- [ "0" ] = "DEF" ,
37- [ "Z" ] = "NON" ,
38- [ "6" ] = "CYN" ,
39- [ "A" ] = "VLT" ,
40- // TODO 补充更多对应关系
57+ [ "0" ] = "DEF" , // Normal / 通常
58+ [ "Z" ] = "NON" , // Transparent / 透明
59+ [ "1" ] = "RED" , // Red / 赤
60+ [ "2" ] = "ORN" , // Orange / 橙
61+ [ "3" ] = "YEL" , // Yellow / 黄
62+ [ "4" ] = "LIM" , // Grass / 黄緑
63+ [ "5" ] = "GRN" , // Green / 緑
64+ [ "6" ] = "AQA" , // Sky / 水
65+ [ "7" ] = "CYN" , // Sky blue / 空
66+ [ "8" ] = "DGR" , // (存疑,不确定) Cobalt blue / 天(DGR ≈ Dark GRay?)
67+ [ "9" ] = "BLU" , // Blue / 青
68+ [ "A" ] = "VLT" , // Violet / 青紫
69+ [ "Y" ] = "PPL" , // Purple / 赤紫
70+ [ "B" ] = "PNK" , // Pink / 桃
71+ [ "C" ] = "GRY" , // (有点存疑,略微不确定) White / 白
72+ [ "D" ] = "BLK" , // Black / 黒
4173 } ;
4274 public static readonly Dictionary < string , string > C2U_AirCrushColor = Utils . ReverseDict ( U2C_AirCrushColor ) ;
4375 public static readonly HashSet < string > C2sAllowedCrushColors = C2U_AirCrushColor . Keys . ToHashSet ( ) ;
@@ -49,6 +81,7 @@ public class ChuUtils
4981 public static bool IsSlide ( string t ) => t is "SLD" or "SLC" or "SXD" or "SXC" ;
5082 public static bool IsAirSlide ( string t ) => t is "ASD" or "ASC" ;
5183 public static bool IsAir ( string t ) => t is "AIR" or "AUR" or "AUL" or "ADW" or "ADR" or "ADL" ;
84+ public static bool IsAirDown ( string t ) => t is "ADW" or "ADR" or "ADL" ;
5285 public static bool IsAirHold ( string t ) => t is "AHD" or "AHX" ;
5386 public static bool IsAirCrush ( string t ) => t is "ALD" ;
5487 // 是否是广义的air音符(Air/Air Hold/Air Slide/Air Crush)
@@ -58,6 +91,7 @@ public class ChuUtils
5891 public static bool IsSlide ( ChuNote ? n ) => IsSlide ( n ? . Type ! ) ;
5992 public static bool IsAirSlide ( ChuNote ? n ) => IsAirSlide ( n ? . Type ! ) ;
6093 public static bool IsAir ( ChuNote ? n ) => IsAir ( n ? . Type ! ) ;
94+ public static bool IsAirDown ( ChuNote ? n ) => IsAirDown ( n ? . Type ! ) ;
6195 public static bool IsAirHold ( ChuNote ? n ) => IsAirHold ( n ? . Type ! ) ;
6296 public static bool IsAirCrush ( ChuNote ? n ) => IsAirCrush ( n ? . Type ! ) ;
6397 // 是否是广义的air音符(Air/Air Hold/Air Slide/Air Crush)
0 commit comments