Files
test/Assets/PerfectWorld/Scripts/UI/SkillUI/CDlgSkillEdit.cs
T
2026-03-12 13:50:41 +07:00

83 lines
2.6 KiB
C#

using Animancer;
using BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay;
using BrewMonster.Network;
using BrewMonster.UI;
using System;
using UnityEngine;
namespace BrewMonster
{
public class CDlgSkillEdit : AUIDialog
{
int m_nIcon;
// Start is called once before the first execution of Update after the MonoBehaviour is created
public override void Start()
{
m_nIcon = 1;
}
#if UNITY_EDITOR
public override void Update()
{
if (Input.GetKeyDown(KeyCode.T))
{
OnShowDialog();
OnCommandConfirm();
}
}
#endif
public void OnShowDialog()
{
EC_VIDEO_SETTING setting = EC_Game.GetConfigs().GetVideoSettings();
if (GetData() == 0)
{
for (uint i = 0; i < EC_ConfigConstants.EC_COMBOSKILL_NUM; i++)
{
if (setting.comboSkill[i].nIcon == 0)
{
SetData(i + 1);
break;
}
}
if (GetData() == 0)
{
//Show(false);
return;
}
}
}
// TODO: this is hard-code to test, need to implement the real logic to get the combo skill info from the UI
public void OnCommandConfirm()
{
EC_VIDEO_SETTING setting = EC_Game.GetConfigs().GetVideoSettings();
setting.comboSkill[GetData() - 1].nIcon = (byte)m_nIcon;
int i;
int j = 0;
for (i = 0; i < 2; i++)
{
/* AString strName;
strName.Format("Item_%d", i + 1);
PAUIIMAGEPICTURE pImage = static_cast<PAUIIMAGEPICTURE>(GetDlgItem(strName));
if (!pImage) break;*/
//CECSkill pSkill = (CECSkill)pImage.GetDataPtr("ptr_CECSkill");
//int iType = pImage->GetData();
if (true/*iType == 0 && pSkill != null*/)
{
setting.comboSkill[0].idSkill[j] = (short)(EC_Game.GetGameRun().GetHostPlayer().GetPositiveSkillByIndex(i).GetSkillID()) /*pSkill.GetSkillID()*/;
j++;
}
else
{
//setting.comboSkill[GetData() - 1].idSkill[j] = -iType;
j++;
}
}
EC_Game.GetConfigs().SetVideoSettings(setting);
//Show(false);
CECUIManager.Instance.m_pDlgSkillSubOther.UpdateComboSkill();
}
}
}