Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kdialog support #667

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following requirements should be available out-of-the-box in most systems:

- _bash_
- either _curl_ or _wget_
- _zenity_
- either _zenity_ or _kdialog_
- _protontricks-launcher_: should be available after installing `protontricks` already, if not see [this](https://github.com/Matoking/protontricks#desktop)

#### Installation steps
Expand Down
1 change: 1 addition & 0 deletions gamesinfo/enderal.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
game_full_name="Enderal: Forgotten Stories"
game_steam_subdirectory="Enderal"
game_nexusid="enderal"
game_appid=933480
Expand Down
1 change: 1 addition & 0 deletions gamesinfo/enderal_se.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
game_full_name="Enderal: Forgotten Stories (Special Edition)"
game_steam_subdirectory="Enderal Special Edition"
game_nexusid="enderalspecialedition"
game_appid=976620
Expand Down
2 changes: 1 addition & 1 deletion gamesinfo/fallout3.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
game_steam_subdirectory="Fallout 3"
game_appid=22300
game_executable="FalloutLauncherSteam.exe"
game_nexusid="fallout3"
game_steam_subdirectory="Fallout 3"
game_protontricks=("d3dcompiler_43" "d3dx9")
game_scriptextender_url="https://www.fose.silverlock.org/download/fose_v1_2_beta2.7z"
game_scriptextender_files="*"
Expand Down
3 changes: 2 additions & 1 deletion gamesinfo/fallout3_goty.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
game_full_name="Fallout 3 - Game of the Year Edition"
game_steam_subdirectory="Fallout 3 goty"
game_appid=22370
game_executable="FalloutLauncherSteam.exe"
game_nexusid="fallout3"
game_steam_subdirectory="Fallout 3 goty"
game_protontricks=("d3dcompiler_43" "d3dx9")
game_scriptextender_url="https://www.fose.silverlock.org/download/fose_v1_2_beta2.7z"
game_scriptextender_files="*"
Expand Down
1 change: 1 addition & 0 deletions gamesinfo/newvegas.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
game_full_name="Fallout: New Vegas"
game_steam_subdirectory="Fallout New Vegas"
game_nexusid="newvegas"
game_appid=22380
Expand Down
1 change: 1 addition & 0 deletions gamesinfo/newvegas_ru.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
game_full_name="Fallout: New Vegas RU"
game_steam_subdirectory="Fallout New Vegas enplczru"
game_nexusid="newvegas"
game_appid=22490
Expand Down
1 change: 1 addition & 0 deletions gamesinfo/skyrimvr.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
game_pretty_name="Skyrim VR"
game_steam_subdirectory="SkyrimVR"
game_nexusid="skyrimspecialedition"
game_appid=611670
Expand Down
32 changes: 28 additions & 4 deletions handlers/modorganizer2-nxm-broker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ if [ -z "$nxm_link" ]; then
exit 1
fi

if [ -n "$(command -v zenity)" ]; then
ui_bin="zenity"
elif [ -z "$(command -v kdialog)" ]; then
ui_bin="kdialog"
else
echo "Error zenity or kdialog required, install one" >&2
exit 1
fi

nexus_game_id=${nxm_link#nxm://}
nexus_game_id=${nexus_game_id%%/*}
### PARSE POSITIONAL ARGS ###
Expand All @@ -17,8 +26,16 @@ instance_dir=$(readlink -f "$instance_link")
if [ ! -d "$instance_dir" ]; then
[ -L "$instance_link"] && rm "$instance_link"

zenity --ok-label=Exit --error --text \
"Could not download file because there is no Mod Organizer 2 instance for '$nexus_game_id'"
error_text="Could not download file because there is no Mod Organizer 2 instance for '$nexus_game_id'"
case "$ui_bin" in
zenity)
zenity --ok-label=Exit --error --text "$error_text"
;;
kdialog)
kdialog --ok-label=Exit --error "$error_text"
;;
esac

exit 1
fi

Expand All @@ -39,8 +56,15 @@ else
fi

if [ "$download_start_status" != "0" ]; then
zenity --ok-label=Exit --error --text \
"Failed to start download:\n\n$download_start_output"
error_text="Failed to start download:\n\n$download_start_output"
case "$ui_bin" in
zenity)
zenity --ok-label=Exit --error --text "$error_text"
;;
kdialog)
kdialog --ok-label=Exit --error "$error_text"
;;
esac
exit 1
fi

2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ source "$step/apply_workarounds.sh"

log_info "installation completed successfully"
expect_exit=1
"$dialog" infobox "Installation successful!\n\Launch the game on Steam to use Mod Organizer 2"
"$dialog" infobox "Installation successful!\n\nLaunch the game on Steam to use Mod Organizer 2"

5 changes: 5 additions & 0 deletions steam-redirector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ sudo dnf install gcc make mingw64-gcc mingw64-winpthreads-static
sudo pacman -S gcc make mingw-w64-gcc mingw-w64-winpthreads
```

#### Debian/Ubuntu
```
sudo apt install -y gcc make mingw-w64
```

Check MinGW's [downloads page](https://www.mingw-w64.org/downloads/) for a more complete list of available packages.

### Compile Commands
Expand Down
4 changes: 2 additions & 2 deletions step/check_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if [ ! $("$utils/protontricks.sh" get-release) ]; then
missing_deps+=(protontricks)
fi

if [ -z "$(command -v zenity)" ]; then
missing_deps+=(zenity)
if [ -z "$(command -v zenity)" ] && [ -z "$(command -v kdialog)" ]; then
missing_deps+=("zenity or kdialog")
fi

if [ -n "${missing_deps[*]}" ]; then
Expand Down
26 changes: 13 additions & 13 deletions step/select_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ Which game would you like to manage with this installation?
EOF
)

game_list=()
for game in $(ls -1 $gamesinfo); do
source "$gamesinfo/$game"
[[ -n "${game_full_name:-}" ]] && game_name="$game_full_name" \
|| game_name="$game_steam_subdirectory"
game_list+=("$(basename "$game" '.sh')" "$game_name")
unset game_full_name game_steam_subdirectory game_protontricks \
game_nexusid game_appid game_executable \
game_scriptextender_url game_scriptextender_files
done


selected_game=$( \
"$dialog" \
radio \
450 "$screen_text" \
"enderal" "Enderal: Forgotten Stories" \
"enderal_se" "Enderal: Forgotten Stories (Special Edition)" \
"fallout3" "Fallout 3" \
"fallout3_goty" "Fallout 3 - Game of the Year Edition" \
"fallout4" "Fallout 4" \
"newvegas" "Fallout: New Vegas" \
"newvegas_ru" "Fallout: New Vegas RU" \
"morrowind" "Morrowind" \
"oblivion" "Oblivion" \
"skyrim" "Skyrim" \
"skyrimspecialedition" "Skyrim Special Edition" \
"skyrimvr" "Skyrim VR" \
"starfield" "Starfield"\
"${game_list[@]}"
)

if [ -z "$selected_game" ]; then
Expand Down
Loading
Loading