Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/GachaPackPointLayout.cs
gamer147 0d9d8acae0 feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
2026-06-05 16:57:20 -04:00

69 lines
2.0 KiB
C#

using System;
using Cute;
using UnityEngine;
namespace Wizard;
public class GachaPackPointLayout : MonoBehaviour
{
[SerializeField]
private GameObject _packPointGaugeRoot;
[SerializeField]
private UIGauge _packPointGauge;
[SerializeField]
private UILabel _packPointGaugePointLabel;
[SerializeField]
private UIButton _packPointExchangeButton;
[SerializeField]
private UILabel _packPointExchangeButtonLabel;
public void SetActivePackPointLayout(bool isActive)
{
_packPointGaugeRoot.gameObject.SetActive(isActive);
}
public void SetPackPointLayout(PackConfig packConfig, Action onClickExchange)
{
if ((packConfig.Category != PackCategory.None && packConfig.Category != PackCategory.LeaderSkinPack) || packConfig.GachaPointData == null)
{
SetActivePackPointLayout(isActive: false);
return;
}
SetActivePackPointLayout(isActive: true);
GachaPointData gachaPointData = packConfig.GachaPointData;
SetPointGauge(gachaPointData);
SetExchangeButton(gachaPointData, onClickExchange);
}
private void SetPointGauge(GachaPointData pointData)
{
_packPointGauge.Value = (float)pointData.GachaPoint / (float)pointData.ExchangeableGachaPoint;
_packPointGaugePointLabel.text = pointData.GachaPoint + "/" + pointData.ExchangeableGachaPoint;
}
private void SetExchangeButton(GachaPointData pointData, Action onClickExchange)
{
if (pointData.IsExchangeableGachaPoint)
{
_packPointExchangeButtonLabel.text = Data.SystemText.Get("Shop_0168");
_packPointExchangeButton.normalSprite = "btn_common_03_s_off";
_packPointExchangeButton.pressedSprite = "btn_common_03_s_on";
}
else
{
_packPointExchangeButtonLabel.text = Data.SystemText.Get("Shop_0169");
_packPointExchangeButton.normalSprite = "btn_common_02_s_off";
_packPointExchangeButton.pressedSprite = "btn_common_02_s_on";
}
_packPointExchangeButton.onClick.Clear();
_packPointExchangeButton.onClick.Add(new EventDelegate(delegate
{
onClickExchange.Call();
}));
}
}