From bb794067c45badd395de7b3e5a323ab9abd49f0c Mon Sep 17 00:00:00 2001 From: milimoe Date: Mon, 17 Nov 2025 21:48:24 +0800 Subject: [PATCH] 1 --- Desktop/GameMapTesting/Converters.cs | 1 - Desktop/GameMapTesting/GameMapController.cs | 20 +++++++++---------- Desktop/GameMapTesting/GameMapTesting.cs | 4 ++-- Desktop/GameMapTesting/GameMapViewer.xaml.cs | 13 +++++------- Desktop/GameMapTesting/TestMap.cs | 2 +- Desktop/GameMapTesting/ViewModels.cs | 2 +- .../Solutions/EntityCreator/SetConfigName.cs | 2 +- .../Solutions/NovelEditor/NovelEditor.xaml.cs | 4 ++-- Library/Main.cs | 7 ------- 9 files changed, 22 insertions(+), 33 deletions(-) diff --git a/Desktop/GameMapTesting/Converters.cs b/Desktop/GameMapTesting/Converters.cs index b1ef57f..429a7ab 100644 --- a/Desktop/GameMapTesting/Converters.cs +++ b/Desktop/GameMapTesting/Converters.cs @@ -1,7 +1,6 @@ using System.Globalization; using System.Windows.Data; using Milimoe.FunGame.Core.Entity; -using Milimoe.FunGame.Core.Interface.Entity; using Milimoe.FunGame.Core.Library.Constant; namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting diff --git a/Desktop/GameMapTesting/GameMapController.cs b/Desktop/GameMapTesting/GameMapController.cs index 9d0b78a..d6ff61a 100644 --- a/Desktop/GameMapTesting/GameMapController.cs +++ b/Desktop/GameMapTesting/GameMapController.cs @@ -186,7 +186,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting _continuePromptRequester.ResolveInput(true); // 任何值都可以,只要完成Task await UI.InvokeAsync(() => UI.HideContinuePrompt()); } - + public async Task ResolveCountDownContinuePrompt() { _continuePromptRequester.ResolveInput(true); @@ -207,12 +207,12 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting { await UI.InvokeAsync(UI.UpdateBottomInfoPanel); } - + public async Task UpdateQueue() { await UI.InvokeAsync(UI.UpdateLeftQueuePanelGrid); } - + public async Task UpdateCharacterPositionsOnMap() { await UI.InvokeAsync(UI.UpdateCharacterPositionsOnMap); @@ -233,7 +233,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting UI.CurrentGameMap = map; }); } - + public async Task SetCurrentRound(int round) { await UI.InvokeAsync(() => @@ -241,7 +241,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting UI.CurrentRound = round; }); } - + public async Task SetTurnRewards(Dictionary> rewards) { await UI.InvokeAsync(() => @@ -257,7 +257,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting UI.PlayerCharacter = character; }); } - + public async Task SetCurrentCharacter(Character character) { await UI.InvokeAsync(() => @@ -274,11 +274,11 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting }); } } - + /// - /// 辅助类,用于管理异步的用户输入请求。 - /// - /// 期望的用户输入类型。 + /// 辅助类,用于管理异步的用户输入请求。 + /// + /// 期望的用户输入类型。 public class UserInputRequester { private TaskCompletionSource? _tcs; diff --git a/Desktop/GameMapTesting/GameMapTesting.cs b/Desktop/GameMapTesting/GameMapTesting.cs index 22421b1..13a0aa7 100644 --- a/Desktop/GameMapTesting/GameMapTesting.cs +++ b/Desktop/GameMapTesting/GameMapTesting.cs @@ -455,7 +455,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting } CharacterStatistics? totalStats = isTeam ? - TeamCharacterStatistics.Where(kv => kv.Key.GetName() == character.GetName()).Select(kv => kv.Value).FirstOrDefault() : + TeamCharacterStatistics.Where(kv => kv.Key.GetName() == character.GetName()).Select(kv => kv.Value).FirstOrDefault() : CharacterStatistics.Where(kv => kv.Key.GetName() == character.GetName()).Select(kv => kv.Value).FirstOrDefault(); if (totalStats != null) { @@ -509,7 +509,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting { if (!IsPlayer_OnlyTest(queue, character) || _gamingQueue is null || _gamingQueue.Map is null) return Grid.Empty; - Grid current = Grid.Empty; + Grid current = Grid.Empty; if (_gamingQueue.CustomData.TryGetValue("currentGrid", out object? currentGrid) && currentGrid is Grid grid) { current = grid; diff --git a/Desktop/GameMapTesting/GameMapViewer.xaml.cs b/Desktop/GameMapTesting/GameMapViewer.xaml.cs index f567d95..f782484 100644 --- a/Desktop/GameMapTesting/GameMapViewer.xaml.cs +++ b/Desktop/GameMapTesting/GameMapViewer.xaml.cs @@ -1,7 +1,5 @@ -using System.Buffers.Text; -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; @@ -13,7 +11,6 @@ using Milimoe.FunGame.Core.Interface.Entity; using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Model; -using Oshima.FunGame.OshimaModules.Effects.OpenEffects; using static Milimoe.FunGame.Core.Library.Constant.General; using Brush = System.Windows.Media.Brush; using Brushes = System.Windows.Media.Brushes; @@ -74,7 +71,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting private Grid? _actingCharacterCurrentGridForTargetSelection; private bool _isSelectingTargetGrid = false; // 标记当前是否处于格子选择模式 private List _potentialTargetGridForSelection = []; - private Brush DefaultGridBrush { get; } = ToWpfBrush(System.Drawing.Color.Gray); + private Brush DefaultGridBrush { get; } = ToWpfBrush(System.Drawing.Color.Gray); // 新增:用于跟踪当前高亮的技能和物品图标 private Border? _highlightedSkillIcon; @@ -733,7 +730,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting if (character.Shield.TotalMagical > 0) shield.Add($"魔法:{character.Shield.TotalMagical:0.##}"); if (character.Shield.TotalMix > 0) shield.Add($"混合:{character.Shield.TotalMix:0.##}"); HpTextBlock.Text = $"生命值:{character.HP:0.##} / {character.MaxHP:0.##}" + (exHP != 0 ? $" [{character.BaseHP:0.##} {(exHP >= 0 ? "+" : "-")} {Math.Abs(exHP):0.##}]" : "") + (shield.Count > 0 ? $"({string.Join(",", shield)})" : ""); - + double exMP = character.ExMP + character.ExMP2 + character.ExMP3; MpTextBlock.Text = $"魔法值:{character.MP:0.##} / {character.MaxMP:0.##}" + (exMP != 0 ? $" [{character.BaseMP:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exMP):0.##}]" : ""); @@ -934,7 +931,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting { // 如果处于目标选择模式,点击格子目前不进行任何操作(因为目标是角色) if (_isSelectingTargets) return; - + // 移除所有格子的旧高亮效果 ClearGridHighlights(); // 高亮当前选中的格子 @@ -1822,7 +1819,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting } } } - + /// /// 从已选目标列表中移除一个格子。 /// diff --git a/Desktop/GameMapTesting/TestMap.cs b/Desktop/GameMapTesting/TestMap.cs index f617b6c..5867832 100644 --- a/Desktop/GameMapTesting/TestMap.cs +++ b/Desktop/GameMapTesting/TestMap.cs @@ -37,7 +37,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting protected override void AfterTimeElapsed(ref double timeToReduce) { - + } } } diff --git a/Desktop/GameMapTesting/ViewModels.cs b/Desktop/GameMapTesting/ViewModels.cs index 1fcef93..69c3352 100644 --- a/Desktop/GameMapTesting/ViewModels.cs +++ b/Desktop/GameMapTesting/ViewModels.cs @@ -20,7 +20,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting } } private List _skills = []; - + public List Items { get => _items; diff --git a/Desktop/Solutions/EntityCreator/SetConfigName.cs b/Desktop/Solutions/EntityCreator/SetConfigName.cs index 9648adf..bd19f6a 100644 --- a/Desktop/Solutions/EntityCreator/SetConfigName.cs +++ b/Desktop/Solutions/EntityCreator/SetConfigName.cs @@ -21,7 +21,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions ItemManager = im; FileName = "Module.ini"; ModuleName = "EntityEditor"; - if (INIHelper.ExistINIFile(FileName)) + if (INIHelper.INIFileExists(FileName)) { ModuleName = INIHelper.ReadINI("ModuleName", "Module", FileName); string character = INIHelper.ReadINI("ModuleName", "Character", FileName); diff --git a/Desktop/Solutions/NovelEditor/NovelEditor.xaml.cs b/Desktop/Solutions/NovelEditor/NovelEditor.xaml.cs index 778cb48..c7f2dce 100644 --- a/Desktop/Solutions/NovelEditor/NovelEditor.xaml.cs +++ b/Desktop/Solutions/NovelEditor/NovelEditor.xaml.cs @@ -197,7 +197,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions.NovelEditor NodeListBox.ItemsSource = _config.Values; NodeListBox.Items.Refresh(); Title = Title.Replace("*", "").Trim(); - if (NovelConfig.ExistsFile("NovelEditor", _config.FileName)) + if (NovelConfig.FileExists("NovelEditor", _config.FileName)) { MessageBox.Show("这是一个在配置文件中已存在相同文件名的文件,建议保存时使用另存为功能。", "提示"); } @@ -224,7 +224,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions.NovelEditor string name = inputDialog.ResponseText; if (name.Trim() != "") { - if (NovelConfig.ExistsFile("NovelEditor", name)) + if (NovelConfig.FileExists("NovelEditor", name)) { if (MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.No) { diff --git a/Library/Main.cs b/Library/Main.cs index 7b90e6d..ce73af0 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -1,13 +1,6 @@ -using System.Text; using Microsoft.Extensions.Logging; using Milimoe.FunGame.Core.Api.Utility; -using Milimoe.FunGame.Core.Entity; -using Milimoe.FunGame.Core.Library.Constant; -using Milimoe.FunGame.Testing.Tests; using Oshima.FunGame.OshimaModules; -using Oshima.FunGame.OshimaModules.Models; -using Oshima.FunGame.OshimaModules.Regions; -using Oshima.FunGame.OshimaServers.Model; using Oshima.FunGame.OshimaServers.Service; using Oshima.FunGame.WebAPI.Controllers;