Skip to content

Commit 7899a5b

Browse files
committed
migrate presets + automigrate dev tool
1 parent 40938c5 commit 7899a5b

File tree

4 files changed

+100
-14
lines changed

4 files changed

+100
-14
lines changed

IntelPresentMon/AppCef/Web/presets/preset-0.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"signature": {
33
"code": "p2c-cap-load",
4-
"version": "0.10.0"
4+
"version": "0.11.0"
55
},
66
"widgets": [
77
{
@@ -183,7 +183,14 @@
183183
"g": 0,
184184
"b": 0,
185185
"a": 0
186-
}
186+
},
187+
"textColor": {
188+
"r": 242,
189+
"g": 242,
190+
"b": 242,
191+
"a": 1
192+
},
193+
"textSize": 11
187194
}
188195
]
189196
}

IntelPresentMon/AppCef/Web/presets/preset-1.json

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"signature": {
33
"code": "p2c-cap-load",
4-
"version": "0.10.0"
4+
"version": "0.11.0"
55
},
66
"widgets": [
77
{
@@ -169,7 +169,14 @@
169169
"g": 0,
170170
"b": 0,
171171
"a": 0
172-
}
172+
},
173+
"textColor": {
174+
"r": 242,
175+
"g": 242,
176+
"b": 242,
177+
"a": 1
178+
},
179+
"textSize": 11
173180
},
174181
{
175182
"key": 3,
@@ -256,7 +263,14 @@
256263
"g": 0,
257264
"b": 0,
258265
"a": 0
259-
}
266+
},
267+
"textColor": {
268+
"r": 242,
269+
"g": 242,
270+
"b": 242,
271+
"a": 1
272+
},
273+
"textSize": 11
260274
},
261275
{
262276
"key": 4,
@@ -343,7 +357,14 @@
343357
"g": 0,
344358
"b": 0,
345359
"a": 0
346-
}
360+
},
361+
"textColor": {
362+
"r": 242,
363+
"g": 242,
364+
"b": 242,
365+
"a": 1
366+
},
367+
"textSize": 11
347368
},
348369
{
349370
"key": 5,
@@ -430,7 +451,14 @@
430451
"g": 0,
431452
"b": 0,
432453
"a": 0
433-
}
454+
},
455+
"textColor": {
456+
"r": 242,
457+
"g": 242,
458+
"b": 242,
459+
"a": 1
460+
},
461+
"textSize": 11
434462
},
435463
{
436464
"key": 6,
@@ -517,7 +545,14 @@
517545
"g": 0,
518546
"b": 0,
519547
"a": 0
520-
}
548+
},
549+
"textColor": {
550+
"r": 242,
551+
"g": 242,
552+
"b": 242,
553+
"a": 1
554+
},
555+
"textSize": 11
521556
},
522557
{
523558
"key": 7,
@@ -604,7 +639,14 @@
604639
"g": 0,
605640
"b": 0,
606641
"a": 0
607-
}
642+
},
643+
"textColor": {
644+
"r": 242,
645+
"g": 242,
646+
"b": 242,
647+
"a": 1
648+
},
649+
"textSize": 11
608650
}
609651
]
610652
}

IntelPresentMon/AppCef/Web/presets/preset-2.json

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"signature": {
33
"code": "p2c-cap-load",
4-
"version": "0.10.0"
4+
"version": "0.11.0"
55
},
66
"widgets": [
77
{
@@ -169,7 +169,14 @@
169169
"g": 0,
170170
"b": 0,
171171
"a": 0
172-
}
172+
},
173+
"textColor": {
174+
"r": 242,
175+
"g": 242,
176+
"b": 242,
177+
"a": 1
178+
},
179+
"textSize": 11
173180
},
174181
{
175182
"key": 3,
@@ -262,7 +269,14 @@
262269
"g": 0,
263270
"b": 0,
264271
"a": 0
265-
}
272+
},
273+
"textColor": {
274+
"r": 242,
275+
"g": 242,
276+
"b": 242,
277+
"a": 1
278+
},
279+
"textSize": 11
266280
},
267281
{
268282
"key": 4,
@@ -332,7 +346,14 @@
332346
"g": 0,
333347
"b": 0,
334348
"a": 0
335-
}
349+
},
350+
"textColor": {
351+
"r": 242,
352+
"g": 242,
353+
"b": 242,
354+
"a": 1
355+
},
356+
"textSize": 11
336357
}
337358
]
338359
}

IntelPresentMon/AppCef/Web/src/App.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
</v-list-item-content>
5555
</v-list-item>
5656

57+
<v-list-item v-if="isDevelopment" color="primary">
58+
<v-list-item-content>
59+
<v-btn @click="doPresetUpdate">Update Presets</v-btn>
60+
</v-list-item-content>
61+
</v-list-item>
62+
5763
</v-list>
5864
</v-navigation-drawer>
5965

@@ -105,7 +111,7 @@ import { Metrics } from '@/store/metrics'
105111
import { Preferences as PrefStore } from '@/store/preferences'
106112
import { Preferences } from '@/core/preferences'
107113
import { Hotkey } from '@/store/hotkey'
108-
import { Api } from '@/core/api'
114+
import { Api, FileLocation } from '@/core/api'
109115
import { Notifications } from '@/store/notifications'
110116
import { Action } from '@/core/hotkey'
111117
import { Processes } from '@/store/processes'
@@ -158,6 +164,13 @@ export default Vue.extend({
158164
PrefStore.setAttribute({attr:'selectedPreset', val:Preset.Slot1});
159165
}
160166
},
167+
async doPresetUpdate() {
168+
for (let i = 0; i < 3; i++) {
169+
const presetFileName = `preset-${i}.json`;
170+
await Loadout.parseAndReplace(await Api.loadPreset(presetFileName));
171+
await Api.storeFile(Loadout.fileContents, FileLocation.Documents, `loadouts\\${presetFileName}`);
172+
}
173+
},
161174
async dismissNotification() {
162175
await Notifications.dismiss();
163176
},
@@ -210,6 +223,9 @@ export default Vue.extend({
210223
},
211224
212225
computed: {
226+
isDevelopment(): boolean {
227+
return process?.env?.NODE_ENV === 'development';
228+
},
213229
widgets(): Widget[] {
214230
return Loadout.widgets;
215231
},

0 commit comments

Comments
 (0)