diff --git a/manifest.json b/manifest.json index 7df5310..f1ce712 100644 --- a/manifest.json +++ b/manifest.json @@ -8,5 +8,5 @@ "sources": [ "src/**/*.cs" ], - "depends": [ "core>=1", "interface>=1", "turn_battle_base>=1" ] + "depends": [ "visual_novel_core>=1", "interface>=1", "turn_battle_base>=1" ] } diff --git a/scenes/ff_character_widget.tscn b/scenes/ff_character_widget.tscn index 49f25bf..3316aa2 100644 --- a/scenes/ff_character_widget.tscn +++ b/scenes/ff_character_widget.tscn @@ -28,7 +28,7 @@ offset_top = 218.0 offset_right = 176.0 offset_bottom = 236.0 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="."] layout_mode = 0 @@ -37,7 +37,7 @@ offset_top = 218.0 offset_right = 176.0 offset_bottom = 236.0 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="."] layout_mode = 0 diff --git a/scenes/ff_menu_panel.tscn b/scenes/ff_menu_panel.tscn index 23979f1..a4f83ef 100644 --- a/scenes/ff_menu_panel.tscn +++ b/scenes/ff_menu_panel.tscn @@ -13,9 +13,9 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 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 anchors_preset = 15 anchor_right = 1.0 @@ -27,11 +27,10 @@ offset_top = -3.0 offset_right = 3.0 offset_bottom = 3.0 mouse_filter = 2 -color = Color(0.3, 0.5, 0.9, 0.9) [node name="Cursor" type="Label" parent="."] text = "►" mouse_filter = 2 visible = false 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) diff --git a/src/Actions/FFAttackAnimation.cs b/src/Actions/FFAttackAnimation.cs index 0f1490f..6581038 100644 --- a/src/Actions/FFAttackAnimation.cs +++ b/src/Actions/FFAttackAnimation.cs @@ -1,8 +1,9 @@ -using Cthangover.Core.Battle; +using Cthangover.Core.Battle; using Cthangover.Core.Battle.Actions; using Cthangover.Core.Characters; using Cthangover.TurnBattle; using Cthangover.FFBattle.UI; +using Cthangover.Core.UI.Theming; using Godot; namespace Cthangover.FFBattle.Actions @@ -70,7 +71,7 @@ namespace Cthangover.FFBattle.Actions 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); if (result.Target.Damage > 0) @@ -115,3 +116,4 @@ namespace Cthangover.FFBattle.Actions } } } + diff --git a/src/Actions/FFDefendAnimation.cs b/src/Actions/FFDefendAnimation.cs index 9961a87..7ecc137 100644 --- a/src/Actions/FFDefendAnimation.cs +++ b/src/Actions/FFDefendAnimation.cs @@ -1,8 +1,9 @@ -using Cthangover.Core.Battle; +using Cthangover.Core.Battle; using Cthangover.Core.Battle.Actions; using Cthangover.Core.Characters; using Cthangover.TurnBattle; using Cthangover.FFBattle.UI; +using Cthangover.Core.UI.Theming; using Godot; namespace Cthangover.FFBattle.Actions @@ -70,7 +71,7 @@ namespace Cthangover.FFBattle.Actions 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) ShowDamageBehaviour.SpawnDefence(result.Target.Defence, Target, Target.GlobalPosition); @@ -113,3 +114,4 @@ namespace Cthangover.FFBattle.Actions } } } + diff --git a/src/Actions/FFItemAnimation.cs b/src/Actions/FFItemAnimation.cs index a5fa81f..63b5e16 100644 --- a/src/Actions/FFItemAnimation.cs +++ b/src/Actions/FFItemAnimation.cs @@ -1,6 +1,7 @@ -using Cthangover.Core.Characters; +using Cthangover.Core.Characters; using Cthangover.Core.Items; using Cthangover.FFBattle.UI; +using Cthangover.Core.UI.Theming; using Godot; namespace Cthangover.FFBattle.Actions @@ -84,7 +85,7 @@ namespace Cthangover.FFBattle.Actions var localTarget = Target.GlobalPosition - Source.Position; var iconStart = Source.GlobalPosition - Source.Position + new Vector2(20, -70); _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) @@ -96,7 +97,7 @@ namespace Cthangover.FFBattle.Actions Source.UpdateInfo(); Target.UpdateInfo(); - Target.Flash(new Color(0.5f, 1f, 0.5f, 1f), 0.3f); + Target.Flash(UiTokens.Success, 0.3f); } if (progress >= 1f) @@ -139,3 +140,5 @@ namespace Cthangover.FFBattle.Actions } } } + + diff --git a/src/FFBattleCore.cs b/src/FFBattleCore.cs index eebdd33..0b5d733 100644 --- a/src/FFBattleCore.cs +++ b/src/FFBattleCore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -10,6 +10,7 @@ using Cthangover.Core.Settings; using Cthangover.Core.Scenes; using Cthangover.Core.Utils; using Cthangover.FFBattle.UI; +using Cthangover.Core.UI.Theming; using Godot; namespace Cthangover.FFBattle @@ -254,7 +255,7 @@ namespace Cthangover.FFBattle foreach (var widget in _playerPanel.Widgets) 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) @@ -427,13 +428,13 @@ namespace Cthangover.FFBattle { foreach (var widget in _playerPanel.Widgets) if (!widget.IsDead) - widget.Highlight(new Color(0.3f, 1f, 0.3f, 0.5f)); + widget.Highlight(UiTokens.Alpha(UiTokens.Success, 0.5f)); } else { foreach (var widget in _enemyPanel.Widgets) if (!widget.IsDead) - widget.Highlight(new Color(1f, 0.3f, 0.3f, 0.5f)); + widget.Highlight(UiTokens.Alpha(UiTokens.Danger, 0.5f)); } _onTargetSelected = null; @@ -868,3 +869,6 @@ namespace Cthangover.FFBattle public void AdvancePlayerTurn() => OnPlayerTurnEnd(); } } + + + diff --git a/src/UI/FFCharacterWidget.cs b/src/UI/FFCharacterWidget.cs index bb4b1b7..f682004 100644 --- a/src/UI/FFCharacterWidget.cs +++ b/src/UI/FFCharacterWidget.cs @@ -3,6 +3,7 @@ using Cthangover.Core.Mods; using Cthangover.Core.Mods.Resolvers; using Cthangover.Core.Characters; using Cthangover.Core.UI; +using Cthangover.Core.UI.Theming; using Godot; namespace Cthangover.FFBattle.UI @@ -40,6 +41,8 @@ namespace Cthangover.FFBattle.UI protected override void Construct() { + CthangoverTheme.Apply(this); + _sprite = GetNode("Sprite"); _hpBg = GetNode("HpBg"); _hpFill = GetNode("HpFill"); @@ -58,7 +61,7 @@ namespace Cthangover.FFBattle.UI _selection.Texture = _cachedSelectTex; _selection.ExpandMode = TextureRect.ExpandModeEnum.IgnoreSize; _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); if (hpPercent > 0.5f) - _hpFill.Color = new Color(0.1f, 0.85f, 0.1f, 1f); + _hpFill.Color = UiTokens.HpOk; else if (hpPercent > 0.25f) - _hpFill.Color = new Color(0.85f, 0.85f, 0.1f, 1f); + _hpFill.Color = UiTokens.Warning; else - _hpFill.Color = new Color(0.85f, 0.1f, 0.1f, 1f); + _hpFill.Color = UiTokens.HpLow; } /// Shows a coloured selection overlay with a 0.15s tween fade-in. Used for target highlighting and selection indication. @@ -121,7 +124,7 @@ namespace Cthangover.FFBattle.UI _animTween?.Kill(); _animTween = CreateTween(); _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); } /// Rapidly oscillates the widget's position with random offsets (6 iterations) to simulate impact feedback. diff --git a/src/UI/FFEnemyPanel.cs b/src/UI/FFEnemyPanel.cs index 5e4fed5..c7edf5d 100644 --- a/src/UI/FFEnemyPanel.cs +++ b/src/UI/FFEnemyPanel.cs @@ -4,6 +4,7 @@ using System.Linq; using Cthangover.Core.Characters; using Cthangover.Core.Scenes; using Cthangover.Core.UI; +using Cthangover.Core.UI.Theming; using Godot; namespace Cthangover.FFBattle.UI @@ -32,7 +33,10 @@ namespace Cthangover.FFBattle.UI /// Raised when an enemy widget is clicked (used for target selection). public event System.Action OnEnemyClicked; - protected override void Construct() { } + protected override void Construct() + { + CthangoverTheme.Apply(this); + } /// Number of enemy widget instances currently managed (including dead). public int EnemyCount => Widgets.Count; diff --git a/src/UI/FFMenuPanel.cs b/src/UI/FFMenuPanel.cs index d790e97..0fbe4a5 100644 --- a/src/UI/FFMenuPanel.cs +++ b/src/UI/FFMenuPanel.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Cthangover.Core.UI; +using Cthangover.Core.UI.Theming; using Godot; namespace Cthangover.FFBattle.UI @@ -36,7 +37,7 @@ namespace Cthangover.FFBattle.UI public partial class FFMenuPanel : ModWidget { private ColorRect _background; - private ColorRect _border; + private Panel _border; private Label _cursorLabel; private List