Skip to content

Commit 187fe2e

Browse files
committed
refactor: 当延迟调整模式为Bar,且确实需要addBar时,也显示提示
1 parent 0b0d4a6 commit 187fe2e

5 files changed

Lines changed: 13 additions & 2 deletions

File tree

MaiChartManager/Controllers/Music/MusicTransferController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ public async Task ExportAsMaidata(int id, string assetDir, bool ignoreVideo = fa
567567
simaiFile.AppendLine($"&title={music.Name}");
568568
simaiFile.AppendLine($"&artist={music.Artist}");
569569
simaiFile.AppendLine($"&wholebpm={music.Bpm}");
570-
simaiFile.AppendLine($"&first={audioDelay::0.####}");
570+
simaiFile.AppendLine($"&first={audioDelay:0.####}");
571571
simaiFile.AppendLine($"&shortid={music.Id}");
572572
simaiFile.AppendLine($"&genreid={music.GenreId}");
573573
var genre = StaticSettings.GenreList.FirstOrDefault(it => it.Id == music.GenreId);

MaiChartManager/Front/src/locales/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ chart:
262262
trimPadding: Will trim {padding} seconds of audio to ensure first note is in second bar
263263
addFirst: Will add {first} seconds of silence to match &first value
264264
trimFirst: Will trim {first} seconds of audio to match &first value
265+
addBar: Will add 1 bar of silence at the beginning of the chart to ensure the first note is after the second bar
265266
error:
266267
noMaidata: maidata.txt not found
267268
noAudio: Audio file not found

MaiChartManager/Front/src/locales/zh-TW.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ chart:
240240
trimPadding: 將裁剪 {padding} 秒音訊以保證第一押在第二小節
241241
addFirst: 將在音訊前面加上 {first} 秒空白以對應 &first 的值
242242
trimFirst: 將裁剪 {first} 秒音訊以對應 &first 的值
243+
addBar: 將在譜面開頭加上1小節空白,以保證第一押出現在第二小節之後
243244
error:
244245
noMaidata: 未找到 maidata.txt
245246
noAudio: 未找到音訊檔案

MaiChartManager/Front/src/locales/zh.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ chart:
240240
trimPadding: 将裁剪 {padding} 秒音频以保证第一押在第二小节
241241
addFirst: 将在音频前面加上 {first} 秒空白以对应 &first 的值
242242
trimFirst: 将裁剪 {first} 秒音频以对应 &first 的值
243+
addBar: 将在谱面开头加上1小节空白,以保证第一押出现在第二小节之后
243244
error:
244245
noMaidata: 未找到 maidata.txt
245246
noAudio: 未找到音频文件

MaiChartManager/Front/src/views/Charts/ImportCreateChartButton/ImportChartButton/ImportAlert.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ export default defineComponent({
2525
props.errors.map((error, i) => {
2626
if ('first' in error) {
2727
const padding = error.chartPaddings?.[props.tempOptions.shift]! - error.first
28-
if (padding > 0){
28+
if (props.tempOptions.shift === ShiftMethod.Bar) {
29+
if (error.chartPaddings?.[ShiftMethod.Bar]! > 0) { // 如果选择的是Bar模式且确实需要addBar,则也显示一条提示
30+
return <div key={i} class="p-3 rounded border border-blue/30 bg-blue/10">
31+
<div class="font-bold mb-1">{error.name}</div>
32+
{t('chart.import.addBar')}
33+
</div>
34+
}
35+
}
36+
else if (padding > 0){
2937
return <div key={i} class="p-3 rounded border border-blue/30 bg-blue/10">
3038
<div class="font-bold mb-1">{error.name}</div>
3139
{t('chart.import.add' + i18nPostfix.value, {padding: padding.toFixed(3)})}

0 commit comments

Comments
 (0)