Skip to content

Commit

Permalink
add reshade version override
Browse files Browse the repository at this point in the history
  • Loading branch information
zany130 committed Nov 8, 2022
1 parent b1f5e6e commit eeabc5a
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 25 deletions.
4 changes: 3 additions & 1 deletion lang/chinese.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/dutch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/englishUK.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/french.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/german.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/italian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/polish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
4 changes: 3 additions & 1 deletion lang/russian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -995,4 +995,6 @@ BUT_RUNWINECFG="Run Winecfg"
DESC_RUNWINECFG="Open Winecfg GUI for one time run (opens on top of this window)"
BUT_RUNWINETRICKS="Run Winetricks"
DESC_RUNWINETRICKS="Open Winetricks GUI for one time run (opens on top of this window)"
BUT_RUNONETIMECMD="RUN COMMAND"
BUT_RUNONETIMECMD="RUN COMMAND"
GUI_RESHADEOVERRIDE="ReShade override"
DESC_RESHADEOVERRIDE="ReShade version to overide gloabl version with"
50 changes: 34 additions & 16 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -2591,7 +2591,7 @@ function setDefaultCfgValues {
if [ -z "$ROBERTAARGS" ] ; then ROBERTAARGS="--wait-before-run"; fi
if [ -z "$LUXTORPEDACMD" ] ; then LUXTORPEDACMD="$STEAMCOMPATOOLS/luxtorpeda/luxtorpeda"; fi
if [ -z "$LUXTORPEDAARGS" ] ; then LUXTORPEDAARGS="wait-before-run"; fi
if [ -z "$RSVERS" ] ; then RSVERS="5.3.0"; fi
if [ -z "$RSVERS" ] ; then RSVERS="5.4.2"; fi
if [ -z "$DOWNLOAD_RESHADE" ] ; then DOWNLOAD_RESHADE="1"; fi
if [ -z "$RESHADESRCDIR" ] ; then RESHADESRCDIR="$STLDLDIR/reshade"; fi
if [ -z "$D3D47_64" ] ; then D3D47_64="${D3D47//./_64.}"; fi
Expand Down Expand Up @@ -2721,6 +2721,7 @@ function setDefaultCfgValues {
if [ -z "$RESHADE_DEPTH3D" ] ; then RESHADE_DEPTH3D="0"; fi
if [ -z "$USERESHADE" ] ; then USERESHADE="0"; fi
if [ -z "$RESHADEUPDATE" ] ; then RESHADEUPDATE="0"; fi
if [ -z "$RSVERSOVRD" ] ; then RSVERSOVRD="0"; fi
if [ -z "$CHOOSESHADERS" ] ; then CHOOSESHADERS="0"; fi
if [ -z "$ALTEXEPATH" ] ; then ALTEXEPATH="/tmp"; fi
if [ -z "$ARCHALTEXE" ] ; then ARCHALTEXE="$DUMMYBIN"; fi
Expand Down Expand Up @@ -3256,6 +3257,8 @@ function saveCfg {
echo "USERESHADE=\"$USERESHADE\""
echo "## $DESC_RESHADEUPDATE"
echo "RESHADEUPDATE=\"$RESHADEUPDATE\""
echo "## $DESC_RESHADEOVERRIDE"
echo "RSVERSOVRD=\"$RSVERSOVRD\""
echo "## $DESC_CHOOSESHADERS"
echo "CHOOSESHADERS=\"$CHOOSESHADERS\""
echo "## $DESC_ALTEXEPATH"
Expand Down Expand Up @@ -4948,6 +4951,7 @@ function AllSettingsEntriesDummyFunction {
--field=" $GUI_RS_64!$DESC_RS_64 ('RS_64')" "${RS_64/#-/ -}" `#CAT_Shader` `#SUB_ReShade` `#MENU_GLOBAL` \
--field=" $GUI_D3D47_32!$DESC_D3D47_32 ('D3D47_32')" "${D3D47_32/#-/ -}" `#CAT_Shader` `#SUB_ReShade` `#MENU_GLOBAL` \
--field=" $GUI_D3D47_64!$DESC_D3D47_64 ('D3D47_64')" "${D3D47_64/#-/ -}" `#CAT_Shader` `#SUB_ReShade` `#MENU_GLOBAL` \
--field=" $GUI_RESHADEOVERRIDE!$DESC_RESHADEOVERRIDE ('RSVERSOVRD')":CBE "$(cleanDropDown "${RSVERS/#-/ -}" "$RESHADEVERSIONS")" `#CAT_Shader` `#SUB_ReShade` `#MENU_GAME` \
--field=" $GUI_ARCHALTEXE!$DESC_ARCHALTEXE ('ARCHALTEXE')":FL "${ARCHALTEXE/#-/ -}" `#CAT_Shader` `#SUB_ReShade` `#MENU_GAME` \
--field=" $GUI_ALTEXEPATH!$DESC_ALTEXEPATH ('ALTEXEPATH')":DIR "${ALTEXEPATH/#-/ -}" `#CAT_Shader` `#SUB_Directories` `#MENU_GAME` \
--field=" $GUI_RESHADESRCDIR!$DESC_RESHADESRCDIR ('RESHADESRCDIR')":DIR "${RESHADESRCDIR/#-/ -}" `#CAT_Shader` `#SUB_ReShade` `#SUB_Directories` `#MENU_GLOBAL` \
Expand Down Expand Up @@ -7433,37 +7437,51 @@ function dlReShade {
else
DLVERS="$1"
fi
rm "$RESHADESRCDIR/$RS_64" 2>/dev/null
rm "$RESHADESRCDIR/$RS_32" 2>/dev/null
rm "$RESHADESRCDIR/${RS_64//.dll/.json}" 2>/dev/null
rm "$RESHADESRCDIR/${RS_32//.dll/.json}" 2>/dev/null
#rm "$RESHADESRCDIR/$RS_64" 2>/dev/null
#rm "$RESHADESRCDIR/$RS_32" 2>/dev/null
#rm "$RESHADESRCDIR/${RS_64//.dll/.json}" 2>/dev/null
#rm "$RESHADESRCDIR/${RS_32//.dll/.json}" 2>/dev/null

DLDST="${RESHADESRCDIR}/${RSSU}.exe"
DLDSTV="${RESHADESRCDIR}/${RSSU}_${DLVERS}.exe"
#DLDST="${RESHADESRCDIR}/${RSSU}.exe"
#DLDSTV="${RESHADESRCDIR}/${RSSU}_${DLVERS}.exe"
DLDST="${RESHADESRCDIR}/${RSSU}_${DLVERS}.exe"

RSSETUP="${RESHADEDLURL}/${RSSU}_${DLVERS}.exe"

dlCheck "$RSSETUP" "$DLDST" "X" "Downloading $RSSU"
if [ ! -f "$DLDSTV" ]; then
writelog "INFO" "${FUNCNAME[0]} - Creating backup '${RSSU}_${DLVERS}.exe'"
cp "$DLDST" "$DLDSTV"
fi
#if [ ! -f "$DLDSTV" ]; then
# writelog "INFO" "${FUNCNAME[0]} - Creating backup '${RSSU}_${DLVERS}.exe'"
# cp "$DLDST" "$DLDSTV"
#fi

echo "$DLVERS" > "${DLDST//.exe/.log}"

if [ ! -s "$DLDST" ]; then
writelog "SKIP" "${FUNCNAME[0]} - Downloaded file '$DLDST' is empty - removing"
rm "$DLDST" 2>/dev/null
else
"$UNZIP" -q "$DLDST" -d "$RESHADESRCDIR" 2>/dev/null
"$UNZIP" -q "$DLDST" -d "$RESHADESRCDIR/$RSVERS" 2>/dev/null
writelog "INFO" "${FUNCNAME[0]} - Downloaded and extracted ${RESH}-v${DLVERS} file '$DLDST'"
fi
}

function overrideReShadeVersion
{
RESHADEVERSIONS="5.4.2!5.0.0!4.2.0!3.5.3" # List some hardcoded reshade versions to selct for the override #TODO replace with a auto poplating list based on the last few releses

if ! [ "$RSVERSOVRD" -eq "0" ]; then
writelog "INFO" "ReShade version - Set to '$RSVERSOVRD'"
RSVERS="$RSVERSOVRD"
else
writelog "SKIP" "RSVERSOVRD is set to '$RSVERSOVRD' continue with reshade version - '$RSVERS'"
fi
}

# prepare reshade files if not found:
function prepareReshadeFiles {
if [ "$DOWNLOAD_RESHADE" -eq 1 ]; then
writelog "INFO" "${FUNCNAME[0]} - DOWNLOAD_RESHADE enabled"
overrideReShadeVersion
if [ "$DOWNLOAD_RESHADE" -eq 1 ]; then
writelog "INFO" "${FUNCNAME[0]} - DOWNLOAD_RESHADE enabled"
if [ ! -f "$D3D47DLDIR/$D3D47_32" ]; then dd
writelog "404" "${FUNCNAME[0]} - '$D3D47DLDIR/$D3D47_32' missing - downloading"

Expand All @@ -7475,8 +7493,8 @@ function prepareReshadeFiles {
dld3d47 "32"
dld3d47 "64"

if [ ! -f "$RESHADESRCDIR/$RS_64" ] || [ ! -f "$RESHADESRCDIR/$RS_32" ]; then
writelog "404" "${FUNCNAME[0]} - '$RESHADESRCDIR/$RS_64' and/or '$RS_32' missing - downloading"
if [ ! -f "$RESHADESRCDIR/$RSVERS/$RS_64" ] || [ ! -f "$RESHADESRCDIR/$RSVERS/$RS_32" ]; then
writelog "404" "${FUNCNAME[0]} - '$RESHADESRCDIR/$RSVERS/$RS_64' and/or '$RS_32' missing - downloading"
dlReShade
fi

Expand Down

0 comments on commit eeabc5a

Please sign in to comment.