diff --git a/locale/ui_en.properties b/locale/ui_en.properties index e678674..e75ace5 100644 --- a/locale/ui_en.properties +++ b/locale/ui_en.properties @@ -1,6 +1,6 @@ # --- scenes/battle/winground.tscn --- -mod_interface_name = Interface -mod_interface_desc = Engine UI subsystem: widget toolkit (Widget/ModWidget/lists), ViewBox background viewport, ToolBox toolbar, GameMenu/SaveIcon, notification panels, UiKit design system and DeviceInput. +mod_ui_base_name = UI +mod_ui_base_desc = Engine UI subsystem: widget toolkit (Widget/ModWidget/lists), ViewBox background viewport, ToolBox toolbar, GameMenu/SaveIcon, notification panels, UiKit design system and DeviceInput. ui/battle/victory = Victory ui/battle/victory/return = Continue ui/battle/victory/loot_title = Loot: diff --git a/locale/ui_ru.properties b/locale/ui_ru.properties index 4b6db4e..12997af 100644 --- a/locale/ui_ru.properties +++ b/locale/ui_ru.properties @@ -258,8 +258,8 @@ ui/journal/entry_of = Запись {0} из {1} ui/journal/finished = Завершено ui/journal/seals = Печати ui/journal/no_entries = Страницы этой записи ещё пусты. Чернила появятся, когда история сдвинется с места. -mod_interface_name = Интерфейс -mod_interface_desc = Подсистема UI движка: набор виджетов (Widget/ModWidget, списки), ViewBox фона, тулбар ToolBox, GameMenu/SaveIcon, панели уведомлений, дизайн-система UiKit и DeviceInput. Ядро работает с модом через контракты IWidget/IToolbarHost и мосты. +mod_ui_base_name = Интерфейс +mod_ui_base_desc = Подсистема UI движка: набор виджетов (Widget/ModWidget, списки), ViewBox фона, тулбар ToolBox, GameMenu/SaveIcon, панели уведомлений, дизайн-система UiKit и DeviceInput. Ядро работает с модом через контракты IWidget/IToolbarHost и мосты. tools/unsaved_title = Есть изменения tools/unsaved_text = У вас есть несохранённые изменения. Закрыть без сохранения? diff --git a/manifest.json b/manifest.json index 9debc69..36ab7d5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { - "id": "interface", - "name": "Interface", + "id": "ui_base", + "name": "UI", "version": "1.0.0", "author": "ct", "description": "Engine UI subsystem: widget toolkit (Widget/ModWidget/lists), ViewBox background viewport, ToolBox toolbar, GameMenu/SaveIcon, notification panels, UiKit design system, DeviceInput. Kernel keeps only contracts (IWidget, IDialogBox, IToolbarHost, ISaveIconHost, IBackgroundView, IUiLazyConstruct, MenuRegistry, ToolFactory, NotificationBuffer, SceneEventController, CthangoverTheme/UiTokens boot styling) and drives this mod through those seams.", @@ -8,5 +8,19 @@ "depends": [], "sources": [ "src/**/*.cs" + ], + "ui": [ + { + "id": "game_menu", + "kind": "panel", + "slot": "ModBeforeUIPanel", + "scene_path": "scenes/menu/game_menu.tscn", + "button": { + "icon": "settings", + "locale": "menu/settings", + "index": 50 + }, + "priority": 10 + } ] } diff --git a/scenes/menu/game_menu.tscn b/scenes/menu/game_menu.tscn new file mode 100644 index 0000000..cab4dc3 --- /dev/null +++ b/scenes/menu/game_menu.tscn @@ -0,0 +1,90 @@ +[gd_scene load_steps=2 format=3] + +[ext_resource type="Script" path="res://mods/ui_base/src/Menu/GameMenu.cs" id="GameMenuScript"] + +[node name="GameMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 1 +script = ExtResource("GameMenuScript") + +[node name="Bg" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 0.9) + +[node name="Panel" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -200.0 +offset_top = -220.0 +offset_right = 200.0 +offset_bottom = 220.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Margin" type="MarginContainer" parent="Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 28 +theme_override_constants/margin_top = 20 +theme_override_constants/margin_right = 28 +theme_override_constants/margin_bottom = 20 + +[node name="VBox" type="VBoxContainer" parent="Panel/Margin"] +layout_mode = 2 +theme_override_constants/separation = 10 + +[node name="Title" type="Label" parent="Panel/Margin/VBox"] +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +theme_override_colors/font_color = Color(0.956863, 0.941176, 0.905882, 1) +text = "Меню" +horizontal_alignment = 1 +uppercase = true + +[node name="ReturnBtn" type="Button" parent="Panel/Margin/VBox"] +layout_mode = 2 +text = "Вернуться" +theme_type_variation = "CthangoverPrimary" + +[node name="SaveBtn" type="Button" parent="Panel/Margin/VBox"] +layout_mode = 2 +text = "Сохранить" + +[node name="LoadBtn" type="Button" parent="Panel/Margin/VBox"] +layout_mode = 2 +text = "Загрузить" + +[node name="SettingsBtn" type="Button" parent="Panel/Margin/VBox"] +layout_mode = 2 +text = "Настройки" + +[node name="Spacer" type="Control" parent="Panel/Margin/VBox"] +layout_mode = 2 +custom_minimum_size = Vector2(0, 16) + +[node name="MainMenuBtn" type="Button" parent="Panel/Margin/VBox"] +layout_mode = 2 +text = "Главное меню" + +[node name="ExitBtn" type="Button" parent="Panel/Margin/VBox"] +layout_mode = 2 +text = "Выход" +theme_type_variation = "CthangoverDanger" diff --git a/scenes/ui/message.tscn b/scenes/ui/message.tscn new file mode 100644 index 0000000..ad3a25e --- /dev/null +++ b/scenes/ui/message.tscn @@ -0,0 +1,18 @@ +[gd_scene format=3] + +[ext_resource type="Script" path="res://mods/ui_base/src/Messages/UiMessage.cs" id="1_msg"] + +[node name="Message" type="Control" node_paths=PackedStringArray("textField")] +layout_mode = 3 +anchors_preset = 0 +script = ExtResource("1_msg") +textField = NodePath("Label") + +[node name="Label" type="Label" parent="."] +layout_mode = 0 +offset_left = 0.0 +offset_top = 0.0 +offset_right = 0.0 +offset_bottom = 0.0 +theme_override_colors/font_color = Color(0.909804, 0.898039, 0.870588, 1) +text = "" diff --git a/src/Menu/GameMenu.cs b/src/Menu/GameMenu.cs index eea7b4c..72e05d6 100644 --- a/src/Menu/GameMenu.cs +++ b/src/Menu/GameMenu.cs @@ -8,7 +8,7 @@ namespace Cthangover.Mods.Interface.Menu /// /// In-game pause menu: save/load/settings/quit. The settings and save/load /// panels are not referenced by type: they are registered in the - /// (by the base_menu mod or any other mod + /// (by the menu_base mod or any other mod /// that wants to provide them) and instantiated here by id, so the panel /// implementations can live entirely inside mods. Both panels stay hidden /// children created on _Ready to avoid loading delays when the player opens diff --git a/src/Theming/UiKit.cs b/src/Theming/UiKit.cs index 531b635..3d25dc8 100644 --- a/src/Theming/UiKit.cs +++ b/src/Theming/UiKit.cs @@ -268,7 +268,7 @@ namespace Cthangover.Mods.Interface.Theming /// backdrop let scene buttons bleed through, which made the panel close /// buttons look noisy; an opaque backing removes them. The colour stays /// underneath as a fallback because the texture ships in the optional - /// "interface" mod and may not resolve, in which case the panel still + /// "ui_base" mod and may not resolve, in which case the panel still /// gets a solid surface. /// public static void ApplyPanelBackdrop(ColorRect backdrop)