From 9fdfd64b7db87a620a749880a81c7f42ae085f31 Mon Sep 17 00:00:00 2001 From: murkl Date: Wed, 29 Jan 2025 10:37:46 +0100 Subject: [PATCH] cleanup --- d2launcher | 14 +++++++------- docs/README.md | 4 ++-- res/tweaks.db | 43 ++++++++++++++++++++++--------------------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/d2launcher b/d2launcher index fa4b201..74bad4a 100755 --- a/d2launcher +++ b/d2launcher @@ -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 @@ -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 @@ -694,7 +694,7 @@ show_gui_mxl_patches() { } show_gui_update_tweaks_db() { - ! zenity_question "D2Launcher Tweaks DB Updater\n\nUpdate and replace local tweaks.db?" && return 1 + ! zenity_question "D2Launcher Tweaks DB Updater\n\nUpstream:\n${tweaks_url}\n\nLocal:\n${SCRIPT_TWEAKS_FILE}\n\nUpdate and replace local tweaks.db?" && 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 diff --git a/docs/README.md b/docs/README.md index a243ef0..bae1290 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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" @@ -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 diff --git a/res/tweaks.db b/res/tweaks.db index 76cad5f..a39c20c 100644 --- a/res/tweaks.db +++ b/res/tweaks.db @@ -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 @@ -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 @@ -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 ''