Skip to content

Commit f1500bd

Browse files
author
HitMargin
committed
refactor: move ghost rain colors into color settings section
- Move ghost rain color pickers into DrawColorSettings() - Add proper i18n keys ghost_rain_color1/2/3 for all languages - Unify Chinese format: 第一排鬼键雨滴颜色 - Remove separate DrawGhostRainColorSettings() method
1 parent 64f1196 commit f1500bd

6 files changed

Lines changed: 49 additions & 49 deletions

File tree

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## v1.6.1
2+
3+
### 🚀 Features
4+
- Custom `RainGraphic` replaces `Image` for normal rain — lighter rendering (solid/gradient quad, 4 verts, no texture sampling)
5+
- Ghost rain now correctly renders the `GhostRain.png` sprite (child `Image` + Tiled mode)
6+
- Per-row ghost rain color customization (`GhostRainColor` / `GhostRainColor2` / `GhostRainColor3`)
7+
- Edge fade slider changed from percentage to pixels (1–200px)
8+
9+
### 🐛 Bug Fixes
10+
- Ghost rain sprite was loaded but never used for rendering — now displays correctly
11+
- Release fade and edge fade now work together without conflict
12+
13+
### 🔧 Performance
14+
- Normal rain: 4 verts / 2 tris, no texture sampling — lighter than old `Image`
15+
- Ghost rain: child `Image` tiling — negligible overhead (low frequency)
16+
17+
### 🧹 Misc
18+
- Removed dead code (unused `Init` overloads, pool methods, stale `ghostSprite`)
19+
- Bumped version to 1.6.1

JipperKeyViewer-FileBased/lang/lang.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
{ "key": "rain_fade", "en": "Release Fade", "zh": "松开淡出", "ko": "릴리스 페이드" },
5353
{ "key": "fade_duration", "en": "Fade Duration", "zh": "淡出时长", "ko": "페이드 시간" },
5454
{ "key": "ghost_rain", "en": "Ghost Rain", "zh": "鬼键雨滴", "ko": "고스트 빗줄" },
55+
{ "key": "ghost_rain_color1", "en": "Ghost Rain Color 1", "zh": "第一排鬼键雨滴颜色", "ko": "1열 고스트 빗줄 색상" },
56+
{ "key": "ghost_rain_color2", "en": "Ghost Rain Color 2", "zh": "第二排鬼键雨滴颜色", "ko": "2열 고스트 빗줄 색상" },
57+
{ "key": "ghost_rain_color3", "en": "Ghost Rain Color 3", "zh": "第三排鬼键雨滴颜色", "ko": "3열 고스트 빗줄 색상" },
5558
{ "key": "hide_main_count", "en": "Hide Main Key Count", "zh": "隐藏主按键计数", "ko": "메인 키 카운트 숨기기" },
5659
{ "key": "per_key_kps", "en": "Per-Key KPS", "zh": "每键KPS", "ko": "키별 KPS" },
5760
{ "key": "per_key_colors", "en": "Per-Key Colors", "zh": "每键独立颜色", "ko": "키별 색상" },

JipperKeyViewer/KeyViewer/I18n.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public static class I18n
3636
["rain_row2"] = "Row 2",
3737
["rain_row3"] = "Row 3",
3838
["rain_height"] = "Rain Height",
39+
["ghost_rain_color1"] = "Ghost Rain Color 1",
40+
["ghost_rain_color2"] = "Ghost Rain Color 2",
41+
["ghost_rain_color3"] = "Ghost Rain Color 3",
3942
["rain_speed"] = "Rain Speed",
4043
["rain_fade"] = "Release Fade",
4144
["fade_duration"] = "Fade Duration",
@@ -110,6 +113,9 @@ public static class I18n
110113
["rain_fade"] = "雨滴松开淡出",
111114
["fade_duration"] = "淡出时长",
112115
["ghost_rain"] = "鬼键雨滴",
116+
["ghost_rain_color1"] = "第一排鬼键雨滴颜色",
117+
["ghost_rain_color2"] = "第二排鬼键雨滴颜色",
118+
["ghost_rain_color3"] = "第三排鬼键雨滴颜色",
113119
["rain_gradient"] = "顶部渐隐",
114120
["gradient_percent"] = "渐隐像素",
115121

