Add anim test scene

This commit is contained in:
Tran Hai Nam
2026-05-19 10:46:26 +07:00
parent e5540e4ff1
commit 2a7f9602db
18 changed files with 1272 additions and 5 deletions
+51
View File
@@ -235,6 +235,57 @@ namespace BrewMonster
}
}
/// <summary>
/// DEBUG ONLY — bypasses the server skill message by loading skills from SkillStub.map
/// (populated at startup from config) that belong to the player's current profession
/// (or are general skills, cls == 255). Safe to call before server data arrives.
///
/// 仅调试用 — 从 SkillStub.map 注入属于当前职业(或通用职业 cls==255)的技能,
/// 绕过服务端消息,可在服务端数据到达前调用。
/// </summary>
public void InjectDebugSkillsFromConfig(int level = 1)
{
m_aPtSkills.Clear();
m_aPsSkills.Clear();
var stubMap = SkillStub.GetMap();
if (stubMap.Count == 0)
{
BMLogger.LogWarning("InjectDebugSkillsFromConfig: SkillStub.map is empty — config not loaded yet.");
return;
}
int playerCls = m_iProfession; // current role's profession ID
int injected = 0;
foreach (var kvp in stubMap)
{
int stubCls = kvp.Value.cls;
// Keep only skills for this profession or universal skills (cls 255).
// Same rule used by EC_HostSkillModel when listing learnable skills.
// 仅保留当前职业技能或通用技能(cls==255),与 EC_HostSkillModel 的过滤规则相同。
if (stubCls != playerCls && stubCls != 255)
continue;
uint skillId = kvp.Key;
CECSkill skill = new CECSkill((int)skillId, level);
if (skill.SkillCore == null)
continue;
int type = skill.GetType();
if (type != (int)CECSkill.SkillType.TYPE_PASSIVE &&
type != (int)CECSkill.SkillType.TYPE_PRODUCE &&
type != (int)CECSkill.SkillType.TYPE_LIVE)
m_aPtSkills.Add(skill);
else
m_aPsSkills.Add(skill);
injected++;
}
BMLogger.Log($"InjectDebugSkillsFromConfig: profession={playerCls}, injected {injected} skills " +
$"({m_aPtSkills.Count} active, {m_aPsSkills.Count} passive) at level {level}.");
}
private void OnMsgHstLearnSkill(ECMSG Msg)
{
cmd_learn_skill pCmd = GPDataTypeHelper.FromBytes<cmd_learn_skill>((byte[])Msg.dwParam1);
+10
View File
@@ -79,8 +79,16 @@ public class CECUIManager : MonoSingleton<CECUIManager>
ShowUI("Win_Hpmpxp");
#if UNITY_EDITOR
if(ChangeSkillShortcutButton == null)
{
return;
}
ChangeSkillShortcutButton.SetActive(true);
#else
if(ChangeSkillShortcutButton == null)
{
return;
}
ChangeSkillShortcutButton.SetActive(false);
#endif
}
@@ -507,6 +515,8 @@ public class CECUIManager : MonoSingleton<CECUIManager>
if (m_pDlgQuickBar1)
m_pDlgQuickBar1.UpdateShortcuts();
SkillTriggerPanel.Instance?.Refresh();
/* if (m_pDlgSkillEdit != null && m_pDlgSkillEdit->IsShow())
{
// ¼¼Äܱ༭½çÃæÖ»ÔÚ Show(true) µÄʱºò²ÅÄܸüÐÂ
+14
View File
@@ -360,6 +360,20 @@ public partial class CECGameRun : ITickable
{
return m_pHostPlayer;
}
/// <summary>
/// Animation / offline test scenes: scene-placed host is not spawned via <see cref="InitCharacter"/>.
/// Registers the in-scene <see cref="CECHostPlayer"/> so <see cref="EC_ManPlayer.GetPlayer"/> and skill GFX resolve host position.
/// </summary>
public void RegisterAnimSceneHostPlayer(CECHostPlayer host)
{
if (host == null)
return;
m_pHostPlayer = host;
BMLogger.Log($"[AnimSceneBootstrap] CECGameRun.RegisterAnimSceneHostPlayer cid={host.GetCharacterID()}");
}
public void InitCharacter(cmd_self_info_1 info)
{
if (_playerPrefab == null)