更新
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user