diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000..367b146 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,42 @@ +name: Deploy Github Pages + +on: + push: + branches: ["main", "dev/doc"] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install Material for MkDocs + run: pip install mkdocs-material mkdocs-minify-plugin pillow cairosvg + - name: Build Website + working-directory: doc/ + run: mkdocs build + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './doc/site/' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 1c26658..304180f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ addons/explore-editor-theme/ archives/ +doc/.cache/ +doc/site/ diff --git a/README.md b/README.md index 18e441c..83a4e87 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Download [here](https://github.com/kenyoni-software/godot-addons/releases/tag/latest). +You can find a documentation [here](https://kenyoni-software.github.io/godot-addons). + ## License [MIT License](./LICENSE.md) @@ -12,700 +14,25 @@ If you import any plugin or open a Godot project for the first time, the plugins *Background: most plugins are using `preload`, but on first import there is nothing which can be preloaded.* -### Nodes +## Addons -- [AspectRatioResizeContainer](#aspectratioresizecontainer) +- [AspectRatioResizeContainer](https://kenyoni-software.github.io/godot-addons/aspect_ratio_resize_container) Extension of `AspectRatioContainer` to update it's own size. -- [TextureButtonColored](#texturebuttoncolored) - Extension of `TextureButton` with color options. -- [Logging](#logging) - Simple logger. -- [QR Code](#qr-code) - QRCodeRect and QR Code generation. - -### Tools - -- [Git SHA Project Setting](#git-sha-project-setting) +- [Custom Theme Overrides](https://kenyoni-software.github.io/godot-addons/custom_theme_overrides) + Utility to provide custom theme overrides for any node. +- [Git SHA Project Setting](https://kenyoni-software.github.io/godot-addons/git_sha_project_setting) Add Git SHA as project setting. -- [Hide Private Properties](#hide-private-properties) +- [Hide Private Properties](https://kenyoni-software.github.io/godot-addons/hide_private_properties) Hide private properties of instantiated child scenes. -- [Icon Explorer](#icon-explorer) +- [Icon Explorer](https://kenyoni-software.github.io/godot-addons/icon_explorer) Browse different icons and save them. -- [Icons Patcher](#icons-patcher) +- [Icons Patcher](https://kenyoni-software.github.io/godot-addons/icons_patcher) Patch Pictogrammers icons to white. -- [License Manager](#license-manager) +- [License Manager](https://kenyoni-software.github.io/godot-addons/licenses) Manage license and copyright for third party graphics, software or libraries. - -### Utility - -- [Custom Theme Overrides](#custom-theme-overrides) - Utility to provide custom theme overrides for any node. - ---- - -## AspectRatioResizeContainer - -The `AspectRatioContainer` allows his own size to be smaller than the children, which causes neighboring UI elements to be covered. -This new node type will extend the existing `AspectRatioContainer` and update it's own minimum size based on the children. -This works except for `STRETCH_MODE_COVER`. - -You are also not able to use the property `custom_minimum_size` anymore as it is used to set the minimum size. - -### Compatibility - -- Godot 4.2 - -### Example - -[examples/aspect_ratio_resize_container](./examples/aspect_ratio_resize_container) - -### Changelog - -#### 3.2.2 - -- Add more static typing - -#### 3.2.1 - -- Revert: Fix ratio calculation, it is clunky on specific settings - -#### 3.2.0 - -- Fix ratio calculation (but it's still bugged in some cases) - -#### 3.1.2 - -- Use absolute paths in preloads - -#### 3.1.1 - -- Code improvement - -#### 3.1.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg -- Add static typing in for loops - ---- - -## Custom Theme Overrides - -Utility to make custom theme overrides for any node possible. - -This plugin will auto register (via `class_name`) the class `CustomThemeOverrides`. - -You should not use `@export` on your custom theme variables, as they will be exported with the `_get_property_list` method. Also setter and getter will not be called inside the editor. - -If everything is set up, your theme override variables can be handled like every other theme override property. - -### Compatibility - -- Godot 4.2 - -### Screenshot - -![Custom theme overrides screenshot](./doc/custom_theme_overrides.png "Custom Theme Overrides") - -### Example - -```gdscript -# declare the members -# DO NOT -# - use @export -# - use setter and getter, they are NOT called in the editor -# - access these variables directly -var my_font_color: Color -var my_border_size: int -var my_font: Font -var my_font_size: int -var my_icon: Texture2D -var my_style_box: StyleBox - -# declare the custom theme overrides, use the member name and the theme data type. -var _theme_overrides = CustomThemeOverrides.new([ - ["my_font_color", Theme.DATA_TYPE_COLOR], - ["my_border_size", Theme.DATA_TYPE_CONSTANT], - ["my_font", Theme.DATA_TYPE_FONT], - ["my_font_size", Theme.DATA_TYPE_FONT_SIZE], - ["my_icon", Theme.DATA_TYPE_ICON], - ["my_style_box", Theme.DATA_TYPE_STYLEBOX] -]) - -# required, if you have other properties use append_array -func _get_property_list() -> Array[Dictionary]: - return self._theme_overrides.theme_property_list(self) - -# optional: if you want to use the revert function -func _property_can_revert(property: StringName) -> bool: - return self._theme_overrides.can_revert(property) - -# optional: if you want to use the revert function, return null -func _property_get_revert(_property: StringName) -> Variant: - return null -``` - -[examples/custom_theme_overrides](./examples/custom_theme_overrides) - -### Changelog - -#### 1.1.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg -- Add static typing in for loops - ---- - -## Git SHA Project Setting - -Previously named `Metadata`. - -Adds the project setting `application/config/git_sha`, which contains the current Git SHA. -This one is automatically set and updated when you run any scene or on exporting the project. The git_sha will **not** be kept in `project.godot` to not clutter any version control system. It will be removed from the settings on closing the Godot Editor. - -### Compatibility - -- Godot 4.2 - -### Example - -[examples/metadata](./examples/metadata) - -### Changelog - -#### 2.1.1 - -- Use absolute paths in preloads - -#### 2.1.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg - -#### 2.0.0 - -- Added an initial Git SHA load on opening the project. -- Removed `application/config/version`, there was no need that this was part of the addon. The value can still be added manually. - ---- - -## Hide Private Properties - -Private members (names starting with an underscore) should not be exposed. - -This plugin will hide exported private properties in the inspector for instantiated child scenes. - -### Compatibility - -- Godot 4.2 - -### Example - -[examples/hide_private_properties](./examples/hide_private_properties) - -### Changelog - -#### 1.1.2 - -- Fix: property not found warning - -#### 1.1.1 - -- Use absolute paths in preloads - -#### 1.1.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg - ---- - -## Icon Explorer - -Browse and save icons from popular icon collections. - -Install or update them via the options menu in the right upper corner. This can take several minutes. - -The following collections are available: - -- [Bootstrap Icons](https://github.com/twbs/icons) -- [Font Awesome 6](https://github.com/FortAwesome/Font-Awesome) -- [Material Design](https://github.com/Templarian/MaterialDesign-SVG) -- [Simple Icons](https://github.com/simple-icons/simple-icons) -- [tabler Icons](https://github.com/tabler/tabler-icons) - -Downloaded data is saved into `.godot/cache/icon_explorer` to avoid importing it. - -### Compatibility - -- Godot 4.3: >= 1.2.0 -- Godot 4.2: <= 1.1.0 - -### Screenshot - -![Icon Explorer screenshot](./doc/icon_explorer.png "Icon Explorer") - -### Changelog - -#### 1.2.0 - -- Require Godot 4.3 -- Make use of @export for custom Nodes -- Improve loading visualization -- Add Icons to Main Screen (this is optional and can be turned off) -- Add check for updates button -- Remove editor toast notification (access was removed) - -#### 1.1.0 - -- Use editor toast notification - -#### 1.0.0 - -- Add icon explorer - ---- - -## Icons Patcher - -*Consider using [Icon Explorer](#icon-explorer) instead and save icons in white color.* - -If you use Material Design icons from [Pictogrammers](https://pictogrammers.com/library/mdi/), they come without any fill color, automatically rendered black. This is not a convenient color as it makes it impossible to modulate the color. The icon patcher provides a utility to automatically patch the icons to white color. - -Set the icon directory in the Project Settings under the menu `Plugins` -> `Icons Patcher`. - -Then use `Project` -> `Tools` -> `Icons Patcher` to patch the icons. - -Consider using [Icon Explorer](#icon-explorer) instead and save it directly in white. - -### Compatibility - -- Godot 4.3: >= 1.5.0 -- Godot 4.2: <= 1.5.0 - -### Changelog - -#### 1.5.0 - -- Remove editor toast notification (access was removed) - -#### 1.4.0 - -- Use editor toast notification - -#### 1.3.3 - -- Use absolute paths in preloads - -#### 1.3.2 - -- Code improvement - -#### 1.3.1 - -- Replace legacy code - -#### 1.3.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg - -#### 1.2.0 - -- Added automatic file reimporting. - ---- - -## License Manager - -Manage license and copyright for third party graphics, software or libraries. -Group them into categories, add descriptions or web links. - -The data is stored inside a json file. This file is automatically added to the export, you do not need to add it yourself. If you provide license files instead of a text, they are also exported. - -If paths are added to license data, it will be automatically adjusted if you rename a file or folder inside the editor. - -You can change the project license file either with a button at the upper right, in the license menu. Or inside the project settings under the menu `Plugins` -> `Licenses`. - -### Compatibility - -- Godot 4.3: >= 1.8.0 -- Godot 4.2: 1.6.0 - 1.7.8 -- Godot 4.1: < 1.6.0 - -### Screenshot - -![license manager screenshot](./doc/license_manager.png "License Manager") - -### Example - -[examples/licenses](./examples/licenses) - -### Classes & Functions - -**Licenses** - [`addons/licenses/licenses.gd`](./addons/licenses/licenses.gd) - -General class, providing among other things static functions to save and load licenses. - -**Component** - [`addons/licenses/component.gd`](./addons/licenses/component.gd) - -Component class, data wrapper for all information regarding one license item. - -**Component.License** - [`addons/licenses/component.gd`](./addons/licenses/component.gd) - -License class. - -### Changelog - -#### 1.8.0 - -- Require Godot 4.3 -- Make use of @export for custom Nodes - -#### 1.7.8 - -- Detect movement of licenses json file - -#### 1.7.7 - -- Use absolute paths in preloads - -#### 1.7.6 - -- Fix scene id -- Code improvement - -#### 1.7.5 - -- Fix license file existing check - -#### 1.7.4 - -- Fix show engine component - -#### 1.7.3 - -- Fix component selection and right click menu - -#### 1.7.2 - -- Fix current selection of component on popup -- Change drag and drop behavior - -#### 1.7.1 - -- Add adjusting filepath of license files on moving -- Add more warnings -- Fix reloading UI if something was changed on moving - -#### 1.7.0 - -- Add renaming of paths when a file or folder gets renamed inside the editor -- Add right click menu to duplicate or delete items - -#### 1.6.1 - -- Workaround show engine components, calling static function is bugged - -#### 1.6.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg -- Add static typing in for loops -- Use static sorting function as lambda - -#### 1.5.0 - -- Removed overriden engine methods -- Creating a plugin component will now add the plugin path to paths -- Fix dragging/ double click crash -- Fix overriding project license file if another license file is loaded -- Add warning tooltip if a component paths does not exist - ---- - -## Logging - -Simple logger. An autoload `GLogging` will be created at installation. -Logging methods support formatting, values wont be stringified if they are not logged. - -Logging into a file is not supported yet. The output will be always done via print. - - -### Compatibility - -- Godot 4.2 - -### Example - -``` -2023-07-04 15:57:16.242 [ INFO] [ root] ready and initialize GUI -2023-07-04 15:57:16.242 [ INFO] [ root] initialized logger root and other -2023-07-04 15:57:18.300 [ DEBUG] [ root] Demo Text! -2023-07-04 15:57:20.452 [ INFO] [ root] Demo Text! -2023-07-04 15:57:22.071 [ WARNING] [ root] Demo Text! -2023-07-04 15:57:24.606 [ ERROR] [ root] Demo Text! -2023-07-04 15:57:28.793 [CRITICAL] [ root] Demo Text! -2023-07-04 15:57:37.483 [ INFO] [ network] Demo Text! -2023-07-04 15:57:50.843 [ INFO] [ gui] Demo Text! -``` - -[examples/glogging](./examples/glogging) - -### Classes & Functions - -**GLogging** - [`addons/glogging/glogging.gd`](./addons/glogging/glogging.gd) - -Logging base class. Provides helper methods. - -- `root_logger: Logger` - root logger object -- `debug(message: Variant, values: Array[Variant] = []) -> void` - log with root logger at debug level -- `info(message: Variant, values: Array[Variant] = []) -> void` - log with root logger at info level -- `warning(message: Variant, values: Array[Variant] = []) -> void` - log with root logger at warning level, will also display a debug warning -- `error(message: Variant, values: Array[Variant] = []) -> void` - log with root logger at error level, will also display a debug error -- `critical(message: Variant, values: Array[Variant] = []) -> void` - log with root logger at critical level -- `log(level: int, message: Variant, values: Array[Variant] = []) -> void` - log at custom level - -**GLogging.Logger** - [`addons/glogging/glogging.gd`](./addons/glogging/glogging.gd) - -Logger class. -If not log level is set, the log level of the parent logger will be used. - -- `create_child(module_name: String, log_level: int = LEVEL_NOTSET) -> Logger` - create a child logger -- `set_log_level(level: int) -> void` - set the log level -- `log_level() -> int` - get log level -- `debug(message: Variant, values: Array[Variant] = []) -> void` - log at debug level -- `info(message: Variant, values: Array[Variant] = []) -> void` - log at info level -- `warning(message: Variant, values: Array[Variant] = []) -> void` - log at warning level, will also display a debug warning -- `error(message: Variant, values: Array[Variant] = []) -> void` - log at error level, will also display a debug error -- `critical(message: Variant, values: Array[Variant] = []) -> void` - log at critical level -- `log(level: int, message: Variant, values: Array[Variant] = []) -> void` - log at custom level - -### Changelog - -#### 1.5.1 - -- Code improvement - -#### 1.5.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg - ---- - -## QR Code - -QR Code generation either with the included `QRCodeRect` node or use the encoding result of the `QRCode` class. - -### Compatibility - -- Godot 4.2 - -### Screenshot - -![QRCodeRect node inspector screenshot](./doc/qr_code.png "QRCodeRect in inspector") - -### Example - -[examples/qr_code](./examples/qr_code) - -### Classes & Functions - -**QRCodeRect** - [`addons/qr_code/qr_code_rect.gd`](./addons/qr_code/qr_code_rect.gd) - -`TextureRect` like node. The texture is updated by itself. -When using byte encoding you can also pass strings for specific ECI values (ISO 8859-1, Shift JIS, UTF-8, UTF-16, US ASCII), the input string will be automatically converted to an byte array. - -#### Properties - -- `mode: QRCode.Mode` -- `error_correction: QRCode.ErrorCorrection` -- `use_eci: bool` - Use Extended Channel Interpretation (ECI) -- `eci_value: int` - Extended Channel Interpretation (ECI) Value -- `data: Variant` - Type varies based on the encoding mode. -- `auto_version: bool` - Use automatically the smallest QR Code version. -- `version: int` -- `auto_mask_pattern: bool` - Use automatically the best mask pattern. -- `mask_pattern: int` -- `light_module_color: Color` -- `dark_module_color: Color` -- `auto_module_px_size: bool` - Automatically set the module pixel size based on the size. - Do not use expand mode KEEP_SIZE when using it. - Turn this off when the QR Code changes or is resized often, as it impacts the performance quite heavily. -- `module_px_size: int` - Use that many pixel for one module. -- `quiet_zone_size: int` - Use that many modules for the quiet zone. A value of 4 is recommended. - -**QRCode** - [`addons/qr_code/qr_code.gd`](./addons/qr_code/qr_code.gd) - -QRCode class to generate QR Codes. - -#### Enums - -- `Mode` - Encoding mode enum. - - `NUMERIC = 1` - - `ALPHANUMERIC = 2` - - `BYTE = 4` - - `KANJI = 8` -- `ErrorCorrection` - Error correction enum. - - `LOW = 1` - - `MEDIUM = 0` - - `QUARTILE = 3` - - `HIGH = 2` -- `ECI` - Extended Channel Interpretation enum. Provides some values by name. - -#### Properties - -- `mode: Mode` -- `error_correction: ErrorCorrection` -- `use_eci: bool` - Use Extended Channel Interpretation (ECI) -- `eci_value: int` - Extended Channel Interpretation (ECI) Value -- `auto_version: bool` - Use automatically the smallest QR Code version. -- `version: int` -- `auto_mask_pattern: bool` - Use automatically the best mask pattern. -- `mask_pattern: int` - -#### Methods - -- `get_module_count() -> int` - Get the module count per side. -- `calc_min_version() -> int` - Get the minimal version required to encode the data. -- `generate_image(module_px_size: int = 1, light_module_color: Color = Color.WHITE, dark_module_color: Color = Color.BLACK) -> Image` - Generate an image. This method can be called repeatedly, as encoding will only happens once and be cached. -- `put_numeric(number: String) -> void` - Put a numeric text as data. Invalid characters are removed. Will change the encoding mode to `Mode.NUMERIC`. -- `put_alphanumeric(text: String) -> void` - Put a alphanumeric text as data. Invalid characters are removed. Will change the encoding mode to `Mode.ALPHANUMERIC`. -- `put_byte(data: PackedByteArray) -> void` - Put a byte data. Will change the encoding mode to `Mode.BYTE`. -- `put_numeric(number: String) -> void` - Put a numeric text as data. Invalid characters are removed. Will change the encoding mode to `Mode.KANJI`. -- `encode() -> PackedByteArray` - Get the QR Code row by row in one array. To get the row size use `get_module_count`. - -**ShiftJIS** - [`addons/qr_code/shift_jis.gd`](./addons/qr_code/shift_jis.gd) - -Shift JIS encoding utility. - -### Functions - -- `static func to_shift_jis_2004_buffer(text: String) -> PackedByteArray` -- `static func get_string_from_shift_jis_2004(arr: PackedByteArray) -> String` -- `static func to_jis_8_buffer(text: String) -> PackedByteArray` -- `static func get_string_from_jis_8(arr: PackedByteArray) -> String` - -### Changelog - -#### 1.1.3 - -- Code improvements - -#### 1.1.2 - -- Use absolute paths in preloads - -#### 1.1.1 - -- Code optimizing - -#### 1.1.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg -- Add static typing in for loops - -#### 1.0.0 - -- Renamed `get_string_from_jis_2004` to `get_string_from_shift_jis_2004` - -#### 0.3.1 - -- Improve inspector properties -- Improve input handling of byte data based on ECI usage - -#### 0.3.0 - -- Make ECI value optional - -#### 0.2.0 - -- Added quiet zone size property - ---- - -## TextureButtonColored - -Let you apply the icon color theme properties for the texture button. Uses `self_modulate`. - -### Compatibility - -- Godot 4.3: >= 1.4.0 -- Godot 4.2: <= 1.4.0 - -### Dependencies - -- [Custom Theme Overrides](#custom-theme-overrides) - -### Example - -[examples/texture_button_colored](./examples/texture_button_colored) - -### Changelog - -#### 1.4.0 - -- Remove editor toast notification (access was removed) - -#### 1.3.3 - -- Notify if Custom Themes Override is missing or enable it if disabled - -#### 1.3.2 - -- Use absolute paths in preloads - -#### 1.3.1 - -- Code improvement - -#### 1.3.0 - -- Require Godot 4.2 -- Add more values to plugin.cfg - -#### 1.2.3 - -- Rename method `get_theme_color` to `get_theme_coloring`, this function was never called by the engine anyway and should not be overridden +- [Logging](https://kenyoni-software.github.io/godot-addons/glogging) + Simple logger. +- [QR Code](https://kenyoni-software.github.io/godot-addons/qr_code) + QRCodeRect and QR Code generation. +- [TextureButtonColored](https://kenyoni-software.github.io/godot-addons/texture_button_colored) + Extension of `TextureButton` with color options. diff --git a/doc/docker-compose.yml b/doc/docker-compose.yml new file mode 100644 index 0000000..b8d3124 --- /dev/null +++ b/doc/docker-compose.yml @@ -0,0 +1,13 @@ +services: + mkdocs-serve: + image: squidfunk/mkdocs-material:9.5.21 + volumes: + - ./:/docs + ports: + - 8000:8000 + + mkdocs-build: + image: squidfunk/mkdocs-material:9.5.21 + volumes: + - ./:/docs + command: build diff --git a/doc/docs/_static/css/badge.css b/doc/docs/_static/css/badge.css new file mode 100644 index 0000000..01ffd6d --- /dev/null +++ b/doc/docs/_static/css/badge.css @@ -0,0 +1,51 @@ +.md-typeset .mdx-badge { + font-size: .85em +} + +[dir=ltr] .md-typeset .mdx-badge__icon { + border-top-left-radius: .1rem +} + +[dir=rtl] .md-typeset .mdx-badge__icon { + border-top-right-radius: .1rem +} + +[dir=ltr] .md-typeset .mdx-badge__icon { + border-bottom-left-radius: .1rem +} + +[dir=rtl] .md-typeset .mdx-badge__icon { + border-bottom-right-radius: .1rem +} + +.md-typeset .mdx-badge__icon { + color: var(--md-typeset-a-color); + background: var(--md-accent-fg-color--transparent); + padding: .2rem +} + +.md-typeset .mdx-badge__icon:last-child { + border-radius: .1rem +} + +[dir=ltr] .md-typeset .mdx-badge__text { + border-top-right-radius: .1rem +} + +[dir=rtl] .md-typeset .mdx-badge__text { + border-top-left-radius: .1rem +} + +[dir=ltr] .md-typeset .mdx-badge__text { + border-bottom-right-radius: .1rem +} + +[dir=rtl] .md-typeset .mdx-badge__text { + border-bottom-left-radius: .1rem +} + +.md-typeset .mdx-badge__text { + color: var(--md-typeset-a-color); + box-shadow: 0 0 0 1px inset var(--md-accent-fg-color--transparent); + padding: .2rem .3rem +} diff --git a/doc/docs/_static/css/common.css b/doc/docs/_static/css/common.css new file mode 100644 index 0000000..1fcb240 --- /dev/null +++ b/doc/docs/_static/css/common.css @@ -0,0 +1,4 @@ +.center-lg-button { + width: 100%; + text-align: center; +} diff --git a/doc/docs/_static/js/mathjax.js b/doc/docs/_static/js/mathjax.js new file mode 100644 index 0000000..0921248 --- /dev/null +++ b/doc/docs/_static/js/mathjax.js @@ -0,0 +1,16 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex" + } +}; + +document$.subscribe(() => { + MathJax.typesetPromise() +}); diff --git a/doc/docs/_static/js/tablesort.js b/doc/docs/_static/js/tablesort.js new file mode 100644 index 0000000..3d3c9d3 --- /dev/null +++ b/doc/docs/_static/js/tablesort.js @@ -0,0 +1,6 @@ +document$.subscribe(function() { + let tables = document.querySelectorAll("article table:not([class])"); + tables.forEach(function(table) { + new Tablesort(table); + }); +}); diff --git a/doc/docs/addons/aspect_ratio_resize_container.md b/doc/docs/addons/aspect_ratio_resize_container.md new file mode 100644 index 0000000..d068b53 --- /dev/null +++ b/doc/docs/addons/aspect_ratio_resize_container.md @@ -0,0 +1,49 @@ +# AspectRatioResizeContainer + +The `AspectRatioContainer` allows his own size to be smaller than the children, which causes neighboring UI elements to be covered. +This new node type will extend the existing `AspectRatioContainer` and update it's own minimum size based on the children. +This works except for `STRETCH_MODE_COVER`. + +!!! warning + + You cannot use the property `custom_minimum_size` anymore as it is used to set the minimum size. + +## Compatibility + +| Godot | Version | +|-------|----------| +| 4.3 | >= 3.1.0 | +| 4.2 | >= 3.1.0 | +| 4.1 | <= 3.0.2 | + +## Example + + + +## Changelog + +### 3.2.2 + +- Add more static typing + +### 3.2.1 + +- Revert: Fix ratio calculation, it is clunky on specific settings + +### 3.2.0 + +- Fix ratio calculation (but it's still bugged in some cases) + +### 3.1.2 + +- Use absolute paths in preloads + +### 3.1.1 + +- Code improvement + +### 3.1.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg +- Add static typing in for loops diff --git a/doc/docs/addons/custom_theme_overrides.md b/doc/docs/addons/custom_theme_overrides.md new file mode 100644 index 0000000..58ba63c --- /dev/null +++ b/doc/docs/addons/custom_theme_overrides.md @@ -0,0 +1,72 @@ +# Custom Theme Overrides + +Utility to make custom theme overrides for any node possible. + +Will register (via `class_name`) the class `CustomThemeOverrides`. + +The custom theme override variables can be handled like every other theme override property. + +## Compatibility + +| Godot | Version | +|-------|---------| +| 4.3 | all | +| 4.2 | all | + +## Screenshot + +![Custom theme overrides screenshot](custom_theme_overrides/custom_theme_overrides.png "Custom Theme Overrides") + +## Example + + + +```gdscript +# declare the members +# DO NOT +# - use @export +# - use setter and getter, they are NOT called in the editor +# - access these variables directly +var my_font_color: Color +var my_border_size: int +var my_font: Font +var my_font_size: int +var my_icon: Texture2D +var my_style_box: StyleBox + +# declare the custom theme overrides, use the member name and the theme data type. +var _theme_overrides = CustomThemeOverrides.new([ + ["my_font_color", Theme.DATA_TYPE_COLOR], + ["my_border_size", Theme.DATA_TYPE_CONSTANT], + ["my_font", Theme.DATA_TYPE_FONT], + ["my_font_size", Theme.DATA_TYPE_FONT_SIZE], + ["my_icon", Theme.DATA_TYPE_ICON], + ["my_style_box", Theme.DATA_TYPE_STYLEBOX] +]) + +# required, if you have other properties use append_array +func _get_property_list() -> Array[Dictionary]: + return self._theme_overrides.theme_property_list(self) + +# optional: if you want to use the revert function +func _property_can_revert(property: StringName) -> bool: + return self._theme_overrides.can_revert(property) + +# optional: if you want to use the revert function, return null +func _property_get_revert(_property: StringName) -> Variant: + return null +``` + +!!! warning + + You should not use `@export` on your custom theme variables, as they will be exported with the `_get_property_list` method. + + Setter and getter of the variables will not be called inside the editor. + +## Changelog + +### 1.1.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg +- Add static typing in for loops \ No newline at end of file diff --git a/doc/custom_theme_overrides.png b/doc/docs/addons/custom_theme_overrides/custom_theme_overrides.png similarity index 100% rename from doc/custom_theme_overrides.png rename to doc/docs/addons/custom_theme_overrides/custom_theme_overrides.png diff --git a/doc/docs/addons/git_sha_project_setting.md b/doc/docs/addons/git_sha_project_setting.md new file mode 100644 index 0000000..4406324 --- /dev/null +++ b/doc/docs/addons/git_sha_project_setting.md @@ -0,0 +1,38 @@ +# Git SHA Project Setting + +!!! note + + Previously named `Metadata`. + +Adds the project setting `application/config/git_sha`, which contains the current Git SHA. +It will be automatically set and updated when you run any scene or export the project. + +The Git SHA will **not** be kept in `project.godot` to not clutter any version control system. It will be removed from the settings on closing the Godot Editor. + +## Compatibility + +| Godot | Version | +|-------|----------| +| 4.3 | >= 2.1.0 | +| 4.2 | >= 2.1.0 | +| 4.1 | <= 2.0.0 | + +## Example + + + +## Changelog + +### 2.1.1 + +- Use absolute paths in preloads + +### 2.1.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg + +### 2.0.0 + +- Added an initial Git SHA load on opening the project. +- Removed `application/config/version`, there was no need that this was part of the addon. The value can still be added manually. diff --git a/doc/docs/addons/glogging.md b/doc/docs/addons/glogging.md new file mode 100644 index 0000000..4a61930 --- /dev/null +++ b/doc/docs/addons/glogging.md @@ -0,0 +1,115 @@ +# Logging + +Simple logger. An autoload `GLogging` will be created on installation. +Logging methods support formatting, values won't be stringified if they are not logged. + +Logging into a file is not supported. The output will be always done via print. + +## Compatibility + +| Godot | Version | +|-------|----------| +| 4.3 | >= 1.5.0 | +| 4.2 | >= 1.5.0 | +| 4.1 | <= 1.4.1 | + +## Example + + + +Example output. + +``` +2023-07-04 15:57:16.242 [ INFO] [ root] ready and initialize GUI +2023-07-04 15:57:16.242 [ INFO] [ root] initialized logger root and other +2023-07-04 15:57:18.300 [ DEBUG] [ root] Demo Text! +2023-07-04 15:57:20.452 [ INFO] [ root] Demo Text! +2023-07-04 15:57:22.071 [ WARNING] [ root] Demo Text! +2023-07-04 15:57:24.606 [ ERROR] [ root] Demo Text! +2023-07-04 15:57:28.793 [CRITICAL] [ root] Demo Text! +2023-07-04 15:57:37.483 [ INFO] [ network] Demo Text! +2023-07-04 15:57:50.843 [ INFO] [ gui] Demo Text! +``` + +## Interface + +### GLogging + + + +Logging base class. Provides helper methods. + +#### Properties + +| Name | Type | Description | +|-------------|---------------------------|---------------------| +| root_logger | [Logger](#glogginglogger) | root logger object. | + +#### Methods + +`debug(message: Variant, values: Array[Variant] = []) -> void` +: log with root logger at debug level + +`info(message: Variant, values: Array[Variant] = []) -> void` +: log with root logger at info level + +`warning(message: Variant, values: Array[Variant] = []) -> void` +: log with root logger at warning level, will also display a debug warning + +`error(message: Variant, values: Array[Variant] = []) -> void` +: with root logger at error level, will also display a debug error + +`critical(message: Variant, values: Array[Variant] = []) -> void` +: log with root logger at critical level + +`log(level: int, message: Variant, values: Array[Variant] = []) -> void` +: log at a custom level + +### GLogging.Logger + + + + + +Logger class. +If not log level is set, the log level of the parent logger will be used. + +#### Methods + +`create_child(module_name: String, log_level: int = LEVEL_NOTSET) -> Logger` +: create a child logger + +`set_log_level(level: int) -> void` +: set the log level + +`log_level() -> int` +: get log level + +`debug(message: Variant, values: Array[Variant] = []) -> void` +: log at debug level + +`info(message: Variant, values: Array[Variant] = []) -> void` +: log at info level + +`warning(message: Variant, values: Array[Variant] = []) -> void` +: log at warning level, will also display a debug warning + +`error(message: Variant, values: Array[Variant] = []) -> void` +: log at error level, will also display a debug error + +`critical(message: Variant, values: Array[Variant] = []) -> void` +: log at critical level + +`log(level: int, message: Variant, values: Array[Variant] = []) -> void` +: log at custom level + +## Changelog + +### 1.5.1 + +- Code improvement + +### 1.5.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg diff --git a/doc/docs/addons/hide_private_properties.md b/doc/docs/addons/hide_private_properties.md new file mode 100644 index 0000000..d5877e0 --- /dev/null +++ b/doc/docs/addons/hide_private_properties.md @@ -0,0 +1,32 @@ +# Hide Private Properties + +Private members (names starting with an underscore) should not be exposed. + +This plugin will hide exported private properties in the inspector for instantiated child scenes. + +## Compatibility + +| Godot | Version | +|-------|----------| +| 4.3 | >= 1.1.0 | +| 4.2 | >= 1.1.0 | +| 4.1 | <= 1.0.2 | + +## Example + + + +## Changelog + +### 1.1.2 + +- Fix: property not found warning + +### 1.1.1 + +- Use absolute paths in preloads + +### 1.1.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg diff --git a/doc/docs/addons/icon_explorer.md b/doc/docs/addons/icon_explorer.md new file mode 100644 index 0000000..1da7de7 --- /dev/null +++ b/doc/docs/addons/icon_explorer.md @@ -0,0 +1,57 @@ +# Icon Explorer + +Browse and save icons from popular icon collections. + +Install or update them via the options menu in the right upper corner. This can take several minutes. + +You can remove the main screen button in the options. + +**Available collections** + +- [Bootstrap Icons](https://github.com/twbs/icons) +- [country-flag-icons](https://gitlab.com/catamphetamine/country-flag-icons) +- [Font Awesome 6](https://github.com/FortAwesome/Font-Awesome) +- [Material Design](https://github.com/Templarian/MaterialDesign-SVG) +- [Simple Icons](https://github.com/simple-icons/simple-icons) +- [tabler Icons](https://github.com/tabler/tabler-icons) + +!!! note + + Downloaded data is saved into `.godot/cache/icon_explorer` to avoid importing it. + +## Compatibility + +| Godot | Version | +|-------|----------| +| 4.3 | >= 1.2.0 | +| 4.2 | <= 1.1.0 | + +## Screenshot + +In Main screen: + +![Icon Explorer screenshot](icon_explorer/main_screen.png "In Main Screen") + +As popup: + +![Icon Explorer screenshot](icon_explorer/popup.png "As Popup") + +## Changelog + +### 1.2.0 + +- Require Godot 4.3 +- Make use of @export for custom Nodes +- Improve loading visualization +- Add Icons to Main Screen (this is optional and can be turned off) +- Add check for updates button +- Remove editor toast notification (access was removed) +- Focus filter input on opening + +### 1.1.0 + +- Use editor toast notification + +### 1.0.0 + +- Add icon explorer diff --git a/doc/docs/addons/icon_explorer/main_screen.png b/doc/docs/addons/icon_explorer/main_screen.png new file mode 100644 index 0000000..100f901 Binary files /dev/null and b/doc/docs/addons/icon_explorer/main_screen.png differ diff --git a/doc/docs/addons/icon_explorer/popup.png b/doc/docs/addons/icon_explorer/popup.png new file mode 100644 index 0000000..328a6ec Binary files /dev/null and b/doc/docs/addons/icon_explorer/popup.png differ diff --git a/doc/docs/addons/icons_patcher.md b/doc/docs/addons/icons_patcher.md new file mode 100644 index 0000000..fdf509c --- /dev/null +++ b/doc/docs/addons/icons_patcher.md @@ -0,0 +1,50 @@ +# Icons Patcher + +!!! danger "Deprecated" + + Use [Icon Explorer](icon_explorer.md) and save icons in white color. + +If you use Material Design icons from [Pictogrammers](https://pictogrammers.com/library/mdi/), they come without any fill color, automatically rendered black. This is not a convenient color as it makes it impossible to modulate the color. The icon patcher provides a utility to automatically patch the icons to white color. + +Set the icon directory in the Project Settings under the menu `Plugins` -> `Icons Patcher`. + +Then use `Project` -> `Tools` -> `Icons Patcher` to patch the icons. + +## Compatibility + +| Godot | Version | +|-------|----------| +| 4.3 | >= 1.5.0 | +| 4.2 | >= 1.3.0 | +| 4.1 | <= 1.2.1 | + +## Changelog + +### 1.5.0 + +- Remove editor toast notification (access was removed) + +### 1.4.0 + +- Use editor toast notification + +### 1.3.3 + +- Use absolute paths in preloads + +### 1.3.2 + +- Code improvement + +### 1.3.1 + +- Replace legacy code + +### 1.3.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg + +### 1.2.0 + +- Added automatic file reimporting. diff --git a/doc/docs/addons/licenses.md b/doc/docs/addons/licenses.md new file mode 100644 index 0000000..8f8ab90 --- /dev/null +++ b/doc/docs/addons/licenses.md @@ -0,0 +1,198 @@ +# License Manager + +Manage license and copyright for third party graphics, software or libraries. +Group them into categories, add descriptions or web links. + +The data is stored inside a json file. This file is automatically added to the export, you do not need to add it +yourself. If you provide license files instead of a text, they are also exported. + +If paths are added to license data, it will be automatically adjusted if you rename a file or folder inside the editor. + +You can change the project license file either with a button at the upper right, in the license menu. Or inside the +project settings under the menu `Plugins` -> `Licenses`. + +## Compatibility + +| Godot | Version | +|-------|---------------| +| 4.3 | >= 1.8.0 | +| 4.2 | 1.6.0 - 1.7.8 | +| 4.1 | <= 1.5.0 | + +## Screenshot + +![license manager screenshot](licenses/license_manager.png "License Manager") + +## Example + + + +## Interface + +### Licenses + + + +Providing static utility and static functions to save and load licenses. + +#### Methods + +`static compare_components_ascending(lhs: Component, rhs: Component) -> bool` +: Compare components ascending. + +`static get_engine_component(name: String) -> Component` +: Get engine component by name. + +`static get_engine_components() -> Array[Component]` +: Get all engine components. + +`static get_required_engine_components() -> Array[Component]` +: Get engine components which are marked as required to mention. + +`static save(components: Array[Component], file_path: String) -> int` +: Save array of components to file. + +`static load(file_path: String) -> LoadResult` +: Load licenses from file. + +`static set_license_data_filepath(path: String) -> void` +: Set the project license data path. + +`static get_license_data_filepath() -> String` +: Returns the project license data path. + +### Component + + + + + +Component class, data wrapper for all information regarding one license item. + +#### Properties + +| Name | Type | Description | +|-------------|---------------------------------------|----------------------------------------------------------------------------| +| id | String | Identifier. | +| category | String | Use to structure the licenses to top categories. E.g. Textures, Fonts, ... | +| name | String | Name of the software or component. | +| version | String | Version of the software or component. | +| copyright | PackedStringArray | Copyrights. | +| contact | String | Contact of developer. | +| description | String | Additional description. | +| web | String | Web url to project page. | +| paths | PackedStringArray | Array of String, affected files or directories. | +| licenses | Array\[[License](#componentlicense)\] | Licenses. | + +#### Methods + +`get_warnings() -> PackedStringArray` +: Get warnings regarding this component, e.g. missing license. + +`serialize() -> Dictionary` +: Serialize to dictionary. + +`deserialize(data: Dictionary) -> Component` +: Load values from dictionary. + +`duplicate() -> Component` +: Returns a duplicate of itself. + +### Component.License + + + + + +License class. + +#### Properties + +| Name | Type | Description | +|------------|--------|-------------------------------------------------------------------------------------------| +| name | String | Full name. | +| identifier | String | Shortcode for this license. | +| text | String | License text. | +| file | String | License file. Will load the license text from this file automatically if `text` is empty. | +| web | String | Web present of the license. | + +#### Methods + +`get_license_text() -> String` +: Either returns the license text or loads the text from file or a message that the text could not be loaded. + +`serialize() -> Dictionary` +: Serialize to dictionary. + +`deserialize() -> Dictionary` +: Load values from dictionary. + +`duplicate() -> License` +: Returns a duplicate of itself. + +## Changelog + +### 1.8.0 + +- Require Godot 4.3 +- Make use of @export for custom Nodes + +### 1.7.8 + +- Detect movement of licenses json file + +### 1.7.7 + +- Use absolute paths in preloads + +### 1.7.6 + +- Fix scene id +- Code improvement + +### 1.7.5 + +- Fix license file existing check + +### 1.7.4 + +- Fix show engine component + +### 1.7.3 + +- Fix component selection and right click menu + +### 1.7.2 + +- Fix current selection of component on popup +- Change drag and drop behavior + +### 1.7.1 + +- Add adjusting filepath of license files on moving +- Add more warnings +- Fix reloading UI if something was changed on moving + +### 1.7.0 + +- Add renaming of paths when a file or folder gets renamed inside the editor +- Add right click menu to duplicate or delete items + +### 1.6.1 + +- Workaround show engine components, calling static function is bugged + +### 1.6.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg +- Add static typing in for loops +- Use static sorting function as lambda + +### 1.5.0 + +- Removed overriden engine methods +- Creating a plugin component will now add the plugin path to paths +- Fix dragging/ double click crash +- Fix overriding project license file if another license file is loaded +- Add warning tooltip if a component paths does not exist diff --git a/doc/license_manager.png b/doc/docs/addons/licenses/license_manager.png similarity index 100% rename from doc/license_manager.png rename to doc/docs/addons/licenses/license_manager.png diff --git a/doc/docs/addons/qr_code.md b/doc/docs/addons/qr_code.md new file mode 100644 index 0000000..17b5638 --- /dev/null +++ b/doc/docs/addons/qr_code.md @@ -0,0 +1,185 @@ +# QR Code + +QR Code generation either with the included `QRCodeRect` node or use the encoding result of the `QRCode` class. + +## Compatibility + +| Godot | Version | +|-------|----------| +| 4.3 | >= 1.1.0 | +| 4.2 | >= 1.1.0 | +| 4.1 | <= 1.0.0 | + +## Screenshot + +![QRCodeRect node inspector screenshot](qr_code/qr_code.png "QRCodeRect in inspector") + +## Example + + + +## Interface + +## QRCodeRect + + + + + +`TextureRect` like node. The texture is updated by itself. +When using byte encoding you can also pass strings for specific ECI values (ISO 8859-1, Shift JIS, UTF-8, UTF-16, US ASCII), the input string will be automatically converted to an byte array. + +#### Properties + +| Name | Type | Description | +|---------------------|--------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| mode | [QRCode.Mode](#qrcodemode) | QR Code mode | +| error_correction | [QRCode.ErrorCorrection](#qrcodeerrorcorrection) | Error correction value. | +| use_eci | String | Use Extended Channel Interpretation (ECI) | +| eci_value | String | Extended Channel Interpretation (ECI) Value | +| data | Variant | Type varies based on the encoding mode. | +| auto_version | bool | Use automatically the smallest QR Code version. | +| version | int | QR Code version (size). | +| auto_mask_pattern | bool | Use automatically the best mask pattern. | +| mask_pattern | int | QR Code mask pattern. | +| light_module_color | Color | Color of the light modules. | +| dark_module_color | Color | Color of the dark modules. | +| auto_module_px_size | bool | Automatically set the module pixel size based on the size. Do not use expand mode `KEEP_SIZE` when using it.
Turn this off when the QR Code changes or is resized often, as it impacts the performance quite heavily. | +| module_px_size | int | Use that many pixel for one module. | +| quiet_zone_size | int | Use that many modules for the quiet zone. A value of 4 is recommended. | + +### QRCode + + + + + +QRCode class to generate QR Codes. + +#### Properties + +| Name | Type | Description | +|-------------------|--------------------------------------------------|-------------------------------------------------| +| mode | [QRCode.Mode](#qrcodemode) | QR Code mode. | +| error_correction | [QRCode.ErrorCorrection](#qrcodeerrorcorrection) | Error correction value. | +| use_eci | String | Use Extended Channel Interpretation (ECI) | +| eci_value | String | Extended Channel Interpretation (ECI) Value | +| auto_version | bool | Use automatically the smallest QR Code version. | +| version | int | QR Code version (size). | +| auto_mask_pattern | bool | Use automatically the best mask pattern. | +| mask_pattern | int | QR Code mask pattern. | + +#### Methods + +`get_module_count() -> int` +: Return the module count per side. + +`calc_min_version() -> int` +: Return the minimal version required to encode the data. + +`generate_image(module_px_size: int = 1, light_module_color: Color = Color.WHITE, dark_module_color: Color = Color.BLACK) -> Image` +: Generate an image. This method can be called repeatedly, as encoding will only happens once and be cached. + +`put_numeric(number: String) -> void` +: Put a numeric text. Invalid characters are removed. Will change the encoding mode to `Mode.NUMERIC`. + +`put_alphanumeric(text: String) -> void` +: Put a alphanumeric text. Invalid characters are removed. Will change the encoding mode to `Mode.ALPHANUMERIC`. + +`put_byte(data: PackedByteArray) -> void` +: Put a bytes. Will change the encoding mode to `Mode.BYTE`. + +`put_kanji(data: String) -> void` +: Put a kanji text. Invalid characters are removed. Will change the encoding mode to `Mode.KANJI`. + +`encode() -> PackedByteArray` +: Get the QR Code row by row in one array. To get the row size use `get_module_count`. + +### QRCode.Mode + + + +Encoding mode enum. + +| Name | Value | +|--------------|-------| +| NUMERIC | 1 | +| ALPHANUMERIC | 2 | +| BYTE | 4 | +| KANJI | 8 | + +### QRCode.ErrorCorrection + + + +Error correction enum. + +| Name | Value | +|----------|-------| +| LOW | 1 | +| MEDIUM | 0 | +| QUARTILE | 3 | +| HIGH | 2 | + +### QRCode.ECI + + + +ECI values. See source code for available values. + +### ShiftJIS + + + +Shift JIS encoding utility. + +## Methods + +`static func to_shift_jis_2004_buffer(text: String) -> PackedByteArray` +: Convert text to Shift JIS 2004 encoded bytes. Returns u16 int array. Unknown characters are skipped. + +`static func get_string_from_shift_jis_2004(arr: PackedByteArray) -> String` +: Get text from Shift JIS 2004 encoded bytes. Requires an u16 int array. Unknown characters are skipped. + +`static func to_jis_8_buffer(text: String) -> PackedByteArray` +: Convert text to JIS 8 encoded bytes. Returns u8 int array. Unknown characters are skipped. + +`static func get_string_from_jis_8(arr: PackedByteArray) -> String` +: Get text from JIS 8 encoded bytes. Requires an u8 int array. Unknown characters are skipped. + +## Changelog + +### 1.1.3 + +- Code improvements + +### 1.1.2 + +- Use absolute paths in preloads + +### 1.1.1 + +- Code optimizing + +### 1.1.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg +- Add static typing in for loops + +### 1.0.0 + +- Renamed `get_string_from_jis_2004` to `get_string_from_shift_jis_2004` + +### 0.3.1 + +- Improve inspector properties +- Improve input handling of byte data based on ECI usage + +### 0.3.0 + +- Make ECI value optional + +### 0.2.0 + +- Added quiet zone size property diff --git a/doc/qr_code.png b/doc/docs/addons/qr_code/qr_code.png similarity index 100% rename from doc/qr_code.png rename to doc/docs/addons/qr_code/qr_code.png diff --git a/doc/docs/addons/texture_button_colored.md b/doc/docs/addons/texture_button_colored.md new file mode 100644 index 0000000..adf8973 --- /dev/null +++ b/doc/docs/addons/texture_button_colored.md @@ -0,0 +1,65 @@ +# TextureButtonColored + +Let you apply the icon color theme properties for the texture button. Uses `self_modulate`. + +## Compatibility + +| Godot | Version | +|-------|---------------| +| 4.3 | >= 1.4.0 | +| 4.2 | 1.3.0 - 1.3.2 | +| 4.1 | <= 1.2.3 | + +## Dependencies + +- [Custom Theme Overrides](custom_theme_overrides.md) + +## Example + + + +## Interface + +### TextureButtonColored + + + + + +#### Theme Overrides + +| Name | Type | +|--------------------------|-------| +| icon_normal_color | Color | +| icon_pressed_color | Color | +| icon_hover_color | Color | +| icon_hover_pressed_color | Color | +| icon_focus_color | Color | +| icon_disabled_color | Color | + +## Changelog + +### 1.4.0 + +- Remove editor toast notification (access was removed) + +### 1.3.3 + +- Notify if Custom Themes Override is missing or enable it if disabled + +### 1.3.2 + +- Use absolute paths in preloads + +### 1.3.1 + +- Code improvement + +### 1.3.0 + +- Require Godot 4.2 +- Add more values to plugin.cfg + +### 1.2.3 + +- Rename method `get_theme_color` to `get_theme_coloring`, this function was never called by the engine anyway and should not be overridden diff --git a/doc/docs/index.md b/doc/docs/index.md new file mode 100644 index 0000000..9508ec7 --- /dev/null +++ b/doc/docs/index.md @@ -0,0 +1,81 @@ +# Kenyoni Godot Addons + +Kenyoni Godot Addons is a pack of useful Godot additions to make your life easier! + +Find the releases [here](https://github.com/kenyoni-software/godot-addons/releases/tag/latest). + +!!! note + + If you import any plugin or open a Godot project for the first time, the plugins will throw errors. To ensure correct operation, reload the project and the errors are gone. + + *Most plugins are using `preload`, but on first import there is nothing which can be preloaded.* + +## :material-puzzle: Addons + +
+ +- [AspectRatioResizeContainer](addons/aspect_ratio_resize_container.md){ .md-button .center-lg-button } + + --- + + Extending `AspectRatioContainer` and update it's own minimum size based on the children. + +- [Custom Theme Overrides](addons/custom_theme_overrides.md){ .md-button .center-lg-button } + + --- + + Utility to provide custom theme overrides for any node. + +- [Git SHA Project Setting](addons/git_sha_project_setting.md){ .md-button .center-lg-button } + + --- + + Adds Git SHA as project setting at `application/config/git_sha`. + +- [Hide Private Properties](addons/hide_private_properties.md){ .md-button .center-lg-button } + + --- + + Hide exported private properties in the inspector for instantiated child scenes. + +- [Logging](addons/glogging.md){ .md-button .center-lg-button } + + --- + + Simple logging utility. + +- [Icon Explorer](addons/icon_explorer.md){ .md-button .center-lg-button } + + --- + + Simple logging utility. + +- [Icons Patcher](addons/icons_patcher.md){ .md-button .center-lg-button } + + --- + + Will convert Pictogrammers icons to white. + +- [License Manager](addons/licenses.md){ .md-button .center-lg-button } + + --- + + Manage license and copyright for third party graphics, software or libraries. + +- [QR Code](addons/qr_code.md){ .md-button .center-lg-button } + + --- + + QR Code generator and nodes. + +- [TextureButtonColored](addons/texture_button_colored.md){ .md-button .center-lg-button } + + --- + + `TextureButton` with color theme. + +
+ +## License + +[MIT License](https://github.com/kenyoni-software/godot-addons/blob/main/LICENSE.md) diff --git a/doc/hooks/badge.py b/doc/hooks/badge.py new file mode 100644 index 0000000..12fd35a --- /dev/null +++ b/doc/hooks/badge.py @@ -0,0 +1,36 @@ +from typing import Callable + +from mkdocs.config.defaults import MkDocsConfig + + +def _badge_html(icon: str, text: str = "", typ: str = ""): + classes = f"mdx-badge mdx-badge--{typ}" if typ else "mdx-badge" + return "".join([ + f'', + f'{icon}' if icon else "", + f'{text}' if text else "", + f"", + ]) + + +def badge(args_text: str, config: MkDocsConfig) -> str: + icon, *text = args_text.split(" ", 1) + return _badge_html( + icon=icon, + text="".join(text) + ) + + +def badge_experimental(_args: str, config: MkDocsConfig): + return _badge_html(":material-flask-outline:") + + +def badge_version(args_text: str, config: MkDocsConfig): + return _badge_html(":material-tag-outline:", f"{args_text}") + + +HOOKS: dict[str, Callable[[str, MkDocsConfig], str]] = { + "badge": badge, + "experimental": badge_experimental, + "version": badge_version, +} diff --git a/doc/hooks/hooks.py b/doc/hooks/hooks.py new file mode 100644 index 0000000..bef45e1 --- /dev/null +++ b/doc/hooks/hooks.py @@ -0,0 +1,30 @@ +import re +from re import Match +from typing import Callable + +from mkdocs.config.defaults import MkDocsConfig +from mkdocs.structure.files import Files +from mkdocs.structure.pages import Page + +import badge +import source_link + + +HOOKS: dict[str, Callable[[str, MkDocsConfig], str]] = badge.HOOKS | source_link.HOOKS + + +def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files: Files): + def replace(match: Match): + typ, args = match.groups() + args = args.strip() + + fn: Callable[[str, MkDocsConfig], str] = HOOKS.get(typ, None) + if fn is None: + raise RuntimeError(f"Unknown shortcode: {type}") + + return fn(args, config) + + return re.sub( + r"", + replace, markdown, flags=re.I | re.M + ) diff --git a/doc/hooks/source_link.py b/doc/hooks/source_link.py new file mode 100644 index 0000000..fd36fe2 --- /dev/null +++ b/doc/hooks/source_link.py @@ -0,0 +1,15 @@ +from typing import Callable + +from mkdocs.config.defaults import MkDocsConfig + + +def source_link(args: str, config: MkDocsConfig) -> str: + path, *text_ = args.split(" ", 1) + text: str = "".join(text_) + print(config.extra["kenyoni"]) + return f"[{path if text == '' else text}]({config.extra.get('kenyoni', {}).get('source_url', '')}{path})" + + +HOOKS: dict[str, Callable[[str, MkDocsConfig], str]] = { + "source": source_link, +} diff --git a/doc/icon_explorer.png b/doc/icon_explorer.png deleted file mode 100644 index 7c2ec5b..0000000 Binary files a/doc/icon_explorer.png and /dev/null differ diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml new file mode 100644 index 0000000..4263ca8 --- /dev/null +++ b/doc/mkdocs.yml @@ -0,0 +1,105 @@ +site_name: Kenyoni Godot Addons +site_url: https://kenyoni-software.github.io/godot-addons +copyright: "© Copyright 2022-present Kenyoni Software" + +extra: + generator: true + social: + - icon: material/earth + link: https://github.com/kenyoni-software + - icon: fontawesome/brands/github + link: https://github.com/kenyoni-software + kenyoni: + source_url: "https://github.com/kenyoni-software/godot-addons/tree/main" + +extra_css: + - _static/css/common.css + - _static/css/badge.css + +extra_javascript: + # mathjax + - _static/js/mathjax.js + - https://polyfill.io/v3/polyfill.min.js?features=es6 + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js + # tablesort + - _static/js/tablesort.js + - https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js + +hooks: + - hooks/hooks.py + +markdown_extensions: + # Python Markdown + - abbr + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - toc: + permalink: true + # Python Markdown Extensions + - pymdownx.arithmatex: + generic: true + - pymdownx.betterem: + smart_enable: all + - pymdownx.caret + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + options: + custom_icons: + - _static/img/icons + - pymdownx.highlight + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + +plugins: + - minify: + minify_html: true + - search + - social: + cards_layout_options: + font_family: Noto Sans + +theme: + name: material + palette: + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/weather-sunny + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/weather-night + name: Switch to system preference + font: false + language: en + features: + - header.autohide + - navigation.top + - navigation.indexes + - navigation.instant + - navigation.instant.progress + - navigation.path + - navigation.prune + - navigation.tracking + - search.highlight + - search.suggest + - toc.follow + - toc.integrate