Split the presets into individual jsons

Closes #274
This commit is contained in:
J??zsef Farkas
2017-03-24 20:16:57 +01:00
committed by József Farkas
parent 36d68d1a68
commit 02bf3f48b9
6 changed files with 1759 additions and 1759 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -53,8 +53,10 @@ export class DataStorage {
initUHKJson() {
this.defaultUserConfiguration = new UserConfiguration()
.fromJsonObject(require('json-loader!../../config-serializer/user-config.json'));
this.uhkPresets = (<any[]>require('json-loader!../../config-serializer/preset-keymaps.json'))
.map(keymap => new Keymap().fromJsonObject(keymap));
const presetsRequireContext = (<any>require).context('../../../res/presets', false, /.json$/);
this.uhkPresets = presetsRequireContext.keys().map(presetsRequireContext) // load the presets into an array
.map((keymap: any) => new Keymap().fromJsonObject(keymap));
}
getConfiguration(): UserConfiguration {