Skip to content

Commit

Permalink
Merge pull request #176 from cbartondock/master
Browse files Browse the repository at this point in the history
2.2.25
  • Loading branch information
doZennn authored May 13, 2020
2 parents c614c69 + d236ada commit 00774bf
Show file tree
Hide file tree
Showing 37 changed files with 272 additions and 190 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Change Log
All notable changes to this project will be documented in this file.

## 2.2.25 - 2020-05-12
### Added
* Setting for whether or not to delete shortcuts from disabled parsers
* Ability to see number of titles in preview and in test parser logs
* Environment variables ${/} and ${srmdir} that can be used even in steam directory, rom directory fields.
### Changed
* Removed retrogaming.cloud from list of image providers (it is defunct)
* Changed structure of AddedItemsV2.json to include Parser ID
* Added lontanadascienza as a contributor
### Fixed
* A bunch of dead links in Readme and About Markdown

## 2.2.23 - 2020-01-27
### Added
* Improved documentation for custom variables based on advice of a friend.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Pull requests will still be reviewed and merged.

# For casual users

Visit [Steam ROM Manager](https://frogthefrog.github.io/steam-rom-manager)'s github page for more information.
There are some helpful (albeit slightly outdated) tutorial videos to be found [here](https://github.com/doZennn/steam-rom-manager/tree/master/docs/videos). There is plenty of documentation available in the app's built in FAQ, and if you need further help there are expert users to be found on the [discord](https://discord.gg/nxxzBPJ).

Check out the [releases page](https://github.com/doZennn/steam-rom-manager/releases) for compiled downloads.

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steam-rom-manager",
"version": "2.2.24",
"version": "2.2.25",
"license": "GPL-3.0",
"description": "An app for managing ROMs in Steam",
"author": {
Expand Down
9 changes: 6 additions & 3 deletions src/lang/english/langData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ export const EnglishLang: languageContainer = {
selectLanguage: 'Select language:',
resetFuzzy_desc: 'Reset fuzzy list:',
resetFuzzy_btn: 'Reset',
showSteamImages: 'Show current Steam images',
clearLogOnTest: 'Automatically clear log when before testing parser'
showSteamImages: 'Show current Steam images by default',
deleteDisabledShortcuts: 'Remove shortcuts for disabled parsers',
clearLogOnTest: 'Automatically clear log before testing parsers'
},
placeholder: {
noProviders: 'None'
Expand Down Expand Up @@ -319,7 +320,8 @@ export const EnglishLang: languageContainer = {
]
},
info: {
testStarting__i: 'Testing "${title}" parser (SRM version - ${version}).',
testStarting__i: 'Testing "${title}" parser (SRM version - ${version} ${portable}).',
opSys__i: 'Operating system is "${os}"',
testCompleted: 'Parser test is completed.',
nothingWasFound: 'Parser found nothing.',
copiedToClipboard: 'Configuration copied to clipboard',
Expand Down Expand Up @@ -437,6 +439,7 @@ export const EnglishLang: languageContainer = {
validationErrors: {
parserType__md: '> Incorrect parser type!',
configTitle__md: '> Configuration title is required!',
parserId__md: '> Parser Id is missing, something is horribly wrong.',
parserInput: {
noInput: 'No inputs are available!',
inputNotAvailable__i: '"${name}" input is not available!',
Expand Down
11 changes: 6 additions & 5 deletions src/lang/english/markdown/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ In case you're having trouble with SRM, feel free to visit [Discord](https://dis

* Official [Steam](http://steamcommunity.com/groups/steamrommanager) group.
* Official [Discord](https://discord.gg/nxxzBPJ) group.
* Official [Github](https://github.com/FrogTheFrog/steam-rom-manager) repository.
* All releases can be downloaded from [here](https://github.com/FrogTheFrog/steam-rom-manager/releases).
* Official [Github](https://github.com/doZennn/steam-rom-manager) repository.
* All releases can be downloaded from [here](https://github.com/doZennn/steam-rom-manager/releases).

## Contributors

* `FrogTheFrog`{.noWrap} - creator of SRM, no longer active.
* `doZennn`{.noWrap} - helped before the initial release of SRM and many times after the release with various stuff.
* `HE Spoke`{.noWrap} - responsible for creating community around SRM. Creator of [Steam](http://steamcommunity.com/groups/steamrommanager) and [Discord](https://discord.gg/nxxzBPJ) groups. Also manages issues in [Github](https://github.com/FrogTheFrog/steam-rom-manager).
* `HE Spoke`{.noWrap} - responsible for creating community around SRM. Creator of [Steam](http://steamcommunity.com/groups/steamrommanager) and [Discord](https://discord.gg/nxxzBPJ) groups. Also manages issues in [Github](https://github.com/doZennn/steam-rom-manager).
* `Choko`{.noWrap} - helps most users setup SRM in [Discord](https://discord.gg/nxxzBPJ).
* `AlexDobeck`{.noWrap} - improved [retrogaming.cloud](http://retrogaming.cloud/) performance.
* `lontanadascienza`{.noWrap} - updated SRM to handle heroes, posters, logos. Some other stuff too.

## Credits

* SRM icon created by [doZennn](https://www.reddit.com/user/dozennn) who's also the big boss of [SteamGridDB](http://www.steamgriddb.com/).
* Most icons were made by [Roundicons](https://www.flaticon.com/authors/roundicons) from [Flaticon](https://www.flaticon.com) (licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/)).
* Most icons were made by [Roundicons](https://www.flaticon.com/authors/roundicons) from [Flaticon](https://www.flaticon.com) (licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/)).
11 changes: 10 additions & 1 deletion src/lang/english/markdown/executable-location.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@ In some cases you might want to run game from a some kind batch file which will

### So, how do I add files to Steam without default executable?

All files retrieved by a parser will be treated as executables instead.
All files retrieved by a parser will be treated as executables instead.

## Environment variables
These variables are pre parsed and can be used even in the Rom Directory, Steam Directory, Executable Location, and Start In Dir fields.
|Variable (case-insensitive)|Corresponding value|
|---:|:---|
|`${/}`|System specific directory separator: `\` or `/`|
|`${srmdir}`|Directory of portable SRM executable|

The use of the variable `${srmdir}` is to make SRM fully portable, eg if you wanted to have the directory layout `D:\Games\Roms` and `D:\Games\PortableSRM\SRM.exe` then setting the field Roms Directory to be `${srmdir}${/}..${/}Roms` would allow you to move the Games directory somewhere else without breaking your setup.
6 changes: 5 additions & 1 deletion src/lang/english/markdown/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,8 @@ Now parser can match any combination and is effectively case-insensitive. Techni

```
{*,*/*}/*/${title}.[nN][eE][sS]
```
```

## The Discord

For further help, please see our [discord](https://discord.gg/nxxzBPJ).
7 changes: 5 additions & 2 deletions src/lang/english/markdown/parser-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ file.dll
file
```

## Other variables

## Environment variables
These variables are pre parsed and can be used even in the Rom Directory, Steam Directory, Executable Location, and Start In Dir fields.
|Variable (case-insensitive)|Corresponding value|
|---:|:---|
|`${/}`|System specific directory separator: `\` or `/`|
|`${srmdir}`|Directory of portable SRM executable|

The use of the variable `${srmdir}` is to make SRM fully portable, eg if you wanted to have the directory layout `D:\Games\Roms` and `D:\Games\PortableSRM\SRM.exe` then setting the field Roms Directory to be `${srmdir}${/}..${/}Roms` would allow you to move the Games directory somewhere else without breaking your setup.
11 changes: 10 additions & 1 deletion src/lang/english/markdown/rom-directory.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# ROMs directory

Starting directory for game or app files.
Starting directory for game or app files.

## Environment variables
These variables are pre parsed and can be used even in the Rom Directory, Steam Directory, Executable Location, and Start In Dir fields.
|Variable (case-insensitive)|Corresponding value|
|---:|:---|
|`${/}`|System specific directory separator: `\` or `/`|
|`${srmdir}`|Directory of portable SRM executable|

The use of the variable `${srmdir}` is to make SRM fully portable, eg if you wanted to have the directory layout `D:\Games\Roms` and `D:\Games\PortableSRM\SRM.exe` then setting the field Roms Directory to be `${srmdir}${/}..${/}Roms` would allow you to move the Games directory somewhere else without breaking your setup.
9 changes: 9 additions & 0 deletions src/lang/english/markdown/start-in-directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ This option allows you to specify any directory you want as a "Start In" directo
![Ner "Start In" directory](../../../assets/images/new-start-in-directory.png) {.fitImage .center}

It is useful when you're using batch files to start emulator and a game, but emulator requires a specific "Start In" directory to work properly.

## Environment variables
These variables are pre parsed and can be used even in the Rom Directory, Steam Directory, Executable Location, and Start In Dir fields.
|Variable (case-insensitive)|Corresponding value|
|---:|:---|
|`${/}`|System specific directory separator: `\` or `/`|
|`${srmdir}`|Directory of portable SRM executable|

The use of the variable `${srmdir}` is to make SRM fully portable, eg if you wanted to have the directory layout `D:\Games\Roms` and `D:\Games\PortableSRM\SRM.exe` then setting the field Roms Directory to be `${srmdir}${/}..${/}Roms` would allow you to move the Games directory somewhere else without breaking your setup.
11 changes: 10 additions & 1 deletion src/lang/english/markdown/steam-directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ Must be a valid Steam directory which contains Steam executable. In order for St

## How do I limit edited Steam accounts?

Enable **Show advanced options** and check **User accounts** option.
Enable **Show advanced options** and check **User accounts** option.

## Environment variables
These variables are pre parsed and can be used even in the Rom Directory, Steam Directory, Executable Location, and Start In Dir fields.
|Variable (case-insensitive)|Corresponding value|
|---:|:---|
|`${/}`|System specific directory separator: `\` or `/`|
|`${srmdir}`|Directory of portable SRM executable|

The use of the variable `${srmdir}` is to make SRM fully portable, eg if you wanted to have the directory layout `D:\Games\Roms` and `D:\Games\PortableSRM\SRM.exe` then setting the field Roms Directory to be `${srmdir}${/}..${/}Roms` would allow you to move the Games directory somewhere else without breaking your setup.
38 changes: 36 additions & 2 deletions src/lib/file-parser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserConfiguration, ParsedUserConfiguration, ParsedData, ParsedUserConfigurationFile, ParsedDataWithFuzzy, userAccountData, ParserVariableData, AllVariables, CustomVariables } from '../models';
import { UserConfiguration, ParsedUserConfiguration, ParsedData, ParsedUserConfigurationFile, ParsedDataWithFuzzy, userAccountData, ParserVariableData, AllVariables, EnvironmentVariables, CustomVariables } from '../models';
import { FuzzyService } from "../renderer/services";
import { VariableParser } from "./variable-parser";
import { APP } from '../variables';
Expand Down Expand Up @@ -81,9 +81,27 @@ export class FileParser {

return Promise.resolve().then(() => {
let promises: Promise<ParsedData>[] = [];

let preParser = new VariableParser({ left: '${', right: '}' });
for (let i = 0; i < configs.length; i++) {
let parser = this.getParserInfo(configs[i].parserType);


// Parse environment variables on rom directory, start in path, executable path
configs[i].steamDirectory = preParser.setInput(configs[i].steamDirectory).parse() ? preParser.replaceVariables((variable) => {
return this.getEnvironmentVariable(variable as EnvironmentVariables).trim()
}) : null;
configs[i].romDirectory = preParser.setInput(configs[i].romDirectory).parse() ? preParser.replaceVariables((variable) => {
return this.getEnvironmentVariable(variable as EnvironmentVariables).trim()
}) : null;
configs[i].startInDirectory = preParser.setInput(configs[i].startInDirectory).parse() ? preParser.replaceVariables((variable) => {
return this.getEnvironmentVariable(variable as EnvironmentVariables).trim()
}) : null;
configs[i].executableLocation = preParser.setInput(configs[i].executableLocation).parse() ? preParser.replaceVariables((variable) => {
return this.getEnvironmentVariable(variable as EnvironmentVariables).trim()
}) : null;


steamDirectories.push({ directory: configs[i].steamDirectory, useCredentials: configs[i].userAccounts.useCredentials, data: [] });

if (parser) {
Expand Down Expand Up @@ -145,6 +163,7 @@ export class FileParser {

parsedConfigs.push({
configurationTitle: configs[i].configTitle,
parserId: configs[i].parserId,
appendArgsToExecutable: configs[i].appendArgsToExecutable,
shortcutPassthrough: configs[i].titleFromVariable.shortcutPassthrough,
imageProviders: configs[i].imageProviders,
Expand All @@ -165,6 +184,7 @@ export class FileParser {
}

let executableLocation = configs[i].executableLocation ? configs[i].executableLocation : data[i].success[j].filePath;

parsedConfigs[i].files.push({
steamCategories: undefined,
executableLocation: executableLocation,
Expand Down Expand Up @@ -197,7 +217,6 @@ export class FileParser {
onlineImageQueries: undefined
});


let lastFile = parsedConfigs[i].files[parsedConfigs[i].files.length - 1];
let variableData = this.makeVariableData(configs[i], lastFile);

Expand Down Expand Up @@ -495,6 +514,18 @@ export class FileParser {
return { config, parsedConfig, resolvedGlobs, resolvedFiles };
});
}
private getEnvironmentVariable(variable: EnvironmentVariables) {
let output = variable as string;
switch (<EnvironmentVariables>variable.toUpperCase()) {
case '/':
output = path.sep;
break;
case 'SRMDIR':
output = APP.srmdir;
break;
}
return output;
}

private getVariable(variable: AllVariables, data: ParserVariableData) {
const unavailable = 'undefined';
Expand All @@ -503,6 +534,9 @@ export class FileParser {
case '/':
output = path.sep;
break;
case 'SRMDIR':
output = APP.srmdir;
break;
case 'EXEDIR':
output = data.executableLocation != undefined ? path.dirname(data.executableLocation) : unavailable;
break;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/image-providers/available-providers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const availableProviders = [
'SteamGridDB',
'retrogaming.cloud'
'SteamGridDB'
//,'GoogleImages'
];
6 changes: 3 additions & 3 deletions src/lib/image-providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const imageProviders = {
'SteamGridDB': require('./steamgriddb.worker'),
'retrogaming.cloud': require('./retrogaming-cloud.worker')
}
'SteamGridDB': require('./steamgriddb.worker'),
//'GoogleImages': require('./googleimages.worker')
}
75 changes: 0 additions & 75 deletions src/lib/image-providers/retrogaming-cloud.worker.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/lib/replace-diacritics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ declare global {
}

String.prototype.replaceDiacritics = function () {
return (this as String).replace(/[^A-Za-z0-9 ]/g,
function (char) {
return (this as String).replace(/[^A-Za-z0-9 ]/g,
function (char) {
return diacriticList[char] || char;
}
);
}

export default undefined;
export default undefined;
Loading

0 comments on commit 00774bf

Please sign in to comment.