-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Blank buttons no longer appear for players who have not selected a token/character * Adds an API, Hooks, and better translations (#37) Fixes #32
- Loading branch information
1 parent
4648f36
commit bd8b867
Showing
21 changed files
with
2,046 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
deploy/ | ||
dist/ | ||
dist/ | ||
gulpfile.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
"singleQuote": false, | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"endOfLine": "lf" | ||
"endOfLine": "auto" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
# API functions | ||
|
||
Access functions via `game["fvtt-player-achievements"].api`. | ||
|
||
All functions return the following object: | ||
|
||
```javascript | ||
{ | ||
errorMessage: 'Error message', | ||
payload: object | ||
} | ||
``` | ||
|
||
## Current API Functions: | ||
|
||
### getAchievements - Returns the achievements array | ||
|
||
|
||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<Array.<Achievement>>"`: Achievements List | ||
|
||
<hr/> | ||
|
||
|
||
### doesAchievementExist - Does the achievement exist? | ||
|
||
|
||
**Parameters:** | ||
|
||
- `achievementId` (string): The achievement id | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<boolean>"`: Does the achievement exist? | ||
|
||
<hr/> | ||
|
||
|
||
### doesCharacterHaveAchievement - Does the character have the achievement? | ||
|
||
|
||
**Parameters:** | ||
|
||
- `characterUUID` (string): The character uuid | ||
|
||
- `achievementId` (string): The achievement id | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<boolean>"`: Does the character have the achievement? | ||
|
||
<hr/> | ||
|
||
|
||
### awardAchievementToCharacter - Award the achievement to the character | ||
|
||
|
||
**Parameters:** | ||
|
||
- `achievementId` (string): The achievement id | ||
|
||
- `characterUUID` (string): The character uuid | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<boolean>"`: Was the achievement awarded? | ||
|
||
<hr/> | ||
|
||
|
||
### getAchievementsByCharacter - Get the achievements for the character | ||
|
||
|
||
**Parameters:** | ||
|
||
- `characterUUID` (string): The character uuid | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<Array.<Achievement>>"`: achievements for the character | ||
|
||
<hr/> | ||
|
||
|
||
### createAchievement - Create an achievement | ||
|
||
|
||
**Parameters:** | ||
|
||
- `id` (string): The achievement id | ||
|
||
- `title` (string): The achievement title | ||
|
||
- `description` (string): The achievement description | ||
|
||
- `showTitleCloaked` (boolean) [**Optional**]: Show the title cloaked? (Default: false) | ||
|
||
- `image` (string) [**Optional**]: The achievement image (Default: "/modules/fvtt-player-achievements/images/default.webp") | ||
|
||
- `cloakedImage` (string) [**Optional**]: The achievement cloaked image (Default: "/modules/fvtt-player-achievements/images/default.webp") | ||
|
||
- `sound` (string) [**Optional**]: The achievement sound effect (Default: "/modules/fvtt-player-achievements/sounds/notification.ogg") | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<boolean>"`: Was the achievement created? | ||
|
||
<hr/> | ||
|
||
|
||
### editAchievement - Edit an achievement | ||
|
||
|
||
**Parameters:** | ||
|
||
- `id` (string): The achievement id | ||
|
||
- `title` (string): The achievement title | ||
|
||
- `description` (string): The achievement description | ||
|
||
- `showTitleCloaked` (boolean) [**Optional**]: Show the title cloaked? (Default: false) | ||
|
||
- `image` (string) [**Optional**]: The achievement image (Default: "/modules/fvtt-player-achievements/images/default.webp") | ||
|
||
- `cloakedImage` (string) [**Optional**]: The achievement cloaked image (Default: "/modules/fvtt-player-achievements/images/default.webp") | ||
|
||
- `sound` (string) [**Optional**]: The achievement sound effect (Default: "/modules/fvtt-player-achievements/sounds/notification.ogg") | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<boolean>"`: Was the achievement edited? | ||
|
||
<hr/> | ||
|
||
|
||
### removeAchievementFromCharacter - Remove an achievement from the character | ||
|
||
|
||
**Parameters:** | ||
|
||
- `achievementId` (string): The achievement id | ||
|
||
- `characterUUID` (string): The character uuid | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<boolean>"`: Was the achievement removed? | ||
|
||
<hr/> | ||
|
||
|
||
### deleteAchievement - Delete an achievement | ||
|
||
|
||
**Parameters:** | ||
|
||
- `id` (string): | ||
|
||
**Returns:** | ||
|
||
- `"PlayerAchievementReturn.<boolean>"`: Was the achievement deleted? | ||
|
||
<hr/> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# API functions | ||
|
||
Access functions via `game["fvtt-player-achievements"].api`. | ||
|
||
All functions return the following object: | ||
|
||
```javascript | ||
{ | ||
errorMessage: 'Error message', | ||
payload: object | ||
} | ||
``` | ||
|
||
## Current API Functions: | ||
{{#functions}} | ||
|
||
### {{name}} - {{description}} | ||
|
||
|
||
{{#if params}} | ||
**Parameters:** | ||
{{#each params}} | ||
|
||
- `{{name}}` ({{ type.names.[0] }}){{#if optional}} [**Optional**]{{/if}}: {{description}}{{#if optional}} (Default: {{defaultvalue}}){{/if}} | ||
{{/each}} | ||
{{/if}} | ||
|
||
{{#if returns}} | ||
**Returns:** | ||
{{#each returns}} | ||
|
||
- `{{stringify type.names.[0]}}`: {{description}} | ||
{{/each}} | ||
{{/if}} | ||
|
||
<hr/> | ||
|
||
{{/functions}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* eslint-disable unicorn/prefer-module */ | ||
const Handlebars = require("handlebars"); | ||
|
||
Handlebars.registerHelper("stringify", function (objectToStringify) { | ||
return new Handlebars.SafeString(JSON.stringify(objectToStringify)); | ||
}); | ||
|
||
module.exports = Handlebars.helpers; |
Oops, something went wrong.