Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
misthero committed Sep 26, 2024
1 parent f9ba323 commit 44cb30a
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 3 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
- 1.1.1 First release
- 1.1.2 Added Italian translation
# CHANGELOG

## [1.2.0]

- Option to disable the view restored message
- Translations fixes

## [1.1.2]

- Added Italian translation

## [1.1.1]

- First release
3 changes: 3 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
3 changes: 3 additions & 0 deletions lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
14 changes: 13 additions & 1 deletion last-scene-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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"));
}
}
})

Expand Down

0 comments on commit 44cb30a

Please sign in to comment.