MOD!
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using SoulliesFramework.General;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.MainGame.UI
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Lean.Common;
|
||||
using Lean.Pool;
|
||||
using SoulliesFramework.General;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.MainGame.UI
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SoulliesFramework.General;
|
||||
using SLSFramework.General;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Character;
|
||||
using Lean.Pool;
|
||||
using SLSFramework.General;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
@@ -11,13 +13,18 @@ namespace Continentis.MainGame.UI
|
||||
public class HUD_CharacterBuffIcon : HUD_BaseIcon
|
||||
{
|
||||
public CharacterBuffBase buff;
|
||||
|
||||
|
||||
public Image buffTypeBackground;
|
||||
public Sprite positive;
|
||||
public Sprite negative;
|
||||
public Sprite neutral;
|
||||
|
||||
public void Initialize(CharacterBuffBase buff)
|
||||
{
|
||||
this.buff = buff;
|
||||
buff.uiSubmodule.buffIcon = this;
|
||||
buff.iconSubmodule.buffIcon = this;
|
||||
|
||||
icon.sprite = buff.uiSubmodule.icon;
|
||||
icon.sprite = buff.iconSubmodule.icon;
|
||||
|
||||
UpdateIcon();
|
||||
}
|
||||
@@ -25,9 +32,12 @@ namespace Continentis.MainGame.UI
|
||||
public override void UpdateIcon()
|
||||
{
|
||||
int index;
|
||||
for (index = 0; index < buff.uiSubmodule.setTextFunctions.Count; index++)
|
||||
List<string> synchronizedParameters = buff.iconSubmodule.synchronizedParameters;
|
||||
|
||||
for (index = 0; index < synchronizedParameters.Count; index++)
|
||||
{
|
||||
var func = buff.uiSubmodule.setTextFunctions[index];
|
||||
string paramKey = synchronizedParameters[index];
|
||||
Func<string> func = buff.contentSubmodule.parameterGetters[paramKey];
|
||||
SetText(index, func);
|
||||
}
|
||||
|
||||
@@ -38,6 +48,20 @@ namespace Continentis.MainGame.UI
|
||||
textList[i].gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
buffTypeBackground.sprite = buff.buffType switch
|
||||
{
|
||||
BuffType.Positive => positive,
|
||||
BuffType.Negative => negative,
|
||||
BuffType.Neutral => neutral,
|
||||
_ => buffTypeBackground.sprite
|
||||
};
|
||||
}
|
||||
|
||||
public void RemoveIcon()
|
||||
{
|
||||
buff.iconSubmodule.buffIcon = null;
|
||||
LeanPool.Despawn(gameObject);
|
||||
}
|
||||
|
||||
public override void OnPointerEnter(PointerEventData eventData)
|
||||
@@ -46,9 +70,21 @@ namespace Continentis.MainGame.UI
|
||||
RectTransform canvasTransform = CombatUIManager.Instance.hudPage.rectTransform;
|
||||
infoBox = LeanPool.Spawn(infoBoxPrefab, canvasTransform).GetComponent<InformationBox>();
|
||||
|
||||
infoBox.Initialize(buff.name, buff.description, canvasTransform.InverseTransformPoint(rectTransform.position));
|
||||
BuffTextInterpreter.InterpretText(buff);
|
||||
string dispelThreshold = buff.dispelThreshold switch
|
||||
{
|
||||
BuffDispelLevel.Basic => "Buff_DispelThreshold_Basic_Suffix",
|
||||
BuffDispelLevel.Strong => "Buff_DispelThreshold_Strong_Suffix",
|
||||
BuffDispelLevel.Immune => "Buff_DispelThreshold_Immune_Suffix",
|
||||
BuffDispelLevel.Undispellable => "Buff_DispelThreshold_Undispellable_Suffix",
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
dispelThreshold = dispelThreshold.Localize();
|
||||
|
||||
string finalDescription = buff.contentSubmodule.interpretedFunctionText + "\n" + dispelThreshold;
|
||||
infoBox.Initialize(buff.contentSubmodule.displayName, finalDescription, canvasTransform.InverseTransformPoint(rectTransform.position));
|
||||
}
|
||||
|
||||
|
||||
public override void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
if (infoBox != null)
|
||||
|
||||
Reference in New Issue
Block a user