|
| 1 | +""" |
| 2 | +Shared constants used across all Turnt-o-mapper modules. |
| 3 | +
|
| 4 | +Contains: |
| 5 | +- Texture registry and category lists (floor, wall, ceiling, special) |
| 6 | +- Map geometry parameters (wall thickness, door dimensions) |
| 7 | +- Ramp physics constants (slope ratio, max angle) |
| 8 | +- UI theme colour palette |
| 9 | +- Image file extensions for texture thumbnail loading |
| 10 | +""" |
| 11 | + |
| 12 | +import math |
| 13 | +from typing import Dict |
| 14 | + |
| 15 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 16 | +# TEXTURES |
| 17 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 18 | +ALL_TEXTURES: Dict[str, int] = { |
| 19 | + "NULL":2,"common/caulk":2,"common/lavacaulk":4,"common/nodraw":2, |
| 20 | + "common/nodrawnonsolid":2,"common/slick":5,"common/slimecaulk":4, |
| 21 | + "common/watercaulk":3,"common/weapclip":2,"common/playerclip":2, |
| 22 | + "turnt/temp_blue":8,"turnt/temp_dark":0,"turnt/temp_green":7, |
| 23 | + "turnt/temp_light":1,"turnt/temp_orange":9,"turnt/temp_purple":10, |
| 24 | + "turnt/temp_red":6,"turnt/temp_yellow":11, |
| 25 | + "turnt/turnt_asphalt":12,"turnt/turnt_asphalt_t2":30, |
| 26 | + "turnt/turnt_boost":13,"turnt/turnt_boost_2":31, |
| 27 | + "turnt/turnt_checkpoint":14,"turnt/turnt_checkpoint_2":32, |
| 28 | + "turnt/turnt_concrete":15,"turnt/turnt_concrete_2":33, |
| 29 | + "turnt/turnt_coral":16,"turnt/turnt_coral_t2":34, |
| 30 | + "turnt/turnt_cyan":17,"turnt/turnt_cyan_t2":17, |
| 31 | + "turnt/turnt_gold":18,"turnt/turnt_gold_t2":36, |
| 32 | + "turnt/turnt_hazard":19,"turnt/turnt_hazard_2t":37, |
| 33 | + "turnt/turnt_lime":20,"turnt/turnt_lime_t2":38, |
| 34 | + "turnt/turnt_magenta":21,"turnt/turnt_magenta_t2":39, |
| 35 | + "turnt/turnt_mint":22,"turnt/turnt_mint_t2":40, |
| 36 | + "turnt/turnt_orange":9,"turnt/turnt_orange_2t":41, |
| 37 | + "turnt/turnt_platform":23,"turnt/turnt_platform_2t":42, |
| 38 | + "turnt/turnt_sky":24,"turnt/turnt_sky_2t":43, |
| 39 | + "turnt/turnt_speed":25,"turnt/turnt_speed_2t":44, |
| 40 | + "turnt/turnt_teal":26,"turnt/turnt_teal_2t":45, |
| 41 | + "turnt/turnt_tech":27,"turnt/turnt_tech_2t":46, |
| 42 | + "turnt/turnt_violet":28,"turnt/turnt_violet_2t":47, |
| 43 | + "turnt/turnt_white":29,"turnt/turnt_white_2t":48, |
| 44 | +} |
| 45 | + |
| 46 | +# Mutable texture category lists — the UI mutates these in place via |
| 47 | +# _update_tex_lists(); other modules (layout, generation) import the same |
| 48 | +# list objects and see the updated selections automatically. |
| 49 | +FLOOR_TEX = ["turnt/turnt_concrete", "turnt/turnt_asphalt", |
| 50 | + "turnt/turnt_platform", "turnt/turnt_tech", "turnt/turnt_teal"] |
| 51 | +WALL_TEX = ["turnt/turnt_concrete", "turnt/turnt_tech", "turnt/turnt_white", |
| 52 | + "turnt/turnt_cyan", "turnt/turnt_mint", "turnt/turnt_violet"] |
| 53 | +CEIL_TEX = ["turnt/turnt_sky", "turnt/turnt_white", "turnt/turnt_tech"] |
| 54 | + |
| 55 | +HIDDEN_TEX = "common/caulk" |
| 56 | +NODRAW_TEX = "common/nodrawnonsolid" |
| 57 | +TRIGGER_TEX = "common/trigger" |
| 58 | + |
| 59 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 60 | +# MAP GEOMETRY PARAMETERS |
| 61 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 62 | +WALL_T = 16 # wall / shell thickness in Quake units |
| 63 | +DOOR_W = 128 # default door width |
| 64 | +DOOR_H = 128 # default door height |
| 65 | + |
| 66 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 67 | +# RAMP PHYSICS CONSTANTS |
| 68 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 69 | +SLOPE_RATIO = 4.0 # horizontal / vertical ~= 14deg -- ideal shallow slope |
| 70 | +MAX_RAMP_ANGLE = 30 # degrees -- steepest allowed ramp |
| 71 | +# Minimum slope ratio that keeps angle <= MAX_RAMP_ANGLE: 1/tan(30deg) ~= 1.732 |
| 72 | +MIN_SLOPE_RATIO = 1.0 / math.tan(math.radians(MAX_RAMP_ANGLE)) |
| 73 | + |
| 74 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 75 | +# THEME (dark UI colour palette) |
| 76 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 77 | +T = { |
| 78 | + "bg": "#0c0e1a", |
| 79 | + "bg_panel": "#12162a", |
| 80 | + "bg_card": "#1a1f38", |
| 81 | + "bg_input": "#0e1224", |
| 82 | + "accent": "#4fc3f7", |
| 83 | + "accent2": "#9575cd", |
| 84 | + "text": "#e8eaf6", |
| 85 | + "text_dim": "#78849e", |
| 86 | + "success": "#66bb6a", |
| 87 | + "warning": "#ffa726", |
| 88 | + "border": "#2a3050", |
| 89 | + "btn_fg": "#ffffff", |
| 90 | + "prev_bg": "#0b0f1e", |
| 91 | + "room_col": "#1a3358", |
| 92 | + "room_bdr": "#4fc3f7", |
| 93 | + "corr_col": "#162238", |
| 94 | + "start_col": "#1b5e20", |
| 95 | + "end_col": "#b71c1c", |
| 96 | + "lbx_bg": "#0e1224", |
| 97 | + "lbx_sel": "#263850", |
| 98 | + "dot_grid": "#182236", |
| 99 | +} |
| 100 | + |
| 101 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 102 | +# FILE EXTENSIONS recognised as texture images |
| 103 | +# ══════════════════════════════════════════════════════════════════════════════ |
| 104 | +IMG_EXTS = {".jpg", ".jpeg", ".png", ".bmp", ".tga", ".gif", ".tiff"} |
0 commit comments