@@ -180,6 +186,9 @@ public static class I18n
180186
["rain_fade"] = "빗줄 페이드아웃",
181187
["fade_duration"] = "페이드 시간",
182188
["ghost_rain"] = "고스트 빗줄",
189+
["ghost_rain_color1"] = "1열 고스트 빗줄 색상",
190+
["ghost_rain_color2"] = "2열 고스트 빗줄 색상",
191+
["ghost_rain_color3"] = "3열 고스트 빗줄 색상",
183192
["rain_gradient"] = "끝 페이드",
184193
["gradient_percent"] = "페이드 px",
185194

JipperKeyViewer/KeyViewer/KeyViewerGUI.cs

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,6 @@ public void DrawSettingsWindow()
531531
SaveSettings();
532532
}
533533

534-
if (Settings.EnableGhostRain)
535-
DrawGhostRainColorSettings();
536534
}
537535

538536
GUILayout.Space(10);
@@ -559,7 +557,7 @@ public void DrawSettingsWindow()
559557

560558
// Color settings section / 颜色设置区域
561559
bool colorsExpanded = GUILayout.Toggle(ColorExpanded != null, (ColorExpanded != null ? "\u25E2 " : "\u25B6 ") + I18n.Tr("colors"));
562-
if (colorsExpanded && ColorExpanded == null) ColorExpanded = new bool[9];
560+
if (colorsExpanded && ColorExpanded == null) ColorExpanded = new bool[12];
563561
if (!colorsExpanded) ColorExpanded = null;
564562
if (ColorExpanded != null)
565563
{
@@ -919,62 +917,26 @@ private void DrawTextChangeSection()
919917
GUILayout.EndVertical();
920918
}
921919

