This repository contains the source code for the UCP3-GUI. This software provides a GUI to configure and manage installations of the UnofficialCrusaderPatch3, a modification utility for the game Stronghold Crusader.
The first version of the GUI as well as the UCP3 itself are heavy work in progress and may currently change without further notice.
The GUI is currently work in progress, so there is no release at the moment.
The first version will likely come in the form of an installer that takes care of the necessities.
The support will include at least Windows 10/11, however, it should go down to Windows 8 and if possible even Windows 7. Linux and Mac will be considered after that and are in the realm of possibilities.
This section will be restructured and extended once the first version is ready for release. (If we forget, please inform us :upside_down_face:.)
Contributions and help are always welcome!
The application is written using Tauri. It is therefore a combination of Frontend-Web-Technologies like HTML, CSS and Javascript and a Rust-based Backend.
The separation is rather strict. Frontend code can not interact "normally" with the filesystem or the OS like some of you are maybe used to from Node. Instead, it relies on specific provided or custom-written API functions in Rust. The window with its frontend code essentially behaves like a webpage.
More information are better taken from Tauri sources :smiley:.
Something is very important, however:
You do not need to know both Rust and Javascript to help.
Most work is done in the frontend. In terms of knowledge for the frontend part: Knowing React or being willing to learn the basics is essential. Styling alone might also be helpful, but due to the usage of React, there is little need for HTML alone.
Multiple words were already said about Tauri, but this just sets the playground for a lot of possible technologies, especially regarding the frontend. The list does not talk about all used packages. Instead it lists noteworthy dependencies that define they way code is written and behaves.
If you think something else is worth mentioning, please tell us.
Backend
Nothing outside what appears to be the "normal" Rust setup using Cargo.
Frontend
To develope and build the application, you need to fullfil some requirements.
Install and setup Git.
Install and setup the prerequisites like explained in the Tauri Docs. This depends on the OS you are developing on and essentially involves:
Install Node.
Install the frontend dependencies.
npm ci
to install the frontend dependencies into the folder. You need to repeat this step if the dependencies were changed by someone else. At best you just run it whenever you pull something from the repository. npm install
should only be used if you want to change or add dependencies.Setup your favorite IDEs and install plugins for the parts you want to work on.
relative
(setting is currently called importModuleSpecifier). The reason is that unimported
, the unused code tracker, works only with relative imports due to the setup of the folders.\n
(LF): setting is called files.eol
rust-analyzer
is heavily recommended (it also is a bit heavy on the system) to get proper code validation und suggestions.To get get better idea of the structure of the project, you can take a look at this Getting Started Guide for setting up a Tauri project using Vite. However, it is important to not follow the steps in it, since they are meant to setup an entirely new project!
We also currently do not monitor which versions should be used of Rust, Node and NPM. We recommend the newest versions. Should something break with them, please inform use, so that we can update the code.
There are currently two commands set up. Both are run through npm:
npm run dev
- Installs the Rust dependencies, starts the frontend development server and opens the window. Vite takes care of hot reloads of changed frontend files.
Changes of Rust files, however, require a re-compile, and are currently also triggered on change. Depending on your system, you therefore may better develop in Rust without the dev-server being active.
npm run build
- Installs the Rust dependencies and builds the application.
The results are an executable under src-tauri\target\release\
and an installer under src-tauri\target\release\bundle
. In case of Windows, it will currently create a msi-installer using the bitness of your system (x32 or x64).
Currently, both the build and the dev versions of the window allow to open the web console by typing F12.
Firefly Studios for the creation of the Stronghold Crusader.