Skip to content

Commit

Permalink
added system specific placeholders everywhere in parser form
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed Oct 17, 2024
1 parent 5d13175 commit fb5cfce
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 21 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file.

## 2.5.24

### Added

- Ability to edit bubble inputs (currently just steam categories in parsers).

### Changed

- All path/directory fields in create parser now have system specific placeholders.

## 2.5.23

## Fixed
Expand Down
37 changes: 30 additions & 7 deletions src/lang/en-US/langStrings.json
Original file line number Diff line number Diff line change
Expand Up @@ -530,18 +530,41 @@
"placeholder": {
"parserType": "Select parser...",
"configTitle": "My Awesome Parser",
"steamDirectory": "${steamdirglobal} or /path/to/steam/",
"userAccounts": "${steamuser1}${steamuser2} or ${${accountsglobal}}",
"steamDirectory": {
"Windows_NT": "${steamdirglobal} or C:\\path\\to\\Steam\\",
"Darwin": "${steamdirglobal} or /path/to/Steam/",
"Linux": "${steamdirglobal} or /path/to/Steam/"
},
"titleFromVariable": "${variableGroup1}${variableGroup2}",
"titleModifier": "${fuzzyTitle} or ${title}",
"defaultImage__i": "/path/to/fallback_${artworkType}.png",
"localImages__i": "/path/to/art/${artworkType}/\\${title}.@(png|jpg)",
"romDirectory": "/path/to/games/",
"defaultImage__i": {
"Windows_NT": "C:\\\\path\\\\to\\\\fallback_${artworkType}.png",
"Darwin": "/path/to/fallback_${artworkType}.png",
"Linux": "/path/to/fallback_${artworkType}"
},
"localImages__i": {
"Windows_NT": "C:\\\\path\\\\to\\\\art\\\\${artworkType}\\\\\\${title}.@(png|jpg)",
"Darwin": "/path/to/art/${artworkType}/\\${title}.@(png|jpg)",
"Linux": "/path/to/art/${artworkType}/\\${title}.@(png|jpg)"
},
"romDirectory": {
"Windows_NT": "C:\\path\\to\\games\\",
"Darwin": "/path/to/games/",
"Linux": "/path/to/games/"
},
"glob": "${title}.@(iso|ISO)",
"executableLocation": "/path/to/emulator.exe",
"executableLocation": {
"Windows_NT": "C:\\path\\to\\emulator.exe",
"Darwin": "/path/to/emulator.app",
"Linux": "/path/to/emulator"
},
"executableArgs": "--arg1 --arg2",
"executableModifier": "\"${exePath}\"",
"startInDirectory": "/path/to/start/in/dir/",
"startInDirectory": {
"Windows_NT": "C:\\path\\to\\start-in-dir\\",
"Darwin": "/path/to/start-in-dir/",
"Linux": "/path/to/start-in-dir/"
},
"imageProviders": "None",
"multiAPIPlaceholder": "No Filter"
},
Expand Down
13 changes: 6 additions & 7 deletions src/models/language.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,17 +581,16 @@ export interface languageStruct {
placeholder: {
parserType: string;
configTitle: string;
romDirectory: string;
steamDirectory: string;
userAccounts: string;
romDirectory: { [key: string]: string };
steamDirectory: { [key: string]: string };
titleFromVariable: string;
titleModifier: string;
executableLocation: string;
executableLocation: { [key: string]: string };
executableArgs: string;
executableModifier: string;
startInDirectory: string;
defaultImage__i: string; //${artworkType}
localImages__i: string; //${artworkType}
startInDirectory: { [key: string]: string };
defaultImage__i: { [key: string]: string }; //${artworkType}
localImages__i: { [key: string]: string }; //${artworkType}
imageProviders: string;
multiAPIPlaceholder: string;
};
Expand Down
18 changes: 11 additions & 7 deletions src/renderer/components/parsers.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
NestedFormElement,
AppSettings,
ConfigPresets,
ControllerTemplates,
ParserType,
OnlineProviderType,
StringDict,
Expand All @@ -41,6 +40,7 @@ import { BehaviorSubject, Subscription, of, concat } from "rxjs";
import { map } from "rxjs/operators";
import { APP } from "../../variables";
import * as _ from "lodash";
import * as os from "os";
import {
imageProviderNames,
onlineProviders,
Expand Down Expand Up @@ -147,7 +147,7 @@ export class ParsersComponent implements AfterViewInit, OnDestroy {
}),
steamDirectory: new NestedFormElement.Input({
path: { directory: true },
placeholder: this.lang.placeholder.steamDirectory,
placeholder: this.lang.placeholder.steamDirectory[os.type()],
required: true,
label: this.lang.label.steamDirectory,
highlight: this.highlight.bind(this),
Expand Down Expand Up @@ -208,7 +208,7 @@ export class ParsersComponent implements AfterViewInit, OnDestroy {
}),
romDirectory: new NestedFormElement.Input({
path: { directory: true },
placeholder: this.lang.placeholder.romDirectory,
placeholder: this.lang.placeholder.romDirectory[os.type()],
required: true,
isHidden: () => this.isHiddenIfNotRomsParser(),
label: this.lang.label.romDirectory,
Expand Down Expand Up @@ -248,7 +248,7 @@ export class ParsersComponent implements AfterViewInit, OnDestroy {
path: new NestedFormElement.Input({
path: { directory: false },
label: this.lang.label.executableLocation,
placeholder: this.lang.placeholder.executableLocation,
placeholder: this.lang.placeholder.executableLocation[os.type()],
highlight: this.highlight.bind(this),
onValidate: (self, path) => {
let serialized: { [k: string]: any } = {};
Expand Down Expand Up @@ -307,7 +307,7 @@ export class ParsersComponent implements AfterViewInit, OnDestroy {
}),
startInDirectory: new NestedFormElement.Input({
path: { directory: true },
placeholder: this.lang.placeholder.startInDirectory,
placeholder: this.lang.placeholder.startInDirectory[os.type()],
label: this.lang.label.startInDirectory,
highlight: this.highlight.bind(this),
isHidden: () => this.isHiddenIfNotRomsParser(),
Expand Down Expand Up @@ -648,7 +648,9 @@ export class ParsersComponent implements AfterViewInit, OnDestroy {
for (const artworkType of artworkTypes) {
defaultImageInputs[artworkType] = new NestedFormElement.Input({
path: { directory: false, useForwardSlash: true },
placeholder: this.lang.placeholder.defaultImage__i.interpolate({
placeholder: this.lang.placeholder.defaultImage__i[
os.type()
].interpolate({
artworkType: artworkSingDict[artworkType],
}),
highlight: this.highlight.bind(this),
Expand Down Expand Up @@ -676,7 +678,9 @@ export class ParsersComponent implements AfterViewInit, OnDestroy {
directory: true,
appendGlob: "${title}.@(png|PNG|jpg|JPG|webp|WEBP)",
},
placeholder: this.lang.placeholder.localImages__i.interpolate({
placeholder: this.lang.placeholder.localImages__i[
os.type()
].interpolate({
artworkType: artworkViewNames[artworkType].toLowerCase(),
}),
highlight: this.highlight.bind(this),
Expand Down

0 comments on commit fb5cfce

Please sign in to comment.