From a1a4777162e89f4844c264f5a9e96ab729c09e25 Mon Sep 17 00:00:00 2001 From: Matteias Collet Date: Sun, 28 Jun 2020 00:05:33 +0200 Subject: [PATCH] wip stage loader integration --- docs/.vuepress/components/ButtonComponent.vue | 59 ++++ docs/.vuepress/components/DownloadButton.vue | 53 +--- docs/.vuepress/components/Generator.vue | 79 +++-- docs/.vuepress/components/StageLoader.vue | 293 ++++++++++++++++++ 4 files changed, 408 insertions(+), 76 deletions(-) create mode 100644 docs/.vuepress/components/ButtonComponent.vue create mode 100644 docs/.vuepress/components/StageLoader.vue diff --git a/docs/.vuepress/components/ButtonComponent.vue b/docs/.vuepress/components/ButtonComponent.vue new file mode 100644 index 0000000..77d5c29 --- /dev/null +++ b/docs/.vuepress/components/ButtonComponent.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/docs/.vuepress/components/DownloadButton.vue b/docs/.vuepress/components/DownloadButton.vue index dc80995..f29001f 100644 --- a/docs/.vuepress/components/DownloadButton.vue +++ b/docs/.vuepress/components/DownloadButton.vue @@ -1,23 +1,16 @@ - diff --git a/docs/.vuepress/components/Generator.vue b/docs/.vuepress/components/Generator.vue index 129d2e9..3109b99 100644 --- a/docs/.vuepress/components/Generator.vue +++ b/docs/.vuepress/components/Generator.vue @@ -12,6 +12,10 @@ Download Format: +
+ Use Stage Loader: + +
Download:
+
+

Stage Loader

+ +

Help

@@ -43,10 +51,14 @@ This is a cheatfile generator for Super Mario Sunshine speedrun practice. If this is your first time using the generator we highly recommend to check out the - guide first. Visit the - the troubleshooting section + guide first. Visit the + the troubleshooting section if you encounter any issues.

@@ -54,41 +66,42 @@

The generator is brought to you by - Psychonauter, - Noki Doki + Psychonauter, + Noki Doki and Milk.

@@ -103,6 +116,8 @@ // Components import VersionSelect from "./VersionSelect"; import FormatSelect from "./FormatSelect"; +import SelectComponent from "./SelectComponent"; +import StageLoader from "./StageLoader"; import CodeInfo from "./CodeInfo"; import CodeList from "./CodeList"; import DownloadButton from "./DownloadButton"; @@ -119,17 +134,17 @@ import axios from "axios"; export default { mounted() { Promise.all( - gameVersions.map(async (v) => ({ + gameVersions.map(async v => ({ identifier: v.identifier, cheats: parseXml((await axios.get(`/codes/${v.identifier}.xml`)).data), - fastCodes: (await axios.get(`/codes/fast/${v.identifier}.json`)).data, + fastCodes: (await axios.get(`/codes/fast/${v.identifier}.json`)).data })) ) - .then((codes) => { + .then(codes => { localStorage.setItem("codes", JSON.stringify(codes)); this.isLoading = false; }) - .catch((err) => { + .catch(err => { if (localStorage.getItem("codes") != null) this.isLoading = false; }); }, @@ -141,6 +156,11 @@ export default { inspectingCode: null, selectedVersion: null, selectedFormat: null, + useStageLoader: false, + useStageLoaderOptions: [ + { value: false, label: "No" }, + { value: true, label: "Yes" } + ] }; }, methods: { @@ -148,19 +168,22 @@ export default { this.selectedVersion = e; this.selectedCheats = []; const storedCodes = JSON.parse(localStorage.getItem("codes")); - this.codes = storedCodes.find((c) => c.identifier === e).cheats; + this.codes = storedCodes.find(c => c.identifier === e).cheats; this.inspectingCode = null; }, onFormatChanged(e) { this.selectedFormat = e; }, + onStageLoaderChanged(e) { + this.useStageLoader = e; + }, onCheatSelectionChanged(e) { this.selectedCheats = e; }, inspect(code) { this.inspectingCode = code; - }, - }, + } + } }; \ No newline at end of file