This commit is contained in:
milimoe 2025-11-17 21:48:24 +08:00
parent 6a6f868230
commit bb794067c4
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
9 changed files with 22 additions and 33 deletions

View File

@ -1,7 +1,6 @@
using System.Globalization; using System.Globalization;
using System.Windows.Data; using System.Windows.Data;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Interface.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting

View File

@ -186,7 +186,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
_continuePromptRequester.ResolveInput(true); // 任何值都可以只要完成Task _continuePromptRequester.ResolveInput(true); // 任何值都可以只要完成Task
await UI.InvokeAsync(() => UI.HideContinuePrompt()); await UI.InvokeAsync(() => UI.HideContinuePrompt());
} }
public async Task ResolveCountDownContinuePrompt() public async Task ResolveCountDownContinuePrompt()
{ {
_continuePromptRequester.ResolveInput(true); _continuePromptRequester.ResolveInput(true);
@ -207,12 +207,12 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
{ {
await UI.InvokeAsync(UI.UpdateBottomInfoPanel); await UI.InvokeAsync(UI.UpdateBottomInfoPanel);
} }
public async Task UpdateQueue() public async Task UpdateQueue()
{ {
await UI.InvokeAsync(UI.UpdateLeftQueuePanelGrid); await UI.InvokeAsync(UI.UpdateLeftQueuePanelGrid);
} }
public async Task UpdateCharacterPositionsOnMap() public async Task UpdateCharacterPositionsOnMap()
{ {
await UI.InvokeAsync(UI.UpdateCharacterPositionsOnMap); await UI.InvokeAsync(UI.UpdateCharacterPositionsOnMap);
@ -233,7 +233,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
UI.CurrentGameMap = map; UI.CurrentGameMap = map;
}); });
} }
public async Task SetCurrentRound(int round) public async Task SetCurrentRound(int round)
{ {
await UI.InvokeAsync(() => await UI.InvokeAsync(() =>
@ -241,7 +241,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
UI.CurrentRound = round; UI.CurrentRound = round;
}); });
} }
public async Task SetTurnRewards(Dictionary<int, List<Skill>> rewards) public async Task SetTurnRewards(Dictionary<int, List<Skill>> rewards)
{ {
await UI.InvokeAsync(() => await UI.InvokeAsync(() =>
@ -257,7 +257,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
UI.PlayerCharacter = character; UI.PlayerCharacter = character;
}); });
} }
public async Task SetCurrentCharacter(Character character) public async Task SetCurrentCharacter(Character character)
{ {
await UI.InvokeAsync(() => await UI.InvokeAsync(() =>
@ -274,11 +274,11 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
}); });
} }
} }
/// <summary> /// <summary>
/// 辅助类,用于管理异步的用户输入请求。 /// 辅助类,用于管理异步的用户输入请求。
/// </summary> /// </summary>
/// <typeparam name="T">期望的用户输入类型。</typeparam> /// <typeparam name="T">期望的用户输入类型。</typeparam>
public class UserInputRequester<T> public class UserInputRequester<T>
{ {
private TaskCompletionSource<T?>? _tcs; private TaskCompletionSource<T?>? _tcs;

View File

@ -455,7 +455,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
} }
CharacterStatistics? totalStats = isTeam ? 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(); CharacterStatistics.Where(kv => kv.Key.GetName() == character.GetName()).Select(kv => kv.Value).FirstOrDefault();
if (totalStats != null) 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; 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) if (_gamingQueue.CustomData.TryGetValue("currentGrid", out object? currentGrid) && currentGrid is Grid grid)
{ {
current = grid; current = grid;

View File

@ -1,7 +1,5 @@
using System.Buffers.Text; using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Documents; 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.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Model; using Milimoe.FunGame.Core.Model;
using Oshima.FunGame.OshimaModules.Effects.OpenEffects;
using static Milimoe.FunGame.Core.Library.Constant.General; using static Milimoe.FunGame.Core.Library.Constant.General;
using Brush = System.Windows.Media.Brush; using Brush = System.Windows.Media.Brush;
using Brushes = System.Windows.Media.Brushes; using Brushes = System.Windows.Media.Brushes;
@ -74,7 +71,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
private Grid? _actingCharacterCurrentGridForTargetSelection; private Grid? _actingCharacterCurrentGridForTargetSelection;
private bool _isSelectingTargetGrid = false; // 标记当前是否处于格子选择模式 private bool _isSelectingTargetGrid = false; // 标记当前是否处于格子选择模式
private List<Grid> _potentialTargetGridForSelection = []; private List<Grid> _potentialTargetGridForSelection = [];
private Brush DefaultGridBrush { get; } = ToWpfBrush(System.Drawing.Color.Gray); private Brush DefaultGridBrush { get; } = ToWpfBrush(System.Drawing.Color.Gray);
// 新增:用于跟踪当前高亮的技能和物品图标 // 新增:用于跟踪当前高亮的技能和物品图标
private Border? _highlightedSkillIcon; 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.TotalMagical > 0) shield.Add($"魔法:{character.Shield.TotalMagical:0.##}");
if (character.Shield.TotalMix > 0) shield.Add($"混合:{character.Shield.TotalMix: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)}" : ""); 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; 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.##}]" : ""); 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; if (_isSelectingTargets) return;
// 移除所有格子的旧高亮效果 // 移除所有格子的旧高亮效果
ClearGridHighlights(); ClearGridHighlights();
// 高亮当前选中的格子 // 高亮当前选中的格子
@ -1822,7 +1819,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
} }
} }
} }
/// <summary> /// <summary>
/// 从已选目标列表中移除一个格子。 /// 从已选目标列表中移除一个格子。
/// </summary> /// </summary>

