Compare commits

...

35 Commits

Author SHA1 Message Date
23441c8b28 Fixed music for funny packs. 2025-03-31 22:03:08 -04:00
6124419d29 Testing updates. 2025-03-30 21:58:26 -04:00
b17f1c0672 Updated the keybinding fix part of the program. 2025-03-25 15:12:20 -04:00
432a55308f Added the targeting key, z, to auto bindings. 2025-03-25 13:34:45 -04:00
60ece5b489 Attempt to standardize controls for all mods. 2025-03-24 21:39:02 -04:00
9b8b21cc55 Generated scripts for posix systems now find the path to gzdoom in case it is not in /usr/bin. 2025-03-23 20:56:50 -04:00
d10312c0d2 Added the powershell script so it will be available for generated scripts. 2025-03-22 22:41:33 -04:00
9e73910121 Experimental: Add generate script for when a game is launched. It's partially for debugging, and also for players to customize games beyond the scope of the launcher. 2025-03-22 22:28:02 -04:00
6a8f866943 Add optional doom_flags.txt so you can add flags for all games. This is experimental and may be removed. 2025-03-16 02:03:41 -04:00
21e933ab53 Fixed an error in Wolfendoom json file. 2025-02-20 20:40:53 -05:00
893f7bf455 Make sure the renamer loads any time Toby Doom levels are selected, so Project Brutality, for example, should have metal again. 2025-02-14 00:30:49 -05:00
5d8aae9386 Paths for simple menu system updated because they were not working on some systems. 2025-01-29 11:43:17 -05:00
4309fd8994 ProjectMSX added in custom games. Thanks nicotomia from forum.audiogames.net. 2025-01-29 11:42:32 -05:00
c2e5a8ee3d Fixed the simple menu addon in all json files. 2025-01-27 12:18:08 -05:00
78f7ae506d Yet another attempt and handling charsets. 2025-01-25 10:56:27 -05:00
a0e539d3ce Specifically set the encoding to UTF-8. Simplify speak_thread. 2025-01-25 08:41:11 -05:00
db40032d3d Removed proximity addon from several json files because it's now built in. 2025-01-24 11:49:13 -05:00
c3c9da9403 Back to trying to fix non-English encodings. 2025-01-22 14:18:18 -05:00
a71bb0e608 Disable text to speech if self-voice is selected. This was harder than I thought it would be. Please report bugs if found. 2025-01-22 02:58:55 -05:00
02b598e987 Moved Audio Manual to a button as requested by Alando1. 2025-01-22 01:12:47 -05:00
6cd034c594 Removed the jack filtering because it needs to be redone. 2025-01-19 17:07:33 -05:00
ad55390801 Another attempt at fixing speech processing for non-English characters. 2025-01-19 12:10:15 -05:00
6e9aaa9751 This attempts to fix the error:
"Error processing game output: 'gbk' codec can't decode byte 0xac in
position 33: illegal multibyte sequence"
as reported by nicotomia from the audiogames.net forum.
2025-01-17 13:39:29 -05:00
1a9b8d5c03 Had to update the jack filter because it would have matched a player name. 2025-01-15 17:04:41 -05:00
d51b5fadd8 Squished more jack stuff. 2025-01-15 16:36:35 -05:00
41f525f51b Also filter out jack grumblings and messages that start with Cannot. 2025-01-15 16:29:39 -05:00
f94521bfb1 Filter out alsa grumblings. 2025-01-15 16:26:32 -05:00
c83714866d Update message when desired mod is not available to indicate it will be opened in the browser. 2025-01-15 08:55:28 -05:00
18279b6e7b Remove the music renamer from the DVD mod because it might cause problems with other maps. 2025-01-13 18:58:05 -05:00
f82c4d2559 Updated the Doomguy Verses Daleks custom file. 2025-01-13 18:55:48 -05:00
3ee8fd0098 Doomguy Verses the Daleks custom game file added. 2025-01-12 22:18:33 -05:00
2e5c14d5d6 Moved the nvda controll,er client to the base git directory since pyinstaller deletes it while building.? 2025-01-11 15:41:11 -05:00
fc53c8be24 I am sure I had fixed this once already, must have forgotten to copy over the code. Make Windows not rely on the DoomTTS.ps1 script. 2025-01-11 15:37:58 -05:00
9dd3d49174 Improved some menu strings. 2025-01-10 16:49:02 -05:00
c332370ba1 Fixed the missing . in the StarWars custom file. Updated the file name and the name of the mod. 2025-01-10 14:38:51 -05:00
11 changed files with 1618 additions and 268 deletions

