Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
murkl committed Jan 29, 2025
1 parent 55565ac commit 9fdfd64
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
14 changes: 7 additions & 7 deletions d2launcher
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ show_settings_menu() {
}

show_update_manager_menu() {
local item_01="Check for Median XL update"
local item_02="Check for D2Launcher update"
local item_03="Update Tweaks Database"
local item_01="Update Tweaks Database"
local item_02="Check for Median XL update"
local item_03="Check for D2Launcher update"
local item_04="Force Proton/Wine update"
local item_05="Force D2Stats update"
local result
Expand All @@ -377,15 +377,15 @@ show_update_manager_menu() {
return
fi
if [ "$result" = "$item_01" ]; then
show_gui_update_mxl
show_gui_update_tweaks_db
return
fi
if [ "$result" = "$item_02" ]; then
show_gui_update_script
show_gui_update_mxl
return
fi
if [ "$result" = "$item_03" ]; then
show_gui_update_tweaks_db
show_gui_update_script
return
fi
if [ "$result" = "$item_04" ]; then
Expand Down Expand Up @@ -694,7 +694,7 @@ show_gui_mxl_patches() {
}

show_gui_update_tweaks_db() {
! zenity_question "<big>D2Launcher Tweaks DB Updater</big>\n\nUpdate and replace local <b>tweaks.db</b>?" && return 1
! zenity_question "<big>D2Launcher Tweaks DB Updater</big>\n\n<b>Upstream:</b>\n${tweaks_url}\n\n<b>Local:</b>\n${SCRIPT_TWEAKS_FILE}\n\n<b>Update</b> and replace local <b>tweaks.db</b>?" && return 1
if [[ "$tweaks_url" = "http"* ]]; then # Download
(curl -sLf "$tweaks_url" >"${SCRIPT_TEMP_DIR}/tweaks.db" || rm "${SCRIPT_TEMP_DIR}/tweaks.db") &
if ! zenity_progress $! "Downloading tweaks.db"; then
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ d2_stats_tray="true"
update_check="true"
mxl_update_check="true"
mxl_update_channel="public"
mxl_update_exclude=("d2gl.mpq" "glide3x.dll" "cnc-ddraw config.exe" "ddraw.dll")
mxl_update_exclude=("d2gl.mpq" "glide3x.dll" "ddraw.dll" "cnc-ddraw config.exe")
gui_width="420"
gui_height="320"
tweaks_url="https://my/custom/url/to/tweaks.db"
Expand All @@ -90,7 +90,7 @@ Add this array property to exclude files from update
Best when using tweaks:

```
mxl_update_exclude=("d2gl.mpq" "glide3x.dll" "cnc-ddraw config.exe" "ddraw.dll")
mxl_update_exclude=("d2gl.mpq" "glide3x.dll" "ddraw.dll" "cnc-ddraw config.exe")
```

## Median XL Beta
Expand Down
43 changes: 22 additions & 21 deletions res/tweaks.db
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ sleep 1.5
github_author=GavinK88
github_repo=d2gl-mxl-1.0
releases_url="https://github.com/${github_author}/${github_repo}/releases"
github_version=$(zenity --entry --title="${github_author}/${github_repo}" --text="$releases_url\n\nEnter GitHub version (e.g. 1.0.5):" --entry-text="1.0.5") || exit 1
github_version=$(zenity --entry --title="${github_author}/${github_repo}" --text="Upstream:\n${releases_url}\n\nEnter GitHub Release-Version (e.g. 1.0.5):" --entry-text="1.0.5") || exit 1
file_name="${github_author}-${github_repo}-${github_version}"
file_ext="zip"
download_url="${releases_url}/download/${github_version}/Release.${file_ext}"
mkdir -p "${HOME}/.d2launcher/tweaks/"
echo -e ":: GitHub URL: ${releases_url}"
echo "// ${download_url}"

# Check version
if [ -n "$github_version" ]; then
echo -e ":: GitHub Version: ${github_version}"
else
echo -e ":: Invalid GitHub Version"
if [ -z "$github_version" ]; then
echo "Invalid GitHub Version"
exit 1
fi

Expand All @@ -24,22 +22,24 @@ if [ ! -f "${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}" ]; then
if curl -Lfs "${download_url}" >"${file_name}.${file_ext}"; then
mv -f "${file_name}.${file_ext}" "${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}"
else
echo -e ":: Error downloading ${download_url}"
echo "Error downloading ${download_url}"
exit 1
fi
fi

# Unzip
if ! unzip -q -o "${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}" -d "${HOME}/.d2launcher/bin/diablo2"; then
echo -e ":: Error unzip ${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}"
echo "Error unzip ${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}"
exit 1
fi

# Finish
echo -e ":::::::::::::::::::::::::::::::::::::::::::::"
echo -e ":: Please set d2_args to: -3dfx"
echo -e ":: Open settings in Diablo II with: Ctrg + o"
echo -e ":::::::::::::::::::::::::::::::::::::::::::::"
echo ''
echo '// You have to do these steps manually'
echo ' - Set property: d2_args="-3dfx"'
echo ' - Set property: mxl_update_exclude=("d2gl.mpq" "glide3x.dll")'
echo ' - Open D2GL Settings in Diablo II with: CTRL + o'
echo ''

###!> name: FunkyFr3sh/cnc-ddraw
###!> version: latest
Expand All @@ -51,26 +51,27 @@ file_ext="zip"
releases_url="https://github.com/${github_author}/${github_repo}/releases"
download_url="${releases_url}/latest/download/cnc-ddraw.${file_ext}"
mkdir -p "${HOME}/.d2launcher/tweaks/"
echo -e ":: GitHub URL: ${releases_url}"
echo "// ${download_url}"

# Download
if curl -Lfs "${download_url}" >"${file_name}.${file_ext}"; then
mv -f "${file_name}.${file_ext}" "${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}"
else
echo -e ":: Error downloading ${download_url}"
echo "Error downloading ${download_url}"
exit 1
fi

# Unzip
if ! unzip -q -o "${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}" -d "${HOME}/.d2launcher/bin/diablo2"; then
echo -e ":: Error unzip ${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}"
echo "Error unzip ${HOME}/.d2launcher/tweaks/${file_name}.${file_ext}"
exit 1
fi

# Finish
echo -e ":::::::::::::::::::::::::::::::::::::::::::::"
echo -e ":: You have to do these steps manually:"
echo -e ":: - Goto Settings > Wine Settings > Library and override/add ddraw (set DLL load strategy to: native then built in)."
echo -e ":: - Goto Settings > Edit Configuration > set d2_args to: -ddraw"
echo -e ":: - Optimize prefered settings: Settings > Direct Draw Settings (optional)"
echo -e ":::::::::::::::::::::::::::::::::::::::::::::"
echo ''
echo '// You have to do these steps manually'
echo ' - Set property: d2_args="-ddraw"'
echo ' - Set property: mxl_update_exclude=("ddraw.dll" "cnc-ddraw config.exe")'
echo ' - Goto Settings > Wine Settings > Library > Override/Add ddraw (set DLL load strategy to: native then built in)'
echo ' - Optimize prefered settings: Settings > Direct Draw Settings (optional)'
echo ''

0 comments on commit 9fdfd64

Please sign in to comment.