ui stule update

This commit is contained in:
cthangover committed 2026-09-26 08:05:12 +03:00
1 parent f83f968ae1
commit f65663fd91
7 files changed
+30 -16

No files matched your search

+1 -1
View File
@@ -8,5 +8,5 @@
"sources": [ "sources": [
"src/**/*.cs" "src/**/*.cs"
], ],
"depends": [ "core>=1", "interface>=1", "turn_battle_base>=1" ] "depends": [ "visual_novel_core>=1", "interface>=1", "turn_battle_base>=1" ]
} }
+2 -2
View File
@@ -92,7 +92,7 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
color = Color(0.2, 0.2, 0.2, 1) color = Color(0.137255, 0.145098, 0.184314, 1)
[node name="HealthRect" type="ColorRect" parent="InfoPanel/HealthBar"] [node name="HealthRect" type="ColorRect" parent="InfoPanel/HealthBar"]
layout_mode = 1 layout_mode = 1
@@ -101,7 +101,7 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
color = Color(0, 0.8, 0, 1) color = Color(0.560784, 0.682353, 0.419608, 1)
[node name="Labels" type="HBoxContainer" parent="InfoPanel"] [node name="Labels" type="HBoxContainer" parent="InfoPanel"]
layout_mode = 1 layout_mode = 1
+3
View File
@@ -1,6 +1,7 @@
using Cthangover.Core.Cards; using Cthangover.Core.Cards;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.UI; using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.CardBattle.UI namespace Cthangover.CardBattle.UI
@@ -42,6 +43,8 @@ namespace Cthangover.CardBattle.UI
protected override void Construct() protected override void Construct()
{ {
CthangoverTheme.Apply(this);
image = GetNode<TextureRect>("Image"); image = GetNode<TextureRect>("Image");
frame = GetNode<TextureRect>("Frame"); frame = GetNode<TextureRect>("Frame");
nameLabel = GetNode<Label>("NameLabel"); nameLabel = GetNode<Label>("NameLabel");
+3
View File
@@ -3,6 +3,7 @@ using System.Linq;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.Scenes; using Cthangover.Core.Scenes;
using Cthangover.Core.UI; using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.CardBattle.UI namespace Cthangover.CardBattle.UI
@@ -49,6 +50,8 @@ namespace Cthangover.CardBattle.UI
protected override void Construct() protected override void Construct()
{ {
CthangoverTheme.Apply(this);
content ??= GetNodeOrNull<Control>("Content"); content ??= GetNodeOrNull<Control>("Content");
} }
+2 -1
View File
@@ -5,6 +5,7 @@ using Cthangover.Core.Scenes;
using Cthangover.Core.Utils; using Cthangover.Core.Utils;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.UI; using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.CardBattle.UI namespace Cthangover.CardBattle.UI
@@ -151,7 +152,7 @@ namespace Cthangover.CardBattle.UI
if (!action.Type.UseInBattle()) if (!action.Type.UseInBattle())
continue; continue;
var cardNode = CreateAction(action, cardScale); var cardNode = CreateAction(action, cardScale);
cardNode.Modulate = new Color(1, 1, 1, 0); cardNode.Modulate = UiTokens.Alpha(UiTokens.White, 0f);
cardNode.Position = originPos - cardNode.Size / 2; cardNode.Position = originPos - cardNode.Size / 2;
actionCards.Add(cardNode); actionCards.Add(cardNode);
+15 -12
View File
@@ -3,6 +3,7 @@ using Cthangover.Core.Mods;
using Cthangover.Core.Mods.Resolvers; using Cthangover.Core.Mods.Resolvers;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.UI; using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.CardBattle.UI namespace Cthangover.CardBattle.UI
@@ -79,6 +80,8 @@ namespace Cthangover.CardBattle.UI
protected override void Construct() protected override void Construct()
{ {
CthangoverTheme.Apply(this);
teamOutline = GetNode<ColorRect>("TeamOutline"); teamOutline = GetNode<ColorRect>("TeamOutline");
image = GetNode<TextureRect>("Image"); image = GetNode<TextureRect>("Image");
frame = GetNode<TextureRect>("Frame"); frame = GetNode<TextureRect>("Frame");
@@ -92,7 +95,7 @@ namespace Cthangover.CardBattle.UI
Size = CustomMinimumSize; Size = CustomMinimumSize;
defaultWidth = 230f; defaultWidth = 230f;
selectionState = new Color(0, 0, 0, 0); selectionState = UiTokens.Alpha(UiTokens.White, 0f);
if (!selectTexLoaded) if (!selectTexLoaded)
{ {
@@ -127,9 +130,9 @@ namespace Cthangover.CardBattle.UI
frame.Texture = characterCard.Image; frame.Texture = characterCard.Image;
if (selection != null) if (selection != null)
selection.Modulate = new Color(0, 0, 0, 0); selection.Modulate = UiTokens.Alpha(UiTokens.White, 0f);
selectionState = new Color(0, 0, 0, 0); selectionState = UiTokens.Alpha(UiTokens.White, 0f);
UpdateInfo(); UpdateInfo();
} }
@@ -142,8 +145,8 @@ namespace Cthangover.CardBattle.UI
{ {
if (teamOutline != null) if (teamOutline != null)
teamOutline.Color = IsPlayer teamOutline.Color = IsPlayer
? new Color(0.2f, 0.4f, 1f, 0.5f) ? UiTokens.Alpha(UiTokens.Info, 0.5f)
: new Color(1f, 0.8f, 0.1f, 0.5f); : UiTokens.Alpha(UiTokens.Accent, 0.5f);
} }
/// <summary> /// <summary>
@@ -159,15 +162,15 @@ namespace Cthangover.CardBattle.UI
} }
/// <summary> /// <summary>
/// Applies a green selection highlight, raises Z-index to 4096 to ensure the card /// Applies a target-accent selection highlight, raises Z-index to 4096 to ensure the card
/// is clickable above other cards during drag-and-drop targeting, and animates /// is clickable above other cards during drag-and-drop targeting, and animates
/// the selection overlay to green. Called when the player clicks a character card /// the selection overlay to <see cref="UiTokens.TypeTarget"/>. Called when the player clicks a character card
/// or when a valid support/self target is dragged over. /// or when a valid support/self target is dragged over.
/// </summary> /// </summary>
public void Select() public void Select()
{ {
_selected = true; _selected = true;
selectionState = new Color(0, 1, 0, 1); selectionState = UiTokens.TypeTarget;
AnimateSelection(selectionState); AnimateSelection(selectionState);
if (selection != null) selection.ZIndex = 1; if (selection != null) selection.ZIndex = 1;
ZIndex = 4096; ZIndex = 4096;
@@ -180,19 +183,19 @@ namespace Cthangover.CardBattle.UI
public void Unselect() public void Unselect()
{ {
_selected = false; _selected = false;
selectionState = new Color(0, 0, 0, 0); selectionState = UiTokens.Alpha(UiTokens.White, 0f);
AnimateSelection(selectionState); AnimateSelection(selectionState);
if (selection != null) selection.ZIndex = 0; if (selection != null) selection.ZIndex = 0;
ZIndex = _baseZIndex; ZIndex = _baseZIndex;
} }
/// <summary> /// <summary>
/// Applies a red highlight indicating this card is being targeted for an attack. /// Applies an enemy-accent highlight indicating this card is being targeted for an attack.
/// Called by <see cref="ICardActionStrategy.HighlightTarget"/> during drag-over. /// Called by <see cref="ICardActionStrategy.HighlightTarget"/> during drag-over.
/// </summary> /// </summary>
public void Attack() public void Attack()
{ {
selectionState = new Color(1, 0, 0, 1); selectionState = UiTokens.TypeEnemy;
AnimateSelection(selectionState); AnimateSelection(selectionState);
if (selection != null) selection.ZIndex = 1; if (selection != null) selection.ZIndex = 1;
} }
@@ -204,7 +207,7 @@ namespace Cthangover.CardBattle.UI
/// </summary> /// </summary>
public void Invalid() public void Invalid()
{ {
selectionState = new Color(0.4f, 0.4f, 0.4f, 0.8f); selectionState = UiTokens.Alpha(UiTokens.Muted, 0.8f);
AnimateSelection(selectionState); AnimateSelection(selectionState);
if (selection != null) selection.ZIndex = 1; if (selection != null) selection.ZIndex = 1;
} }
+4
View File
@@ -1,4 +1,5 @@
using Cthangover.Core.UI; using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.CardBattle.UI namespace Cthangover.CardBattle.UI
@@ -20,7 +21,10 @@ namespace Cthangover.CardBattle.UI
protected override void Construct() protected override void Construct()
{ {
CthangoverTheme.Apply(this);
_button = GetNode<Button>("BtnEndTurn"); _button = GetNode<Button>("BtnEndTurn");
CthangoverTheme.ApplyPrimary(_button);
Size = CustomMinimumSize; Size = CustomMinimumSize;