|
6 | 6 | PREFIX="/usr"
|
7 | 7 | PROGNAME="SteamTinkerLaunch"
|
8 | 8 | NICEPROGNAME="Steam Tinker Launch"
|
9 |
| -PROGVERS="v14.0.20231024-1" |
| 9 | +PROGVERS="v14.0.20231024-2" |
10 | 10 | PROGCMD="${0##*/}"
|
11 | 11 | PROGINTERNALPROTNAME="Proton-stl"
|
12 | 12 | SHOSTL="stl"
|
@@ -1391,6 +1391,7 @@ function checkSGDbApi {
|
1391 | 1391 | ## Generic function to fetch some artwork from SteamGridDB based on an endpoint
|
1392 | 1392 | ## TODO: Steam only officially supports PNGs, test to see if WebP works when manually copied, and if it doesn't, we should try to only download PNG files
|
1393 | 1393 | ## TODO: Add max filesize option? Some artworks are really big, we should skip ones that are too large (though this may mean many animated APNG artworks will get skipped, because APNG can be huge)
|
| 1394 | +## TODO: Retry/Timeout when fetching artwork |
1394 | 1395 | function downloadArtFromSteamGridDB {
|
1395 | 1396 | if checkSGDbApi && [ "$STLPLAY" -eq 0 ]; then
|
1396 | 1397 | # Required
|
@@ -1668,6 +1669,32 @@ function getSGDBGameIDFromTitle {
|
1668 | 1669 | fi
|
1669 | 1670 | }
|
1670 | 1671 |
|
| 1672 | +# Remove artwork for single game based on AppID, or all grids |
| 1673 | +function removeSteamGrids { |
| 1674 | + RMGAMEGRID="${1,,}" # Should be Steam AppID or "all" |
| 1675 | + SGGRIDDIR="${STUIDPATH}/config/grid" |
| 1676 | + |
| 1677 | + if [ -z "$1" ]; then |
| 1678 | + writelog "ERROR" "${FUNCNAME[0]} - No parameter given, cannot remove artwork, skipping" |
| 1679 | + echo "You must provide either a Steam AppID to remove artwork for, or specify 'all' to remove all game artwork" |
| 1680 | + fi |
| 1681 | + |
| 1682 | + if [ "$1" == "all" ]; then |
| 1683 | + writelog "INFO" "${FUNCNAME[0]} - Removing grid artwork for all Steam games" |
| 1684 | + rmDirIfExists "${SGGRIDDIR}" |
| 1685 | + mkdir "${SGGRIDDIR}" |
| 1686 | + else |
| 1687 | + # Find any grid artwork for AppID -- Have to use find and use it on each artwork name because we don't want to match AppIDs which contain other AppIDs |
| 1688 | + # i.e. searching for '140*' would return matches with '1402750' as well |
| 1689 | + writelog "INFO" "${FUNCNAME[0]} - Removing any grid artwork for game with AppID '$1'" |
| 1690 | + find "${SGGRIDDIR}" -name "${RMGAMEGRID}_hero.*" -exec rm {} \; # Hero |
| 1691 | + find "${SGGRIDDIR}" -name "${RMGAMEGRID}_logo.*" -exec rm {} \; # Logo |
| 1692 | + find "${SGGRIDDIR}" -name "${RMGAMEGRID}p.*" -exec rm {} \; # Boxart |
| 1693 | + find "${SGGRIDDIR}" -name "${RMGAMEGRID}.*" -exec rm {} \; # Tenfoot |
| 1694 | + find "${SGGRIDDIR}" -name "${RMGAMEGRID}_icon.*" -exec rm {} \; # Icon (custom STL name for Non-Steam Games) |
| 1695 | + fi |
| 1696 | +} |
| 1697 | + |
1671 | 1698 | function getDataForAllGamesinSharedConfig {
|
1672 | 1699 | while read -r CATAID; do
|
1673 | 1700 | getGameData "$CATAID"
|
@@ -21276,6 +21303,20 @@ function getDefaultProton {
|
21276 | 21303 | fi
|
21277 | 21304 | }
|
21278 | 21305 |
|
| 21306 | +function rmFileIfExists { |
| 21307 | + if [ -f "$1" ]; then |
| 21308 | + writelog "INFO" "${FUNCNAME[0]} - Removing '$1'" |
| 21309 | + rm "$1" |
| 21310 | + fi |
| 21311 | +} |
| 21312 | + |
| 21313 | +function rmDirIfExists { |
| 21314 | + if [ -d "$1" ]; then |
| 21315 | + writelog "INFO" "${FUNCNAME[0]} - Removing '$1'" |
| 21316 | + rm -rf "$1" |
| 21317 | + fi |
| 21318 | +} |
| 21319 | + |
21279 | 21320 | function FUSEID {
|
21280 | 21321 | if [ -n "$1" ]; then
|
21281 | 21322 | USEID="$1"
|
@@ -21353,6 +21394,9 @@ function howto {
|
21353 | 21394 | echo " (for 'SteamAppID' or 'all')"
|
21354 | 21395 | echo " block Opens the category Block selection menu"
|
21355 | 21396 | echo " cleardeckdeps Remove downloaded Steam Deck dependencies, allowing them to"
|
| 21397 | + echo " cleargamegrids <arg> Remove downloaded game grids based on <arg>, which should be one of the following" |
| 21398 | + echo " <appid> Remove artwork for game with specific AppID, ex: 787480" |
| 21399 | + echo " all Remove ALL grid artwork by removing entire Steam Grids folder" |
21356 | 21400 | echo " update on next launch (This option is only applicable to SteamOS 3.X)"
|
21357 | 21401 | echo " compat <cmd> Will (add|del|get) ${PROGNAME,,} as"
|
21358 | 21402 | echo " Steam compatibility tool"
|
@@ -22122,6 +22166,13 @@ function commandline {
|
22122 | 22166 | else
|
22123 | 22167 | howto
|
22124 | 22168 | fi
|
| 22169 | + elif [ "$1" == "cleargamegrids" ]; then |
| 22170 | + if [ -z "$2" ]; then |
| 22171 | + writelog "ERROR" "${FUNCNAME[0]} - No parameter given, cannot remove artwork, skipping" |
| 22172 | + echo "You must provide either a Steam AppID to remove artwork for, or specify 'all' to remove all game artwork" |
| 22173 | + else |
| 22174 | + removeSteamGrids "$2" |
| 22175 | + fi |
22125 | 22176 | elif [ "$1" == "version" ] || [ "$1" == "--version" ] || [ "$1" == "-v" ]; then
|
22126 | 22177 | echo "${PROGNAME,,}-${PROGVERS}"
|
22127 | 22178 | elif [ "$1" == "$VTX" ]; then
|
|
0 commit comments