231
DoomTTS.ps1 Normal file
View File

@ -0,0 +1,231 @@
# Change the next line to $true to enable the script
$useTextToSpeech = $true
# Set this to $true to use SAPI, $false to use nvdaControllerClient or fall back to clipboard
$useSAPI = $false
# Set the speech rate. -10 to 10, default 0
$speechRate = 0
# Do not edit below this line.
######################################################################
# Exit if text-to-speech is disabled
if (-not $useTextToSpeech) {
exit
}
# Define antigrep, and sed patterns
$antigrepPatterns = @(
'^P_StartScript:',
'^[Ff]luidsynth:',
'^(Facing|INTRO|MAP[0-9]+|README)',
'^ *TITLEMAP',
'key card',
'^\[Toby Accessibility Mod\] (INTRO|READMe)([0-9]+).*',
"^(As |Computer Voice:|I |I've|Monorail|Ugh|What|Where)",
[regex]::Escape('Ugh... Huh? What the hell was that?! Better go check it out...')
)
$sedPatterns = @(
@("\[Toby Accessibility Mod\] M_", "[Toby Accessibility Mod] "),
@("^\[Toby Accessibility Mod\] ", ""),
@("^MessageBoxMenu$", "Confirmation menu: Press Y for yes or N for no"),
@("^Mainmenu$", "Main menu"),
@("^Playerclassmenu$", "Player class menu"),
@("^Skillmenu$", "Difficulty menu"),
@("^NGAME", "New game"),
@("^LOADG$", "Load game"),
@("^SAVEG$", "Save game"),
@("^QUITG$", "Quit game"),
@('"cl_run" = "true"', "Run"),
@('"cl_run" = "false"', "Walk"),
@('.*/:Game saved. \(', ""),
@('^\*\*\*', ""),
@('^\+', "")
)
# Check PowerShell version
$requiredPowershellVersion = [Version]"5.1"
$currentPowershellVersion = $PSVersionTable.PSVersion
$logFile = ".\DoomTTS.log"
Set-Content -Path $logFile -Value "Logging started $(Get-Date -Format 'dddd MMMM dd, yyyy') at $(Get-Date -Format 'hh:mmtt')"
Add-Content -Path $logFile -Value "Powershell $currentPowershellVersion"
if ($currentVersion -lt $requiredVersion) {
Add-Content -Path $logFile -Value "PowerShell version $requiredPowershellVersion or later is required. Exiting."
exit
}
# Function for logging
function Write-Log {
param (
[string]$Message,
[string]$Type = "INFO" # Can be INFO, ERROR, or SPEECH
)
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logMessage = "$Message [$Type] [$timestamp]"
# Append the message to the log file
Add-Content -Path $logFile -Value $logMessage
# If it's an error, also write to the console
if ($Type -eq "ERROR") {
Write-Host $logMessage -ForegroundColor Red
}
}
# Function to load NVDA DLL and check if NVDA is running
function Initialize-NVDA {
try {
# Declare the P/Invoke signatures
$signature = @"
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
[DllImport("kernel32.dll")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
[DllImport("kernel32.dll")]
public static extern bool FreeLibrary(IntPtr hModule);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate int NvdaTestIfRunning();
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate void NvdaSpeakText([MarshalAs(UnmanagedType.LPWStr)] string text);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate void NvdaBrailleMessage([MarshalAs(UnmanagedType.LPWStr)] string message);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate void NvdaCancelSpeech();
"@
Add-Type -MemberDefinition $signature -Name "NvdaFunctions" -Namespace "Win32Functions"
# Load the NVDA client library
$dllPath = ".\nvdaControllerClient.dll"
$nvdaDll = [Win32Functions.NvdaFunctions]::LoadLibrary($dllPath)
if ($nvdaDll -eq [IntPtr]::Zero) {
throw "Failed to load nvdaControllerClient.dll"
}
# Define function pointers
$nvdaTestIfRunning = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer(
[Win32Functions.NvdaFunctions]::GetProcAddress($nvdaDll, "nvdaController_testIfRunning"),
[Type][Win32Functions.NvdaFunctions+NvdaTestIfRunning]
)
$nvdaSpeakText = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer(
[Win32Functions.NvdaFunctions]::GetProcAddress($nvdaDll, "nvdaController_speakText"),
[Type][Win32Functions.NvdaFunctions+NvdaSpeakText]
)
$nvdaBrailleMessage = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer(
[Win32Functions.NvdaFunctions]::GetProcAddress($nvdaDll, "nvdaController_brailleMessage"),
[Type][Win32Functions.NvdaFunctions+NvdaBrailleMessage]
)
$nvdaCancelSpeech = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer(
[Win32Functions.NvdaFunctions]::GetProcAddress($nvdaDll, "nvdaController_cancelSpeech"),
[Type][Win32Functions.NvdaFunctions+NvdaCancelSpeech]
)
# Test if NVDA is running
$res = $nvdaTestIfRunning.Invoke()
if ($res -ne 0) {
$errorMessage = [ComponentModel.Win32Exception]::new([System.Runtime.InteropServices.Marshal]::GetLastWin32Error()).Message
throw "NVDA is not running or communication failed. Error: $errorMessage"
}
return @{
SpeakText = $nvdaSpeakText
BrailleMessage = $nvdaBrailleMessage
CancelSpeech = $nvdaCancelSpeech
}
}
catch {
Write-Log -Message "Error initializing NVDA: $_" -Type "ERROR"
return $null
}
}
# Function to speak text using SAPI, NVDA, or copy to clipboard
function Speak-Text {
param (
[string]$text
)
Write-Log -Message "Speaking: $text" -Type "SPEECH"
if ($useSAPI) {
try {
$tts = New-Object -ComObject SAPI.SPVoice
$tts.Rate = $speechRate
$tts.Speak($text)
} catch {
Write-Log -Message "Error using SAPI: $_" -Type "ERROR"
}
} else {
$nvdaFunctions = Initialize-NVDA
if ($nvdaFunctions) {
try {
$nvdaFunctions.SpeakText.Invoke($text)
} catch {
Write-Log -Message "Error using nvdaControllerClient.dll: $_" -Type "ERROR"
Set-Clipboard -Value $text
}
} else {
Set-Clipboard -Value $text
Write-Log -Message "Failed to initialize NVDA, text copied to clipboard" -Type "INFO"
}
}
}
# Process the output with grep, antigrep, and sed-like functionality
function Process-Output {
param (
[string]$line,
[string[]]$antigrepPatterns,
[array]$sedPatterns
)
# Apply antigrep (exclude lines)
foreach ($pattern in $antigrepPatterns) {
if ($line -match $pattern) {
return # Skip this line
}
}
# Apply sed (modify lines)
foreach ($pattern in $sedPatterns) {
$line = $line -replace $pattern[0], $pattern[1]
}
return $line
}
# Start reading the piped output
$stream = [System.IO.StreamReader]::new([Console]::OpenStandardInput(), [System.Text.Encoding]::UTF8)
# Use the 40 - line to let us know when to start speaking.
$startProcessing = $false
while ($null -ne ($line = $stream.ReadLine())) {
Write-Log -Message "Raw input: $line" -Type "INFO"
# Check for the separator
if ($line -match '^-{5,}$') {
$startProcessing = $true
continue # Skip the separator
}
# Only process lines after we've seen the separator
if ($startProcessing) {
$processedLine = Process-Output -line $line -antigrepPatterns $antigrepPatterns -sedPatterns $sedPatterns
if ($processedLine) {
Write-Log -Message "Processed line: $processedLine" -Type "INFO"
Speak-Text -text $processedLine
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
}
],
"files": [
"Addons/MENU/TobyV{toby_base_version}_*",
"Addons/MENU/TobyV*_SimpleMenu.pk3",
"aoddoom1.wad"
],
"optional_files": [

View File

@ -0,0 +1,24 @@
{
"name": "DoomGuy Verses the Daleks",
"dependencies": [
{
"file": "DoomguyVsTheDaleks_V1.1.wad",
"url": "https://www.moddb.com/mods/doomguy-vs-the-daleks",
"messages": [
"Place \"DoomguyVsTheDaleks_V1.1.wad\" in the Toby Doom directory. On Linux/Mac this is ~/.local/games/doom"
]
}
],
"files": [
"Addons/MENU/TobyV*_SimpleMenu.pk3",
"Addons/DOOM/TobyV*_Decorations.pk3",
"Addons/DOOM/TobyV*_Guns.pk3",
"Addons/DOOM/TobyV*_Pickups.pk3",
"DoomguyVsTheDaleks_V1.1.wad"
],
"optional_files": [
"DoomMetalVol7.wad",
"DoomMetalVol6.wad"
],
"use_map_menu": true
}

View File

@ -10,8 +10,7 @@
}
],
"files": [
"Addons/MENU/TobyV{toby_base_version}_*",
"Addons/DOOM/TobyV{toby_base_version}_Proximity.pk3",
"Addons/MENU/TobyV*_SimpleMenu.pk3",
"GMOTA_V.1.5.2.pk3"
],
"flags": [

View File

@ -0,0 +1,17 @@
{
"name": "ProjectMSX",
"dependencies": [
{
"file": "projectmsx_v0.2a.pk3",
"url": "https://www.moddb.com/mods/project-msx",
"messages": [
"Place projectmsx_v0.2a.pk3 in the Toby Doom directory. On Linux/Mac this is ~/.local/games/doom."
]
}
],
"files": [
"Addons/MENU/TobyV*_SimpleMenu.pk3",
"projectmsx_v0.2a.pk3"
],
"use_map_menu": true
}

View File

@ -12,7 +12,7 @@
}
],
"files": [
"Addons/DOOM/TobyV{toby_base_version}_Proximity.pk3",
"Addons/MENU/TobyV*_SimpleMenu.pk3",
"PB-Toby-Compatibility-Addon.pk3",
"Project_Brutality.pk3"
],