922-
/// <summary>
923-
/// Draw the color settings section / 绘制颜色设置区域
924-
/// RGB-A sliders with preview and reset buttons for each color / 每个颜色的 R/G/B/A 滑块、预览和重置按钮
925-
/// </summary>
926-
private void DrawGhostRainColorSettings()
927-
{
928-
GUILayout.BeginVertical("box");
929-
string[] rowNames = { I18n.Tr("rain_row1"), I18n.Tr("rain_row2"), I18n.Tr("rain_row3") };
930-
Color[] ghostColors = { Settings.GhostRainColor, Settings.GhostRainColor2, Settings.GhostRainColor3 };
931-
Color[] ghostDefaults = { GhostRainColorDefault, GhostRainColor2Default, GhostRainColor3Default };
932-
933-
int rowCount = Settings.KeyViewerStyle == KeyviewerStyle.Key20 ? 3 : 2;
934-
for (int r = 0; r < rowCount; r++)
935-
{
936-
bool expanded = GUILayout.Toggle(ghostRainColorExpanded == r,
937-
(ghostRainColorExpanded == r ? "\u25E2 " : "\u25B6 ") + I18n.Tr("ghost_rain") + " " + rowNames[r]);
938-
if (expanded != (ghostRainColorExpanded == r))
939-
ghostRainColorExpanded = expanded ? r : -1;
940-
941-
if (ghostRainColorExpanded == r)
942-
{
943-
GUILayout.BeginVertical("box");
944-
Color cur = ghostColors[r];
945-
Color newColor = DrawColorPicker(rowNames[r], cur, ghostDefaults[r]);
946-
if (newColor != cur)
947-
{
948-
switch (r)
949-
{
950-
case 0: Settings.GhostRainColor = newColor; break;
951-
case 1: Settings.GhostRainColor2 = newColor; break;
952-
case 2: Settings.GhostRainColor3 = newColor; break;
953-
}
954-
SaveSettings();
955-
}
956-
GUILayout.EndVertical();
957-
}
958-
}
959-
GUILayout.EndVertical();
960-
}
961-
962920
private void DrawColorSettings()
963921
{
964922
GUILayout.BeginVertical("box");
965923
string[] colorNames = {
966924
I18n.Tr("color_bg"), I18n.Tr("color_bg_clicked"), I18n.Tr("color_outline"), I18n.Tr("color_outline_clicked"),
967925
I18n.Tr("color_text"), I18n.Tr("color_text_clicked"),
968-
I18n.Tr("color_rain1"), I18n.Tr("color_rain2"), I18n.Tr("color_rain3")
926+
I18n.Tr("color_rain1"), I18n.Tr("color_rain2"), I18n.Tr("color_rain3"),
927+
I18n.Tr("ghost_rain_color1"), I18n.Tr("ghost_rain_color2"), I18n.Tr("ghost_rain_color3")
969928
};
970929
Color[] defaultColors = {
971930
Background, BackgroundClicked, Outline, OutlineClicked,
972931
Text, TextClicked,
973-
RainColor, RainColor2, RainColor3
932+
RainColor, RainColor2, RainColor3,
933+
GhostRainColorDefault, GhostRainColor2Default, GhostRainColor3Default
974934
};
975-
for (int i = 0; i < 9; i++)
935+
for (int i = 0; i < 12; i++)
976936
{
977-
if (i >= 6 && !Settings.EnableRainEffect)
937+
if (i >= 6 && i < 9 && !Settings.EnableRainEffect)
938+
continue;
939+
if (i >= 9 && !Settings.EnableGhostRain)
978940
continue;
979941
ColorExpanded[i] = GUILayout.Toggle(ColorExpanded[i], ColorExpanded[i] ? $"\u25E2 {colorNames[i]}" : $"\u25B6 {colorNames[i]}");
980942
if (ColorExpanded[i])
@@ -1002,8 +964,6 @@ private void DrawColorSettings()
1002964
int kpsColorType = -1;
1003965
int totalColorType = -1;
1004966

1005-
int ghostRainColorExpanded = -1;
1006-
1007967
private void DrawKpsTotalColors(int pi, string label, ref int expandedType)
1008968
{
1009969
bool show = GUILayout.Toggle(expandedType >= 0, (expandedType >= 0 ? "◢ " : "▶ ") + label);

JipperKeyViewer/KeyViewer/KeyViewerLayout.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,9 @@ private Color GetColorByIndex(int index)
631631
6 => Settings.RainColor,
632632
7 => Settings.RainColor2,
633633
8 => Settings.RainColor3,
634+
9 => Settings.GhostRainColor,
635+
10 => Settings.GhostRainColor2,
636+
11 => Settings.GhostRainColor3,
634637
_ => Color.white
635638
};
636639
}
@@ -649,6 +652,9 @@ private void SetColorByIndex(int index, Color color)
649652
case 6: Settings.RainColor = color; break;
650653
case 7: Settings.RainColor2 = color; break;
651654
case 8: Settings.RainColor3 = color; break;
655+
case 9: Settings.GhostRainColor = color; break;
656+
case 10: Settings.GhostRainColor2 = color; break;
657+
case 11: Settings.GhostRainColor3 = color; break;
652658
}
653659
}
654660

JipperKeyViewer/lang/lang.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
{ "key": "rain_fade", "en": "Release Fade", "zh": "松开淡出", "ko": "릴리스 페이드" },
5353
{ "key": "fade_duration", "en": "Fade Duration", "zh": "淡出时长", "ko": "페이드 시간" },
5454
{ "key": "ghost_rain", "en": "Ghost Rain", "zh": "鬼键雨滴", "ko": "고스트 빗줄" },
55+
{ "key": "ghost_rain_color1", "en": "Ghost Rain Color 1", "zh": "第一排鬼键雨滴颜色", "ko": "1열 고스트 빗줄 색상" },
56+
{ "key": "ghost_rain_color2", "en": "Ghost Rain Color 2", "zh": "第二排鬼键雨滴颜色", "ko": "2열 고스트 빗줄 색상" },
57+
{ "key": "ghost_rain_color3", "en": "Ghost Rain Color 3", "zh": "第三排鬼键雨滴颜色", "ko": "3열 고스트 빗줄 색상" },
5558
{ "key": "hide_main_count", "en": "Hide Main Key Count", "zh": "隐藏主按键计数", "ko": "메인 키 카운트 숨기기" },
5659
{ "key": "per_key_kps", "en": "Per-Key KPS", "zh": "每键KPS", "ko": "키별 KPS" },
5760
{ "key": "per_key_colors", "en": "Per-Key Colors", "zh": "每键独立颜色", "ko": "키별 색상" },

0 commit comments

Comments
 (0)