- SelectRoleForm 五层归位:UseCase 改为构造注入 IProcedureMenu(新增 Runtime/ProcedureInterface),RawData 暴露原始 StatModifier[] 而非展示串,Controller 复用 ItemDescUtility 拼装属性文本,并修复 OpenUIAsync(object) 合法 RawData 分支缺少 return 的误报路径 - StatModifier 去展示职责:删除 _statTypeNames / ToString,富文本格式化下沉到 Presentation 层的 ItemDescUtility.Describe(StatModifier),CreatePropDescription 改用统一入口 - 事件目录按 UIForm 归档:Base/Event/UI/Menu/* 拆解到 SelectRoleForm/ MenuForm/ DialogForm/ DisplayItemInfoForm/ Combat/ 等各自子目录,MenuSelectRoleReturnEventArgs 改名 SelectRoleReturnEventArgs,语义归属本 UI 模块 - IUIFormController → IUIController 改名,联动 UIControllerBase / UIRouterComponent / Editor - 同步更新 docs/UI-5层架构设计规范.md 中相关示例与 MenuForm.prefab、ProcedureMenu 引用
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System;
|
|
using SepCore.Definition;
|
|
using SepCore.CustomUtility;
|
|
using UnityGameFramework.Runtime;
|
|
|
|
namespace SepCore.Definition
|
|
{
|
|
public class StatModifier
|
|
{
|
|
public StatType StatType;
|
|
public float Value;
|
|
public bool IsPercent;
|
|
|
|
public static StatModifier StringToModifier(string input)
|
|
{
|
|
if (string.IsNullOrEmpty(input))
|
|
{
|
|
Log.Warning("Invalid modifier: {0}", input);
|
|
return null;
|
|
}
|
|
|
|
if (!input.StartsWith('[') || !input.EndsWith(']'))
|
|
{
|
|
throw new ArgumentException("Input must be enclosed in square brackets.");
|
|
}
|
|
|
|
string inner = input.Substring(1, input.Length - 2);
|
|
|
|
// 如果是空列表 "[]"
|
|
if (inner.Length == 0) return null;
|
|
|
|
string[] property = inner.Split(",");
|
|
int propertyIndex = 0;
|
|
return new StatModifier
|
|
{
|
|
StatType = EnumUtility<StatType>.Get(property[propertyIndex++]),
|
|
Value = float.Parse(property[propertyIndex++]),
|
|
IsPercent = bool.Parse(property[propertyIndex++])
|
|
};
|
|
}
|
|
}
|
|
} |