# --- Firefrost Gaming Cinematic Suite Launcher ---
# Created: March 30, 2026
# Purpose: One-click launch of replay folder + Mineways + Blender
# Author: Chronicler #48

Write-Host "🔥❄️ Firefrost Gaming Cinematic Suite" -ForegroundColor Cyan
Write-Host "Initializing tools..." -ForegroundColor Yellow
Write-Host ""

# Auto-detect current user (no hardcoded paths)
$username = $env:USERNAME

# 1. Open the Replay Mod folder
$replayPath = "C:\Users\$username\AppData\Roaming\.minecraft\replay_recordings"
Write-Host "Opening Replay Mod folder..." -ForegroundColor Green
if (Test-Path $replayPath) {
    Invoke-Item $replayPath
    Write-Host "  ✓ Replay folder opened" -ForegroundColor Green
} else {
    # Try alternative path for Forge port
    $replayPath = "C:\Users\$username\AppData\Roaming\.minecraft\replays"
    if (Test-Path $replayPath) {
        Invoke-Item $replayPath
        Write-Host "  ✓ Replay folder opened (Forge path)" -ForegroundColor Green
    } else {
        Write-Host "  ✗ Replay folder not found" -ForegroundColor Red
        Write-Host "    Tried: replay_recordings and replays" -ForegroundColor Yellow
        Write-Host "    Check your Minecraft installation path" -ForegroundColor Yellow
    }
}
Write-Host ""

# 2. Launch Mineways
$minewaysPath = "C:\Program Files (x86)\Mineways\mineways.exe"
Write-Host "Launching Mineways..." -ForegroundColor Green
if (Test-Path $minewaysPath) {
    Start-Process $minewaysPath
    Write-Host "  ✓ Mineways launched" -ForegroundColor Green
} else {
    # Try 64-bit path
    $minewaysPath = "C:\Program Files\Mineways\mineways.exe"
    if (Test-Path $minewaysPath) {
        Start-Process $minewaysPath
        Write-Host "  ✓ Mineways launched (64-bit)" -ForegroundColor Green
    } else {
        Write-Host "  ✗ Mineways not found" -ForegroundColor Red
        Write-Host "    Expected at: C:\Program Files (x86)\Mineways\mineways.exe" -ForegroundColor Yellow
        Write-Host "    Or: C:\Program Files\Mineways\mineways.exe" -ForegroundColor Yellow
        Write-Host "    Check installation location" -ForegroundColor Yellow
    }
}
Write-Host ""

# 3. Launch Blender
$blenderPath = "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe"
Write-Host "Launching Blender..." -ForegroundColor Green
if (Test-Path $blenderPath) {
    Start-Process $blenderPath
    Write-Host "  ✓ Blender launched (version 4.0)" -ForegroundColor Green
} else {
    # Try newer versions
    $blenderPath = "C:\Program Files\Blender Foundation\Blender 4.1\blender.exe"
    if (Test-Path $blenderPath) {
        Start-Process $blenderPath
        Write-Host "  ✓ Blender launched (version 4.1)" -ForegroundColor Green
    } else {
        $blenderPath = "C:\Program Files\Blender Foundation\Blender 4.2\blender.exe"
        if (Test-Path $blenderPath) {
            Start-Process $blenderPath
            Write-Host "  ✓ Blender launched (version 4.2)" -ForegroundColor Green
        } else {
            Write-Host "  ✗ Blender not found" -ForegroundColor Red
            Write-Host "    Tried versions: 4.0, 4.1, 4.2" -ForegroundColor Yellow
            Write-Host "    Expected at: C:\Program Files\Blender Foundation\Blender X.X\blender.exe" -ForegroundColor Yellow
            Write-Host "    Check Blender installation" -ForegroundColor Yellow
        }
    }
}
Write-Host ""

Write-Host "🎬 Cinematic Suite ready!" -ForegroundColor Cyan
Write-Host "Fire + Frost + Foundation = Where Love Builds Legacy" -ForegroundColor Magenta
Write-Host ""
Write-Host "Need help? See: docs/tasks/blender-cinematic-workflow/DEPLOYMENT-GUIDE.md" -ForegroundColor DarkGray
Write-Host ""
Pause
