ui stule update

This commit is contained in:
cthangover committed 2026-09-26 08:05:13 +03:00
1 parent 28046f901e
commit 86e3de904e
11 files changed
+59 -29

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
@@ -28,7 +28,7 @@ offset_top = 218.0
offset_right = 176.0 offset_right = 176.0
offset_bottom = 236.0 offset_bottom = 236.0
mouse_filter = 2 mouse_filter = 2
color = Color(0.15, 0.15, 0.15, 1) color = Color(0.137255, 0.145098, 0.184314, 1)
[node name="HpFill" type="ColorRect" parent="."] [node name="HpFill" type="ColorRect" parent="."]
layout_mode = 0 layout_mode = 0
@@ -37,7 +37,7 @@ offset_top = 218.0
offset_right = 176.0 offset_right = 176.0
offset_bottom = 236.0 offset_bottom = 236.0
mouse_filter = 2 mouse_filter = 2
color = Color(0.1, 0.85, 0.1, 1) color = Color(0.560784, 0.682353, 0.419608, 1)
[node name="NameLabel" type="Label" parent="."] [node name="NameLabel" type="Label" parent="."]
layout_mode = 0 layout_mode = 0
+3 -4
View File
@@ -13,9 +13,9 @@ anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 2 mouse_filter = 2
color = Color(0.02, 0.05, 0.12, 0.88) color = Color(0.062745, 0.066667, 0.094118, 1)
[node name="Border" type="ColorRect" parent="."] [node name="Border" type="Panel" parent="."]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@@ -27,11 +27,10 @@ offset_top = -3.0
offset_right = 3.0 offset_right = 3.0
offset_bottom = 3.0 offset_bottom = 3.0
mouse_filter = 2 mouse_filter = 2
color = Color(0.3, 0.5, 0.9, 0.9)
[node name="Cursor" type="Label" parent="."] [node name="Cursor" type="Label" parent="."]
text = "►" text = "►"
mouse_filter = 2 mouse_filter = 2
visible = false visible = false
theme_override_font_sizes/font_size = 18 theme_override_font_sizes/font_size = 18
theme_override_colors/font_color = Color(1, 0.95, 0.7, 1) theme_override_colors/font_color = Color(0.941176, 0.756863, 0.411765, 1)
+4 -2
View File
@@ -1,8 +1,9 @@
using Cthangover.Core.Battle; using Cthangover.Core.Battle;
using Cthangover.Core.Battle.Actions; using Cthangover.Core.Battle.Actions;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.TurnBattle; using Cthangover.TurnBattle;
using Cthangover.FFBattle.UI; using Cthangover.FFBattle.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.FFBattle.Actions namespace Cthangover.FFBattle.Actions
@@ -70,7 +71,7 @@ namespace Cthangover.FFBattle.Actions
if (result.Result) if (result.Result)
{ {
Target.Flash(new Color(1f, 0.3f, 0.3f, 1f), 0.2f); Target.Flash(UiTokens.Danger, 0.2f);
Target.Shake(4f, 0.25f); Target.Shake(4f, 0.25f);
if (result.Target.Damage > 0) if (result.Target.Damage > 0)
@@ -115,3 +116,4 @@ namespace Cthangover.FFBattle.Actions
} }
} }
} }
+4 -2
View File
@@ -1,8 +1,9 @@
using Cthangover.Core.Battle; using Cthangover.Core.Battle;
using Cthangover.Core.Battle.Actions; using Cthangover.Core.Battle.Actions;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.TurnBattle; using Cthangover.TurnBattle;
using Cthangover.FFBattle.UI; using Cthangover.FFBattle.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.FFBattle.Actions namespace Cthangover.FFBattle.Actions
@@ -70,7 +71,7 @@ namespace Cthangover.FFBattle.Actions
if (result.Result) if (result.Result)
{ {
Target.Flash(new Color(0.3f, 1f, 0.3f, 1f), 0.4f); Target.Flash(UiTokens.Success, 0.4f);
if (result.Target.Defence > 0) if (result.Target.Defence > 0)
ShowDamageBehaviour.SpawnDefence(result.Target.Defence, Target, Target.GlobalPosition); ShowDamageBehaviour.SpawnDefence(result.Target.Defence, Target, Target.GlobalPosition);
@@ -113,3 +114,4 @@ namespace Cthangover.FFBattle.Actions
} }
} }
} }
+6 -3
View File
@@ -1,6 +1,7 @@
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.Items; using Cthangover.Core.Items;
using Cthangover.FFBattle.UI; using Cthangover.FFBattle.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.FFBattle.Actions namespace Cthangover.FFBattle.Actions
@@ -84,7 +85,7 @@ namespace Cthangover.FFBattle.Actions
var localTarget = Target.GlobalPosition - Source.Position; var localTarget = Target.GlobalPosition - Source.Position;
var iconStart = Source.GlobalPosition - Source.Position + new Vector2(20, -70); var iconStart = Source.GlobalPosition - Source.Position + new Vector2(20, -70);
_itemIcon.Position = iconStart.Lerp(localTarget + new Vector2(20, -20), EaseInOutQuad(progress)); _itemIcon.Position = iconStart.Lerp(localTarget + new Vector2(20, -20), EaseInOutQuad(progress));
_itemIcon.Modulate = new Color(1, 1, 1, 1f - progress * 0.5f); _itemIcon.Modulate = UiTokens.Alpha(UiTokens.White, 1f - progress * 0.5f);
} }
if (!_effectApplied && progress >= 0.3f) if (!_effectApplied && progress >= 0.3f)
@@ -96,7 +97,7 @@ namespace Cthangover.FFBattle.Actions
Source.UpdateInfo(); Source.UpdateInfo();
Target.UpdateInfo(); Target.UpdateInfo();
Target.Flash(new Color(0.5f, 1f, 0.5f, 1f), 0.3f); Target.Flash(UiTokens.Success, 0.3f);
} }
if (progress >= 1f) if (progress >= 1f)
@@ -139,3 +140,5 @@ namespace Cthangover.FFBattle.Actions
} }
} }
} }
+8 -4
View File
@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -10,6 +10,7 @@ using Cthangover.Core.Settings;
using Cthangover.Core.Scenes; using Cthangover.Core.Scenes;
using Cthangover.Core.Utils; using Cthangover.Core.Utils;
using Cthangover.FFBattle.UI; using Cthangover.FFBattle.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.FFBattle namespace Cthangover.FFBattle
@@ -254,7 +255,7 @@ namespace Cthangover.FFBattle
foreach (var widget in _playerPanel.Widgets) foreach (var widget in _playerPanel.Widgets)
widget.ClearHighlight(); widget.ClearHighlight();
_currentCharacter?.Highlight(new Color(0, 0.6f, 1f, 0.6f)); _currentCharacter?.Highlight(UiTokens.Alpha(UiTokens.Info, 0.6f));
} }
private void OnMenuItemSelected(int index) private void OnMenuItemSelected(int index)
@@ -427,13 +428,13 @@ namespace Cthangover.FFBattle
{ {
foreach (var widget in _playerPanel.Widgets) foreach (var widget in _playerPanel.Widgets)
if (!widget.IsDead) if (!widget.IsDead)
widget.Highlight(new Color(0.3f, 1f, 0.3f, 0.5f)); widget.Highlight(UiTokens.Alpha(UiTokens.Success, 0.5f));
} }
else else
{ {
foreach (var widget in _enemyPanel.Widgets) foreach (var widget in _enemyPanel.Widgets)
if (!widget.IsDead) if (!widget.IsDead)
widget.Highlight(new Color(1f, 0.3f, 0.3f, 0.5f)); widget.Highlight(UiTokens.Alpha(UiTokens.Danger, 0.5f));
} }
_onTargetSelected = null; _onTargetSelected = null;
@@ -868,3 +869,6 @@ namespace Cthangover.FFBattle
public void AdvancePlayerTurn() => OnPlayerTurnEnd(); public void AdvancePlayerTurn() => OnPlayerTurnEnd();
} }
} }
+8 -5
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.FFBattle.UI namespace Cthangover.FFBattle.UI
@@ -40,6 +41,8 @@ namespace Cthangover.FFBattle.UI
protected override void Construct() protected override void Construct()
{ {
CthangoverTheme.Apply(this);
_sprite = GetNode<TextureRect>("Sprite"); _sprite = GetNode<TextureRect>("Sprite");
_hpBg = GetNode<ColorRect>("HpBg"); _hpBg = GetNode<ColorRect>("HpBg");
_hpFill = GetNode<ColorRect>("HpFill"); _hpFill = GetNode<ColorRect>("HpFill");
@@ -58,7 +61,7 @@ namespace Cthangover.FFBattle.UI
_selection.Texture = _cachedSelectTex; _selection.Texture = _cachedSelectTex;
_selection.ExpandMode = TextureRect.ExpandModeEnum.IgnoreSize; _selection.ExpandMode = TextureRect.ExpandModeEnum.IgnoreSize;
_selection.StretchMode = TextureRect.StretchModeEnum.Scale; _selection.StretchMode = TextureRect.StretchModeEnum.Scale;
_selection.Modulate = new Color(0, 0, 0, 0); _selection.Modulate = UiTokens.Alpha(UiTokens.White, 0f);
} }
} }
@@ -93,11 +96,11 @@ namespace Cthangover.FFBattle.UI
_hpFill.Size = new Vector2((Size.X - 8) * hpPercent, 18); _hpFill.Size = new Vector2((Size.X - 8) * hpPercent, 18);
if (hpPercent > 0.5f) if (hpPercent > 0.5f)
_hpFill.Color = new Color(0.1f, 0.85f, 0.1f, 1f); _hpFill.Color = UiTokens.HpOk;
else if (hpPercent > 0.25f) else if (hpPercent > 0.25f)
_hpFill.Color = new Color(0.85f, 0.85f, 0.1f, 1f); _hpFill.Color = UiTokens.Warning;
else else
_hpFill.Color = new Color(0.85f, 0.1f, 0.1f, 1f); _hpFill.Color = UiTokens.HpLow;
} }
/// <summary>Shows a coloured selection overlay with a 0.15s tween fade-in. Used for target highlighting and selection indication.</summary> /// <summary>Shows a coloured selection overlay with a 0.15s tween fade-in. Used for target highlighting and selection indication.</summary>
@@ -121,7 +124,7 @@ namespace Cthangover.FFBattle.UI
_animTween?.Kill(); _animTween?.Kill();
_animTween = CreateTween(); _animTween = CreateTween();
_animTween.SetEase(Tween.EaseType.Out).SetTrans(Tween.TransitionType.Quad); _animTween.SetEase(Tween.EaseType.Out).SetTrans(Tween.TransitionType.Quad);
_animTween.TweenProperty(_selection, "modulate", new Color(0, 0, 0, 0), 0.15f); _animTween.TweenProperty(_selection, "modulate", UiTokens.Alpha(UiTokens.White, 0f), 0.15f);
} }
/// <summary>Rapidly oscillates the widget's position with random offsets (6 iterations) to simulate impact feedback.</summary> /// <summary>Rapidly oscillates the widget's position with random offsets (6 iterations) to simulate impact feedback.</summary>
+5 -1
View File
@@ -4,6 +4,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.FFBattle.UI namespace Cthangover.FFBattle.UI
@@ -32,7 +33,10 @@ namespace Cthangover.FFBattle.UI
/// <summary>Raised when an enemy widget is clicked (used for target selection).</summary> /// <summary>Raised when an enemy widget is clicked (used for target selection).</summary>
public event System.Action<FFCharacterWidget> OnEnemyClicked; public event System.Action<FFCharacterWidget> OnEnemyClicked;
protected override void Construct() { } protected override void Construct()
{
CthangoverTheme.Apply(this);
}
/// <summary>Number of enemy widget instances currently managed (including dead).</summary> /// <summary>Number of enemy widget instances currently managed (including dead).</summary>
public int EnemyCount => Widgets.Count; public int EnemyCount => Widgets.Count;
+13 -4
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using Cthangover.Core.UI; using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot; using Godot;
namespace Cthangover.FFBattle.UI namespace Cthangover.FFBattle.UI
@@ -36,7 +37,7 @@ namespace Cthangover.FFBattle.UI
public partial class FFMenuPanel : ModWidget public partial class FFMenuPanel : ModWidget
{ {
private ColorRect _background; private ColorRect _background;
private ColorRect _border; private Panel _border;
private Label _cursorLabel; private Label _cursorLabel;
private List<Label> _itemLabels = new(); private List<Label> _itemLabels = new();
private Tween _cursorTween; private Tween _cursorTween;
@@ -74,9 +75,17 @@ namespace Cthangover.FFBattle.UI
protected override void Construct() protected override void Construct()
{ {
CthangoverTheme.Apply(this);
_background = GetNode<ColorRect>("Background"); _background = GetNode<ColorRect>("Background");
_border = GetNode<ColorRect>("Border"); _background.Color = UiTokens.Surface2;
_border = GetNode<Panel>("Border");
_border.AddThemeStyleboxOverride("panel",
UiKit.Frame(UiTokens.RadiusSm, UiTokens.Alpha(UiTokens.White, 0f), UiTokens.AccentLine, 2));
_cursorLabel = GetNode<Label>("Cursor"); _cursorLabel = GetNode<Label>("Cursor");
_cursorLabel.AddThemeColorOverride("font_color", UiTokens.AccentBright);
GuiInput += OnPanelGuiInput; GuiInput += OnPanelGuiInput;
} }
@@ -101,8 +110,8 @@ namespace Cthangover.FFBattle.UI
label.Text = entries[i].Label; label.Text = entries[i].Label;
label.AddThemeFontSizeOverride("font_size", 17); label.AddThemeFontSizeOverride("font_size", 17);
label.AddThemeColorOverride("font_color", entries[i].Enabled label.AddThemeColorOverride("font_color", entries[i].Enabled
? new Color(1f, 1f, 1f, 1f) ? UiTokens.Ink
: new Color(0.5f, 0.5f, 0.5f, 1f)); : UiTokens.Faint);
label.MouseFilter = MouseFilterEnum.Stop; label.MouseFilter = MouseFilterEnum.Stop;
label.Position = new Vector2(PADDING + 24, PADDING + i * ITEM_HEIGHT + CURSOR_OFFSET_Y); label.Position = new Vector2(PADDING + 24, PADDING + i * ITEM_HEIGHT + CURSOR_OFFSET_Y);
label.Size = new Vector2(width - PADDING * 2 - 24, ITEM_HEIGHT); label.Size = new Vector2(width - PADDING * 2 - 24, ITEM_HEIGHT);
+5 -1
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.FFBattle.UI namespace Cthangover.FFBattle.UI
@@ -25,7 +26,10 @@ namespace Cthangover.FFBattle.UI
/// <summary>Raised when a player widget is clicked — routed to <see cref="FFBattleCore"/> for character selection.</summary> /// <summary>Raised when a player widget is clicked — routed to <see cref="FFBattleCore"/> for character selection.</summary>
public event System.Action<FFCharacterWidget> OnWidgetClicked; public event System.Action<FFCharacterWidget> OnWidgetClicked;
protected override void Construct() { } protected override void Construct()
{
CthangoverTheme.Apply(this);
}
/// <summary> /// <summary>
/// Creates <see cref="FFCharacterWidget"/> instances for each player, scales /// Creates <see cref="FFCharacterWidget"/> instances for each player, scales