From 44cb30a9f60a807934f9a100c42523bf4d5bf945 Mon Sep 17 00:00:00 2001 From: "Luca T." Date: Thu, 26 Sep 2024 08:30:01 +0200 Subject: [PATCH] v1.2.0 --- .github/workflows/main.yml | 70 ++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 16 +++++++-- lang/en.json | 3 ++ lang/it.json | 3 ++ last-scene-view.js | 14 +++++++- 5 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..eee2515 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,70 @@ +name: Release Creation + +on: + push: + tags: + - 'v*' + release: + types: [published] +env: + MODULE_ID: last-scene-view +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Get part of the tag after the `v`. + - name: Extract tag version number + id: get_version + uses: battila7/get-version-action@v2 + + # Modify manifest version, download, esmodules, styles, remove hotreload. + - name: Modify Manifest to remove HotReload + uses: microsoft/variable-substitution@v1 + with: + files: "module.json" + env: + flags.hotReload: false + version: ${{steps.get_version.outputs.version-without-v}} + id: ${{env.MODULE_ID}} + url: https://github.com/${{ github.repository }} + download: https://github.com/${{ github.repository }}/releases/download/${{steps.get_version.outputs.version}}/${{env.MODULE_ID}}.zip + manifest: https://github.com/${{ github.repository }}/releases/latest/download/module.json + + # Create zip file. + - name: Create ZIP archive + run: zip -r ./${{env.MODULE_ID}}.zip + module.json + README.md + LICENSE + CHANGELOG.md + css/ + lang/ + templates/ + + # Get the release notes and set a convenient 'id' for accessing later + - name: Read release notes and add to package + uses: yashanand1910/standard-release-notes@v1.5.0 + id: get_release_notes + with: + changelog_path: ./CHANGELOG.md # Optional + version: ${{steps.get_version.outputs.version}} # Required + + # Create a release for this specific version. + - name: Update Release with Files + if: '!github.event.release.prerelease' + id: create_version_release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + name: ${{ github.event.release.name }} + draft: false + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: "./module.json, ./${{env.MODULE_ID}}.zip" + tag: ${{ github.event.release.tag_name }} + body: ${{ steps.get_release_notes.outputs.release_notes }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 98f3f1b..693f1f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,14 @@ -- 1.1.1 First release -- 1.1.2 Added Italian translation \ No newline at end of file +# CHANGELOG + +## [1.2.0] + +- Option to disable the view restored message +- Translations fixes + +## [1.1.2] + +- Added Italian translation + +## [1.1.1] + +- First release diff --git a/lang/en.json b/lang/en.json index 44bca49..eb16681 100644 --- a/lang/en.json +++ b/lang/en.json @@ -2,11 +2,14 @@ "last-scene-view.options-name": "Last scene view.", "last-scene-view.disabled": "Disbled.", "last-scene-view.disabled-tooltip": "Disable for this scene.", + "last-scene-view.clear-tooltip": "Delete the last scene position for this scene.", "last-scene-view.scene-config-note": "The checkbox will disable the module for the current scene. Click the clear button to remove every saved position for this scene.", "last-scene-view.enable-gm": "Save last scene view for GM.", "last-scene-view.enable-gm-note": "By default the last view will be saved for both players and GMs, you can disable it for GM and the scene will keep the configured Initial View Position in the scene configuration.", "last-scene-view.timeout": "Timeout befor saving scene view", "last-scene-view.timeout-note": "Number of seconds to wait before saving the new scene view position. Minimum 3 seconds", + "last-scene-view.message-enable": "Enable restored message.", + "last-scene-view.message-enable-note": "Show a message when scene view position is restored.", "last-scene-view.position-restored": "Last scene view position restored!", "last-scene-view.positions-deleted": "Every saved position for the scene \"{sceneName}\" has been eliminated!" } \ No newline at end of file diff --git a/lang/it.json b/lang/it.json index 6a5923a..2b3e8e8 100644 --- a/lang/it.json +++ b/lang/it.json @@ -2,11 +2,14 @@ "last-scene-view.options-name": "Last scene view.", "last-scene-view.disabled": "Disattivato.", "last-scene-view.disabled-tooltip": "Disattivato per questa scena.", + "last-scene-view.clear-tooltip": "Elimina le posizioni salvate per questa scena", "last-scene-view.scene-config-note": "Il checkbox disattiva il modulo per la scena attuale. Clicca il pulsante di reset per eliminare tutte le posizioni salvate per questa scena.", "last-scene-view.enable-gm": "Salva l'ultima posizione della scena per il GM.", "last-scene-view.enable-gm-note": "Di base l'ultima posizione viene salvata sia per giocatori che per GM, puoi disattivare il salvataggio per il GM, in tal caso la posizione iniziale nella configurazione della scena verrĂ  rispettata.", "last-scene-view.timeout": "Pausa prima di salvare la scena", "last-scene-view.timeout-note": "Il numero di secondi che dovranno passare prima che la posizione attuale venga salvata. Minimo 3 secondi", + "last-scene-view.message-enable": "Messaggio di ripristino.", + "last-scene-view.message-enable-note": "Mostra un messaggio quando la posizione della scene viene ripristinata.", "last-scene-view.position-restored": "Ultima posizione della scena ripristinata!", "last-scene-view.positions-deleted": "Tutte le posizioni per la scena \"{sceneName}\" sono state eliminate!" } \ No newline at end of file diff --git a/last-scene-view.js b/last-scene-view.js index 971e736..05abd1c 100644 --- a/last-scene-view.js +++ b/last-scene-view.js @@ -32,6 +32,16 @@ class LastSceneView { config: true }); + game.settings.register(LastSceneView.mId, 'enableRestoredMessage', { + name: game.i18n.localize("last-scene-view.message-enable"), + hint: game.i18n.localize("last-scene-view.message-enable-note"), + scope: 'world', + requiresReload: true, + default: true, + type: Boolean, + config: true + }); + // renderSceneControls hooks seems to happen later enough to override the inital scene position Hooks.on('canvasReady', (c) => { if (LastSceneView.isDisabled(game.scenes.current._id)) { @@ -50,7 +60,9 @@ class LastSceneView { if (typeof game.scenes.current.flags?.lastSceneView?.lastPosition[game.userId] !== 'undefined') { // move the canvas and notify the user. canvas.pan(game.scenes.current.flags?.lastSceneView?.lastPosition[game.userId]); - ui.notifications.info(game.i18n.localize("last-scene-view.position-restored")); + if (game.settings.get(LastSceneView.mId, 'enableRestoredMessage')) { + ui.notifications.info(game.i18n.localize("last-scene-view.position-restored")); + } } })