Skip to content

Commit 20c3e37

Browse files
committed
Merge branch 'PoorPocketsMcNewHold-patch-1'
2 parents fd0f07b + 081da04 commit 20c3e37

8 files changed

+250
-172
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.exe
2+
*.jpg
23
*.png
34
*.zip
45

README.md

+20-13
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
**SteamGrid** is a standalone, fire-and-forget program to enhance Steam's grid view and Big Picture. It preloads the banner images for all your games (even non-Steam ones) and applies overlays depending on your categories.
44

5-
You run it once and it'll set up everything above, automatically, keeping your existing custom images. You can run
5+
You run it once, and it'll set up everything above, automatically, keeping your existing custom images. You can run
66
again when you get more games or want to update the category overlays.
77

88
# Download #
99

10-
[**steamgrid-windows.zip (4.4MB)**](https://github.com/boppreh/steamgrid/releases/latest/download/steamgrid_windows.zip)
10+
[**steamgrid-windows.zip (4.4 MB)**](https://github.com/boppreh/steamgrid/releases/latest/download/steamgrid_windows.zip)
1111

12-
[**steamgrid-linux.zip (4.5MB)**](https://github.com/boppreh/steamgrid/releases/latest/download/steamgrid_linux.zip)
12+
[**steamgrid-linux.zip (4.5 MB)**](https://github.com/boppreh/steamgrid/releases/latest/download/steamgrid_linux.zip)
1313

14-
[**steamgrid-mac.zip (4.6MB)**](https://github.com/boppreh/steamgrid/releases/latest/download/steamgrid_mac.zip)
14+
[**steamgrid-mac.zip (4.6 MB)**](https://github.com/boppreh/steamgrid/releases/latest/download/steamgrid_mac.zip)
1515

1616
# How to use #
1717

1818
1. Download the [latest version](https://github.com/boppreh/steamgrid/releases/latest) and extract the zip wherever.
19-
2. *(optional)* Name the overlays after your categories. So if you have a category "Games I Love", put a nice little heart overlay there named `games i love.banner.png`. You can rename the defaults that came with the zip or get new ones at [/r/steamgrid](http://www.reddit.com/r/steamgrid/wiki/overlays).
19+
2. *(optional)* Name the overlays after your categories. So if you have a category Games I Love, put a nice little heart overlay there named `games i love.banner.png`. You can rename the defaults that came with the zip or get new ones at [/r/steamgrid](http://www.reddit.com/r/steamgrid/wiki/overlays).
2020
* Add the extension `.banner` before the image extension for banner art: `games i love.banner.png`
2121
* Add the extension `.cover` before the image extension for cover art: `games i love.cover.png`
2222
* Add the extension `.hero` before the image extension for hero art `games i love.hero.png`
@@ -28,13 +28,20 @@ again when you get more games or want to update the category overlays.
2828
* Add the extension `.logo`/`_hero` before the image extension for logo art `Psychonauts.logo.png`, `3830_logo.png`
2929
4. *(optional)* Generate a some API Keys to enhance the automatic search:
3030
* [SteamGridDB API Key](https://www.steamgriddb.com/profile/preferences)
31-
* [IGDB API Key](https://api.igdb.com/signup)
32-
5. Run `steamgrid` and wait. No, really, it's all automatic. Not a single keypress required.
31+
* [IGDB API Client/Secret](https://api-docs.igdb.com/#about)
32+
5. Run `steamgrid` and wait. No, really, it's all automatic. Not a single key press required.
3333
* *(optional)* Append `--steamgriddb <api key>` if you've generated one before.
34-
* *(optional)* Append `--igdb <api key>` if you've genereated one before.
34+
* *(optional)* Append `--igdbclient <igdb client>` if you've genereated one before.
35+
* *(optional)* Append `--igdbsecret <igdb secret>` if you've genereated one before.
3536
* *(optional)* Append `--types <preference>` to choose your preferences between animated steam covers or static ones Available choices : `animated`,`static`. Default : `static`. You can use `animated,static` to download both while preferring animated covers, and `static,animated` for preferring static covers.
3637
* *(optional)* Append `--styles <preference>` to choose your preferences between the different covers styles from steamgriddb. Available choices : `material`,`white_logo`,`alternate`,`blurred`,`no_logo`. Default: `alternate`. You can also input multiple comma-separated choices in the same manners of the `--types` argument.
3738
* *(optional)* Append `--appids <appid1,appid2>` to only process the specified appID(s)
39+
* *(optional)* Append `--onlymissingartwork` to only download artworks missing on the official servers.
40+
* *(optional)* Append `-nonsteamonly` to only search artworks for non-steam games added onto the Steam client.
41+
* *(optional)* Append `-skip<preference>` to skip searching and downloading parts from certain artwork elements. Available choices : `-skipbanner`,`-skipcover`,`-skiphero`,`-skiplogo`. For example: Appending `-skiplogo -skipbanner` will prevent steamgrid to search and download logo and banners for any games.
42+
* *(optional)* Append `-skipsteam` to not download the default artworks from Steam.
43+
* *(optional)* Append `-skipgoogle` to skip search and downloads from Google.
44+
* *(tip)* Run with `--help` to see all available options again.
3845
6. Read the report and open Steam in grid view to check the results.
3946

4047
---
@@ -57,14 +64,14 @@ again when you get more games or want to update the category overlays.
5764
- Loads your categories from the local Steam installation.
5865
- Applies transparent overlays based on each game categories (make sure the name
5966
of the overlay file is the name of the category).
60-
- If you already have any customized images it'll use them and apply the
67+
- If you already have any customized images, it'll use them and apply the
6168
overlay, but keeping a backup.
6269
- If you have images in the directory `games/`, it'll search by game name or by id and use them.
6370
- Works just as well with non-Steam games.
6471
- Supports PNG and JPG images.
6572
- Supports games with multiple categories.
6673
- No installation required, just extract the zip and double click.
67-
- Works with Windows, Linux, and MacOS, 32 or 64 bit.
74+
- Works with Windows, Linux, and macOS, 32 or 64 bit.
6875
- 100% fire and forget, no interaction required, and can cancel and retry at any moment.
6976

7077
# Something wrong? #
@@ -73,7 +80,7 @@ again when you get more games or want to update the category overlays.
7380
- **Fails to find steam location**: You can drag and drop the Steam installation folder (not the library!) into `steamgrid.exe` for a manual override.
7481
- **A few images were not found**: Some images are hard to find. The program may miss a game, especially betas, prototypes and tests, but you can set an image manually through the Steam client (right click > `Set Custom Image`). Run `steamgrid` again to apply the overlays. If you know a good source of images, drop me a message.
7582
- **No overlays found**: make sure you put your overlays inside the `overlays by category` folder, and it's near the program itself. This error means absolutely no overlays were found, without even taking your categories names into consideration.
76-
- **It didn't apply any overlays**: ensure the overlay file name matches your category name, including possible punctuation (differences in caps are ignored). For example `favorites.png` is used for the `Favorites` category.
77-
- **I'm worried this is a virus**: I work with security, so no offense taken from a little paranoia. The complete source code is provided at this [Github repo](https://github.com/boppreh/steamgrid). If you are worried the binaries don't match the source, you can install Go on your machine and run the sources directly. All it does is save images inside `Steam/userdata/ID/config/grid`. It does connect to the internet, but only to fetch game names from you Steam profile and download images into the Steam's grid image folder. Nothing is installed or saved in the Windows registry, and aside from images downloaded it should leave the computer exactly as it found.
83+
- **It didn't apply any overlays**: ensure the overlay file name matches your category name, including possible punctuation (differences in caps are ignored). For example, `favorites.png` is used for the `Favorites` category.
84+
- **I'm worried this is a virus**: I work with security, so no offense taken from a little paranoia. The complete source code is provided at this [Github repo](https://github.com/boppreh/steamgrid). If you are worried the binaries don't match the source, you can install Go on your machine and run the sources directly. All it does is save images inside `Steam/userdata/ID/config/grid`. It does connect to the internet, but only to fetch game names from you Steam profile and download images into the Steam's grid image folder. Nothing is installed or saved in the Windows registry, and aside from images downloaded, it should leave the computer exactly as it found.
7885

79-
If you encounter any problems please [open an issue](https://github.com/boppreh/steamgrid/issues/new). All critics and suggestions are welcome.
86+
If you encounter any problems, please [open an issue](https://github.com/boppreh/steamgrid/issues/new). All critics and suggestions are welcome.

backup.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
// BackupGame if a game has a custom image, backs it up by appending "(original)" to the
1616
// file name.
17-
func BackupGame(gridDir string, game *Game, artStyleExtensions []string) error {
17+
func backupGame(gridDir string, game *Game, artStyleExtensions []string) error {
1818
if game.CleanImageBytes != nil {
1919
return ioutil.WriteFile(getBackupPath(gridDir, game, artStyleExtensions), game.CleanImageBytes, 0666)
2020
}
@@ -25,17 +25,17 @@ func getBackupPath(gridDir string, game *Game, artStyleExtensions []string) stri
2525
hash := sha256.Sum256(game.OverlayImageBytes)
2626
// [:] is required to convert a fixed length byte array to a byte slice.
2727
hexHash := hex.EncodeToString(hash[:])
28-
return filepath.Join(gridDir, "originals", game.ID + artStyleExtensions[0] + " " + hexHash+game.ImageExt)
28+
return filepath.Join(gridDir, "originals", game.ID+artStyleExtensions[0]+" "+hexHash+game.ImageExt)
2929
}
3030

31-
func RemoveExisting(gridDir string, gameId string, artStyleExtensions []string) error {
32-
images, err := filepath.Glob(filepath.Join(gridDir, gameId + artStyleExtensions[0] + ".*"))
31+
func removeExisting(gridDir string, gameID string, artStyleExtensions []string) error {
32+
images, err := filepath.Glob(filepath.Join(gridDir, gameID+artStyleExtensions[0]+".*"))
3333
if err != nil {
3434
return err
3535
}
3636
images = filterForImages(images)
3737

38-
backups, err := filepath.Glob(filepath.Join(gridDir, "originals", gameId + artStyleExtensions[0] + " *.*"))
38+
backups, err := filepath.Glob(filepath.Join(gridDir, "originals", gameID+artStyleExtensions[0]+" *.*"))
3939
if err != nil {
4040
return err
4141
}
@@ -63,7 +63,7 @@ func loadImage(game *Game, sourceName string, imagePath string) error {
6363
}
6464

6565
// https://wenzr.wordpress.com/2018/04/09/go-glob-case-insensitive/
66-
func InsensitiveFilepath(path string) string {
66+
func insensitiveFilepath(path string) string {
6767
if runtime.GOOS == "windows" {
6868
return path
6969
}
@@ -95,8 +95,8 @@ func filterForImages(paths []string) []string {
9595
return matchedPaths
9696
}
9797

98-
func LoadExisting(overridePath string, gridDir string, game *Game, artStyleExtensions []string) {
99-
overridenIDs, _ := filepath.Glob(filepath.Join(overridePath, game.ID + artStyleExtensions[0] + ".*"))
98+
func loadExisting(overridePath string, gridDir string, game *Game, artStyleExtensions []string) {
99+
overridenIDs, _ := filepath.Glob(filepath.Join(overridePath, game.ID+artStyleExtensions[0]+".*"))
100100
if overridenIDs != nil && len(overridenIDs) > 0 {
101101
loadImage(game, "local file in directory 'games'", overridenIDs[0])
102102
return
@@ -106,15 +106,15 @@ func LoadExisting(overridePath string, gridDir string, game *Game, artStyleExten
106106
if game.Name != "" {
107107
re := regexp.MustCompile(`\W+`)
108108
globName := re.ReplaceAllString(game.Name, "*")
109-
overridenNames, _ := filepath.Glob(filepath.Join(overridePath, InsensitiveFilepath(globName) + artStyleExtensions[1] + ".*"))
109+
overridenNames, _ := filepath.Glob(filepath.Join(overridePath, insensitiveFilepath(globName)+artStyleExtensions[1]+".*"))
110110
if overridenNames != nil && len(overridenNames) > 0 {
111111
loadImage(game, "local file in directory games/", overridenNames[0])
112112
return
113113
}
114114
}
115115

116116
// If there are any old-style backups (without hash), load them over the existing (with overlay) images.
117-
oldBackups, err := filepath.Glob(filepath.Join(gridDir, game.ID + artStyleExtensions[0] + " (original)*"))
117+
oldBackups, err := filepath.Glob(filepath.Join(gridDir, game.ID+artStyleExtensions[0]+" (original)*"))
118118
if err == nil && len(oldBackups) > 0 {
119119
err = loadImage(game, "legacy backup (now converted)", oldBackups[0])
120120
if err == nil {
@@ -123,7 +123,7 @@ func LoadExisting(overridePath string, gridDir string, game *Game, artStyleExten
123123
}
124124
}
125125

126-
files, err := filepath.Glob(filepath.Join(gridDir, game.ID + artStyleExtensions[0] + ".*"))
126+
files, err := filepath.Glob(filepath.Join(gridDir, game.ID+artStyleExtensions[0]+".*"))
127127
files = filterForImages(files)
128128
if err == nil && len(files) > 0 {
129129
err = loadImage(game, "manual customization", files[0])

0 commit comments

Comments
 (0)