除了充盈都做完了

This commit is contained in:
SoulliesOfficial
2025-10-31 10:02:30 -04:00
parent 5d09ef7b53
commit ee1d3d9c0a
179 changed files with 3239 additions and 200 deletions

View File

@@ -31,6 +31,7 @@ namespace Continentis.MainGame.UI
this.Priority = buff.Priority;
buff.iconSubmodule.buffIcon = this;
icon.sprite = buff.iconSubmodule.icon;
this.infoBox = null;
PlayApplyAnimation();
UpdateIcon();
}
@@ -43,6 +44,7 @@ namespace Continentis.MainGame.UI
spreadImage.rectTransform.localScale = Vector3.zero;
spreadImage.color = Color.white;
spreadImage.DOColor(new Color(1f, 1f, 1f, 0f), 1.1f).SetEase(Ease.Linear).Play();
spreadImage.maskable = false;
spreadImage.rectTransform.DOScale(4f, 1.2f).SetEase(Ease.OutQuad).OnComplete(() =>
{
LeanPool.Despawn(spreadImage.gameObject);
@@ -63,6 +65,7 @@ namespace Continentis.MainGame.UI
{
string paramKey = synchronizedParameters[index];
Func<string> func = buff.contentSubmodule.parameterGetters[paramKey];
Debug.Log($"Updating buff icon text for parameter {paramKey} with func is {func == null}");
SetText(index, func);
}
@@ -94,8 +97,12 @@ namespace Continentis.MainGame.UI
{
GameObject infoBoxPrefab = MainGameManager.Instance.basePrefabs.informationBox;
RectTransform canvasTransform = CombatUIManager.Instance.hudPage.rectTransform;
infoBox = LeanPool.Spawn(infoBoxPrefab, canvasTransform).GetComponent<InformationBox>();
if (infoBox == null)
{
infoBox = LeanPool.Spawn(infoBoxPrefab, canvasTransform).GetComponent<InformationBox>();
}
BuffTextInterpreter.InterpretText(buff);
string dispelThreshold = buff.dispelThreshold switch
{
@@ -106,7 +113,7 @@ namespace Continentis.MainGame.UI
_ => throw new ArgumentOutOfRangeException()
};
dispelThreshold = dispelThreshold.Localize();
string finalDescription = buff.contentSubmodule.interpretedFunctionText + "\n" + dispelThreshold;
infoBox.Initialize(buff.contentSubmodule.displayName, finalDescription, canvasTransform.InverseTransformPoint(rectTransform.position));
@@ -122,6 +129,20 @@ namespace Continentis.MainGame.UI
LeanPool.Despawn(infoBox.gameObject);
infoBox = null;
}
else
{
Debug.LogWarning("InfoBox is already null on pointer exit.");
}
}
private void OnDisable()
{
if (infoBox != null)
{
Debug.Log("Cleaning up InfoBox from OnDisable.");
LeanPool.Despawn(infoBox.gameObject);
infoBox = null;
}
}
}
}