View File

@ -11,7 +11,7 @@
}
],
"files": [
"Addons/DOOM/TobyV{toby_base_version}_Proximity.pk3",
"Addons/MENU/TobyV*_SimpleMenu.pk3",
"Project_Brutality-Latest.pk3"
],
"optional_files": [

View File

@ -29,8 +29,7 @@
]
},
"files": [
"Addons/MENU/TobyV{toby_base_version}_*",
"Addons/DOOM/TobyV{toby_base_version}_Proximity.pk3"
"Addons/MENU/TobyV*_SimpleMenu.pk3"
],
"flags": [
"+bind", "Ctrl", "+attack",

View File

@ -1,15 +1,16 @@
{
"name": "Star Wars",
"name": "Xim Star Wars",
"dependencies": [
{
"file": "Xim-StarWars-v3.1.5.pk3",
"url": "https://www.moddb.com/mods/xims-star-wars-doom",
"messages": [
"Place Xim-StarWars-v3.1.5.pk3 in the Toby Doom directory, on Linux or Mac, ~/.local/games/doom"
"Extract Xim-StarWars-v3.1.5.6.zip to the Toby Doom directory, on Linux or Mac, ~/.local/games/doom"
]
}
],
"files": [
"Addons/MENU/TobyV*_SimpleMenu.pk3",
"Xim-StarWars-v3.1.5.pk3",
"Addons/STARWARS/*.pk3"
],