From 2d3f4761e759f2619874f38ec1414c8d28c3b3f1 Mon Sep 17 00:00:00 2001 From: iisaev Date: Sun, 18 Oct 2026 19:00:22 +0200 Subject: [PATCH] Mod naming rule and engine UI in engine mods Mods are renamed by role (shell2d_base, menu_base, ui_base, live2d_base, editor_tools, cthangover_story, cthangover_murakami, cthangover_party) and every reference follows. Engine UI prefabs (dialog, answers, message, game menu, inventory, map, skills) and their panel entries moved out of the story mod into the subsystem mods; the card_novel and vn_starter_novel collections are removed. --- manifest.json | 2 +- patches/scenes/ui/base_scene.tscn | 7 +- scenes/ui/answer_box.tscn | 26 +++++++ scenes/ui/answer_item.tscn | 30 +++++++++ scenes/ui/dialog_box.tscn | 105 +++++++++++++++++++++++++++++ scenes/ui/dialog_canvas.tscn | 12 ++++ src/UI/Executable/ScenarioEvent.cs | 2 +- test_suites/autoplay/manifest.json | 4 +- test_suites/gdscript/manifest.json | 2 +- 9 files changed, 183 insertions(+), 7 deletions(-) create mode 100644 scenes/ui/answer_box.tscn create mode 100644 scenes/ui/answer_item.tscn create mode 100644 scenes/ui/dialog_box.tscn create mode 100644 scenes/ui/dialog_canvas.tscn diff --git a/manifest.json b/manifest.json index 203decf..f361c92 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ "sources": [ "src/**/*.cs" ], - "depends": ["base2d>=1", "interactive_base>=1", "effects_base>=1", "time_base>=1", "map_base>=1", "interface>=1"], + "depends": ["shell2d_base>=1", "interactive_base>=1", "effects_base>=1", "time_base>=1", "map_base>=1", "ui_base>=1"], "ui": [], "test_suites": [ {"id": "autoplay", "activate": ["--choices=", "--timeout="]}, diff --git a/patches/scenes/ui/base_scene.tscn b/patches/scenes/ui/base_scene.tscn index ad37719..966e116 100644 --- a/patches/scenes/ui/base_scene.tscn +++ b/patches/scenes/ui/base_scene.tscn @@ -1,7 +1,10 @@ -[gd_scene load_steps=3 format=3] +[gd_scene load_steps=4 format=3] -[ext_resource type="PackedScene" path="res://mods/base2d/scenes/ui/base_scene.tscn" id="1_target"] +[ext_resource type="PackedScene" path="res://mods/shell2d_base/scenes/ui/base_scene.tscn" id="1_target"] [ext_resource type="Script" path="res://mods/dialog_base/src/UI/Executable/ExecutableMainEventChain.cs" id="2_chain"] +[ext_resource type="PackedScene" path="res://scenes/ui/dialog_canvas.tscn" id="3_dialog"] [node name="BaseScene" instance=ExtResource("1_target")] script = ExtResource("2_chain") + +[node name="DialogCanvas" parent="Scene" index="2" instance=ExtResource("3_dialog")] diff --git a/scenes/ui/answer_box.tscn b/scenes/ui/answer_box.tscn new file mode 100644 index 0000000..6f9af6b --- /dev/null +++ b/scenes/ui/answer_box.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=2 format=3] + +[ext_resource type="Script" path="res://mods/dialog_base/src/UI/Dialog/AnswerBox.cs" id="1_answerbox"] +[ext_resource type="PackedScene" path="res://mods/dialog_base/scenes/ui/answer_item.tscn" id="2_answeritem"] + +[node name="AnswerBox" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_answerbox") +itemScene = ExtResource("2_answeritem") +content = NodePath("Content") + +[node name="Content" type="VBoxContainer" parent="."] +layout_mode = 1 +anchor_left = 0.6 +anchor_top = 0.35 +anchor_right = 0.95 +anchor_bottom = 0.65 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +alignment = 1 diff --git a/scenes/ui/answer_item.tscn b/scenes/ui/answer_item.tscn new file mode 100644 index 0000000..696defe --- /dev/null +++ b/scenes/ui/answer_item.tscn @@ -0,0 +1,30 @@ +[gd_scene format=3 uid="uid://bv80qy227xxee"] + +[ext_resource type="Script" uid="uid://dbrnsck0vtfb3" path="res://mods/dialog_base/src/UI/Dialog/AnswerItem.cs" id="1_answeritem"] + +[node name="AnswerItem" type="Control" unique_id=1180917887] +custom_minimum_size = Vector2(0, 50) +layout_mode = 3 +anchors_preset = 0 +size_flags_horizontal = 3 +size_flags_vertical = 0 +script = ExtResource("1_answeritem") + +[node name="Button" type="Button" parent="." unique_id=2087954476] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="TextLabel" type="Label" parent="Button" unique_id=1302827224] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 22 +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/scenes/ui/dialog_box.tscn b/scenes/ui/dialog_box.tscn new file mode 100644 index 0000000..28f26e5 --- /dev/null +++ b/scenes/ui/dialog_box.tscn @@ -0,0 +1,105 @@ +[gd_scene format=3 uid="uid://b8vnxfoixyust"] + +[ext_resource type="Script" uid="uid://b41bti3wq4m88" path="res://mods/dialog_base/src/UI/Dialog/DialogBox.cs" id="1_dialogbox"] + +[ext_resource type="PackedScene" path="res://mods/dialog_base/scenes/ui/answer_box.tscn" id="2_answerbox"] + +[node name="DialogBox" type="Control" unique_id=702809053] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_dialogbox") +answerBoxScene = ExtResource("2_answerbox") + +[node name="DialogBody" type="ColorRect" parent="." unique_id=1510369637] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -300.0 +grow_horizontal = 2 +grow_vertical = 0 +color = Color(0.054902, 0.058824, 0.082353, 0.9) + +[node name="TextField" type="Label" parent="DialogBody" unique_id=2065569930] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 20.0 +offset_top = 10.0 +offset_right = -20.0 +offset_bottom = -10.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 24 +theme_override_colors/font_color = Color(0.909804, 0.898039, 0.870588, 1) +vertical_alignment = 1 +autowrap_mode = 2 + +[node name="FirstAvatar" type="TextureRect" parent="." unique_id=1696535122] +visible = false +texture_filter = 1 +layout_mode = 1 +anchors_preset = -1 +anchor_top = 0.6 +anchor_right = 0.13 +anchor_bottom = 1.0 +offset_left = 90.0 +offset_top = -300.0 +offset_right = 90.0 +offset_bottom = -300.0 +grow_horizontal = 0 +grow_vertical = 0 +expand_mode = 1 +stretch_mode = 4 + +[node name="SecondAvatar" type="TextureRect" parent="." unique_id=1913233391] +visible = false +texture_filter = 1 +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.87 +anchor_top = 0.6 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -90.0 +offset_top = -300.0 +offset_right = -90.0 +offset_bottom = -300.0 +grow_horizontal = 0 +grow_vertical = 0 +expand_mode = 1 +stretch_mode = 4 + +[node name="TitleBody" type="Control" parent="." unique_id=1986161675] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -400.0 +offset_top = -60.0 +offset_right = 400.0 +offset_bottom = 60.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="TitleField" type="Label" parent="TitleBody" unique_id=2046072321] +visible = false +layout_mode = 1 +anchors_preset = -1 +anchor_left = -0.5 +anchor_right = 1.5 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 28 +theme_override_colors/font_color = Color(0.956863, 0.941176, 0.905882, 1) +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/scenes/ui/dialog_canvas.tscn b/scenes/ui/dialog_canvas.tscn new file mode 100644 index 0000000..a116cc6 --- /dev/null +++ b/scenes/ui/dialog_canvas.tscn @@ -0,0 +1,12 @@ +[gd_scene format=3] + +[ext_resource type="Script" path="res://mods/dialog_base/src/UI/Dialog/DialogCanvas.cs" id="1_canvas"] + +[node name="DialogCanvas" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_canvas") diff --git a/src/UI/Executable/ScenarioEvent.cs b/src/UI/Executable/ScenarioEvent.cs index 7f3d3f5..1095a95 100644 --- a/src/UI/Executable/ScenarioEvent.cs +++ b/src/UI/Executable/ScenarioEvent.cs @@ -22,7 +22,7 @@ namespace Cthangover.Mods.Dialog.Executable /// dialog queue. Resolves the scenario path via convention: if ScenarioPath /// is set, uses that; otherwise searches all mods for a matching file name /// derived from the class name (stripping "Event" suffix), with a fallback - /// to res://mods/visual_novel_core/scenarios/. CustomMappings allows code to register + /// to res://mods/cthangover_story/scenarios/. CustomMappings allows code to register /// arbitrary class-to-path bindings for mod-provided scenarios. Supports /// inline ScenarioText for embedded scenarios that don't need a separate /// file. Checks conditions through ScenarioCondition.Evaluate before triggering. diff --git a/test_suites/autoplay/manifest.json b/test_suites/autoplay/manifest.json index 294ddc6..a330f50 100644 --- a/test_suites/autoplay/manifest.json +++ b/test_suites/autoplay/manifest.json @@ -1,10 +1,10 @@ { "name": "Test Runner", - "description": "Test harness mod: ports the integration DialogAutoDriver into an engine mod. Activated by --choices=/--timeout= user args; auto-plays the active dialog, prints [TEST_RESULT] and quits. Depends on visual_novel_core and dialog_base.", + "description": "Test harness mod: ports the integration DialogAutoDriver into an engine mod. Activated by --choices=/--timeout= user args; auto-plays the active dialog, prints [TEST_RESULT] and quits. Depends on cthangover_story and dialog_base.", "sources": [ "src/*.cs" ], "depends": [ - "visual_novel_core>=1" + "cthangover_story>=1" ] } diff --git a/test_suites/gdscript/manifest.json b/test_suites/gdscript/manifest.json index 5dbb35a..ff9592f 100644 --- a/test_suites/gdscript/manifest.json +++ b/test_suites/gdscript/manifest.json @@ -8,6 +8,6 @@ "scripts/*.gd" ], "depends": [ - "visual_novel_core>=1" + "cthangover_story>=1" ] }