文本显示和Command大修
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SLSFramework.General;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.MainGame.Card
|
||||
@@ -16,6 +17,11 @@ namespace Continentis.MainGame.Card
|
||||
public string originalFunctionText;
|
||||
public string interpretedFunctionText;
|
||||
|
||||
/// <summary>
|
||||
/// 标记:内容已更改,需要刷新
|
||||
/// </summary>
|
||||
public bool dirtyMark;
|
||||
|
||||
public ContentSubmodule(CardLogicBase card) : base(card)
|
||||
{
|
||||
keywords = card.cardData.keywords;
|
||||
@@ -24,9 +30,27 @@ namespace Continentis.MainGame.Card
|
||||
originalFunctionText = card.cardData.functionText.Localize();
|
||||
cardRarity = card.cardData.cardRarity;
|
||||
cardType = card.cardData.cardType;
|
||||
dirtyMark = false;
|
||||
|
||||
Observable.EveryLateUpdate().Subscribe(_ =>
|
||||
{
|
||||
if (dirtyMark)
|
||||
{
|
||||
RefreshContent();
|
||||
dirtyMark = false;
|
||||
}
|
||||
}).AddTo(card.disposables);
|
||||
|
||||
//CardDescriptionInterpreter.InterpretDescription(card);
|
||||
//keywords = CardDescriptionInterpreter.GetKeywords(card.cardData.cardDescription);
|
||||
//Debug.Log($"Extracted Keywords: {string.Join(", ", keywords)}");
|
||||
}
|
||||
|
||||
public void RefreshContent()
|
||||
{
|
||||
CardTextInterpreter.InterpretText(owner);
|
||||
owner.handCardView?.Setup();
|
||||
owner.intentionCardView?.Setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user