73 lines
2.2 KiB
C#
73 lines
2.2 KiB
C#
using BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay;
|
|
using BrewMonster.UI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using static UnityEditor.AddressableAssets.Build.Layout.BuildLayout;
|
|
|
|
namespace BrewMonster
|
|
{
|
|
public class CDlgSkillSubAction : MonoBehaviour
|
|
{
|
|
[SerializeField] List<ActionInfo> m_aActionInfo = new List<ActionInfo>();
|
|
|
|
private void OnEnable()
|
|
{
|
|
OnShowDialog();
|
|
}
|
|
public void OnShowDialog()
|
|
{
|
|
AUIImagePicture pImage;
|
|
TextMeshProUGUI pLabel;
|
|
CECShortcut pSCThis;
|
|
string strFile = "";
|
|
var gameUIMan = CECUIManager.Instance.GetInGameUIMan();
|
|
|
|
CECGameRun pGameRun = CECGameRun.Instance;
|
|
int[] objCount = { 9, 3, 3, 30 };
|
|
CECShortcutSet[] a_pSC =
|
|
{
|
|
pGameRun.GetGenCmdShortcuts(),
|
|
pGameRun.GetTeamCmdShortcuts(),
|
|
pGameRun.GetTradeCmdShortcuts(),
|
|
pGameRun.GetPoseCmdShortcuts()
|
|
};
|
|
int count = 0;
|
|
for (int i = 0; i < a_pSC.Length; i++)
|
|
{
|
|
for (int j = 0; j < objCount[i]; j++)
|
|
{
|
|
pImage = m_aActionInfo[count].image;
|
|
pLabel = m_aActionInfo[count].pLabel;
|
|
|
|
if (!pImage) break;
|
|
|
|
if (j < a_pSC[i].GetShortcutNum())
|
|
{
|
|
pSCThis = a_pSC[i].GetShortcut(j);
|
|
pImage.SetDataPtr(pSCThis, "ptr_CECShortcut");
|
|
|
|
strFile = pSCThis.GetIconFile();
|
|
gameUIMan.SetCover(pImage, strFile, EC_GAMEUI_ICONS.ICONS_ACTION);
|
|
|
|
pLabel.SetText(pSCThis.GetDesc());
|
|
}
|
|
else
|
|
{
|
|
/* pImage->Show(false);
|
|
pLabel->Show(false);*/
|
|
}
|
|
count++;
|
|
}
|
|
}
|
|
}
|
|
[Serializable]
|
|
public struct ActionInfo
|
|
{
|
|
public AUIImagePicture image;
|
|
public TextMeshProUGUI pLabel;
|
|
}
|
|
}
|