Compare commits
93 Commits
ae267f971a
...
master
Author | SHA1 | Date | |
---|---|---|---|
623de671f2 | |||
d6cfe797bc | |||
50b577d7aa | |||
ef43dca94f | |||
a38fc607a8 | |||
937b52ffd0 | |||
4ee362b1c0 | |||
f86d25924f | |||
6dbf578c5a | |||
ec8bb229f0 | |||
3d95cefb02 | |||
d9c6c80e00 | |||
8b8f01f39d | |||
a18b2ec61b | |||
e6cfa00c15 | |||
0a1a130399 | |||
a8833aa173 | |||
447344bec9 | |||
ba0844cc49 | |||
9a47da3239 | |||
2c8b419656 | |||
06c50154fc | |||
8b3e1b777b | |||
e9b23e968f | |||
54e3ef8190 | |||
2472ea640a | |||
43005a75b6 | |||
7359be180b | |||
fbba315e1b | |||
6b69da95c0 | |||
22e4f89a06 | |||
50bb4a5383 | |||
c5d88f5215 | |||
8b7704167a | |||
f2cdcaa62a | |||
7bd0bb60f4 | |||
30803d6066 | |||
90d64278aa | |||
620b8af135 | |||
e86ddd7935 | |||
4cce555b7d | |||
fa75ba31ca | |||
11139ce376 | |||
10f4871bee | |||
ace9f56ae9 | |||
b290387fa0 | |||
2b436df45d | |||
e091ff036b | |||
4975822ce1 | |||
e0d9a9564d | |||
226c080cd0 | |||
6daad63de4 | |||
e133f7d318 | |||
fe8135ba96 | |||
054d0b2d5e | |||
7b57f8c8d2 | |||
f5b8b26c01 | |||
250498706d | |||
6b9428d2e4 | |||
18a30297e8 | |||
4f206e13cc | |||
6cfdf58e68 | |||
f7623868fc | |||
8ff0a56874 | |||
4cb854b881 | |||
7052aefbb0 | |||
fcce6243bf | |||
bdeef5b367 | |||
017f823544 | |||
1759661f34 | |||
a3d5fd5b6a | |||
61cf058921 | |||
78a037a6b1 | |||
6a4464d692 | |||
26e53ee2c3 | |||
8c2e37e135 | |||
1bffc6f244 | |||
38a64cdb64 | |||
609edfe111 | |||
881498ea47 | |||
9f42469b89 | |||
8a17939f3c | |||
b5fe20eb2d | |||
793efc694b | |||
b7ff93c740 | |||
fd33349864 | |||
e0b86e0e3c | |||
c3a7e39def | |||
d9489819b7 | |||
eae85b0299 | |||
9532eef142 | |||
14093c80ca | |||
f46a4efa88 |
@ -1,5 +1,5 @@
|
||||
export bottle="bg"
|
||||
download "${ipfsGateway}/ipfs/QmWAk2TMHMvW6Kjc1sZBEPsxmCNHfY3nF1K723PCqaTa57?filename=TPB32Setup10a.exe"
|
||||
download "${ipfsGateway}/ipfs/QmWAk2TMHMvW6Kjc1sZBEPsxmCNHfY3nF1K723PCqaTa57?filename=T20B32Setup10.exe"
|
||||
install_wine_bottle speechsdk
|
||||
wine "${cache}/T20B32Setup10.exe" /silent
|
||||
add_launcher "c:\Program Files\Games\T20CricketB\CricketB.exe"
|
||||
|
@ -1,4 +1,4 @@
|
||||
download "http://tunmi13.ddns.net/projects/bth.zip"
|
||||
download "http://files.tunmi13.com/projects_archive/bth.zip"
|
||||
export bottle="tunmi13"
|
||||
export winVer="win7"
|
||||
install_wine_bottle speechsdk
|
||||
|
@ -1,4 +1,4 @@
|
||||
download "http://tunmi13.ddns.net/projects/coth.zip"
|
||||
download "http://files.tunmi13.com/projects_archive/coth.zip"
|
||||
export bottle="tunmi13"
|
||||
export winVer="win7"
|
||||
install_wine_bottle speechsdk
|
||||
|
7
.install/Constant Motion.sh
Normal file
7
.install/Constant Motion.sh
Normal file
@ -0,0 +1,7 @@
|
||||
export WINEARCH=win64
|
||||
export winVer="win7"
|
||||
download "https://samtupy.com/games/cm.zip" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll"
|
||||
install_wine_bottle
|
||||
unzip -d "$WINEPREFIX/drive_c/Program Files/ConstantMotion" "$cache/cm.zip"
|
||||
find "$WINEPREFIX/drive_c/Program Files/ConstantMotion" -name "nvdaControllerClient64.dll" -exec cp -v "$cache/nvda2speechd64.dll" "{}" \;
|
||||
add_launcher 'c:\Program Files\ConstantMotion\cm.exe'
|
@ -1,7 +1,7 @@
|
||||
export winVer="win7"
|
||||
get_installer "Mist World_Setup.exe" "https://drive.google.com/uc?export=download&id=12YeUqorkkMT46ZSR5pcfWxSY8DHOLxZ-"
|
||||
download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll"
|
||||
install_wine_bottle ole32
|
||||
install_wine_bottle sapi
|
||||
7z x -o"$WINEPREFIX/drive_c/Program Files/Mist World" "$cache/Mist World_Setup.exe"
|
||||
sed -i 's/1024m/768m/g' "$WINEPREFIX/drive_c/Program Files/Mist World/mw.exe.vmoptions"
|
||||
cp "$WINEPREFIX/drive_c/Program Files/Mist World/"{mw.exe.vmoptions,update.exe.vmoptions}
|
||||
|
@ -1,4 +1,3 @@
|
||||
#
|
||||
download "http://gmagames.com/sod1208.exe"
|
||||
install_wine_bottle vb6run dx8vb speechsdk
|
||||
wine "${cache}/sod1208.exe" /sp- /verysilent
|
||||
|
@ -1,5 +1,5 @@
|
||||
export winVer="win7"
|
||||
download "http://www.gmagames.com/sod20022.exe"
|
||||
download "http://www.gmagames.com/sod20024.exe"
|
||||
install_wine_bottle vb6run dx8vb speechsdk
|
||||
wine "${cache}/sod20022.exe" /silent
|
||||
wine "${cache}/sod20024.exe" /silent
|
||||
add_launcher "c:\Program Files\Shades of Doom 2.0\sod.exe"
|
||||
|
5
.install/Smashathon.sh
Normal file
5
.install/Smashathon.sh
Normal file
@ -0,0 +1,5 @@
|
||||
export bottle="l-works"
|
||||
download "https://agarchive.net/games/lworks/Smashathon0.02.zip"
|
||||
install_wine_bottle speechsdk
|
||||
unzip -d "$WINEPREFIX/drive_c/Program Files" "$cache/Smashathon0.02.zip"
|
||||
add_launcher 'c:\Program Files\Smashathon0.02\smashathon.exe'
|
@ -1,5 +1,5 @@
|
||||
export bottle="l-works"
|
||||
download "http://files.l-works.net/superegghuntsetup.exe"
|
||||
download "https://agarchive.net/games/lworks/super%20egg%20hunt+%20setup.exe"
|
||||
install_wine_bottle
|
||||
wine "${cache}/superegghuntsetup.exe" /silent
|
||||
wine "${cache}/super egg hunt+ setup.exe" /silent
|
||||
add_launcher "c:\Program Files\Lworks\super egg hunt\superegghunt.exe"
|
||||
|
@ -4,7 +4,7 @@ export winetricksSettings="vd=1024x768"
|
||||
dialog --backtitle "Audiogame manager" --yesno "If you do not have a full 32 bit gstreamer installation, the Swamp music can cause stuttering and crashes. Would you like to remove the music directory after installation?" -1 -1 --stdout
|
||||
deleteMusic=$?
|
||||
download "https://www.kaldobsky.com/audiogames/Swamp.zip"
|
||||
install_wine_bottle dx8vb quartz corefonts vb6run speechsdk ole32
|
||||
install_wine_bottle dx8vb quartz corefonts vb6run speechsdk
|
||||
unzip -d "$WINEPREFIX/drive_c/Program Files/swamp" "${cache}/Swamp.zip"
|
||||
# make sure the latest version is installed.
|
||||
if curl -L --output "${cache}/SwampPatch.zip" "https://www.kaldobsky.com/audiogames/SwampPatch.zip" ; then
|
||||
|
7
.install/Toy Mania.sh
Normal file
7
.install/Toy Mania.sh
Normal file
@ -0,0 +1,7 @@
|
||||
export WINEARCH=win64
|
||||
export winVer="win7"
|
||||
get_installer "ToyMania_windows_portable_password_is_GrateCollector.7z" "https://tsatria03.itch.io/toymania"
|
||||
install_wine_bottle
|
||||
7z x -o"$WINEPREFIX/drive_c/Program Files/ToyMania" "${cache}/ToyMania_windows_portable_password_is_GrateCollector.7z" -pGrateCollector
|
||||
find "${WINEPREFIX}/drive_c/Program Files/ToyMania" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \;
|
||||
add_launcher "c:\Program Files\ToyMania\tm.exe"
|
@ -1,4 +1,3 @@
|
||||
#
|
||||
export WINEARCH=win64
|
||||
export winVer="win7"
|
||||
download "https://dl.dropbox.com/scl/fi/ukvou0y4gwg21nhhdpj40/Wave-of-the-Undead-Setup.exe?rlkey=4xnuwicpmbkx6w2jo2i56mijg" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll"
|
||||
|
@ -324,6 +324,8 @@ download() {
|
||||
# Add HTML check for other file types
|
||||
if file -b "${cache}/${dest}" | grep -q "HTML document" ; then
|
||||
echo "File not found: \"$i\" (HTML document probably 404)"
|
||||
downloadError=1
|
||||
else
|
||||
downloadError=0
|
||||
fi
|
||||
;;
|
||||
@ -373,6 +375,7 @@ get_bottle() {
|
||||
"judgement-day"*) ;&
|
||||
"lockpick"*) ;&
|
||||
"pigeon-panic"*) ;&
|
||||
"smashathon"*) ;&
|
||||
"super-egg-hunt"*) ;&
|
||||
"super-liam"*) ;&
|
||||
"the-great-toy-robbery"*) export WINEPREFIX="${HOME}/.local/wine/l-works";;
|
||||
@ -632,6 +635,9 @@ winetricks() {
|
||||
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/winetricks/"
|
||||
echo "1" > "${XDG_CACHE_HOME:-$HOME/.cache}/winetricks/track_usage"
|
||||
fi
|
||||
# Temporary work around for winetricks git bugs. Requires winetricks be installed from package manager.
|
||||
/usr/bin/winetricks "$@"
|
||||
return
|
||||
# Download or update agm's copy of winetricks
|
||||
if [[ ! -e "${winetricksPath}/winetricks" ]]; then
|
||||
checkWinetricksUpdate="true"
|
||||
@ -665,11 +671,11 @@ install_rhvoice() {
|
||||
return
|
||||
fi
|
||||
declare -A RHVoice=(
|
||||
[alan]="https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Alan-v4.0.2008.15-setup.exe"
|
||||
[bdl]="https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Bdl-v4.1.2008.15-setup.exe"
|
||||
[clb]="https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Clb-v4.0.2008.15-setup.exe"
|
||||
[alan]="https://github.com/RHVoice/alan-eng/releases/download/4.0/RHVoice-voice-English-Alan-v4.0.2016.21-setup.exe"
|
||||
[bdl]="https://github.com/RHVoice/bdl-eng/releases/download/4.1/RHVoice-voice-English-Bdl-v4.1.2016.21-setup.exe"
|
||||
[clb]="https://github.com/RHVoice/clb-eng/releases/download/4.0/RHVoice-voice-English-Clb-v4.0.2016.21-setup.exe"
|
||||
[lyubov]="https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Lyubov-v4.0.2008.15-setup.exe"
|
||||
[slt]="https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Slt-v4.0.2008.15-setup.exe"
|
||||
[slt]="https://github.com/RHVoice/slt-eng/releases/download/4.1/RHVoice-voice-English-Slt-v4.1.2016.21-setup.exe"
|
||||
)
|
||||
voiceName="${voiceName:-bdl}"
|
||||
voiceName="${voiceName,,}"
|
||||
@ -706,7 +712,7 @@ install_wine_bottle() {
|
||||
# Arguments to the function are dependancies to be installed.
|
||||
# Get location of mono and gecko.
|
||||
monoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name mono 2> /dev/null)"
|
||||
geckoPath="$(find /usr/share/wine/ -maxdepth 1 -type d "gecko" 2> /dev/null)"
|
||||
geckoPath="$(find /usr/share/wine/ -maxdepth 1 -type d -name "gecko" 2> /dev/null)"
|
||||
if [[ -z "$monoPath" ]]; then
|
||||
download 'http://dl.winehq.org/wine/wine-mono/6.0.0/wine-mono-6.0.0-x86.msi'
|
||||
monoPath="${cache}/wine-mono-6.0.0-x86.msi"
|
||||
@ -965,10 +971,10 @@ custom_launch_parameters() {
|
||||
if [[ "${game[0]}" == "sequence-storm" ]]; then
|
||||
"${0%/*}/speech/clipboard_reader.sh" SequenceStorm &
|
||||
fi
|
||||
if [[ "${game[0]}" == "shadow-line" ]]; then
|
||||
find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \;
|
||||
"${0%/*}/speech/clipboard_translator.sh" play_sr.exe shadow-line &
|
||||
fi
|
||||
#if [[ "${game[0]}" == "shadow-line" ]]; then
|
||||
#find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \;
|
||||
#"${0%/*}/speech/clipboard_translator.sh" play_sr.exe shadow-line &
|
||||
#fi
|
||||
if [[ "${game[0]}" == "sketchbook" ]]; then
|
||||
find "${WINEPREFIX}" -type f -name 'nvdaControllerClient32.dll' -exec cp -v "${cache}/nvdaControllerClient32.dll" "{}" \;
|
||||
fi
|
||||
@ -1052,6 +1058,7 @@ game_launcher() {
|
||||
done
|
||||
menuList+=("Donate" "Donate")
|
||||
menuList+=("Become a Patron" "Become a Patron")
|
||||
local game=""
|
||||
game="$(dialog --backtitle "Audio Game Launcher" \
|
||||
--clear \
|
||||
--extra-button \
|
||||
@ -1060,7 +1067,7 @@ game_launcher() {
|
||||
--no-tags \
|
||||
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)"
|
||||
local menuCode=$?
|
||||
if [[ $menuCode -eq 1 ]]; then
|
||||
if [[ $menuCode -eq 1 ]] || [[ $menuCode -eq 255 ]]; then
|
||||
exit 0
|
||||
elif [[ $menuCode -eq 3 ]]; then
|
||||
documentation "$game" "$(echo "$game" | cut -d '|' -f2)"
|
||||
@ -1153,8 +1160,8 @@ if [[ -z "$DISPLAY" ]]; then
|
||||
export DISPLAY=":0"
|
||||
fi
|
||||
# Settings file
|
||||
cache="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager"
|
||||
configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/games.conf"
|
||||
export cache="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager"
|
||||
export configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/games.conf"
|
||||
mkdir -p "${cache}"
|
||||
mkdir -p "${configFile%/*}"
|
||||
# Create the path for AGM's helper programs.
|
||||
|
@ -7,7 +7,6 @@
|
||||
# set -Eeuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/#:~:text=set%20%2Du,is%20often%20highly%20desirable%20behavior.
|
||||
shopt -s expand_aliases
|
||||
|
||||
|
||||
if [[ $# -ne 2 ]]; then
|
||||
echo "Usage: $0 \"application name\" \"file name\"."
|
||||
exit 1
|
||||
@ -22,6 +21,40 @@ fileName="${2,,}"
|
||||
fileName="${fileName//[[:space:]]/-}.sqlite"
|
||||
translationFile="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager/${fileName}"
|
||||
|
||||
# Make sure the directory exists
|
||||
mkdir -p "$(dirname "$translationFile")"
|
||||
|
||||
# Initialize database if it doesn't exist
|
||||
if [[ ! -s "$translationFile" ]]; then
|
||||
rm -f "$translationFile"
|
||||
sqlite3 "$translationFile" <<EOF
|
||||
CREATE TABLE translations(
|
||||
text TEXT NOT NULL,
|
||||
translation TEXT NOT NULL,
|
||||
PRIMARY KEY (text)
|
||||
);
|
||||
CREATE INDEX translations_text_idx ON translations (text);
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Define a function to safely query the database
|
||||
query_database() {
|
||||
local db_file="$1"
|
||||
local sql_query="$2"
|
||||
sqlite3 -line "$db_file" "$sql_query"
|
||||
}
|
||||
|
||||
# Define a function to safely insert into the database
|
||||
insert_database() {
|
||||
local db_file="$1"
|
||||
local text="$2"
|
||||
local translation="$3"
|
||||
|
||||
# Use sqlite3 .import feature which is more robust for special characters
|
||||
echo "$text|$translation" | sqlite3 -separator "|" "$db_file" ".import /dev/stdin temp_import"
|
||||
sqlite3 "$db_file" "INSERT OR IGNORE INTO translations SELECT * FROM temp_import; DROP TABLE IF EXISTS temp_import;"
|
||||
}
|
||||
|
||||
# Read so long as the application is running
|
||||
while pgrep -u "$USER" ^$1 &> /dev/null ; do
|
||||
sleep 0.05
|
||||
@ -37,24 +70,6 @@ while pgrep -u "$USER" ^$1 &> /dev/null ; do
|
||||
if [[ -z "$text" ]]; then
|
||||
continue
|
||||
fi
|
||||
q() { sqlite3 -column -init "" "$translationFile" "$@" 2> /dev/null ; }
|
||||
|
||||
|
||||
if [[ ! -s "$translationFile" ]]; then
|
||||
rm -f "$translationFile"
|
||||
cat << EOF | sqlite3 -init "" "$translationFile" 2> /dev/null
|
||||
.bail on
|
||||
|
||||
CREATE TABLE translations(
|
||||
text TEXT NOT NULL,
|
||||
translation TEXT NOT NULL,
|
||||
|
||||
PRIMARY KEY (text)
|
||||
);
|
||||
CREATE INDEX translations_text_idx ON translations (text);
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
# https://en.wikipedia.org/wiki/Unicode_equivalence#Combining_and_precomposed_characters
|
||||
# https://www.effectiveperlprogramming.com/2011/09/normalize-your-perl-source/
|
||||
@ -65,18 +80,32 @@ EOF
|
||||
alias normalize_spaces="perl -CSDA -plE 's/[^\\S\\t]/ /g'"
|
||||
alias normalize_unicode="normalize_spaces | nfc"
|
||||
|
||||
textEscaped="$(echo "$text" | sed "s/'/''/g" | normalize_unicode)" # escape single quotes for sqlite
|
||||
translated="$(q "SELECT translation FROM translations WHERE text = '$textEscaped' LIMIT 1" | sed 's/\s*$//')"
|
||||
|
||||
# Normalize text
|
||||
normalized_text="$(echo "$text" | normalize_unicode)"
|
||||
|
||||
# Create a temporary database for import
|
||||
sqlite3 "$translationFile" "CREATE TABLE IF NOT EXISTS temp_import(text TEXT, translation TEXT);"
|
||||
|
||||
# Check if we already have a translation
|
||||
translated=$(sqlite3 "$translationFile" "SELECT translation FROM translations WHERE text = '$normalized_text' LIMIT 1;" 2>/dev/null)
|
||||
|
||||
if [[ -z "$translated" ]]; then
|
||||
translated="$(trans -no-autocorrect -no-warn -brief "$text" | head -1 | sed 's/\s*$//' | normalize_unicode)"
|
||||
# Get translation from the trans utility
|
||||
translated="$(trans -no-autocorrect -no-warn -brief "$normalized_text" | head -1 | sed 's/\s*$//' | normalize_unicode)"
|
||||
|
||||
if [[ -n "$translated" ]]; then
|
||||
translatedEscaped="$(echo "$translated" | sed "s/'/''/g")"
|
||||
q "INSERT OR IGNORE INTO translations (text, translation) VALUES ('$textEscaped', '$translatedEscaped')"
|
||||
# Insert using echo piping to avoid escaping issues
|
||||
echo "$normalized_text|$translated" | sqlite3 -separator "|" "$translationFile" ".import /dev/stdin temp_import"
|
||||
sqlite3 "$translationFile" "INSERT OR IGNORE INTO translations SELECT * FROM temp_import; DELETE FROM temp_import;"
|
||||
fi
|
||||
fi
|
||||
|
||||
spd-say -- "$translated"
|
||||
|
||||
# If we got a translation, speak it
|
||||
if [[ -n "$translated" ]]; then
|
||||
spd-say -- "$translated"
|
||||
fi
|
||||
|
||||
# Clear clipboard
|
||||
echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null
|
||||
done
|
||||
|
||||
|
Reference in New Issue
Block a user