文本显示和Command大修

This commit is contained in:
SoulliesOfficial
2025-11-08 09:50:55 -05:00
parent 3f1e04dee7
commit b2e9e84c52
78 changed files with 293 additions and 244 deletions

View File

@@ -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();
}
}
}