TOPIC: [QoL] RegEx for adding default values to tooltips!
[QoL] RegEx for adding default values to tooltips! 2 years 4 months ago #1
| || |
After searching and discovering there is no way to load default values without manually deleting stuff in saved profiles, I decided to dig into the .FX files and somehow create a way to at least view the defaults while in-game. The solution I decided on was to copy the default values given to each setting when they are defined, and simply append them to the end of the tooltips that pop up when you hover each setting in game. Doing this manually however is no ones idea of fun so I came up with 2 regex lines that together can be used to automate the work!
This regex uses PCRE syntax. If your text editor doesn't support regex or you dont know what syntax it uses, I suggest just installing Notepad++ which adopted PCRE as its standard since version 6.0 (2012)
BACK UP YOUR FILTERS!!! (the .FX files)
For Notepad++ users, you'll want to use the "Replace in Files" button which can be found under the "Find in Files" dialogue as you can see here.
1) Set the directory to that which contains all of your FX filters.
2) Change the (ironic) "Filters" box to... "*.fx" without quotes, as seen above.
3) Under "Search Mode" switch it to "Regular expression"
There are then 2 different expressions to execute. I tried really hard to get the entire process into a single expression but my brain just couldn't handle it... sorry ^^
First expression: Appends default values to existing tooltip definitions
(?si)(uniform[ ][\w]+[ ])([\w_]+)([^>]+ui_tooltip[ ][=][ ]["][^"]*?)(["][^>]+[\r\n]+[>][ ][=][ ])([^;\r\n]+)[;]
Second expression: Creates tooltips for any settings that don't have tooltips defined
\1\2\3 [ \5 ]\4\5;
(?si)(uniform[ ][\w]+[ ][\w_]+(?![^>]+ui_tooltip)[^>]+[;])([\r\n]+[>][ ][=][ ])([^;\r\n]+)[;]
\1\r\n\tui_tooltip = "[ \3 ]";\2\3;
Depending on which filters you are using with Reshade, the second expression may not find any results to replace so don't worry.
Once completed if everything went according to plan, you will now be able to see the default values for every single filter setting in reshade!
If anything went wrong for any reason, simply copy the filters from the backup you made. Also this regex does not account for any filters that have already have been edited so if you add additional filters in the future, run the expressions on them in a temporary folder by themselves before copying them to your main reshade folder. Worst case scenario though you'll end up with the default listed twice at the end of some of your tooltips.
Please reply with any questions or issues and I'll do my best to assist!
The administrator has disabled public write access.