View File

@ -37,7 +37,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
protected override void AfterTimeElapsed(ref double timeToReduce) protected override void AfterTimeElapsed(ref double timeToReduce)
{ {
} }
} }
} }

View File

@ -20,7 +20,7 @@ namespace Milimoe.FunGame.Testing.Desktop.GameMapTesting
} }
} }
private List<ISkill> _skills = []; private List<ISkill> _skills = [];
public List<Item> Items public List<Item> Items
{ {
get => _items; get => _items;

View File

@ -21,7 +21,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
ItemManager = im; ItemManager = im;
FileName = "Module.ini"; FileName = "Module.ini";
ModuleName = "EntityEditor"; ModuleName = "EntityEditor";
if (INIHelper.ExistINIFile(FileName)) if (INIHelper.INIFileExists(FileName))
{ {
ModuleName = INIHelper.ReadINI("ModuleName", "Module", FileName); ModuleName = INIHelper.ReadINI("ModuleName", "Module", FileName);
string character = INIHelper.ReadINI("ModuleName", "Character", FileName); string character = INIHelper.ReadINI("ModuleName", "Character", FileName);

View File

@ -197,7 +197,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions.NovelEditor
NodeListBox.ItemsSource = _config.Values; NodeListBox.ItemsSource = _config.Values;
NodeListBox.Items.Refresh(); NodeListBox.Items.Refresh();
Title = Title.Replace("*", "").Trim(); Title = Title.Replace("*", "").Trim();
if (NovelConfig.ExistsFile("NovelEditor", _config.FileName)) if (NovelConfig.FileExists("NovelEditor", _config.FileName))
{ {
MessageBox.Show("这是一个在配置文件中已存在相同文件名的文件,建议保存时使用另存为功能。", "提示"); MessageBox.Show("这是一个在配置文件中已存在相同文件名的文件,建议保存时使用另存为功能。", "提示");
} }
@ -224,7 +224,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions.NovelEditor
string name = inputDialog.ResponseText; string name = inputDialog.ResponseText;
if (name.Trim() != "") if (name.Trim() != "")
{ {
if (NovelConfig.ExistsFile("NovelEditor", name)) if (NovelConfig.FileExists("NovelEditor", name))
{ {
if (MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.No) if (MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.No)
{ {

View File

@ -1,13 +1,6 @@
using System.Text;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Milimoe.FunGame.Core.Api.Utility; 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;
using Oshima.FunGame.OshimaModules.Models;
using Oshima.FunGame.OshimaModules.Regions;
using Oshima.FunGame.OshimaServers.Model;
using Oshima.FunGame.OshimaServers.Service; using Oshima.FunGame.OshimaServers.Service;
using Oshima.FunGame.WebAPI.Controllers; using Oshima.FunGame.WebAPI.Controllers;