Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.0.0 #43

Merged
merged 2 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"back": "{name} ist zurück",
"afk": "{name} ist afk",
"iconPosition": "Wo soll das AFK-Symbol angezeigt werden?",
"disable": "AFK System abschalten?"
"disable": "AFK System abschalten?",
"afk_command": "Away from Keyboard, du möchtest AFK gehen und es allen zeigen. Ein optionaler Text kann angefügt werden, dieser wird dann als Grund in der Chatmeldung mit aufgenommen.",
"back_command": "Du bist zurück und möchtest es allen zeigen"
},
"typing": {
"timeOutSec": "Tippen zurücksetzen nach x Sekunden nach dem letzten Zeichen",
Expand Down
24 changes: 13 additions & 11 deletions languages/en.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{
"PLAYER-STATUS": {
"afk": {
"showAfkIndicator": "Should an AFK emoji indicator be displayed in the Players list?",
"showChatNotification": "Should a message be posted to chat when a player is AFK?",
"showChatActivityRemoveAFK": "If you are AFK and post a chat message, should the AFK indicator go away?",
"showAfkIndicator": "Should an AFK emoji indicator be displayed in the player list?",
"showChatNotification": "Should a message be posted in the chat when a player is AFK?",
"showChatActivityRemoveAFK": "Should the AFK indicator disappear when one is AFK and posts a chat message?",
"back": "{name} is back",
"afk": "{name} is afk",
"iconPosition": "Where should the AFK symbol be displayed?",
"disable": "Disable AFK function?"
"iconPosition": "Where should the AFK icon be displayed?",
"disable": "disable AFK system?",
"afk_command": "Away from Keyboard, you want to go AFK and show it to everyone. An optional text can be added, this will then be included as a reason in the chat message.",
"back_command": "You are back and want to show everyone."
},
"typing": {
"timeOutSec": "Reset typing after x seconds after last character",
"icon": "Select typing icon",
"iconPosition": "Where should the tap icon be displayed?",
"disable": "Disable typing function?"
"icon": "select typing icon",
"iconPosition": "Where should the typing icon be displayed?",
"disable": "Disable typing display?"
},
"iconPosition": {
"beforeOnline": "Before the online status",
"afterOnline": "After the online status",
"afterName": "After the username"
"beforeOnline": "Before online status",
"afterOnline": "After online status",
"afterName": "After the user name"
}
}
}
26 changes: 26 additions & 0 deletions languages/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"PLAYER-STATUS": {
"afk": {
"showAfkIndicator": "Faut-il afficher un indicateur d'emoji AFK dans la liste des joueurs ?",
"showChatNotification": "Faut-il mettre un message dans le chat lorsqu'un joueur est AFK ?",
"showChatActivityRemoveAFK": "L'indicateur AFK doit-il disparaître lorsqu'on est AFK et qu'on poste un message de chat ?",
"back": "{name} est de retour",
"afk": "{name} est afk",
"iconPosition": "où voulez-vous que l'icône AFK soit affichée",
"disable": "Désactiver le système AFK ?",
"afk_command": "Away from Keyboard, tu veux aller AFK et le montrer à tout le monde. Un texte optionnel peut être ajouté, il sera alors inclus comme raison dans le message de chat",
"back_command": "Tu es de retour et tu veux le montrer à tout le monde"
},
"typing": {
"timeOutSec": "Réinitialiser la frappe après x secondes après le dernier caractère",
"icon": "Sélectionner l'icône de frappe",
"iconPosition": "Où doit s'afficher l'icône de frappe ?",
"disable": "Désactiver l'affichage de la frappe ?"
},
"iconPosition": {
"beforeOnline": "Avant le statut en ligne",
"afterOnline": "Après le statut en ligne",
"afterName": "Après le nom d'utilisateur"
}
}
}
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"manifest": "https://github.com/Talaren/FoundryVTT-PlayerListStatus/releases/latest/download/module.json",
"compatibility": {
"minimum": "2.1.0",
"verified": "2.1.3"
"verified": "3.0.0"
}
}
]
},
"compatibility": {
"minimum": "9",
"verified": "10.288",
"maximum": "10"
"verified": "11.302",
"maximum": "11"
},
"languages": [
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/afkStatus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class AfkStatus {
/**
* parse the position to show
* @param {string} setting the setting from Foundry
* @returns {symbol} the position
* @returns {Object} the position
*/
static parsePositionConfig(setting) {
switch (setting) {
Expand Down
12 changes: 12 additions & 0 deletions scripts/playerstatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ Hooks.once('playerListStatusInit', function (register) {
Hooks.once('playerListStatusReady', function (playerListStatus) {
if (playerListStatus.isRegistered(AfkStatus.keyName)) {
Game.prototype.afkStatus = new AfkStatus();
game.chatCommands?.register({
name: "/afk",
module: "PlayerStatus",
description: game.i18n.localize("PLAYER-STATUS.afk.afk_command"),
icon: "<i class='fas fa-comment-slash'></i>"
});
game.chatCommands?.register({
name: "/back",
module: "PlayerStatus",
description: game.i18n.localize("PLAYER-STATUS.afk.back_command"),
icon: "<i class='fas fa-comment-slash'></i>"
});
}
if (playerListStatus.isRegistered(WrittingStatus.keyName)) {
Game.prototype.writtingStatus = new WrittingStatus();
Expand Down
18 changes: 12 additions & 6 deletions scripts/writtingStatus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@ export default class WrittingStatus {
*/
constructor() {
this.keytimer = undefined;
Hooks.on("chatMessage", function (_chatlog, _messageText, _chatData) {
this.stop()
}.bind(this));
let chat = document.getElementById('chat-message');
chat.addEventListener("keydown", function eventHandler(event) {
if(event.key !== "Enter"){
this.typing();
if (event.key !== "Enter") {
if (chat.value !== "") {
this.typing();
}
} else {
// Add a slight delay to allow the text field to clear
setTimeout(() => {
if (chat.value === "") {
this.stop();
}
}, 10);
}
}.bind(this));
}

/**
* Parse the position config to a position
* @param {string} setting The position config
* @returns {symbol} The position
* @returns {Object} The position
*/
static parsePositionConfig(setting) {
switch (setting) {
Expand Down