Localization in es, zh, ja, ko, vi; novel editor hub removed (its collection is gone, tools open from the menu and the toolbar)

This commit is contained in:
cthangover committed 2026-10-23 20:54:37 +02:00
1 parent e1a1d770cf
commit 3ddb61d61e
19 files changed
+1714 -282

No files matched your search

-79
View File
@@ -1,79 +0,0 @@
namespace Cthangover.Tools.Hub
{
using Cthangover.Core.Scenes;
using Cthangover.Core.UI.Theming;
using Cthangover.Core.UI.Tool;
using Cthangover.Core.Utils;
using Cthangover.Mods.Interface.Theming;
using Godot;
/// <summary>
/// Launcher screen of the <c>novel_editor</c> collection, entered as its
/// logical entry scene. Lists every registered tool the same way the main
/// menu does — each <see cref="IToolProvider"/> appends its own button via
/// <see cref="IToolProvider.AddMenuButton"/> — so a new editor shows up here
/// without touching this screen. Tool windows open on the tree root and
/// survive scene switches (playing a scenario, returning to the menu).
/// </summary>
public partial class NovelEditorHub : Control
{
/// <summary>Logical scene name; the collection's <c>entry.scene</c>.</summary>
public const string SceneName = "novel_editor";
private const int PanelWidth = 420;
public override void _Ready()
{
CthangoverTheme.Apply(this);
AddChild(new ColorRect
{
Color = UiTokens.Page,
MouseFilter = MouseFilterEnum.Ignore,
AnchorRight = 1f,
AnchorBottom = 1f,
});
var center = new CenterContainer { AnchorRight = 1f, AnchorBottom = 1f };
AddChild(center);
var panel = new PanelContainer { CustomMinimumSize = new Vector2(PanelWidth, 0) };
var frame = UiKit.Frame(UiTokens.RadiusLg, UiTokens.Surface1, UiTokens.Line);
frame.SetContentMarginAll(UiTokens.Space8);
panel.AddThemeStyleboxOverride("panel", frame);
center.AddChild(panel);
var column = UiKit.Column(UiTokens.Space5);
panel.AddChild(column);
column.AddChild(UiKit.Label(Tr("tools/hub/title").ToUpperInvariant(), UiTokens.FontTitle, UiTokens.InkBright));
var hint = UiKit.Hint(Tr("tools/hub/hint"));
hint.AutowrapMode = TextServer.AutowrapMode.WordSmart;
column.AddChild(hint);
column.AddChild(new HSeparator());
column.AddChild(UiKit.SectionTitle(Tr("tools/hub/editors"), UiTokens.FontSmall));
var tools = UiKit.Column(UiTokens.Space2);
tools.MouseFilter = MouseFilterEnum.Pass;
column.AddChild(tools);
foreach (var tool in ToolFactory.Instance.GetAll())
tool.AddMenuButton(tools);
if (tools.GetChildCount() == 0)
column.AddChild(UiKit.EmptyState(Tr("tools/hub/empty")));
column.AddChild(new HSeparator());
var menu = UiKit.Button(Tr("tools/hub/main_menu"));
menu.Pressed += OnMainMenuPressed;
column.AddChild(menu);
GameLogger.Log("TOOLS", $"Novel editor hub: {tools.GetChildCount()} tool button(s)");
}
private void OnMainMenuPressed()
{
GetNodeOrNull<GodotSceneService>("/root/GodotSceneService")?.SwitchToMenu();
}
}
}
-26
View File
@@ -1,26 +0,0 @@
namespace Cthangover.Tools.Hub
{
using Cthangover.Core.Mods;
using Cthangover.Core.Scenes;
/// <summary>
/// Lifecycle entry point of the tools mod. Publishes the logical scene
/// <see cref="NovelEditorHub.SceneName"/>, the entry scene of the
/// <c>novel_editor</c> collection: launching that collection from the game
/// picker goes through the regular new-game flow and lands on the editor
/// launcher instead of a story scene.
/// </summary>
public class ToolsInitializer : IModInitializer
{
private const string HubScenePath = "scenes/novel_editor_hub.tscn";
public void OnModLoaded(string modId)
{
}
public void OnModResourcesReady()
{
SceneRouteRegistry.Register(NovelEditorHub.SceneName, HubScenePath, fade: false);
}
}
}
+2 -2
View File
@@ -321,8 +321,8 @@ namespace Cthangover.Core.UI.Tool.ScenarioEditor
Visible = false;
// The screen the editor was opened from (the novel_editor hub, a
// mod menu) is freed by the shell load below; remember its route so
// The screen the editor was opened from (a mod menu, a mod
// route) is freed by the shell load below; remember its route so
// the play-test returns there instead of to the engine's main menu.
var sceneService = GetNodeOrNull<GodotSceneService>("/root/GodotSceneService");
var current = sceneService?.CurrentGodotSceneName;
+1 -1
View File
@@ -4,7 +4,7 @@ using Godot;
namespace Cthangover.Tools.SceneEditor
{
/// <summary>Registers the scene editor as a tool window (hub, main menu tools, in-game toolbox).</summary>
/// <summary>Registers the scene editor as a tool window (main menu tools, in-game toolbox).</summary>
public class SceneEditorToolProvider : IToolProvider
{
/// <summary>Unique tool identifier.</summary>