This commit is contained in:
SoulliesOfficial
2026-04-01 12:23:27 -04:00
parent aff7ac0e03
commit c3b1561375
933 changed files with 114333 additions and 119360 deletions

View File

@@ -22,15 +22,21 @@ namespace Continentis.MainGame.Card
/// </summary>
public bool dirtyMark;
/// <summary>
/// 标记hint shadow 颜色需要刷新,不触发文本重解析
/// </summary>
public bool hintDirtyMark;
public ContentSubmodule(CardInstance card) : base(card)
{
keywords = card.cardData.keywords;
cardName = card.cardData.displayName.Localize();
cardSprite = card.cardData.cardSprite;
cardSprite = card.cardData.cardSprite ?? MainGameManager.Instance.basePrefabs.defaultCardImage;
originalFunctionText = card.cardData.functionText.Localize();
cardRarity = card.cardData.cardRarity;
cardType = card.cardData.cardType;
dirtyMark = false;
hintDirtyMark = false;
Observable.EveryLateUpdate().Subscribe(_ =>
{
@@ -39,11 +45,12 @@ namespace Continentis.MainGame.Card
RefreshContent();
dirtyMark = false;
}
if (hintDirtyMark)
{
RefreshHintShadow();
hintDirtyMark = false;
}
}).AddTo(card.disposables);
//CardDescriptionInterpreter.InterpretDescription(card);
//keywords = CardDescriptionInterpreter.GetKeywords(card.cardData.cardDescription);
//Debug.Log($"Extracted Keywords: {string.Join(", ", keywords)}");
}
public void RefreshContent()
@@ -51,6 +58,19 @@ namespace Continentis.MainGame.Card
CardTextInterpreter.InterpretText(owner);
owner.handCardView?.Setup();
owner.intentionCardView?.Setup();
// 文本刷新后hint 也需要同步更新
hintDirtyMark = true;
}
/// <summary>
/// 仅刷新 hint shadow 颜色,不触发文本重解析。
/// </summary>
public void RefreshHintShadow()
{
if (owner.handCardView == null || owner.handCardView.isSelecting) return;
Color? hintColor = owner.cardLogic?.GetHintColor();
owner.handCardView.UpdateHintShadow(hintColor);
}
}
}