将 DisplayItemInfoForm 更名为 ItemTooltipForm

This commit is contained in:
SepComet 2026-06-15 11:23:44 +08:00
parent bba17bbac2
commit 44498e5859
27 changed files with 108 additions and 110 deletions

View File

@ -5,9 +5,10 @@
100 主菜单 MenuForm Default False True
101 设置 SettingForm Default False True
102 关于 AboutForm Default False True
200 开始菜单 StartMenuForm Default False True
201 角色选择页 SelectRoleForm Default False True
202 游戏商店页 ShopForm Default False True
203 游戏HUD HudForm HUD False True
204 角色升级奖励页 LevelUpForm Default False True
205 物品信息展示 DisplayItemInfoForm Default False False
205 物品信息展示 ItemTooltipForm Default False False
206 虚拟摇杆 JoystickForm Default False False

View File

@ -57,7 +57,7 @@ namespace SepCore.Definition
/// <summary>
/// 物品信息展示页
/// </summary>
DisplayItemInfoForm = 205,
ItemTooltipForm = 205,
/// <summary>
/// 虚拟摇杆。

View File

@ -1,27 +0,0 @@
using GameFramework;
using GameFramework.Event;
namespace SepCore.Event
{
public class DisplayItemInfoLockEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(DisplayItemInfoLockEventArgs).GetHashCode();
public override int Id => EventId;
public DisplayItemInfoLockEventArgs()
{
}
public static DisplayItemInfoLockEventArgs Create()
{
var args = ReferencePool.Acquire<DisplayItemInfoLockEventArgs>();
return args;
}
public override void Clear()
{
}
}
}

View File

