Skip to content

Commit e001dfa

Browse files
authored
Merge pull request #11 from dhcold/dhc/laughing-brahmagupta
Migrate UI to PyQt6 with dark/light theme, DBT importer overhaul, CI
2 parents 931f5ef + cc65c01 commit e001dfa

11 files changed

Lines changed: 2616 additions & 1170 deletions

File tree

.github/workflows/release.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- os: windows-latest
15+
artifact_name: turnt-o-mapper-windows.exe
16+
pyinstaller_args: >-
17+
--onefile
18+
--windowed
19+
--name turnt-o-mapper
20+
--icon assets/icon.ico
21+
dist_file: turnt-o-mapper.exe
22+
23+
- os: macos-latest
24+
artifact_name: turnt-o-mapper-macos
25+
pyinstaller_args: >-
26+
--onefile
27+
--windowed
28+
--name turnt-o-mapper
29+
dist_file: turnt-o-mapper
30+
31+
- os: ubuntu-latest
32+
artifact_name: turnt-o-mapper-linux
33+
pyinstaller_args: >-
34+
--onefile
35+
--name turnt-o-mapper
36+
dist_file: turnt-o-mapper
37+
38+
runs-on: ${{ matrix.os }}
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- uses: actions/setup-python@v5
44+
with:
45+
python-version: "3.12"
46+
47+
- name: Install dependencies
48+
run: pip install PyQt6 Pillow pyinstaller
49+
50+
- name: Bump __version__ to match tag
51+
shell: bash
52+
run: |
53+
TAG="${{ github.ref_name }}"
54+
VER="${TAG#v}"
55+
echo "__version__ = \"$VER\"" > turnt_o_mapper/__version__.py
56+
57+
- name: Build binary (Windows)
58+
if: runner.os == 'Windows'
59+
run: pyinstaller ${{ matrix.pyinstaller_args }} main.py
60+
continue-on-error: true
61+
62+
- name: Build binary (macOS / Linux)
63+
if: runner.os != 'Windows'
64+
run: pyinstaller ${{ matrix.pyinstaller_args }} main.py
65+
66+
- name: Rename artifact
67+
shell: bash
68+
run: |
69+
SRC="dist/${{ matrix.dist_file }}"
70+
DST="dist/${{ matrix.artifact_name }}"
71+
if [ "$SRC" != "$DST" ]; then mv "$SRC" "$DST"; fi
72+
73+
- name: Upload artifact
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: ${{ matrix.artifact_name }}
77+
path: dist/${{ matrix.artifact_name }}
78+
retention-days: 5
79+
80+
release:
81+
needs: build
82+
runs-on: ubuntu-latest
83+
permissions:
84+
contents: write
85+
86+
steps:
87+
- name: Download all artifacts
88+
uses: actions/download-artifact@v4
89+
with:
90+
path: artifacts
91+
92+
- name: Create GitHub Release
93+
uses: softprops/action-gh-release@v2
94+
with:
95+
files: artifacts/**/*
96+
generate_release_notes: true
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Turnt-o-Mapper
2+
3+
> A procedural `.map` file generator and Diabotical importer for the game **Turnt**.
4+
5+
<!-- Insert hero screenshot here -->
6+
7+
Turnt-o-Mapper generates ready-to-play for Turnt / ready-to-compile Quake 3 `.map` files.
8+
Design a full map layout in seconds: choose room count, dimensions, corridor width, texture sets, and let the generator handle the geometry.
9+
10+
---
11+
12+
## Features
13+
14+
- **6 layout strategies** — Linear, Zigzag, Snake, Random, Spiral, Multilevel
15+
- **Interactive 2D preview** — scroll to zoom, drag to pan, double-click to fit
16+
- **Interactive 3D wireframe** — drag to rotate, WASD to pan, scroll to zoom, Iso/Top/Front/Side presets
17+
- **Physics model** — acceleration-based speed simulation per room segment
18+
- **Texture selector** — assign floor / wall / ceiling textures with live preview
19+
- **Diabotical `.rbe` importer** — import existing DBT maps with configurable XYZ scale
20+
- **Auto-update** — checks GitHub Releases on startup and downloads new versions automatically
21+
22+
---
23+
24+
## Download
25+
26+
Pre-built binaries are available on the [Releases](../../releases) page:
27+
28+
| Platform | File |
29+
|---|---|
30+
| Windows | `turnt-o-mapper-windows.exe` |
31+
| macOS | `turnt-o-mapper-macos` |
32+
| Linux | `turnt-o-mapper-linux` |
33+
34+
**Windows:** Double-click the `.exe` — no install needed.
35+
36+
**macOS:** If you see a security warning, right-click → Open, or run:
37+
```bash
38+
xattr -cr turnt-o-mapper-macos && chmod +x turnt-o-mapper-macos && ./turnt-o-mapper-macos
39+
```
40+
41+
**Linux:**
42+
```bash
43+
chmod +x turnt-o-mapper-linux && ./turnt-o-mapper-linux
44+
```
45+
46+
---
47+
48+
## Build from source
49+
50+
**Requirements:** Python 3.10+
51+
52+
```bash
53+
git clone https://github.com/dhcold/Turnt-o-mapper.git
54+
cd Turnt-o-mapper
55+
pip install PyQt6 Pillow
56+
python main.py
57+
```
58+
59+
Optional — texture thumbnails require Pillow (already listed above).
60+
61+
### Build a standalone binary yourself
62+
63+
```bash
64+
pip install pyinstaller
65+
pyinstaller --onefile --windowed --name turnt-o-mapper main.py
66+
# Output: dist/turnt-o-mapper[.exe]
67+
```
68+
69+
---
70+
71+
## Usage
72+
73+
### Generate tab
74+
1. Set **Number of rooms** (2–100) and choose a **Layout style**
75+
2. Adjust **Room size** (min/max width, depth, height)
76+
3. Set **Corridor width** (25–100%)
77+
4. Optionally enable **Physics model** for acceleration-based level design
78+
5. Click **⚡ Generate** — preview updates instantly
79+
80+
### Textures tab
81+
- Assign textures to **Floor**, **Wall**, and **Ceiling** categories using the F/W/C checkboxes
82+
- Set the **Texture folder** path in Settings to see live thumbnails
83+
- The generator picks randomly from each category per room
84+
85+
### Settings tab
86+
- **Output .map file** — where the generated file is saved
87+
- **Texture folder** — path to your Turnt texture assets (for preview only)
88+
- **Game executable** — path to Turnt binary for the Launch button
89+
90+
### DBT Import tab
91+
- Select a Diabotical `.rbe` map file
92+
- Configure X/Y/Z scale (Quake units per DBT block)
93+
- Click **Import** to get a `.map`
94+
- **Save** map file
95+
96+
### Save & launch
97+
- **Save .map** — writes the current map to the configured output path
98+
- **Open folder** — opens the output folder in your file manager
99+
- **Launch game** — runs Turnt with `--import=<path>` to preview in-engine
100+
101+
---
102+
103+
## Map pipeline
104+
105+
```
106+
Turnt-o-Mapper → .map file → Turnt
107+
```
108+
109+
The generated `.map` uses standard Quake 3 brush format and is compatible
110+
with any Q3-based compiler (q3map2, DarkPlaces, etc.).
111+
112+
---
113+
114+
## Project structure
115+
116+
```
117+
main.py Entry point (QApplication bootstrap)
118+
turnt_o_mapper/
119+
app.py Main window (PyQt6 UI)
120+
preview2d.py 2D top-down preview widget
121+
viewer3d.py 3D wireframe preview widget
122+
generation.py Map generation orchestrator
123+
layout.py Room placement & corridor routing
124+
brushes.py Quake 3 brush/face geometry
125+
entities.py Spawn, trigger, checkpoint entities
126+
dbt_import.py Diabotical .rbe importer
127+
constants.py Texture registry, theme colours, geometry params
128+
models.py Room & Bridge dataclasses
129+
config.py JSON config persistence
130+
updater.py GitHub Releases auto-update
131+
__version__.py Version string
132+
```
133+
134+
---
135+
136+
## License
137+
138+
MIT

main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/usr/bin/env python3
22
"""Turnt-o-mapper -- launch entry point."""
33

4-
from turnt_o_mapper.app import App
4+
import sys
5+
from PyQt6.QtWidgets import QApplication
6+
from turnt_o_mapper.app import App, DARK_QSS
57

68
if __name__ == "__main__":
7-
App().mainloop()
9+
app = QApplication(sys.argv)
10+
app.setStyleSheet(DARK_QSS)
11+
window = App()
12+
window.show()
13+
sys.exit(app.exec())

turnt_o_mapper/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.1.0"

0 commit comments

Comments
 (0)