From ec27fd0530ced6b61a5df2378d2d94c255b021e0 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sun, 1 May 2022 23:09:20 -0700 Subject: [PATCH] download page open/close --- resources/icons/download.svg | 11 +++++++++++ resources/index.html | 13 +++++++++++-- resources/js/index.js | 10 ++++++++++ resources/style/index.css | 4 ++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 resources/icons/download.svg diff --git a/resources/icons/download.svg b/resources/icons/download.svg new file mode 100644 index 0000000..8baf9ed --- /dev/null +++ b/resources/icons/download.svg @@ -0,0 +1,11 @@ + +Created with Fabric.js 1.7.22 + + + + + + + + + \ No newline at end of file diff --git a/resources/index.html b/resources/index.html index 41b951e..6b86265 100644 --- a/resources/index.html +++ b/resources/index.html @@ -134,7 +134,7 @@
- Download Stable Build + Download Grasscutter Stable Build
@@ -143,13 +143,22 @@
- Download Development Build + Download Grasscutter Development Build
Install Grasscutter development branch. This build sometimes has bugs, and is frequently updated. Use at your own risk.
+
+
+ Download Grasscutter Resources + +
+ + Downloads Grasscutter resources into the currently set Grasscutter folder. This should be done unless you plan on getting resources externally. + +
diff --git a/resources/js/index.js b/resources/js/index.js index 2656464..db2b550 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -248,10 +248,20 @@ async function handleFavoriteList() { async function openDownloads() { const downloads = document.querySelector('#downloadPanel') + const config = await getCfg() if (downloads.style.display === 'none') { downloads.style.removeProperty('display') } + + // Disable the resource download button if a serverFolder path is not set + if (!config.serverFolder) { + document.querySelector('#resourceInstall').disabled = true + document.querySelector('#resourceInstall').classList.add('disabled') + } else { + document.querySelector('#resourceInstall').disabled = false + document.querySelector('#resourceInstall').classList.remove('disabled') + } } async function closeDownloads() { diff --git a/resources/style/index.css b/resources/style/index.css index d466177..d1e2ea6 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -216,6 +216,10 @@ a { margin: 10px 0px; } +.downloadLabel { + margin: 14px 0px; +} + .downloadSubtitle, .settingSubtitle { color: rgb(165, 165, 165);