@ -3,22 +3,22 @@ using GameFramework.Event;
namespace SepCore.Event
{
public class DisplayItemInfoHideEventArgs : GameEventArgs
public class ItemTooltipHideEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(DisplayItemInfoHideEventArgs).GetHashCode();
public static readonly int EventId = typeof(ItemTooltipHideEventArgs).GetHashCode();
public override int Id => EventId;
public bool Force = false;
public DisplayItemInfoHideEventArgs()
public ItemTooltipHideEventArgs()
{
Force = false;
}
public static DisplayItemInfoHideEventArgs Create(bool force = false)
public static ItemTooltipHideEventArgs Create(bool force = false)
{
var args = ReferencePool.Acquire<DisplayItemInfoHideEventArgs>();
var args = ReferencePool.Acquire<ItemTooltipHideEventArgs>();
args.Force = force;
return args;

View File

@ -0,0 +1,27 @@
using GameFramework;
using GameFramework.Event;
namespace SepCore.Event
{
public class ItemTooltipLockEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(ItemTooltipLockEventArgs).GetHashCode();
public override int Id => EventId;
public ItemTooltipLockEventArgs()
{
}
public static ItemTooltipLockEventArgs Create()
{
var args = ReferencePool.Acquire<ItemTooltipLockEventArgs>();
return args;
}
public override void Clear()
{
}
}
}

View File

@ -3,24 +3,24 @@ using GameFramework.Event;
namespace SepCore.Event
{
public class DisplayItemInfoRecycleEventArgs : GameEventArgs
public class ItemTooltipRecycleEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(DisplayItemInfoRecycleEventArgs).GetHashCode();
public static readonly int EventId = typeof(ItemTooltipRecycleEventArgs).GetHashCode();
public override int Id => EventId;
public int Index;
public int Price;
public DisplayItemInfoRecycleEventArgs()
public ItemTooltipRecycleEventArgs()
{
Index = -1;
Price = 0;
}
public static DisplayItemInfoRecycleEventArgs Create(int index, int price)
public static ItemTooltipRecycleEventArgs Create(int index, int price)
{
var args = ReferencePool.Acquire<DisplayItemInfoRecycleEventArgs>();
var args = ReferencePool.Acquire<ItemTooltipRecycleEventArgs>();
args.Index = index;
args.Price = price;

View File

@ -4,9 +4,9 @@ using UnityEngine;
namespace SepCore.Event
{
public class DisplayItemShowEventArgs : GameEventArgs
public class ItemTooltipShowEventArgs : GameEventArgs
{
public static readonly int EventId = typeof(DisplayItemShowEventArgs).GetHashCode();
public static readonly int EventId = typeof(ItemTooltipShowEventArgs).GetHashCode();
public override int Id => EventId;
@ -16,15 +16,15 @@ namespace SepCore.Event
public Vector3 TargetPos { get; private set; }
public DisplayItemShowEventArgs()
public ItemTooltipShowEventArgs()
{
Index = -1;
IsWeapon = false;
}
public static DisplayItemShowEventArgs Create(int index, bool isWeapon, Vector3 targetPos)
public static ItemTooltipShowEventArgs Create(int index, bool isWeapon, Vector3 targetPos)
{
var args = ReferencePool.Acquire<DisplayItemShowEventArgs>();
var args = ReferencePool.Acquire<ItemTooltipShowEventArgs>();
args.Index = index;
args.IsWeapon = isWeapon;
args.TargetPos = targetPos;
@ -38,4 +38,4 @@ namespace SepCore.Event
TargetPos = Vector3.zero;
}
}
}
}

View File

@ -1,14 +1,10 @@
using System;
using System.Drawing;
using SepCore.CustomUtility;
using SepCore.Entity;
using SepCore.Entity.Weapon;
using SepCore.Definition;
using UnityEngine;
namespace SepCore.UI
{
public class DisplayItemInfoContext : UIContext
public class ItemTooltipContext : UIContext
{
public int Index;
public string IconAssetName;
@ -20,7 +16,7 @@ namespace SepCore.UI
public Vector3 TargetPos;
public bool ShowRecycleButton;
public DisplayItemInfoContext()
public ItemTooltipContext()
{
Index = -1;
IconAssetName = string.Empty;
@ -33,7 +29,7 @@ namespace SepCore.UI
ShowRecycleButton = false;
}
public DisplayItemInfoContext(DisplayItemInfoRawData rawData)
public ItemTooltipContext(ItemTooltipRawData rawData)
{
Index = rawData.Index;
ItemType = rawData.ItemType;

View File

@ -8,68 +8,68 @@ using UnityGameFramework.Runtime;
namespace SepCore.UI
{
public class DisplayItemInfoController : UIControllerBase<DisplayItemInfoContext, DisplayItemInfoForm>
public class ItemTooltipController : UIControllerBase<ItemTooltipContext, ItemTooltipForm>
{
protected override UIFormType UIFormType => UIFormType.DisplayItemInfoForm;
protected override UIFormType UIFormType => UIFormType.ItemTooltipForm;
private bool _locked = false;
private Action<int, int> _onRecycle;
protected override void SubscribeCustomEvents()
{
GameEntry.Event.Subscribe(DisplayItemInfoLockEventArgs.EventId, DisplayItemInfoLock);
GameEntry.Event.Subscribe(DisplayItemInfoHideEventArgs.EventId, DisplayItemInfoHide);
GameEntry.Event.Subscribe(DisplayItemInfoRecycleEventArgs.EventId, DisplayItemInfoRecycle);
GameEntry.Event.Subscribe(ItemTooltipLockEventArgs.EventId, ItemTooltipInfoLock);
GameEntry.Event.Subscribe(ItemTooltipHideEventArgs.EventId, ItemTooltipHide);
GameEntry.Event.Subscribe(ItemTooltipRecycleEventArgs.EventId, ItemTooltipRecycle);
}
protected override void UnsubscribeCustomEvents()
{
GameEntry.Event.Unsubscribe(DisplayItemInfoLockEventArgs.EventId, DisplayItemInfoLock);
GameEntry.Event.Unsubscribe(DisplayItemInfoHideEventArgs.EventId, DisplayItemInfoHide);
GameEntry.Event.Unsubscribe(DisplayItemInfoRecycleEventArgs.EventId, DisplayItemInfoRecycle);
GameEntry.Event.Unsubscribe(ItemTooltipLockEventArgs.EventId, ItemTooltipInfoLock);
GameEntry.Event.Unsubscribe(ItemTooltipHideEventArgs.EventId, ItemTooltipHide);
GameEntry.Event.Unsubscribe(ItemTooltipRecycleEventArgs.EventId, ItemTooltipRecycle);
}
protected override void RefreshUI(DisplayItemInfoForm form, DisplayItemInfoContext context)
protected override void RefreshUI(ItemTooltipForm form, ItemTooltipContext context)
{
form.RefreshUI(context).Forget();
}
protected override void CloseLoadedFormDirect(DisplayItemInfoForm form)
protected override void CloseLoadedFormDirect(ItemTooltipForm form)
{
GameEntry.UI.CloseUIForm(form);
}
private static DisplayItemInfoContext BuildContext(DisplayItemInfoRawData rawData)
private static ItemTooltipContext BuildContext(ItemTooltipRawData rawData)
{
if (rawData == null)
{
Log.Error("DisplayItemInfoFormController.BuildContext() rawData is null.");
Log.Error("ItemTooltipController.BuildContext() rawData is null.");
return null;
}
return new DisplayItemInfoContext(rawData);
return new ItemTooltipContext(rawData);
}
public override async UniTask OpenUIAsync(object userData = null, float timeout = 30f)
{
if (userData is not DisplayItemInfoRawData rawData)
if (userData is not ItemTooltipRawData rawData)
{
if (userData != null)
{
Log.Warning("DisplayItemInfoController.OpenUIAsync() userData type is invalid.");
Log.Warning("ItemTooltipController.OpenUIAsync() userData type is invalid.");
}
else
{
Log.Warning("DisplayItemInfoController.OpenUIAsync() rawData is required.");
Log.Warning("ItemTooltipController.OpenUIAsync() rawData is required.");
}
return;
}
DisplayItemInfoContext context = BuildContext(rawData);
ItemTooltipContext context = BuildContext(rawData);
if (context == null)
{
Log.Warning("DisplayItemInfoController.OpenUIAsync() rawData is invalid.");
Log.Warning("ItemTooltipController.OpenUIAsync() rawData is invalid.");
return;
}
@ -88,15 +88,15 @@ namespace SepCore.UI
{
if (useCase != null)
{
Log.Warning("DisplayItemInfoController does not use a use case.");
Log.Warning("ItemTooltipController does not use a use case.");
}
}
private bool IsCurrentFormSender(object sender)
{
if (sender is DisplayItemInfoForm displayItemInfoForm)
if (sender is ItemTooltipForm ItemTooltipForm)
{
return displayItemInfoForm == Form;
return ItemTooltipForm == Form;
}
if (sender is Component component && Form != null)
@ -109,9 +109,9 @@ namespace SepCore.UI
#region Event Handlers
private void DisplayItemInfoLock(object sender, GameEventArgs e)
private void ItemTooltipInfoLock(object sender, GameEventArgs e)
{
if (e is not DisplayItemInfoLockEventArgs)
if (e is not ItemTooltipLockEventArgs)
{
return;
}
@ -119,21 +119,21 @@ namespace SepCore.UI
_locked = true;
}
private void DisplayItemInfoHide(object sender, GameEventArgs e)
private void ItemTooltipHide(object sender, GameEventArgs e)
{
if (e is not DisplayItemInfoHideEventArgs args)
if (e is not ItemTooltipHideEventArgs args)
{
return;
}
if (_locked && !args.Force) return;
GameEntry.UIRouter.CloseUIAsync(UIFormType.DisplayItemInfoForm).Forget();
GameEntry.UIRouter.CloseUIAsync(UIFormType.ItemTooltipForm).Forget();
}
private void DisplayItemInfoRecycle(object sender, GameEventArgs e)
private void ItemTooltipRecycle(object sender, GameEventArgs e)
{
if (e is not DisplayItemInfoRecycleEventArgs args)
if (e is not ItemTooltipRecycleEventArgs args)
{
return;
}

View File

@ -7,7 +7,7 @@ using UnityGameFramework.Runtime;
namespace SepCore.UI
{
public class DisplayItemInfoForm : UGuiForm
public class ItemTooltipForm : UGuiForm
{
[SerializeField] private RectTransform _content;
@ -33,15 +33,15 @@ namespace SepCore.UI
[SerializeField] private float _screenEdgePadding = 0f;
private DisplayItemInfoContext _context;
private ItemTooltipContext _context;
private Vector3 _targetPos;
public async UniTaskVoid RefreshUI(DisplayItemInfoContext context)
public async UniTaskVoid RefreshUI(ItemTooltipContext context)
{
if (context == null)
{
Log.Warning("DisplayItemInfoForm context is invalid.");
Log.Warning("ItemTooltipForm context is invalid.");
return;
}
@ -85,9 +85,9 @@ namespace SepCore.UI
{
base.OnOpen(userData);
if (!(userData is DisplayItemInfoContext context))
if (!(userData is ItemTooltipContext context))
{
Log.Error("DisplayItemInfoFormContext is invalid.");
Log.Error("ItemTooltipForm context is invalid.");
return;
}
@ -192,12 +192,12 @@ namespace SepCore.UI
public void OnRecycleButtonClick()
{
if (_context == null) return;
GameEntry.Event.Fire(this, DisplayItemInfoRecycleEventArgs.Create(_context.Index, _context.Price));
GameEntry.Event.Fire(this, ItemTooltipRecycleEventArgs.Create(_context.Index, _context.Price));
}
public void OnCancelButtonClick()
{
GameEntry.Event.Fire(this, DisplayItemInfoHideEventArgs.Create(true));
GameEntry.Event.Fire(this, ItemTooltipHideEventArgs.Create(true));
}
private string BuildTypeText(ItemType type)

View File

@ -27,7 +27,7 @@ namespace SepCore.UI
GameEntry.Event.Subscribe(RefreshEventArgs.EventId, Refresh);
GameEntry.Event.Subscribe(ShopPurchaseEventArgs.EventId, ShopPurchase);
GameEntry.Event.Subscribe(ShopContinueEventArgs.EventId, ShopContinue);
GameEntry.Event.Subscribe(DisplayItemShowEventArgs.EventId, DisplayItemShow);
GameEntry.Event.Subscribe(ItemTooltipShowEventArgs.EventId, DisplayItemShow);
}
protected override void UnsubscribeCustomEvents()
@ -35,7 +35,7 @@ namespace SepCore.UI
GameEntry.Event.Unsubscribe(RefreshEventArgs.EventId, Refresh);
GameEntry.Event.Unsubscribe(ShopPurchaseEventArgs.EventId, ShopPurchase);
GameEntry.Event.Unsubscribe(ShopContinueEventArgs.EventId, ShopContinue);
GameEntry.Event.Unsubscribe(DisplayItemShowEventArgs.EventId, DisplayItemShow);
GameEntry.Event.Unsubscribe(ItemTooltipShowEventArgs.EventId, DisplayItemShow);
}
#region BuildContext
@ -205,7 +205,7 @@ namespace SepCore.UI
public override async UniTask CloseUIAsync(object userData = null, float timeout = 30f)
{
GameEntry.Event.Fire(this, DisplayItemInfoHideEventArgs.Create(true));
GameEntry.Event.Fire(this, ItemTooltipHideEventArgs.Create(true));
_rawData = null;
await base.CloseUIAsync(userData, timeout);
}
@ -344,7 +344,7 @@ namespace SepCore.UI
return false;
}
private bool TryGetWeaponInfoRawData(int index, Vector3 targetPos, out DisplayItemInfoRawData rawData)
private bool TryGetWeaponInfoRawData(int index, Vector3 targetPos, out ItemTooltipRawData rawData)
{
rawData = null;
@ -373,7 +373,7 @@ namespace SepCore.UI
return false;
}
rawData = new DisplayItemInfoRawData
rawData = new ItemTooltipRawData
{
TargetPos = targetPos,
Index = index,
@ -386,7 +386,7 @@ namespace SepCore.UI
return true;
}
private bool TryGetPropInfoRawData(int index, Vector3 targetPos, out DisplayItemInfoRawData rawData)
private bool TryGetPropInfoRawData(int index, Vector3 targetPos, out ItemTooltipRawData rawData)
{
rawData = null;
@ -409,7 +409,7 @@ namespace SepCore.UI
return false;
}
rawData = new DisplayItemInfoRawData
rawData = new ItemTooltipRawData
{
TargetPos = targetPos,
Index = index,
@ -442,7 +442,7 @@ namespace SepCore.UI
}
Form?.RemoveWeaponDisplayItem(index);
GameEntry.Event.Fire(this, DisplayItemInfoHideEventArgs.Create(true));
GameEntry.Event.Fire(this, ItemTooltipHideEventArgs.Create(true));
}
#endregion
@ -513,7 +513,7 @@ namespace SepCore.UI
private void DisplayItemShow(object sender, GameEventArgs e)
{
if (e is not DisplayItemShowEventArgs args)
if (e is not ItemTooltipShowEventArgs args)
{
return;
}
@ -529,7 +529,7 @@ namespace SepCore.UI
return;
}
DisplayItemInfoRawData rawData;
ItemTooltipRawData rawData;
bool success = args.IsWeapon
? TryGetWeaponInfoRawData(args.Index, args.TargetPos, out rawData)
: TryGetPropInfoRawData(args.Index, args.TargetPos, out rawData);
@ -539,7 +539,7 @@ namespace SepCore.UI
return;
}
GameEntry.UIRouter.OpenUIAsync(UIFormType.DisplayItemInfoForm, rawData).Forget();
GameEntry.UIRouter.OpenUIAsync(UIFormType.ItemTooltipForm, rawData).Forget();
}
#endregion

View File

@ -56,17 +56,17 @@ namespace SepCore.UI
rect.yMax,
0f)
);
GameEntry.Event.Fire(this, DisplayItemShowEventArgs.Create(_index, _context.IsWeapon, targetPos));
GameEntry.Event.Fire(this, ItemTooltipShowEventArgs.Create(_index, _context.IsWeapon, targetPos));
}
public void OnItemInfoLock()
{
GameEntry.Event.Fire(this, DisplayItemInfoLockEventArgs.Create());
GameEntry.Event.Fire(this, ItemTooltipLockEventArgs.Create());
}
public void OnItemInfoHide()
{
GameEntry.Event.Fire(this, DisplayItemInfoHideEventArgs.Create());
GameEntry.Event.Fire(this, ItemTooltipHideEventArgs.Create());
}
}
}

View File

@ -1,7 +1,6 @@
using System;
using SepCore.Definition;
using SepCore.Entity;
using SepCore.Entity.Weapon;
using UnityEngine;
namespace SepCore.UI
@ -13,7 +12,7 @@ namespace SepCore.UI
Prop
}
public class DisplayItemInfoRawData
public class ItemTooltipRawData
{
public int Index;
public WeaponData WeaponData;

View File

@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 6368625289863409235}
- component: {fileID: 4303509830935515119}
m_Layer: 5
m_Name: DisplayItemInfoForm
m_Name: ItemTooltipForm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -234,7 +234,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4303509830935515119}
m_TargetAssemblyTypeName: SepCore.UI.DisplayItemInfoForm, SepCore.Presentation
m_TargetAssemblyTypeName: SepCore.UI.ItemTooltipForm, SepCore.Presentation
m_MethodName: OnCancelButtonClick
m_Mode: 1
m_Arguments:
@ -503,7 +503,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4303509830935515119}
m_TargetAssemblyTypeName: SepCore.UI.DisplayItemInfoForm, SepCore.Presentation
m_TargetAssemblyTypeName: SepCore.UI.ItemTooltipForm, SepCore.Presentation
m_MethodName: OnRecycleButtonClick
m_Mode: 1
m_Arguments:

