diff --git a/.github/workflows/dev.build.yml b/.github/workflows/dev.build.yml index 6edc4beec0..ef405e0684 100644 --- a/.github/workflows/dev.build.yml +++ b/.github/workflows/dev.build.yml @@ -7,6 +7,7 @@ on: env: GMC_ENABLE_ON_PUBLISH: true + GMC_ONLY_DEFAULT_LANG: false GMC_DEV_URL: 'https://auronen.cokoliv.eu/gmc/' jobs: diff --git a/.github/workflows/master.build.yml b/.github/workflows/master.build.yml index 7ab67db47c..189a8ddef9 100644 --- a/.github/workflows/master.build.yml +++ b/.github/workflows/master.build.yml @@ -7,6 +7,7 @@ on: env: GMC_ENABLE_ON_PUBLISH: true + GMC_ONLY_DEFAULT_LANG: false jobs: deploy: diff --git a/.github/workflows/pull.request.yml b/.github/workflows/pull.request.yml index 33e67a00e4..5c3f09d053 100644 --- a/.github/workflows/pull.request.yml +++ b/.github/workflows/pull.request.yml @@ -7,6 +7,7 @@ on: env: GMC_ENABLE_ON_PUBLISH: true + GMC_ONLY_DEFAULT_LANG: false jobs: deploy: diff --git a/docs/zengin/scripts/extenders/index.md b/docs/zengin/scripts/extenders/index.md index 2217f9c320..4b0d99633c 100644 --- a/docs/zengin/scripts/extenders/index.md +++ b/docs/zengin/scripts/extenders/index.md @@ -1,4 +1,4 @@ # Daedalus extenders The default scripting language Daedalus can be quite limiting. Over the years the community created quite a few extenders to, well, extend the functionality. Before Union came along, the standard to interface with the engine was the script library [Ikarus](ikarus/index.md) and a collection of packages [LeGo](lego/index.md) built on top of that. Not so recently, an additional script packet was made (and is actively being worked on) [AF Script Packet](afsp/index.md) that offers even more functionality and is built on tom of Ikarus & LeGo. -With the adoption of Union and plugins the Union system can use a new extender emerged called [zParserExtender](../../scripts/extenders/zparserextender). Other Union plugins can, of course, implement their own external functions. +With the adoption of Union and plugins the Union system can use a new extender emerged called [zParserExtender](zparserextender/index.md). Other Union plugins can, of course, implement their own external functions. A lot of scripts are also scattered on the Gothic forums, and documentation of some of them can be found in the [Standalone](standalone/index.md) section. \ No newline at end of file diff --git a/docs/zengin/scripts/extenders/index.pl.md b/docs/zengin/scripts/extenders/index.pl.md index 61b9262ca1..0992559a0d 100644 --- a/docs/zengin/scripts/extenders/index.pl.md +++ b/docs/zengin/scripts/extenders/index.pl.md @@ -1,4 +1,4 @@ # Extendery Daedalusa Extendery to pakiety skryptowe rozszerzające składnię Daedalusa, która może być dosyć ograniczająca. Przez lata społeczność stworzyła całkiem sporo takich extenderów. Zanim pojawił się Union, standardową metodą na interfejs z silnikiem było wykorzystanie [Ikarusa](ikarus/index.md) i zbudowanej na jego bazie kolekcji pakietów [LeGo](lego/index.md). Nie tak niedawno powstał dodatkowy pakiet skryptowy (a prace nad nim wciąż trwają) [AF Script Packet](afsp/index.md), który oferuje jeszcze więcej funkcji i jest zbudowany na bazie Ikarusa i LeGo. -Wraz z pojawieniem się Uniona i jego systemu pluginów powstał nowy extender o nazwie [zParserExtender](../../scripts/extenders/zparserextender). Oczywiście również inne pluginy mogą implementować własne funkcje zewnętrzne. +Wraz z pojawieniem się Uniona i jego systemu pluginów powstał nowy extender o nazwie [zParserExtender](zparserextender/index.md). Oczywiście również inne pluginy mogą implementować własne funkcje zewnętrzne. Wiele skryptów jest również rozsianych po forach Gothicowych, a dokumentacje niektórych z nich można znaleźć w sekcji [Samodzielne](standalone/index.md). \ No newline at end of file diff --git a/docs/zengin/tools/index.md b/docs/zengin/tools/index.md index 25e5a314a8..4434a39252 100644 --- a/docs/zengin/tools/index.md +++ b/docs/zengin/tools/index.md @@ -15,12 +15,12 @@ The community has developed many tools to help with the creation of Gothic mods. - [Ninja](https://github.com/szapp/Ninja) - Ninja introduces the possibility of true modular modifications for the video games Gothic and Gothic 2 Night of the Raven. -**[VDFS tools](../general_info/vdfs)** +**[VDFS tools](../general_info/vdfs.md)** - [GothicVDFS](vdfs_tools/gothic_vdfs.md) - NiceDE's viewer, extractor and builder for `.vdf` and `.mod` volumes - [VDFS Tool](vdfs_tools/vdfs_tool.md) - Gratt's Union VDFS viewer, extractor, builder, optimizer and ZIP compressor for `.vdf` and `.mod` volumes -**[World Editors](../worlds)** +**[World Editors](../worlds/index.md)** - Spacer - the original world editor for ZenGin, ships with the MDK - [Union Gothic World Editor](https://worldofplayers.ru/threads/42322/) - Saturas' world editor, supports new object classes created with Union diff --git a/docs/zengin/tools/zSpy.md b/docs/zengin/tools/zSpy.md index 127fc1f29d..24b0bc05f8 100644 --- a/docs/zengin/tools/zSpy.md +++ b/docs/zengin/tools/zSpy.md @@ -2,7 +2,7 @@ **zSpy** is a debugging tool that displays most of the operations performed by the engine during the Gothic or Spacer running. ??? example "Example image of running zSpy" - ![zSpy](../../../overrides/assets/images/zSpy.png) + ![zSpy](../../assets/images/zSpy.png) !!! Warning zSpy must be started before Gothic or the Spacer is started so that the program can find it. Sometimes in Gothic I this has to be done manually, in Gothic II This is done by the GothicStarter_mod. diff --git a/docs/zengin/union/sdk/getting_started.md b/docs/zengin/union/sdk/getting_started.md index b09b18f593..2bf7f5d46e 100644 --- a/docs/zengin/union/sdk/getting_started.md +++ b/docs/zengin/union/sdk/getting_started.md @@ -83,7 +83,8 @@ void Game_Init() { } ``` -Now we can Build (F7) the project to create the DLL. If we have set up **Output Directory** before, the plugin will deploy directly to the game. Otherwise, we can copy it manually from `Bin` to `/System/Autorun/MyPlugin.dll`. When we launch the game, a MessageBox should appear right before the main menu: [https://i.imgur.com/JsAn8iR.png](https://i.imgur.com/JsAn8iR.png) +Now we can Build (F7) the project to create the DLL. If we have set up **Output Directory** before, the plugin will deploy directly to the game. Otherwise, we can copy it manually from `Bin` to `/System/Autorun/MyPlugin.dll`. When we launch the game, a MessageBox should appear right before the main menu: +![Union SDK MessageBox](../../../assets/images/union_sdk_getting_started_messagebox.png){ style='min-width: 0;' } #### Couldn't build the plugin? If you could not build the plugin or it crashed the game, you have to do some debugging and find the root cause of that. For compilation errors look at the Visual Studio **Output** tab and read the errors. diff --git a/docs/zengin/union/sdk/index.md b/docs/zengin/union/sdk/index.md index 98fdd77901..fe64a5a0d4 100644 --- a/docs/zengin/union/sdk/index.md +++ b/docs/zengin/union/sdk/index.md @@ -6,9 +6,9 @@ Working with Union SDK requires at least basic knowledge of C++ programming. Kno ## Requirements Union SDK requires Visual Studio IDE, NET Framework 4.7.2, and Visual C++ 2010 libraries. They are available on Microsoft websites: -* Visual Studio - [https://visualstudio.microsoft.com/pl/vs/](https://visualstudio.microsoft.com/pl/vs/) -* NET Framework 4.7.2 - [https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472) -* Visual C++ 2010 - [https://www.microsoft.com/en-us/download/details.aspx?id=26999](https://www.microsoft.com/en-us/download/details.aspx?id=26999) +* Visual Studio - [https://visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) +* NET Framework 4.7.2 - [https://dotnet.microsoft.com/download/dotnet-framework/net472](https://dotnet.microsoft.com/download/dotnet-framework/net472) +* Visual C++ 2010 - [https://www.microsoft.com/download/details.aspx?id=26999](https://www.microsoft.com/download/details.aspx?id=26999) ## Resource Manager The official installation of Union SDK is provided through [Resource Manager](https://worldofplayers.ru/threads/41415/). After the installation, Visual Studio will have a new project template "Union Plugin 1.0" that creates a basic Union plugin project. diff --git a/mkdocs.yml b/mkdocs.yml index 7cfaf9b3b8..c467799561 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -77,7 +77,7 @@ markdown_extensions: - pymdownx.caret - pymdownx.details - pymdownx.highlight: - use_pygments: !ENV [GMC_ENABLE_ON_PUBLISH, False] + use_pygments: true linenums: true anchor_linenums: true # This sets the same ID for the and tags, @@ -128,7 +128,7 @@ plugins: - assets/javascripts/extra.js - i18n: default_language: !ENV [GMC_DEFAULT_LANG, en] - default_language_only: !ENV [GMC_ONLY_DEFAULT_LANG, False] + default_language_only: !ENV [GMC_ONLY_DEFAULT_LANG, True] languages: en: name: en - English diff --git a/overrides/assets/images/union_sdk_getting_started_messagebox.png b/overrides/assets/images/union_sdk_getting_started_messagebox.png new file mode 100644 index 0000000000..481b1c0b86 Binary files /dev/null and b/overrides/assets/images/union_sdk_getting_started_messagebox.png differ diff --git a/overrides/main.html b/overrides/main.html index a6a6e8e9ce..577c48f73a 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -9,14 +9,11 @@ {{ super() }} {% if page %} {% if not page.meta %} - {# Set page.meta to a hacky reference of the page itself #} - {% set _ = page.__setattr__("meta", page) %} - {# Let It Snow by setting the page object attribute #} - {% set _ = page.meta.__setattr__("ᴴₒᴴₒᴴₒ", True) %} - {% else %} - {# Let It Snow by updating the dict/mapping pair #} - {% set _ = page.meta.update({"ᴴₒᴴₒᴴₒ": True}) %} + {# Set page.meta to an empty dict/mapping #} + {% set _ = page.__setattr__("meta", {}) %} {% endif %} + {# Let It Snow by updating the dict/mapping pair #} + {% set _ = page.meta.update({"ᴴₒᴴₒᴴₒ": True}) %} {% endif %} {% endblock %} diff --git a/requirements.txt b/requirements.txt index 0f36f762ce..06315d4367 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,11 @@ # Core Requirements -mkdocs-material==9.1.8 +mkdocs-material==9.1.21 mkdocs-git-revision-date-localized-plugin==1.2.0 mkdocs-video==1.5.0 -mkdocs-redirects==1.2.0 -mkdocs-minify-plugin==0.6.4 -# mkdocs-static-i18n==0.53 +mkdocs-redirects==1.2.1 +mkdocs-minify-plugin==0.7.1 +# mkdocs-static-i18n==0.56 git+https://github.com/kamilkrzyskow/i18n.git@5e286be68ad6fafed7affd44cd57d3625c0a02cc#egg=mkdocs_static_i18n git+https://github.com/kamilkrzyskow/gothic-lexer.git@b5ee7868a7e7397cd129ff1f847daa7d39c0e416#egg=gothic_lexer -mkdocs-awesome-pages-plugin==2.9.0 \ No newline at end of file +mkdocs-awesome-pages-plugin==2.9.1 +git+https://github.com/kamilkrzyskow/pymdownx-fork.git@47b9281e910ad225279c8a2397c6b89399463897#egg=pymdown-extensions \ No newline at end of file diff --git a/tests/test_localization.py b/tests/test_localization.py index 255fe4c43b..1b439c898f 100644 --- a/tests/test_localization.py +++ b/tests/test_localization.py @@ -5,12 +5,12 @@ import json import os import unittest + import regex # noinspection PyPackageRequirements -import yaml - -from tests.path_constants import DOCS_DIR, OVERRIDES_DIR, ROOT_DIR +from mkdocs.utils import yaml_load +from path_constants import DOCS_DIR, OVERRIDES_DIR, ROOT_DIR class LocalizationTest(unittest.TestCase): @@ -19,18 +19,26 @@ class LocalizationTest(unittest.TestCase): """ config: dict = None + current_settings: list[tuple] = None + expected_settings: dict = None @classmethod def setUpClass(cls) -> None: with open(os.path.join(ROOT_DIR, "mkdocs.yml"), encoding="utf8") as file: - lines = file.readlines() + content = file.read() + + # Extract the ENV options, and assert that the selected boolean variables + # are set to the correct boolean values (aka weren't changed by mistake) + cls.current_settings = regex.findall( + r"\s*(.*?):\s*!ENV\s*\[(.*?)\s*,\s*(.*?)\s*\]", content + ) - # The default safe loader doesn't handle values containing !, they're not needed for localization - # for the exception of !ENV which are important - lines = [regex.sub(r"!ENV.*,\s*?(\w+)\]", r"\g<1>", line) for line in lines] - output = "\n".join([regex.sub(r"!.*", "", line) for line in lines]) + cls.expected_settings = { + "GMC_ENABLE_ON_PUBLISH": False, + "GMC_ONLY_DEFAULT_LANG": True, + } - for plugin in yaml.safe_load(output)["plugins"]: + for plugin in yaml_load(content)["plugins"]: if isinstance(plugin, dict): cls.config = plugin.get("i18n") if cls.config is not None: @@ -38,6 +46,16 @@ def setUpClass(cls) -> None: def setUp(self) -> None: self.assertIsNot(self.config, None, msg="Localization config is None") + for setting_name, envar_name, raw_value in self.current_settings: + if envar_name not in self.expected_settings: + continue + actual = eval(raw_value) + expected = self.expected_settings[envar_name] + self.assertEqual( + actual, + expected, + msg=f"Setting '{setting_name}'->{envar_name} is set to {actual} instead of {expected}", + ) def test_default(self) -> None: """