Add mod documentation in seven languages

This commit is contained in:
cthangover committed 2026-10-29 09:26:23 +01:00
1 parent 90ce5fad8c
commit 307da15a12
28 files changed
+540 -18

No files matched your search

+3
View File
@@ -22,6 +22,7 @@ namespace Cthangover.Mods.Interface.Menu
private ISettingsPanel _settingsPanel;
private ISaveLoadPanel _saveLoadPanel;
private Button _saveBtn;
private Label _title;
private readonly Dictionary<Button, string> _btnKeys = new();
/// <summary>Wires menu buttons, instantiates the hidden settings and save/load panels from the <see cref="MenuRegistry"/>, and subscribes to language changes.</summary>
@@ -42,6 +43,7 @@ namespace Cthangover.Mods.Interface.Menu
_btnKeys[GetNode<Button>("Panel/Margin/VBox/SettingsBtn")] = "menu/settings";
_btnKeys[GetNode<Button>("Panel/Margin/VBox/MainMenuBtn")] = "menu/main_menu";
_btnKeys[GetNode<Button>("Panel/Margin/VBox/ExitBtn")] = "menu/exit";
_title = GetNode<Label>("Panel/Margin/VBox/Title");
AttachPanel(MenuRegistry.OpenPanel("settings"));
AttachPanel(MenuRegistry.OpenPanel("save_load"));
@@ -92,6 +94,7 @@ namespace Cthangover.Mods.Interface.Menu
{
foreach (var kv in _btnKeys)
kv.Key.Text = TranslationServer.Translate(kv.Value);
_title.Text = TranslationServer.Translate("menu/title");
}
private void OnReturnClick()
+18 -3
View File
@@ -99,15 +99,30 @@ namespace Cthangover.Mods.Interface.View
{
var result = layerName?.ToLowerInvariant() switch
{
"background" => InteractiveLayerBackground ??= CreateLayerDirect("InteractiveLayer_Background", 1),
"foreground" => InteractiveLayerForeground ??= CreateLayerDirect("InteractiveLayer_Foreground", 3),
"background" => InteractiveLayerBackground ??= CreateSceneLayer("InteractiveLayer_Background"),
"foreground" => InteractiveLayerForeground ??= CreateSceneLayer("InteractiveLayer_Foreground"),
"ui" => InteractiveLayerUI ??= CreateLayerDirect("InteractiveLayer_UI", 5),
_ => InteractiveLayerForeground ??= CreateLayerDirect("InteractiveLayer_Foreground", 3)
_ => InteractiveLayerForeground ??= CreateSceneLayer("InteractiveLayer_Foreground")
};
return result;
}
/// <summary>
/// Creates a layer that belongs to the picture itself. It keeps the default
/// z index and is ordered by its place among the ViewBox children instead: a
/// z index is global to the canvas, so it lifted scene objects over the dialog
/// box, the toolbar and the open panels that follow the ViewBox in the tree.
/// The background layer stays below the foreground one whichever comes first.
/// </summary>
private Control CreateSceneLayer(string name)
{
var layer = CreateLayerDirect(name, 0);
if (InteractiveLayerForeground != null)
MoveChild(layer, InteractiveLayerForeground.GetIndex());
return layer;
}
private Control CreateLayerDirect(string name, int zIndex)
{
var layer = new Control