View File

@ -1583,7 +1583,7 @@ MonoBehaviour:
_controllerTypeName: SepCore.UI.LevelUpController, SepCore.Presentation, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
- _uiFormType: 205
_controllerTypeName: SepCore.UI.DisplayItemInfoController, SepCore.Presentation,
_controllerTypeName: SepCore.UI.ItemTooltipController, SepCore.Presentation,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- _uiFormType: 206
_controllerTypeName: SepCore.UI.JoystickController, SepCore.Presentation, Version=0.0.0.0,

Binary file not shown.

View File

@ -1,7 +1,9 @@
import pandas as pd
import os
def convert_excel_to_txt(folder_path='.'):
def convert_excel_to_txt(folder_path=None):
if folder_path is None:
folder_path = os.path.dirname(os.path.abspath(__file__))
# 计数器,用于最后汇总
count = 0
target_dir = os.path.join(os.path.dirname(__file__), '../Assets/GameMain/DataTables')
@ -37,7 +39,7 @@ def convert_excel_to_txt(folder_path='.'):
print(f"\n任务完成!共转换了 {count} 个文件。")
if __name__ == "__main__":
convert_excel_to_txt('.')
convert_excel_to_txt()
# --- 关键修改:在这里添加暂停 ---
print("\n" + "="*30)