Development guide for FS25 Vehicle Sorter Python desktop app that reorders Farming Simulator 2025 vehicles
Development guide for working with the FS25 Vehicle Sorter codebase - a Python desktop application that allows Farming Simulator 2025 players to reorder vehicles in their savegame by modifying the `vehicles.xml` file.
FS25 Vehicle Sorter is a Python desktop application that modifies the TAB-cycling order of vehicles in Farming Simulator 2025 by reordering elements in the savegame's `vehicles.xml` file.
The project follows the modern Python src/ layout:
**src/fs25_vehicle_sorter/main.py** - GUI application entry point using FreeSimpleGUI. Handles all UI events, vehicle selection, and movement operations. The main event loop processes user interactions and updates the vehicle list display.
**src/fs25_vehicle_sorter/vehicle_xml.py (VehiclesXml class)** - Core business logic for loading/saving savegames and manipulating vehicle order. This class:
**src/fs25_vehicle_sorter/model.py (Vehicle class)** - Simple data model representing a vehicle with properties:
FS25 significantly changed the vehicles.xml format from FS22:
**Key differences:**
**How it works:**
This project uses [uv](https://docs.astral.sh/uv/) for Python version and dependency management.
```bash
uv sync
```
```bash
uv run python main.py
```
Run Ruff for linting and formatting:
```bash
uv run ruff check .
uv run ruff check --fix .
uv run ruff format .
uv run ruff check --fix . && uv run ruff format .
```
Pre-commit hooks automatically run ruff before each commit:
```bash
uv run pre-commit install
uv run pre-commit run --all-files
git commit --no-verify
```
Build a standalone executable using PyInstaller:
```bash
uv run pyinstaller --onefile --name "FS25 Vehicle Sorter" --windowed main.py
```
**XML Element Ordering**: TAB order is determined by the order of `<vehicle>` elements in the XML file. When saving, reorder these elements to match the vehicles_list order (src/fs25_vehicle_sorter/vehicle_xml.py:50-53).
**Attachment Tracking**: Uses `uniqueId` references via `attachedVehicleUniqueId` attribute. These remain valid when reordering since uniqueId values are not modified.
**Backup Creation**: Always creates a timestamped backup before saving (src/fs25_vehicle_sorter/vehicle_xml.py:56-59).
**Reload After Save**: Always reload the savegame after saving (src/fs25_vehicle_sorter/vehicle_xml.py:65) to refresh the in-memory state.
**Package Structure**: Uses relative imports (e.g., `from .model import Vehicle`) within the src/fs25_vehicle_sorter directory.
The app detects the platform and sets default savegame locations:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/fs25-vehicle-sorter-development/raw