Skip to content

Commit

Permalink
Merge pull request #24 from EddieDover/new-discord
Browse files Browse the repository at this point in the history
Reimplements a discord link
  • Loading branch information
EddieDover authored Jun 13, 2024
2 parents 484285a + 24911d5 commit 5862ff1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

## [2.5.1](https://github.com/EddieDover/fvtt-party-sheet/compare/v2.5.0...v2.5.1) (2024-06-13)


### Features

* added new discord link ([ce0a020](https://github.com/EddieDover/fvtt-party-sheet/commit/ce0a020739dd4f7703fab8c157398b929a89e271))

## [2.5.0](https://github.com/EddieDover/fvtt-party-sheet/compare/v2.4.1...v2.5.0) (2024-06-09)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fvtt-party-sheet",
"version": "2.5.0",
"version": "2.5.1",
"description": "A FoundryVTT module that adds a customizable Party Sheet window.",
"main": "index.js",
"author": {
Expand Down
3 changes: 2 additions & 1 deletion src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"no-players": "No players are currently logged in.",
"no-systems": "You do not have any json files for this system in your data/partysheets folder. Please add some to enable this feature.",
"bugreport": "File a Bug Report",
"feedback": "Send Feedback"
"feedback": "Send Feedback",
"discord": "Discord"
},
"hide-sheet": {
"button": "Configure Hidden Characters",
Expand Down
3 changes: 2 additions & 1 deletion src/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"no-players": "Ningún jugador ha iniciado sesión actualmente.",
"no-systems": "La carpeta data/partysheets no contiene archivos JSON para este sistema. Necesitas agregar algunos para activar esta funcionalidad.",
"bugreport": "Dar retroalimentación",
"feedback": "Reportar un fallo"
"feedback": "Reportar un fallo",
"discord": "Discord"
},
"hide-sheet": {
"button": "Configurar personajes ocultos",
Expand Down
2 changes: 1 addition & 1 deletion src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"url": "https://github.com/eddiedover/"
}
],
"version": "2.5.0",
"version": "2.5.1",
"compatibility": {
"minimum": "11",
"verified": "12"
Expand Down
9 changes: 9 additions & 0 deletions src/module/app/party-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { HiddenCharactersSettings } from "./hidden-characters-settings.js";
const FEEDBACK_URL = "https://github.com/EddieDover/fvtt-party-sheet/issues/new/choose";
const BUGREPORT_URL =
"https://github.com/EddieDover/fvtt-party-sheet/issues/new?assignees=EddieDover&labels=bug&projects=&template=bug_report.yml&title=%5BBug%5D%3A+";
const DISCORD_URL = "https://discord.gg/mvMdc7bH2d";

const DEFAULT_EXCLUDES = ["npc"];

Expand Down Expand Up @@ -739,6 +740,8 @@ export class PartySheetForm extends FormApplication {
// @ts-ignore
$('button[name="bugreport"]', html).click(this.onBugReport.bind(this));
// @ts-ignore
$('button[name="discord"]', html).click(this.onDiscord.bind(this));
// @ts-ignore
$('select[class="fvtt-party-sheet-dropdown"]', html).change((event) => {
const dropdownSection = event.currentTarget.dataset.dropdownsection;
const dropdownValue = event.currentTarget.value;
Expand All @@ -762,4 +765,10 @@ export class PartySheetForm extends FormApplication {
const newWindow = window.open(BUGREPORT_URL, "_blank", "noopener,noreferrer");
if (newWindow) newWindow.opener = undefined;
}

onDiscord(event) {
event.preventDefault();
const newWindow = window.open(DISCORD_URL, "_blank", "noopener,noreferrer");
if (newWindow) newWindow.opener = undefined;
}
}
3 changes: 3 additions & 0 deletions src/templates/party-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<button type="button" class="btn btn--primary" style="max-width:50px" name="bugreport" title="{{localize "fvtt-party-sheet.party-sheet.bugreport"}}">
<i class="fas fa-bug"></i>
</button>
<button type="button" class="btn btn--primary" style="max-width:50px" name="discord" title={{localize "fvtt-party-sheet.party-sheet.discord"}}>
<i class="fab fa-discord"></i>
</button>
{{/unless}}
</div>
{{#if applicableSystems.length}}
Expand Down

0 comments on commit 5862ff1

Please sign in to comment.