Skip to content

Latest commit

 

History

History
51 lines (29 loc) · 3.78 KB

File metadata and controls

51 lines (29 loc) · 3.78 KB

Contributing to OneLauncher

Contributions and questions are always welcome! Here's just a couple of things to keep in mind:

  • Remember to search the GitHub Issues before making a bug report or feature request.
  • Please open an issue to discuss changes before creating a pull request.

Development Install

OneLauncher uses uv for dependency management. Run uv run onelauncher in the root folder of this repository to install and start OneLauncher. Alternatively, Nix can be used.

For game patching support, extra C code must be compiled with mingw-w64. Run make -C src/run_patch_client && mv src/run_patch_client/run_ptch_client.exe src/onelauncher/external/. Your mingw-w64 installation must have support for i686 builds. innoextract is needed for game installation support.

Nix

OneLauncher comes with a Nix flake for easily replicating the standard development environment. It can be used with direnv or the nix develop command.

The compiled builds can be tested on NixOS with nix run .#fhs-run build/out/onelauncher.bin. Similarly, nix run .#fhs-run onelauncher can be used while in the development shell to start OneLauncher from source with support for the WINE binaries it downloads.

Building

Build by running uv run python -m build in the project's root directory. This will output everything to "build/out". Individual scripts can also be called to skip parts of the build or pass arguments to the build tool.

The .NET CLI is required for building the Windows installer.

Translation

OneLauncher uses Weblate for translations. You can make an account and contribute translations through their site. See the project page here.

Coding Conventions

All code is strictly type checked with Mypy and both linted and formatted with Ruff. Pytest unit tests are encouraged.

UI Changes

User interfaces are defined in .ui files that can be visually edited in pyside6-designer. You can use the command onelauncher designer to launch pyside6-designer with OneLauncher's plugins enabled.

UI files must be compiled into Python to be used in OneLauncher. This can be done with pyside6-uic src/onelauncher/ui/example_window.ui -o src/onelauncher/ui/example_window_uic.py, replacing "example_window" with the one being updated.

QSS Classes

OneLauncher uses a system similar to Tailwind CSS for styling UIs responsively.

Here's how it works:

  • The dynamic property qssClass is added to the widget that needs to be styled. This property should always be of the type StringList.
  • Each string in qssClass is a "class" that will affect the widget's styling. This works by selecting for them in dynamically generated Qt Style Sheets.
  • The classes are mainly used to set sizes and margins relative to the system font size. Changes can be previewed live in pyside6-designer.
  • See the Tailwind Docs for specific class names. The currently supported types are padding, margin, width, min-width, max-width, height, min-height, max-height, font-size, and icon-size.