-
Notifications
You must be signed in to change notification settings - Fork 73
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
Reshade version override #649
Conversation
No worries about the other PR, it's all good :-)
They might be blank because it's looking for The rest of your I'll add a few more comments in the PR (mostly the same as what I added in the last PR) but it's looking pretty good so far! 😄 |
oh, sorry didn't see you added comments on the old one. Also looks like I still forgot something, as it's not installing the overridden reshade into the game so that needs to be fixed |
No worries, maybe something in |
nah I don't think I changed anything there (at least, looking at some old files I have on my computer, I didn't) I was missing some changes to |
Was that an issue we had before related to where the ReShade function was being called? #645 (comment) |
hmm don't think so it seems my function is always getting called it just seems when yad refreshes it sets it back to the global version ( it is also successfully being saved to the game config file so idk why yad is doing that) I did have this issue before when I set the default value of EDIT: only thing I can think of that can be causing this is this
EDIT2: yeah just reread you explanation of the yad stuff and that's exactly whats happening 😅 Will finish this sometime this week (Tomorrow probably) but I'm thinking i can leave the yad default blank so it doesn't update everytime yaw is called? Then i can just set the default value in the default Cfg function to be 'RSVERS' and check for that in my function |
No rush :-) You could potentially leave it blank but you'll want the values for the different ReShade versions in the dropdown. Maybe the default should match the global ReShade and then in your override function you can check if the versions are different? |
The problem is (at least it seems might be wrong) whatever value I set after the cleanDropDown gets set to I noticed this because I can type in say 5.4.1 hit save and when the menu comes back ti will be set back to the global (5.4.2). Its saving in the config file correctly as 5.4.1 but in yad its getting overridden to 5.4.2 so I think its because of that. so what I am thinking is I can leave the yad default blank and then in my versions function I think I can just add so that way, if no version has been set in the config, it will default to the global version otherwise it will use the version set in the game config. Then the dropdown will have a option to see it back to the global version |
Oooohhh this may be because the first value in the I would try that before delving into keeping the value blank :-) |
Actually, yup you are right its I removed the default value part from the yad command and it still overrides it what ever is the first version in |
So no clue why as for auto-populating the list, that looks a lot more complicated than I originally thought. It SHOULD be technically possible by using the tagged releases here https://github.com/crosire/reshade/tags other than those two things, I think this is pretty much complete and once I figure out how to prevent the override, it can be merged. What do you think @sonic2kk ? |
First of all, I totally messed up and didn't understand how GitHub PR reviews worked. I was adding comments and thought they'd show up right away, but I had to hit a "submit review" button. Wow I'm dumb... I'm so sorry for that. It must've seemed like I was silent on your work! I was leaving all that feedback incorrectly... I submitted the review now I think, I noticed I couldn't view it in private browsing so I hunted around and I think I got it now 😅 It's getting a bit late here, but I'll take a look at the code and see why it's not setting the version properly. If I don't come up with anything tonight I'll take a closer look tomorrow. When you enter the value and it keeps the override version of ReShade, does it use that version of ReShade? Is there even a way to tell that? 😅 For fetching the versions, we can come to that last. Really sorry again for my inexperience here with reviewing PRs 😓 But I agree once we have some discussion on the feedback I left and once we get the ReShade version issue sorted out, we can take a look at the tag fetching for getting the versions and getting this merged. We can just fetch the last 5 or so, maybe we can use similar logic to the #!/usr/bin/env bash
GHURL="https://github.com"
WGET="wget"
function getTagsList {
PROJURL="$1"
N="$2"
RELEASESURL="${PROJURL}/releases"
EXPANDEDASSETSURL="${RELEASESURL}/expanded_assets"
TAGSURL="${PROJURL}/tags"
TAGSGREP="${RELEASESURL#"$GHURL"}/tag"
LATESTTAGS="$("$WGET" -q "${TAGSURL}" -O - 2> >(grep -v "SSL_INIT") | grep -m "$N" "$TAGSGREP" | grep -oE "${TAGSGREP}[^\"]+")"
LATESTTAGS="${LATESTTAGS##*/}"
LATESTTAGS="${LATESTTAGS//$'\n'/!}"
echo "$LATESTVER"
}
echo "Latest STL ver: $( getLatestGitHubReleaseVer "https://github.com/sonic2kk/steamtinkerlaunch" "5" )" I did a brief test and that returns duplicates (probably will just need some extra logic in the grepping to ignore duplicates or something) so it's not perfect but something along these lines might work. If you'd like it's something I could implement after merging 🙂 |
Some late-night Bash scripting later, I made a function that fetches the last N tags from a given repo. Check it out: #!/usr/bin/env bash
GHURL="https://github.com"
WGET="wget"
function fetchGitHubTags {
PROJURL="$1"
N="$2"
RELEASESURL="${PROJURL}/releases"
TAGSURL="${PROJURL}/tags"
TAGSGREP="${RELEASESURL#"$GHURL"}/tag"
mapfile -t BASETAGS < <("$WGET" -q "${TAGSURL}" -O - 2> >(grep -v "SSL_INIT") | grep -oE "${TAGSGREP}[^\"]+" | sort -urV | grep -m "$N" "$TAGSGREP")
for TAG in "${BASETAGS[@]}"; do
basename "$TAG"
done
}
RESHADETAGS="$( fetchGitHubTags "https://github.com/crosire/reshade" "5" )"
RESHADETAGS="${RESHADETAGS//$'\n'/!}"
RESHADETAGS="${RESHADETAGS//v/}"
echo "${RESHADETAGS}" Tested with ReShade and STL and it works :-) You should be able to just drop the function into STL and use it. The echoes are just there to give you an idea of what the output is. Usage is The function is really limited by how many tags come back on one GitHub page, which I think is 10. But that's fine to be honest. To save on calls, you might want to also wrap a call to that function in an (if I'm feeling brave, maybe in future I'll expand a function like that to go back in pages and get all the tags that way, but that is hurting my already sleepy brain too much 😅) |
Fixed the overriding issue by setting the first value of RESHADEVERSIONS to RSVERSOVRD and removing the RSVERS in the command to make the dropdown
I had a couple more thoughts just quickly before I sign off for the night: It might be a good idea to guard this behind a checkbox as well, that way a user can more easily toggle this on and off. It might give them more peace of mind and it's easier to remember to turn off the checkbox than to set the ReShade version back to the global version. We could then do a check in the same place where you have the check for the override and global ReShade versions being the same, so something like It hopefully shouldn't be too much to implement. If you need help with it I can try post an example tomorrow. Should be the same idea as the dropdown though: Add the strings, the UI element (you could look for some examples in the code that end in The other thing I thought of is, we may need some better validation for checking the ReShade version, but I'm not even sure this exists for the regular ReShade version so likely this is out of scope for this PR and something that should be worked on separately :-) Sorry I just thought of this now so late on. If you aren't up for looking into adding any more functionality that's totally fine and it can be added at a later date :-) |
no worries, I have been toying with the idea of a toggle since the beginning going back and forth the main reason for not doing it if I'm being honest, is laziness and being afraid of more code 😅 but your right it should be more or less the same as what I already did so I think I can manage... |
Totally fair 😄 Good luck! I'll try write up an example if you need it tomorrow. (Also, review has been more thorough than I thought. I appreciate all of your time! It's looking really good) |
Left a review comment about
Ah! I suppose that's fine then. Though I thought STL had logic to update the global config, maybe it isn't working (hopefully it wasn't something that I broke...) It's not a huge deal, but it's something I'll try to find time to investigate! |
Ah fishsticks, the HedgeModManager merge created langfile conflicts. No rush on resolving those though, we can do that at the end :-) |
nice to see some active contributions 👍 |
@zany130 I resolved the conflicts, that was my bad and I should've waited on you before merging the HMM branch, so I went ahead and cleaned up my mess. This PR is looking pretty sweet. Is autoBumpReshade the last thing left to do? I believe all of my review comments (except for the autoBumpReshade hint) are resolved now (the last one I forgot to mark resolved as the file overwrite, since you added the Of course there is still no rush, and you can just let me know when you feel it's ready for merging 😃 |
thanks for helping with the conflicts yeah the autobump for the resade version is the only thing left. Haven't had much time yesterday or today to take a look at it, but I hope I can finish it tomorrow. I wrote a response to your review on where I was stuck with the auto bump reshade function. everything else seems to be working nicely and I think is ready for merging |
If there's a response to that review it isn't showing up for me, I hunted around but tbh the review workflow is still very new to me 😅 if you could leave it as a regular comment I can take a look and try help out however I can :-) |
ahh sorry about that what follows is post i mentioned I think its the second part that giving me issues (really should be
|
This might work already with
Ahh, it's because of this: RSVERSLATEST="${RSVERSONLINE//v/}" should be this: RSVERSLATEST="${RSVERSLATEST//v/}" The variable A fixed solution might look like: function autoBumpReShade {
echo "HELLLLLLLOOOOOO"
RSVERSLATEST="$( fetchGitHubTags "$RESHADEPROJURL" "1" )"
RSVERSLATEST="${RSVERSONLINE//v/}"
echo " latest reshade version is '$RSVERSLATEST'"
echo " current reshade version is '$RSVERS'"
if [ "$AUTOBUMPRESHADE" -eq 1 ] && [[ "$RSVERS" < "$RSVERSLATEST" ]]; then # Note the double brackets when comparing strings
echo "updating reshade"
writelog "INFO" "${FUNCNAME[0]} - Found newer version of '$RESH' - Updating '$RSVERS' to '$RSVERSLATEST"
touch "$FUPDATE"
updateConfigEntry "RSVERS" "$RSVERSLATEST" "$STLDEFGLOBALCFG"
else
echo "not updating reshade"
writelog "SKIP" "${FUNCNAME[0]} - '$RSVERS' is the latest version of '$RESH' - not updating"
fi
# any extra code can go here...
fi |
yup, to be honest, I wrote this function late at night a few days ago and haven't even looked at it since works now 😅 going to push it in a bit I'm not sure about the placement of the call to |
I've been here many times (even recently), it happens 😄
Ah good thinking. I think a call to this in Awesome work here! |
…/steamtinkerlaunch into reshade_version_override
The new function and function call placement looks good to me. I think GitHub has an option to squash commits but if you'd like you can squash them locally and force-push so that there's just one single commit for this 😃 After that I'm good to merge this if you're ready |
commit 2018d45 Merge: 3137922 021f7e5 Author: zany130 <andresdortiz@gmail.com> Date: Sun Nov 13 15:49:34 2022 -0500 Merge branch 'reshade_version_override' of https://github.com/zany130/steamtinkerlaunch into reshade_version_override commit 3137922 Author: zany130 <andresdortiz@gmail.com> Date: Sun Nov 13 15:49:17 2022 -0500 fix autoBumpReShade commit 021f7e5 Merge: 6424c69 90c95b7 Author: Eamonn Rea <eamonnrea@gmail.com> Date: Sat Nov 12 20:26:26 2022 +0000 Merge branch 'master' into reshade_version_override commit 90c95b7 Author: Eamonn Rea <eamonnrea@gmail.com> Date: Sat Nov 12 03:25:27 2022 +0000 Remove useless Flatpak warning Does not work as Flatpak STL does not come with sh, and since users on Steam Deck (at least the ones that complain it doesn't work) almost certainly wont have Flatpak Steam installed, they won't be able to run the script at all and so it won't show up. commit b731f7e Author: Eamonn Rea <eamonnrea@gmail.com> Date: Sat Nov 12 03:03:28 2022 +0000 Add check for JQ installation before generating online Proton versions JQ is required for online Proton version checking. In future we could potentially remove the reliance on this and instead parse it with a different function commit e89df4e Author: Eamonn Rea <eamonnrea@gmail.com> Date: Sat Nov 12 01:06:02 2022 +0000 HMM: Only install Winetricks for installed games commit 064b947 Author: Eamonn Rea <eamonnrea@gmail.com> Date: Sat Nov 12 00:24:07 2022 +0000 version bump commit e69f02a Author: Eamonn Rea <eamonnrea@gmail.com> Date: Sat Nov 12 00:23:55 2022 +0000 HMM: Fix wrong RUNWINE name Stopped Sonic Generations from correctly applying Winetricks commit 27c3c6e Author: Eamonn Rea <eamonnrea@gmail.com> Date: Fri Nov 11 22:14:40 2022 +0000 Add HedgeModManager usage to help screen commit ce9b196 Author: Eamonn Rea <eamonnrea@gmail.com> Date: Fri Nov 11 21:52:22 2022 +0000 Add HedgeModManager support commit 6424c69 Author: zany130 <andresdortiz@gmail.com> Date: Thu Nov 10 18:45:33 2022 -0500 some sanity checks and more autoBumpReShade work commit ea566c8 Author: zany130 <andresdortiz@gmail.com> Date: Thu Nov 10 16:05:30 2022 -0500 update lang files commit 8f9443e Author: zany130 <andresdortiz@gmail.com> Date: Thu Nov 10 15:42:58 2022 -0500 fix reshade override list and some skel work on Auto bumping global reshade version commit b6c24d6 Author: zany130 <andresdortiz@gmail.com> Date: Thu Nov 10 13:45:24 2022 -0500 autopopulating reshade list and some cleanups commit 39ad6e8 Author: zany130 <andresdortiz@gmail.com> Date: Wed Nov 9 22:38:01 2022 -0500 minor fix indentation commit 8dda5a9 Author: zany130 <andresdortiz@gmail.com> Date: Wed Nov 9 22:23:37 2022 -0500 skel reshade vulkan support and update overrideReshadeVersion as @sonic2kk suggested :) commit 0210acf Author: zany130 <andresdortiz@gmail.com> Date: Wed Nov 9 21:45:35 2022 -0500 Add override toggle commit a3a557e Author: zany130 <andresdortiz@gmail.com> Date: Wed Nov 9 20:22:53 2022 -0500 Fixes and cleanups Fixed the overriding issue by setting the first value of RESHADEVERSIONS to RSVERSOVRD and removing the RSVERS in the command to make the dropdown commit 6b329ee Author: zany130 <andresdortiz@gmail.com> Date: Wed Nov 9 19:04:47 2022 -0500 minor commit 555cdeb Author: Eamonn Rea <eamonnrea@gmail.com> Date: Wed Nov 9 22:01:49 2022 +0000 Always update Yad config entry on Steam Deck If SteamTinkerLaunch is installed, but the config folder goes missing, the Yad binary may not get set again since we don't call setYadBin again on Steam Deck. Force add the path to the Yad bin to the global config if Yad is found on Steam Deck. Should address sonic2kk#646 commit 891315b Author: Eamonn Rea <eamonnrea@gmail.com> Date: Wed Nov 9 18:31:48 2022 +0000 More work for sonic2kk#651 commit 95ad206 Author: Eamonn Rea <eamonnrea@gmail.com> Date: Wed Nov 9 17:40:47 2022 +0000 Fix local install check on Steam Deck commit dae5c47 Author: zany130 <andresdortiz@gmail.com> Date: Tue Nov 8 20:00:21 2022 -0500 some fixes for hardcoded reshade versions commit a279216 Author: zany130 <andresdortiz@gmail.com> Date: Tue Nov 8 16:48:03 2022 -0500 fix missing hardcoded reshade versions commit 43bb296 Author: zany130 <andresdortiz@gmail.com> Date: Tue Nov 8 16:33:58 2022 -0500 fix installRSdll commit da57b7b Merge: eeabc5a 907a03b Author: Andres <andresdortiz@gmail.com> Date: Tue Nov 8 15:19:45 2022 -0500 Merge branch 'sonic2kk:master' into reshade_version_override commit eeabc5a Author: zany130 <andresdortiz@gmail.com> Date: Tue Nov 8 15:17:07 2022 -0500 add reshade version override
I think that did it? not sure. Sorry still learning GitHub 😓 |
I don't think it did it but it's no problem, I'll use GitHub's squash feature (it should work, I just know some projects shy away from it). |
Yup looks like that merged in fine - Thanks for all your work here! ❤️ |
sorry small bug I just notice @sonic2kk |
Fixed it :-) Changelog has also been updated: https://github.com/sonic2kk/steamtinkerlaunch/wiki/Changelog#changes-in-latest-master (feel free to edit if you want to make any changes 😃) |
Oh something that totally slipped my mind, @zany130 If you would like you can update the ReShade wiki page: https://github.com/sonic2kk/steamtinkerlaunch/wiki/ReShade Feel free to update as much or as little as you want on this page, or if you don't want to, I can do it another time. There is no rush on this though :-) |
#645
Sorry didn't mean to close the previous PR accidentally merged your changes into my branch, which not only closed the PR but also messed some things up. So I deleted the branch and created a new one
This branch should be up-to-date and correct. The only things left to do here is
I already did some preliminary testing, and everything seems to work.
Again sorry about the mistake I think everything is as it should be