ui stule update

This commit is contained in:
cthangover committed 2026-09-26 08:05:13 +03:00
1 parent e2b4f7a1c1
commit 2b2c70d0ac
5 files changed
+21 -18

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@
"sources": [
"src/*.cs"
],
"depends": [ "core>=1", "interface>=1" ],
"depends": [ "visual_novel_core>=1", "interface>=1" ],
"ui": [
{
"id": "cooking_workbench",
+2 -2
View File
@@ -29,10 +29,10 @@ custom_minimum_size = Vector2(100, 30)
[node name="TxtName" type="Label" parent="HBox"]
size_flags_horizontal = 3
theme_override_colors/font_color = Color(1, 1, 0, 1)
theme_override_colors/font_color = Color(0.941176, 0.756863, 0.411765, 1)
theme_override_font_sizes/font_size = 12
[node name="TxtTime" type="Label" parent="HBox"]
custom_minimum_size = Vector2(40, 30)
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_colors/font_color = Color(0.909804, 0.662745, 0.670588, 1)
theme_override_font_sizes/font_size = 12
+6 -5
View File
@@ -1,6 +1,7 @@
using Cthangover.Core.Items;
using Cthangover.Core.Settings;
using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Cthangover.Core.Utils;
using Godot;
@@ -15,8 +16,8 @@ namespace Mods.Cooking.Workbench
/// </summary>
public class RecipeIconItemBehaviour : Widget
{
private static readonly Color NormalColor = Colors.White;
private static readonly Color NotItemsColor = Colors.Gray;
private static readonly Color NormalColor = UiTokens.InkBright;
private static readonly Color NotItemsColor = UiTokens.Muted;
private TextureRect img;
private Label txt;
@@ -53,8 +54,8 @@ namespace Mods.Cooking.Workbench
/// <summary>
/// Evaluates whether the player's inventory contains enough of the
/// required ingredient. Tints the icon and count text to
/// <c>NormalColor</c> (white) when satisfied or <c>NotItemsColor</c>
/// (grey) when insufficient. Called by the parent
/// <c>NormalColor</c> (bright ink) when satisfied or <c>NotItemsColor</c>
/// (muted) when insufficient. Called by the parent
/// <see cref="RecipeItemBehaviour"/> during state refresh.
/// </summary>
/// <returns><c>true</c> if inventory meets or exceeds the required count.</returns>
@@ -62,7 +63,7 @@ namespace Mods.Cooking.Workbench
{
var result = GameData.Instance.Runtime.Inventory.CheckCount(ingredient.Item) >= ingredient.Count;
txt.AddThemeColorOverride("font_color", result ? NormalColor : NotItemsColor);
img.Modulate = result ? Colors.White : NotItemsColor;
img.Modulate = result ? UiTokens.White : NotItemsColor;
return result;
}
}
+9 -8
View File
@@ -3,6 +3,7 @@ using Cthangover.Core.Items;
using Cthangover.Core.Scenes;
using Cthangover.Core.Settings;
using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Godot;
namespace Mods.Cooking.Workbench
@@ -25,9 +26,9 @@ namespace Mods.Cooking.Workbench
private Label txtTime;
private HBoxContainer recipeContentHbox;
private static readonly Color normalColor = new(1f, 1f, 1f, 1f);
private static readonly Color selectedColor = new(0.8f, 0.8f, 0.8f, 1f);
private static readonly Color disableColor = new(0.5f, 0.5f, 0.5f, 1f);
private static readonly Color normalColor = UiTokens.White;
private static readonly Color selectedColor = UiTokens.Alpha(UiTokens.White, 0.8f);
private static readonly Color disableColor = UiTokens.Muted;
private IRecipe recipe;
private Node panel;
@@ -79,8 +80,8 @@ namespace Mods.Cooking.Workbench
/// Refreshes the visual availability state of this recipe.
/// Iterates all child <see cref="RecipeIconItemBehaviour"/> widgets,
/// calling <c>CheckAndUpdate</c> on each. If any ingredient is missing,
/// tints the name and time labels with <c>disableColor</c> (greyed out);
/// otherwise restores the default yellow/red colour scheme.
/// tints the name and time labels with <c>disableColor</c> (muted);
/// otherwise restores the accent (gold) and danger (red) colour scheme.
/// Call after inventory changes or cooking operations.
/// </summary>
public void UpdateState()
@@ -98,8 +99,8 @@ namespace Mods.Cooking.Workbench
}
else
{
txtName.AddThemeColorOverride("font_color", Colors.Yellow);
txtTime.AddThemeColorOverride("font_color", Colors.Red);
txtName.AddThemeColorOverride("font_color", UiTokens.AccentBright);
txtTime.AddThemeColorOverride("font_color", UiTokens.DangerText);
}
}
@@ -143,7 +144,7 @@ namespace Mods.Cooking.Workbench
{
var plus = new Label();
plus.Text = "+";
plus.AddThemeFontSizeOverride("font_size", 12);
plus.AddThemeFontSizeOverride("font_size", UiTokens.FontBodySmall);
plus.VerticalAlignment = VerticalAlignment.Center;
recipeContentHbox.AddChild(plus);
items.Add(plus);
+3 -2
View File
@@ -7,6 +7,7 @@ using Cthangover.Core.Items;
using Cthangover.Core.Scenes;
using Cthangover.Core.Settings;
using Cthangover.Core.UI;
using Cthangover.Core.UI.Theming;
using Cthangover.Core.UI.Tool;
using Cthangover.Core.UI.Inventory;
using Godot;
@@ -38,7 +39,7 @@ namespace Mods.Cooking.Workbench
var leftTitle = GetNode<Label>("HBox/LeftPanel/LeftTitle");
leftTitle.Text = TranslationServer.Translate("ui/cook/title");
leftTitle.AddThemeFontSizeOverride("font_size", 16);
leftTitle.AddThemeFontSizeOverride("font_size", UiTokens.FontLead);
content = GetNode<VBoxContainer>("HBox/LeftPanel/Scroll/Content");
@@ -109,7 +110,7 @@ namespace Mods.Cooking.Workbench
public void ClickRecipe(IRecipe recipe, RecipeItemBehaviour recipeItemBehaviour)
{
if (txtDescription != null)
txtDescription.Text = "[b][color=yellow]" + TranslationServer.Translate(recipe.Name) + "[/color][/b]\n\n" +
txtDescription.Text = "[b][color=#" + UiTokens.AccentBright.ToHtml(false) + "]" + TranslationServer.Translate(recipe.Name) + "[/color][/b]\n\n" +
TranslationServer.Translate(recipe.Description);
outputContainer.List = recipe.Output.Select(o => (IItemContainer)new ItemContainer