Skip to content

Commit

Permalink
Multiple trackers, Advanced options, Commenting
Browse files Browse the repository at this point in the history
-  Multiple trackers: Support multiple trackers at the same time
- Advanced options: Optional array parameter on open() method to pass
  advanced options
- Commenting: Comment code
  • Loading branch information
Larkinabout committed Jun 28, 2022
1 parent 1200001 commit c9df1c3
Show file tree
Hide file tree
Showing 6 changed files with 463 additions and 303 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ An interactive aid to track successes and failures in challenges.
- **Player View:** Click **Show** on the header to show the tracker to your players and click **Hide** to hide it from your players.

## How to Use
1. Create a macro with a Type of 'script' and enter: `ChallengeTracker.open(successes, failures, {show: true/false})` where `successes` is the number of successes required, `failures` is the number of failures required, and `{show: true/false}` equals `{show: true}` to show the tracker to your players or `{show: false}` to hide it from your players. `{show: true/false}` is optional and is set to false by default.
1. Create a macro with a Type of 'script' and enter: `ChallengeTracker.open(outer, inner)` where `outer` is the number of segments required on the outer ring (successes) and `inner` is the number of segments required on the inner circle (failures).
2. Execute the macro to open the Challenge Tracker.

![challenge-tracker-macro](https://user-images.githubusercontent.com/105953297/174798982-53b25513-5aca-464d-9556-1ab7ee543856.png)
## Advanced Options
More options can be set using an optional array parameter: `ChallengeTracker.open(successes failures, {options})` where options is a comma-separated list of any of the following parameters in the format `option: value`:
- **show:** Set to `true` to show the Challenge Tracker to your players. Default is `false`. Example: `show: true`
- **outerCurrent:** Set the number of completed segments on the outer ring (successes). Default is `0`. Example: `outerCurrent: 3`
- **innerCurrent:** Set the number of completed segments on the inner circle (failures). Default is `0`. Example: `innerCurrent: 3`
- **outerColor:** Set the hex color of the outer ring (successes). The 'Outer Color' module setting will be ignored. Example: `outerColor: '#0000FF'`
- **innerColor:** Set the hex color of the inner circle (failures). The 'Inner Color' module setting will be ignored. Example: `outerColor: '#0000FF'`
- **frameColor:** Set the hex color of the frame. The 'Frame Color' module setting will be ignored. Example: `outerColor: '#0000FF'`
- **size:** Set the size of the Challenge Tracker in pixels between 200 to 600. The 'Size' module setting will be ignored. Example: `size: 400`
- **title:** Set the title of the Challenge Tracker in the window header. Default is `Challenge Tracker`. Example: `title: 'Skill Challenge 1'`

By default, successes are tracked on the outer ring while failures are tracked on the inner circle.
**Example:** `ChallengeTracker.open(10, 5, {show: true, outerCurrent: 10, innerCurrent: 5, outerColor: '#FF3232', innerColor: '#2180FF', title: 'Health & Mana'})`

Currently, only the GM can open, control and close the Challenge Tracker. In a future release, I'll add the functionality to hand over the Challenge Tracker to a player.
![challenge-tracker-macro](https://user-images.githubusercontent.com/105953297/174798982-53b25513-5aca-464d-9556-1ab7ee543856.png)
14 changes: 7 additions & 7 deletions languages/en.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"settings": {
"successColor" : {
"name": "Success Color",
"hint": "Set the color for successes",
"outerColor" : {
"name": "Outer Color",
"hint": "Set the color for the outer ring",
"label": "Color Picker"
},
"failureColor" : {
"name": "Failure Color",
"hint": "Set the color for failures",
"innerColor" : {
"name": "Inner Color",
"hint": "Set the color for the inner circle",
"label": "Color Picker"
},
"frameColor" : {
Expand All @@ -21,7 +21,7 @@
},
"scroll" : {
"name": "Scroll",
"hint": "Enable the scroll wheel for increasing/decreasing successes and failures"
"hint": "Enable the scroll wheel for increasing/decreasing segments"
}
}
}
Loading

0 comments on commit c9df1c3

Please sign in to comment.