#!/usr/bin/env python3 """ Fast Static Asset Gallery Generator Scans assets and generates HTML - NO file copying! """ import os from pathlib import Path from collections import defaultdict # Skip these folders (backups, etc.) SKIP_FOLDERS = {'BACKUP', 'node_modules', '.git', 'out', '__pycache__'} # Categories with keywords CATEGORIES = { "🌱 Ground & Terrain": ["ground", "grass", "dirt", "soil", "water", "teren", "tla"], "🌾 Crops & Farming": ["crop", "wheat", "potato", "corn", "tomato", "seed", "harvest", "pridelek", "sadik"], "🌳 Trees & Nature": ["tree", "apple", "cherry", "dead", "bush", "drevo", "narava", "gozd"], "šŸ—ļø Props & Objects": ["fence", "chest", "barrel", "crate", "prop", "objekt", "ograja"], "šŸ  Buildings": ["house", "barn", "building", "zgradba", "hisa", "gothic"], "šŸ‘¤ Characters & NPCs": ["character", "npc", "kai", "ana", "gronk", "zombie", "lik", "igralec"], "šŸ’„ Effects & VFX": ["blood", "fog", "rain", "vfx", "effect", "kri", "megla"], "šŸŽØ UI & Icons": ["icon", "ui", "button", "menu", "ikona"], "šŸ”§ Tools & Items": ["tool", "hoe", "axe", "pickaxe", "sword", "orodi", "item"], "šŸ“¦ Other": [] } def should_skip(path_str): """Check if we should skip this path.""" for skip in SKIP_FOLDERS: if skip in path_str: return True return False def categorize(filepath): """Determine category from path.""" path_lower = str(filepath).lower() for category, keywords in CATEGORIES.items(): if category == "šŸ“¦ Other": continue for kw in keywords: if kw in path_lower: return category return "šŸ“¦ Other" def scan_fast(): """Fast scan - limit depth and skip backups.""" categorized = defaultdict(list) count = 0 max_files = 500 # Limit for speed print("šŸ” Scanning assets...") for root, dirs, files in os.walk("assets"): # Remove skip folders from search dirs[:] = [d for d in dirs if not should_skip(os.path.join(root, d))] for file in files: if not file.endswith('.png'): continue if count >= max_files: break full_path = os.path.join(root, file) category = categorize(full_path) categorized[category].append({ "path": full_path, "name": file }) count += 1 if count % 50 == 0: print(f" Found {count} assets...") if count >= max_files: break print(f"āœ… Scanned {count} assets") return categorized def generate_html(categorized): """Generate beautiful HTML gallery.""" total = sum(len(assets) for assets in categorized.values()) html = f""" Mrtva Dolina - Full Asset Gallery

šŸ’€ MRTVA DOLINA šŸ’€

Complete Asset Gallery - Static Offline Version

šŸ“Š Total Assets: {total} | šŸ“ Categories: {len([c for c in categorized if categorized[c]])}
""" for category in sorted(categorized.keys()): assets = categorized[category] if not assets: continue # Sort by name assets.sort(key=lambda x: x['name']) html += f"""
{category} ({len(assets)} assets)
""" for asset in assets: html += f"""
{asset['name']}
{asset['name']}
""" html += """
""" html += """ """ with open('asset_gallery_full.html', 'w', encoding='utf-8') as f: f.write(html) print(f"\nāœ… Gallery created: asset_gallery_full.html") print(f" {total} assets in {len([c for c in categorized if categorized[c]])} categories") print(f"\nšŸŽÆ Double-click to open (works offline!)") if __name__ == "__main__": categorized = scan_fast() generate_html(categorized)