upd: sync local changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
iisaevandClaude Opus 5.5 committed 2026-10-16 16:18:12 +00:00
1 parent b243a318f4
commit 214ddb32fc
20 files changed
+120 -23

No files matched your search

+3
View File
@@ -4,6 +4,8 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.Theming;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -50,6 +52,7 @@ namespace Cthangover.CardBattle.UI
/// <inheritdoc />
public Control GetControlNode() => this;
/// <summary>Builds the action card visuals: artwork, name label and point cost chip from the bound ActionCharacter.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
+3
View File
@@ -2,6 +2,8 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.Theming;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -28,6 +30,7 @@ namespace Cthangover.CardBattle.UI
/// <summary>Container that receives action cards; owned by the input controller.</summary>
public Control Body => _grid;
/// <summary>Builds the bottom action bar shown while a card is selected.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
+3
View File
@@ -2,6 +2,8 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.Theming;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -22,6 +24,7 @@ namespace Cthangover.CardBattle.UI
private Label _label;
private Tween _tween;
/// <summary>Builds the centre-screen turn/victory banner label.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
+3
View File
@@ -6,6 +6,8 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.View;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -48,6 +50,7 @@ namespace Cthangover.CardBattle.UI
/// </summary>
public event System.Action<CharacterCardNode> OnCardDead;
/// <summary>Builds the card grid container rows for one battle side.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
+3
View File
@@ -2,6 +2,8 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.Theming;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -19,6 +21,7 @@ namespace Cthangover.CardBattle.UI
private Label _roundValue;
private Label _enemiesValue;
/// <summary>Builds the battle HUD frame: turn indicator, speed control and log button.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
+4
View File
@@ -2,6 +2,8 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.Theming;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -25,6 +27,7 @@ namespace Cthangover.CardBattle.UI
private ScrollContainer _scroll;
private VBoxContainer _rows;
/// <summary>Builds the scrollable battle log with coloured entries per <see cref="BattleLogKind"/>.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
@@ -51,6 +54,7 @@ namespace Cthangover.CardBattle.UI
BattleLogHub.Entry += Append;
}
/// <summary>Unsubscribes from the shared <see cref="BattleLogHub"/> so the freed panel stops receiving entries.</summary>
protected override void Destruct()
{
BattleLogHub.Entry -= Append;
+3
View File
@@ -2,6 +2,8 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.View;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -48,6 +50,7 @@ namespace Cthangover.CardBattle.UI
/// </summary>
public CanvasLayer DragLayer { get; private set; }
/// <summary>Assembles the full card-battle screen: panels, HUD, banner, log and drag layer.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
+6 -4
View File
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Cthangover.Core.Cards;
using Cthangover.Core.Audio;
using Cthangover.Core.Scenes;
@@ -9,6 +9,7 @@ using Cthangover.Core.UI.CharacterPanel;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -70,6 +71,7 @@ namespace Cthangover.CardBattle.UI
_panels = new[] { screen.PlayerPanel, screen.EnemyPanel };
}
/// <summary>Routes mouse input into card selection and target picking for the player turn.</summary>
protected override void OnInput(InputEvent @event)
{
if (Cthangover.Core.Battle.BattleSceneContext.Instance != null &&
@@ -274,7 +276,7 @@ namespace Cthangover.CardBattle.UI
if (source != _selectedCharacter && _selectedCharacter != null)
_selectedCharacter.Unselect();
var audioService = SceneContextNode.Instance?.GetSceneRoot<AudioService>("AudioService");
var audioService = SceneContextNode.Instance?.GetSceneRoot<Node>("AudioService") as IAudioService;
audioService?.PlaySound("battle/card_show_actions", SoundType.CardEffect);
_selectedCharacter = source;
@@ -303,7 +305,7 @@ namespace Cthangover.CardBattle.UI
_currentActionCard.Unselect();
_dragValid = true;
var audioService = SceneContextNode.Instance?.GetSceneRoot<AudioService>("AudioService");
var audioService = SceneContextNode.Instance?.GetSceneRoot<Node>("AudioService") as IAudioService;
audioService?.PlaySound("battle/card_pick", 4, SoundType.CardEffect);
_currentActionCard = source;
@@ -382,7 +384,7 @@ namespace Cthangover.CardBattle.UI
_originalActionCardParent = null;
}
var audioService = SceneContextNode.Instance?.GetSceneRoot<AudioService>("AudioService");
var audioService = SceneContextNode.Instance?.GetSceneRoot<Node>("AudioService") as IAudioService;
audioService?.PlaySound("battle/card_drop", 4, SoundType.CardEffect);
DoActionToTarget();
+23 -6
View File
@@ -6,13 +6,18 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
using Cthangover.Mods.Interface.Theming;
namespace Cthangover.CardBattle.UI
{
/// <summary>
/// Party or enemy card on the battle field, rebuilt from the interface
/// mockup (mockups/card_battle): full-bleed portrait, team-coloured frame,
/// bottom info block with the name, four stat chips (HP/ЗАЩ/АТК/ОД) and an
/// HP bar, plus stun badge, zap flash and selection frame in the upper right.
/// bottom info block with the name, four stat chips (HP/ЗАЩ/АТК/ОД) and a
/// layered health bar (<see cref="UiKit.StyleShieldedHealthBar"/>:
/// track → health fill → blue defence segment drawn past the health edge
/// while <see cref="CharacterAttributes.Defence"/> absorbs damage), plus
/// stun badge, zap flash and selection frame in the upper right.
/// The node tree lives in <c>scenes/character_card.tscn</c>; this class
/// fetches the nodes once, dresses them with <see cref="UiTokens"/> styles and
/// exposes the battle-facing API: <see cref="UpdateInfo"/> is the single
@@ -34,6 +39,7 @@ namespace Cthangover.CardBattle.UI
private TextureRect _art;
private Panel _teamFrame;
private Label _nameLabel;
private ProgressBar _shieldBar;
private ProgressBar _hpBar;
private Label _hpValue;
private Label _defValue;
@@ -87,6 +93,7 @@ namespace Cthangover.CardBattle.UI
/// <inheritdoc />
public Control GetControlNode() => this;
/// <summary>Builds the character card: portrait, art frame, selection overlay and stat labels.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);
@@ -94,7 +101,8 @@ namespace Cthangover.CardBattle.UI
_art = GetNode<TextureRect>("Art");
_teamFrame = GetNode<Panel>("TeamFrame");
_nameLabel = GetNode<Label>("Info/Column/NameLabel");
_hpBar = GetNode<ProgressBar>("Info/Column/HpBar");
_shieldBar = GetNode<ProgressBar>("Info/Column/HpBarStack/ShieldBar");
_hpBar = GetNode<ProgressBar>("Info/Column/HpBarStack/HpBar");
_hpValue = GetNode<Label>("Info/Column/Stats/HpChip/Row/Value");
_defValue = GetNode<Label>("Info/Column/Stats/DefChip/Row/Value");
_atkValue = GetNode<Label>("Info/Column/Stats/AtkChip/Row/Value");
@@ -165,8 +173,9 @@ namespace Cthangover.CardBattle.UI
}
/// <summary>
/// Refreshes every mutable value from the character model: name, HP
/// number and bar (turning red below 40%), defence, attack, action
/// Refreshes every mutable value from the character model: name, layered
/// HP/defence bar and HP number (health turning red below 40%, blue
/// defence segment drawn past the health edge), defence, attack, action
/// points and the stun badge with its remaining turns. Called after each
/// action, on turn start, and by the panel after re-gridding.
/// </summary>
@@ -180,9 +189,13 @@ namespace Cthangover.CardBattle.UI
var health = Card.Attributes.Health;
var percent = Mathf.Clamp(health.Percent, 0f, 1f);
_hpBar.Value = percent * 100f;
_hpBar.AddThemeStyleboxOverride("background", UiKit.Frame(UiTokens.RadiusSm, UiTokens.LineDisabled));
_hpBar.AddThemeStyleboxOverride("fill", UiKit.Frame(UiTokens.RadiusSm, percent < 0.4f ? UiTokens.HpLow : UiTokens.HpOk));
// Blue defence segment on top of the health fill; collapses onto
// the health edge when the shield is gone.
UiKit.UpdateShieldedHealthBar(
_shieldBar, percent, Card.Attributes.Defence.Value, health.BaseValue);
_hpValue.Text = health.Value + "/" + health.BaseValue;
_defValue.Text = Card.Attributes.Defence.Value.ToString();
_atkValue.Text = Card.Attributes.Attack.Value.ToString();
@@ -269,6 +282,10 @@ namespace Cthangover.CardBattle.UI
_nameLabel.AddThemeColorOverride("font_color", UiTokens.InkBright);
// Layered pie: the shield bar owns the track and the blue defence
// fill; the health bar paints only its fill on top of it.
UiKit.StyleShieldedHealthBar(_shieldBar, _hpBar);
StyleChip("Info/Column/Stats/HpChip", UiTokens.HpText);
StyleChip("Info/Column/Stats/DefChip", UiTokens.Ink);
StyleChip("Info/Column/Stats/AtkChip", UiTokens.Ink);
+2
View File
@@ -2,6 +2,7 @@ using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
using Cthangover.Mods.Interface.Base.Lists;
namespace Cthangover.CardBattle.UI
{
/// <summary>
@@ -19,6 +20,7 @@ namespace Cthangover.CardBattle.UI
/// </summary>
public event System.Action OnPressed;
/// <summary>Builds the end-turn button and binds its pressed event.</summary>
protected override void Construct()
{
CthangoverTheme.Apply(this);