Skip to content

Developer Information

jokal2 edited this page Sep 14, 2020 · 7 revisions

Development Environment

  • Windows 7 or 10 is the primary target for support, but Linux (at least Ubuntu 16.04) and macOS can be used as well.
  • On Windows, install Qt Creator with mingw 5.3.0 and Qt 5.14.0 (in Qt installer, make sure to include archived releases). Note that Qt 5.12.0+ / mingw 5.7+ does not seem to work (on Win 10 x64 at least). MVSC15-19 has also so far been unsuccessful. Make sure to include Qt Charts in the installation as well.
  • Git LFS is used to distribute assets. The repository will not build properly unless the Git LFS files are checked out (install Git LFS with git lfs install and check out LFS files with git lfs pull). Note: expect the initial Git LFS download to take ~20 minutes+.
  • This repository provides certain development tools under DevTools/ (requires python 3.6+). For host development run using python3 DevTools/copy_to_debug.py. This will generate a build.config file in the repository root the first time. Fill with your host-specific configuration and re-run the script. This script sets up and copies various runtime data like rotations and items to the debug directory. After doing this once you only need to run the script if this runtime data has changed (either by yourself or after rebasing).
  • If you do not have python 3.6+ installed and cannot install it then you will have to manually set up the debug directory. Build the repository (which creates the debug directory) and copy Rotations/ directory, rotation_paths.xml, equipment directories (e.g. Wrists/, etc.), equipment_paths.xml, set_bonuses.xml, and random_affixes.xml. They should all be placed in the root of the debug build directory.

Clang-format and Code Style

This project uses clang-format from LLVM in order to format the project. If you are using QtCreator then you will need to do the following to set up code formatting:

  • Install binary, e.g. Win 64-bit, from LLVM.
  • In QtCreator, Help -> About Plugins.., scroll down to Beautifier and clang-format and enable both and restart QtCreator.
  • After restart go to Tools -> Options -> Beautifier -> General and make sure "Restrict to files contained in the current project" is checked. Optionally also use "Enable auto format on file save".
  • In Tools -> Options -> Beautifier -> Clang Format change the "Use predefined style" to "File" in the dropdown list.

Now clang-format can be run either by saving (if using the auto-format option described above), or via Tools -> Beautifier -> ClangFormat -> Format Current File.

See the following for more information regarding the Code Style.

How to add images

When adding for example new items that has an icon that was previously not used by any other item the icon will likely not exist in the repository. This can be confirmed by using git-ls-files:

git ls-files | grep -i <image>
Example:
git ls-files | grep -i "inv_axe_11\.png"

If it does not return a result the image has to be added to the project. You do this by:

  1. Finding the appropriate icon on wikis like this one and placing it in the appropriate QML/Assets directory in the repository (for items this would be QML/Assets/items/).
  2. Add the file to git, which is set up to handle images using Git LFS.
git add QML/
  1. Add it to qml.qrc either manually editing or via Qt Creator. If doing it via Qt Creator you expand Resources in the project view, right-click qml.qrc -> Add Existing Directory -> point towards QML/Assets/items. It will warn you it failed to add many files as they already exist: ignore this warning by cancelling (the screen will not be able to show the entire list of warnings because there are hundreds if not thousands of duplicates). If you re-compile you will see it will recompile qml.qrc, and git status will show that qml.qrc was modified.

Clone this wiki locally