feat: store toggles on profiles
This commit is contained in:
+16
-2
@@ -69,6 +69,7 @@ export default function Home() {
|
|||||||
const getExportText = () => {
|
const getExportText = () => {
|
||||||
return JSON.stringify(
|
return JSON.stringify(
|
||||||
{
|
{
|
||||||
|
profile: {
|
||||||
unlockedCharacters: store.unlockedCharacters,
|
unlockedCharacters: store.unlockedCharacters,
|
||||||
unlockedCustomizations: store.unlockedCustomizations,
|
unlockedCustomizations: store.unlockedCustomizations,
|
||||||
unlockedDLCs: store.unlockedDLCs,
|
unlockedDLCs: store.unlockedDLCs,
|
||||||
@@ -77,6 +78,13 @@ export default function Home() {
|
|||||||
offerings: store.offerings,
|
offerings: store.offerings,
|
||||||
addons: store.addons
|
addons: store.addons
|
||||||
},
|
},
|
||||||
|
toggles: {
|
||||||
|
spoofItems: store.spoofItems,
|
||||||
|
spoofPerks: store.spoofPerks,
|
||||||
|
spoofCatalog: store.spoofCatalog,
|
||||||
|
spoofDLCs: store.spoofDLCs
|
||||||
|
}
|
||||||
|
},
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
@@ -85,7 +93,9 @@ export default function Home() {
|
|||||||
const handleImport = async () => {
|
const handleImport = async () => {
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(importText);
|
const parsed = JSON.parse(importText);
|
||||||
store.importProfile(parsed);
|
if (parsed.profile) store.importProfile(parsed.profile);
|
||||||
|
else store.importProfile(parsed);
|
||||||
|
if (parsed.toggles) store.importToggles(parsed.toggles);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Invalid JSON', e);
|
console.error('Invalid JSON', e);
|
||||||
}
|
}
|
||||||
@@ -100,7 +110,11 @@ export default function Home() {
|
|||||||
store.unlockedPerks,
|
store.unlockedPerks,
|
||||||
store.items,
|
store.items,
|
||||||
store.offerings,
|
store.offerings,
|
||||||
store.addons
|
store.addons,
|
||||||
|
store.spoofItems,
|
||||||
|
store.spoofPerks,
|
||||||
|
store.spoofCatalog,
|
||||||
|
store.spoofDLCs
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user