Working toward Mac compatability.

This commit is contained in:
Storm Dragon 2020-12-11 21:46:50 -05:00
parent 3a92b161fc
commit 91741afa64

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Dialog accessibility # Dialog accessibility
export DIALOGOPTS='--no-lines --visit-items' export DIALOGOPTS='--no-lines --visit-items'
@ -28,6 +28,15 @@ update() {
fi fi
} }
# Function to open urls across OS.
open_url() {
if [[ "$(uname)" == "Darwin" ]]; then
open "${*}"
else
xdg-open "${*}"
fi
}
# Create the clipboard reading function for Sequence Storm # Create the clipboard reading function for Sequence Storm
write_sequence_storm_reader() { write_sequence_storm_reader() {
if -e ~/.SequenceStormReader ]]; then if -e ~/.SequenceStormReader ]]; then
@ -231,11 +240,11 @@ game_removal() {
--menu "Please select a game to delete" 0 0 0 "${menuList[@]}" --stdout)" --menu "Please select a game to delete" 0 0 0 "${menuList[@]}" --stdout)"
if [[ ${#game} -gt 0 ]]; then if [[ ${#game} -gt 0 ]]; then
if [[ "$game" == "Make a One Time Donation" ]]; then if [[ "$game" == "Make a One Time Donation" ]]; then
xdg-open "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=stormdragon2976@gmail.com&lc=US&item_name=Donation+to+Storm+Games&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted" open_url "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=stormdragon2976@gmail.com&lc=US&item_name=Donation+to+Storm+Games&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"
exit 0 exit 0
fi fi
if [[ "$game" == "Become a Patron" ]]; then if [[ "$game" == "Become a Patron" ]]; then
xdg-open "https://patreon.com/stormux" open_url "https://patreon.com/stormux"
exit 0 exit 0
fi fi
local winePath="${game#*|}" local winePath="${game#*|}"
@ -274,11 +283,11 @@ game_launcher() {
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)" --menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)"
if [[ ${#game} -gt 0 ]]; then if [[ ${#game} -gt 0 ]]; then
if [[ "$game" == "Make a One Time Donation" ]]; then if [[ "$game" == "Make a One Time Donation" ]]; then
xdg-open "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=stormdragon2976@gmail.com&lc=US&item_name=Donation+to+Storm+Games&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted" open_url "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=stormdragon2976@gmail.com&lc=US&item_name=Donation+to+Storm+Games&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"
exit 0 exit 0
fi fi
if [[ "$game" == "Become a Patron" ]]; then if [[ "$game" == "Become a Patron" ]]; then
xdg-open "https://patreon.com/stormux" open_url "https://patreon.com/stormux"
exit 0 exit 0
fi fi
# for games that require custom scripts before launch # for games that require custom scripts before launch
@ -890,10 +899,10 @@ EOF
add_launcher "c:\Program Files\undead_assault\Undead Assault.exe" add_launcher "c:\Program Files\undead_assault\Undead Assault.exe"
;; ;;
"Make a One Time Donation") "Make a One Time Donation")
xdg-open "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=stormdragon2976@gmail.com&lc=US&item_name=Donation+to+Storm+Games&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted" open_url "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=stormdragon2976@gmail.com&lc=US&item_name=Donation+to+Storm+Games&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"
;; ;;
"Become a Patron") "Become a Patron")
xdg-open "https://patreon.com/stormux" open_url "https://patreon.com/stormux"
;; ;;
*) *)
exit 0 exit 0