Compare commits
3
Commits
0a32c0756c
...
914849d9eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
914849d9eb | ||
|
|
0bc9040c28 | ||
|
|
f11cbbb651 |
No files matched your search
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
"test_sources": [
|
"test_sources": [
|
||||||
"tests/*.cs"
|
"tests/*.cs"
|
||||||
],
|
],
|
||||||
"depends": [ "visual_novel_core>=1", "interface>=1", "items_base>=1", "time_base>=1" ],
|
"depends": [ "cthangover_game>=1", "ui_base>=1", "items_base>=1", "time_base>=1" ],
|
||||||
"ui": [
|
"ui": [
|
||||||
{
|
{
|
||||||
"id": "cooking_workbench",
|
"id": "cooking_workbench",
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
"src/*.cs"
|
"src/*.cs"
|
||||||
],
|
],
|
||||||
"depends": [
|
"depends": [
|
||||||
"visual_novel_core>=1",
|
"cthangover_game>=1",
|
||||||
"items_base>=1",
|
"items_base>=1",
|
||||||
"interface>=1",
|
"ui_base>=1",
|
||||||
"dialog_base>=1"
|
"dialog_base>=1"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -435,7 +435,7 @@ namespace Mods.CookingWalkTest
|
|||||||
{
|
{
|
||||||
// IDialogBox — контракт ядра без Node-членов; сам бокс живёт
|
// IDialogBox — контракт ядра без Node-членов; сам бокс живёт
|
||||||
// под concrete-узлом DialogBox в дереве.
|
// под concrete-узлом DialogBox в дереве.
|
||||||
var box = (dialogBox as Node)?.FindChild("AnswerBox", true, false) as Control;
|
var box = FindAnswerBox(dialogBox as Node);
|
||||||
if (box == null)
|
if (box == null)
|
||||||
throw new CheckException("AnswerBox node not found under dialog box");
|
throw new CheckException("AnswerBox node not found under dialog box");
|
||||||
var content = box.FindChild("Content", true, false);
|
var content = box.FindChild("Content", true, false);
|
||||||
@@ -451,6 +451,30 @@ namespace Mods.CookingWalkTest
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ищет показанный AnswerBox по типу, а не по имени узла: прошлый бокс
|
||||||
|
/// освобождается через QueueFree при скрытии, и если следующий вопрос
|
||||||
|
/// открывается в том же кадре, новый бокс получает автоимя
|
||||||
|
/// (<c>@Control@N</c>), а старый с именем «AnswerBox» уже помечен на удаление.
|
||||||
|
/// </summary>
|
||||||
|
private static Cthangover.Mods.Dialog.AnswerBox FindAnswerBox(Node node)
|
||||||
|
{
|
||||||
|
if (node == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
foreach (var child in node.GetChildren())
|
||||||
|
{
|
||||||
|
if (child is Cthangover.Mods.Dialog.AnswerBox box && !box.IsQueuedForDeletion() && box.Visible)
|
||||||
|
return box;
|
||||||
|
|
||||||
|
var found = FindAnswerBox(child);
|
||||||
|
if (found != null)
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private bool TryGetDialogBox(out IDialogBox box)
|
private bool TryGetDialogBox(out IDialogBox box)
|
||||||
{
|
{
|
||||||
var node = SceneContextNode.FindNode<Node>("DialogBox");
|
var node = SceneContextNode.FindNode<Node>("DialogBox");
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace Cthangover.Cooking.Tests
|
|||||||
ModAssert.NotNull(raw, "manifest.json exists");
|
ModAssert.NotNull(raw, "manifest.json exists");
|
||||||
using var doc = JsonDocument.Parse(raw);
|
using var doc = JsonDocument.Parse(raw);
|
||||||
var depends = doc.RootElement.GetProperty("depends");
|
var depends = doc.RootElement.GetProperty("depends");
|
||||||
var found = new[] { "visual_novel_core", "interface", "items_base", "time_base" };
|
var found = new[] { "cthangover_game", "ui_base", "items_base", "time_base" };
|
||||||
foreach (var dep in found)
|
foreach (var dep in found)
|
||||||
{
|
{
|
||||||
var ok = false;
|
var ok = false;
|
||||||
|
|||||||
Reference in new issue
Block a user