Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…iFumenEditor into batch_mode

# Conflicts:
#	OngekiFumenEditor/Modules/FumenVisualEditor/ViewModels/FumenVisualEditorViewModel.cs
#	OngekiFumenEditor/Properties/Resources.resx
#	OngekiFumenEditor/Properties/Resources.zh-Hans.resx
  • Loading branch information
MikiraSora committed Feb 17, 2025
2 parents 6dde8e3 + 5170569 commit afd3334
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/BuildProgram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: dotnet restore
- name: Publish
run: dotnet publish .\OngekiFumenEditor\OngekiFumenEditor.csproj --no-restore -c ${{env.Configuration}} -o ./bin/githubActions/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: OngekiFumenEditor_${{steps.project-version.outputs.version}}_${{env.Branch}}_(GABuild${{ steps.current-time.outputs.formattedTime }}_${{ steps.short-sha.outputs.sha }}_${{env.Configuration}})
path: D:\a\OngekiFumenEditor\OngekiFumenEditor\bin\githubActions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void RebuildSvgContent()
brush.Freeze();
var pen = new Pen(brush, 1);
pen.Freeze();
var dpiInfo = VisualTreeHelper.GetDpi(Application.Current.MainWindow);
var dpiInfo = Application.Current.MainWindow is not null ? VisualTreeHelper.GetDpi(Application.Current.MainWindow) : new();

var direction = ContentFlowDirection switch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,32 @@ protected override async Task DoSave(string filePath)
}
}

public override async Task<bool> CanCloseAsync(CancellationToken cancellationToken)
{
if (!IsDirty)
return true;

var result = MessageBox.Show(
Resources.SaveBeforeClosingPrompt.Format(DisplayName),
Resources.Warning,
MessageBoxButton.YesNoCancel,
MessageBoxImage.Warning,
MessageBoxResult.Cancel);

switch (result)
{
case MessageBoxResult.Yes:
if (IsNew)
return await DoSaveAs(this);
await Save(FilePath);
return true;
case MessageBoxResult.No:
return true;
default:
return false;
}
}

#endregion

#region Activation
Expand Down
11 changes: 10 additions & 1 deletion OngekiFumenEditor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions OngekiFumenEditor/Properties/Resources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1591,4 +1591,7 @@
<data name="CurvePrecisionLabel" xml:space="preserve">
<value>CurvePrecision</value>
</data>
<data name="SaveBeforeClosingPrompt" xml:space="preserve">
<value>閉じる前に変更された"{0}" を保存しますか?</value>
</data>
</root>
3 changes: 3 additions & 0 deletions OngekiFumenEditor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2010,4 +2010,7 @@
<data name="ConflictNotifyComfirm" xml:space="preserve">
<value>The key you bind to conflicts with {0}, if you continue to bind, the conflicting key will be cleared, do you want to continue?</value>
</data>
<data name="SaveBeforeClosingPrompt" xml:space="preserve">
<value>Save changes to "{0}" before closing?</value>
</data>
</root>
2 changes: 2 additions & 0 deletions OngekiFumenEditor/Properties/Resources.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1959,5 +1959,7 @@
</data>
<data name="ConflictNotifyComfirm" xml:space="preserve">
<value>你绑定的键位和 {0} 冲突, 如果继续绑定则清空对方冲突的键位, 是否继续?</value>
<data name="SaveBeforeClosingPrompt" xml:space="preserve">
<value>关闭文档前是否要保存文件 {0} ?</value>
</data>
</root>
5 changes: 4 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
* 打包生成工具
* 完全实现Soflan倒车变速!
* 多语言支持 (English/Japanese DONE) [For translators](https://github.com/NyagekiFumenProject/OngekiFumenEditor/wiki/For-translators)
* 谱面预览生成
* 谱面预览生成
* 程序更新检测/下载安装
* 更好的CLI支持
* 自定义快捷键按键绑定
* 塞小功能&修BUG.... **<--- we are here! ---**
....、

Expand Down

0 comments on commit afd3334

Please sign in to comment.