diff --git a/languages/en.json b/languages/en.json index 82fe291..d7ba60a 100644 --- a/languages/en.json +++ b/languages/en.json @@ -81,5 +81,11 @@ "updateNotifText": "A new update is available! Newest version: ", - "chineseCharacterAlert": "The file path set contains Chinese characters, this may cause problems!" + "chineseCharacterAlert": "The file path set contains Chinese characters, this may cause problems!", + + "dialogOk": "OK", + "dialogNo": "NO", + "serverEnableDialogTitle": "You found the Grasscutter server launcher!", + "serverEnableDialogText": "If you do not have an existing Grasscutter installation to set, would you like to download a build?" + } diff --git a/resources/js/helpers.js b/resources/js/helpers.js index b55fc02..558d91a 100644 --- a/resources/js/helpers.js +++ b/resources/js/helpers.js @@ -123,13 +123,16 @@ function openDialog(title, message, negBtn = false, affirmBtn = closeDialog) { const noBtn = document.getElementById('dialogButtonNeg') const yesBtn = document.getElementById('dialogButtonAffirm') - if (!noBtn) { + if (!negBtn) { noBtn.style.display = 'none' } else { noBtn.style.removeProperty('display') noBtn.onclick = () => closeDialog() } + yesBtn.innerText = localeObj.dialogYes || 'OK' + noBtn.innerText = localeObj.dialogNo || 'NO' + yesBtn.onclick = () => { affirmBtn() closeDialog() diff --git a/resources/js/options.js b/resources/js/options.js index 3f8f4e9..f18d2cf 100644 --- a/resources/js/options.js +++ b/resources/js/options.js @@ -27,8 +27,8 @@ async function toggleServerLaunchSection() { closeSettings() openDialog( - 'You found the Grasscutter server launcher!' || localeObj.serverEnableDialogTitle, - 'If you do not have an existing Grasscutter installation to set, would you like to download a build?' || localeObj.serverEnableDialogText, + localeObj.serverEnableDialogTitle || 'You found the Grasscutter server launcher!', + localeObj.serverEnableDialogText || 'If you do not have an existing Grasscutter installation to set, would you like to download a build?', true, openDownloads )