Skip to content

Commit ea7837f

Browse files
committed
Copy, Localization, README
- Copy: Add copy functionality to Challenge Tracker List. - Localization: Add localization support. - README: Update README.
1 parent b2993aa commit ea7837f

File tree

12 files changed

+589
-211
lines changed

12 files changed

+589
-211
lines changed

README.md

Lines changed: 244 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,265 @@
11
# Challenge Tracker
22
An interactive aid to track successes and failures in challenges à la D&D 4e-inspired skill challenges and Blades in the Dark progress clocks.
33

4-
![challenge-tracker](./images/challenge-tracker.png) ![challenge-tracker](./images/challenge-tracker-progress-clock.png)
4+
![Challenge Tracker](./images/challenge-tracker.png) ![Progress Clock](./images/challenge-tracker-progress-clock.png)
55

6-
## Features
6+
# Features
77
- **Versatile:** Works for D&D 4e-inspired skill challenges, Blades in the Dark progress clocks, or as a resource/countdown tracker.
88
- **Click to Fill:** Left-click anywhere within the ring or circle to fill a segment in that area. Right-click to clear a segment.
99
- **Scroll to Change:** Hover over the ring or circle and use your mouse wheel, or the +/- keys, to increase or decrease the number of segments.
1010
- **Player View:** Click **Show** on the header to show the tracker to other players and click **Hide** to hide it from other players.
1111

12-
## How to Use
13-
### Using the Player List
14-
![challenge-tracker-macro](./images/challenge-tracker-player-list.png)
15-
1. Click the ![challenge-tracker-macro](./images/challenge-tracker-player-list-button.png) button in the player list.
12+
# How to Use
13+
## Using the Challenge Tracker List
14+
1. Click the ![Player List Button](./images/challenge-tracker-player-list-button.png) button in the player list to open the Challenge Tracker List.
1615

17-
![challenge-tracker-macro](./images/challenge-tracker-list.png)
16+
![Player List with Button](./images/challenge-tracker-player-list.png)
17+
18+
![Challenge Tracker List](./images/challenge-tracker-list.png)
1819

1920
2. Click 'Create New' to create a new Challenge Tracker.
2021
3. Fill in the options and click 'Save and Close'.
21-
- Click 'Open' to open a Challenge Tracker.
22-
- Click 'Edit' to edit an existing Challenge Tracker.
23-
- Click 'Delete' to delete an existing Challenge Tracker.
22+
- Click 'Open' to open a Challenge Tracker.
23+
- Click 'Copy' to copy an existing Challenge Tracker.
24+
- Click 'Edit' to edit an existing Challenge Tracker.
25+
- Click 'Delete' to delete an existing Challenge Tracker.
26+
27+
## Using Macros
28+
1. Create a macro with a Type of 'script' and enter:
29+
```
30+
ChallengeTracker.open(outer, inner)
31+
```
32+
*`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).*
2433

25-
### Using Macros
26-
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).
2734
2. Execute the macro to open the Challenge Tracker.
2835

29-
![challenge-tracker-macro](./images/challenge-tracker-macro.png)
36+
![Challenge Tracker Macro](./images/challenge-tracker-macro.png)
37+
38+
# Module Settings
39+
Module settings are found in Foundry VTT under Game Settings > Configure Settings > Module Settings > Challenge Tracker.
40+
41+
### **Display Button**
42+
Display the Challenge Tracker button to users with the selected role and above. Default is Player.
43+
44+
### **Button Location**
45+
Set the location of the Challenge Tracker button. Default is Player List.
46+
47+
### **Allow Show to Others**
48+
Allows users with the selected role (and above) to show Challenge Trackers to others. Default is false.
49+
50+
### **Size**
51+
Set the default size of the Challenge Tracker in pixels. Default is 400.
52+
53+
### **Frame Width**
54+
Set the width of the frame. Default is Medium.
55+
56+
### **Frame Color**
57+
Set the default color of the frame. Default is #0f1414.
58+
59+
### **Outer Color**
60+
Set the default color of the outer ring. Default is #228b22ff.
61+
62+
### **Outer Background**
63+
Set the default background color of the outer ring. Default is #1b6f1b66.
3064

31-
## Advanced Options
65+
### **Inner Color**
66+
Set the default color of the inner circle. Default is #dc0000ff.
67+
68+
### **Inner Background Color**
69+
Set the default background color of the inner circle. Default is #b0000066.
70+
71+
# Advanced Options
3272
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`:
33-
- **outerCurrent:** Set the number of completed segments on the outer ring (successes). Default is `0`. Example: `outerCurrent: 3
34-
- **innerCurrent:** Set the number of completed segments on the inner circle (failures). Default is `0`. Example: `innerCurrent:
35-
- **outerBackgroundColor:** Set the background hex color of the outer ring (successes). The 'Outer Background Color' module setting will be ignored. Example: `outerBackgroundColor: '#1B6F1B66'`
36-
- **outerColor:** Set the hex color of the outer ring (successes). The 'Outer Color' module setting will be ignored. Example: `outerColor: '#0000FF'`
37-
- **innerColor:** Set the hex color of the inner circle (failures). The 'Inner Color' module setting will be ignored.
38-
- **innerBackgroundColor:** Set the background hex color of the inner circle (failures). The 'Inner Background Color' module setting will be ignored. Example: `innerBackgroundColor: '#B0000066'`
39-
- **frameColor:** Set the hex color of the frame. The 'Frame Color' module setting will be ignored. Example: `frameColor: '#0000FF'`
40-
- **persist:** Set to `true` to persist the Challenge Tracker across sessions. Default is `false`. Example: `persist: true`
41-
- **show:** Set to `true` to show the Challenge Tracker to your players. Default is `false`. This option will be ignored when the user's role is not equal to or greater than the role selected in the 'Allow Show to Others' module setting. Example: `show: true`
42-
- **size:** Set the size of the Challenge Tracker in pixels between 200 to 600. The 'Size' module setting will be ignored. Example: `size: 400`
43-
- **title:** Set the title of the Challenge Tracker in the window header. Default is `Challenge Tracker`. Example: `title: 'Skill Challenge 1'`
44-
- **windowed:** Set the Challenge Tracker to windowed (true) or windowless (false). The 'Windowed' module setting will be ignored. Example: `windowed: false`
45-
46-
## Examples
73+
### **closeFunction**
74+
Execute a function when a Challenge Tracker is closed.
75+
76+
Example `closeFunction: () => { ui.notifications.info('Goodbye!') }`
77+
78+
### **frameColor**
79+
Set the hex color of the frame. The 'Frame Color' module setting will be ignored.
80+
81+
Example: `frameColor: '#0000FF'`
82+
83+
### **frameWidth**
84+
Set the width of the frame. The 'Frame Width' module setting will be ignored.
85+
86+
Options are:
87+
- 'none'
88+
- 'extra-thin'
89+
- 'thin'
90+
- 'medium'
91+
- 'thick'
92+
93+
Example: `frameWidth: 'thin'`
94+
95+
### **innerBackgroundColor**
96+
Set the background hex color of the inner circle (failures). The 'Inner Background Color' module setting will be ignored.
97+
98+
Example: `innerBackgroundColor: '#b0000066'`
99+
100+
### **innerColor**
101+
Set the hex color of the inner circle (failures). The 'Inner Color' module setting will be ignored.
102+
103+
Example: `innerColor: '#dc0000ff'`
104+
105+
### **id**
106+
Set to the ID of an existing Challenge Tracker to open that Challenge Tracker. Other options included will overwrite the Challenge Tracker's previous options.
107+
108+
Example: `id: 'challenge-tracker-8b814267e7dfa`
109+
110+
### **innerCurrent**
111+
Set the number of completed segments on the inner circle (failures). Default is `0`.
112+
113+
Example: `innerCurrent: 3`
114+
115+
### **openFunction**
116+
Execute a function when a Challenge Tracker is opened.
117+
118+
Example `openFunction: () => { ui.notifications.info('Hello!') }`
119+
120+
### **outerBackgroundColor**
121+
Set the background hex color of the outer ring (successes). The 'Outer Background Color' module setting will be ignored.
122+
123+
Example: `outerBackgroundColor: '#1B6F1B66'`
124+
125+
### **outerColor**
126+
Set the hex color of the outer ring (successes). The 'Outer Color' module setting will be ignored.
127+
128+
Example: `outerColor: '#0000FF'`
129+
130+
### **outerCurrent**
131+
Set the number of completed segments on the outer ring (successes). Default is `0`.
132+
133+
Example: `outerCurrent: 3`
134+
135+
### **persist**
136+
Set to `true` to persist the Challenge Tracker across sessions. Default is `false`.
137+
138+
Example: `persist: true`
139+
140+
### **show**
141+
Set to `true` to show the Challenge Tracker to your players. Default is `false`. This option will be ignored when the user's role is not equal to or greater than the role selected in the 'Allow Show to Others' module setting.
142+
143+
Example: `show: true`
144+
145+
### **size**
146+
Set the size of the Challenge Tracker in pixels between 200 to 600. The 'Size' module setting will be ignored.
147+
148+
Example: `size: 400`
149+
### **title**
150+
Set the title of the Challenge Tracker in the window header. Default is `Challenge Tracker`.
151+
152+
Example: `title: 'Skill Challenge 1'`
153+
154+
### **windowed**
155+
Set the Challenge Tracker to windowed (true) or windowless (false). The 'Windowed' module setting will be ignored.
156+
157+
Example: `windowed: false`
158+
159+
# Functions
160+
161+
### **ChallengeTracker.open(*outer*, *inner*, {*options*})**
162+
Open a Challenge Tracker.
163+
164+
Also accepts `ChallengeTracker.open(outer, {options})` or `ChallengeTracker.open({options})`. See *Using Macros* for more info.
165+
166+
Examples:
167+
- `ChallengeTracker.open(4, 3, { title: 'Skills Challenge L1' })`
168+
- `ChallengeTracker.open(8, { title: 'Progress Clock' })`
169+
- `ChallengeTracker.open({ outerTotal: 6, innerTotal: 3, title: 'Social Conflict', frameColor: game.user.color })`
170+
171+
### **ChallengeTracker.setById(*id*, {*options*})**
172+
Set the options of a Challenge Tracker by its ID.
173+
174+
Example: `ChallengeTracker.setById('challenge-tracker-8b814267e7dfa', { outerCurrent: 3 })`
175+
176+
### **ChallengeTracker.setByTitle(*title*, {*options*})**
177+
Set the options of a Challenge Tracker by its title. Only the first Challenge Tracker with a matching title will be set.
178+
179+
Example: `ChallengeTracker.setById('Challenge Tracker', { outerCurrent: 3 })`
180+
181+
### **ChallengeTracker.getById(*id*)**
182+
Get the options of a Challenge Tracker by its ID.
183+
184+
Example: `const challengeTrackerOptions = ChallengeTracker.getById('challenge-tracker-8b814267e7dfa')`
185+
186+
### **ChallengeTracker.getByTitle(*title*)**
187+
Get the options of a Challenge Tracker by its title. Only the first Challenge Tracker with a matching title will be returned.
188+
189+
Example: `const challengeTrackerOptions = ChallengeTracker.getByTitle('Challenge Tracker')`
190+
191+
### **ChallengeTracker.closeAll()**
192+
Close all Challenge Trackers.
193+
194+
Example: `ChallengeTracker.closeAll()`
195+
196+
### **ChallengeTracker.closeById(*id*)**
197+
198+
Close a Challenge Tracker by its ID.
199+
200+
Example: `ChallengeTracker.closeById('challenge-tracker-8b814267e7dfa')`
201+
202+
### **ChallengeTracker.closeByTitle(*title*)**
203+
Close a Challenge Tracker by its title. Only the first Challenge Tracker with a matching title will be closed.
204+
205+
Example: `ChallengeTracker.closeById('Challenge Tracker')`
206+
207+
### **ChallengeTracker.deleteAll()**
208+
Delete all Challenge Trackers. Open Challenge Trackers will not be closed.
209+
210+
Example: `ChallengeTracker.deleteAll()`
211+
212+
### **ChallengeTracker.deleteById(*id*)**
213+
214+
Delete a Challenge Tracker by its ID. An open Challenge Tracker will not be closed.
215+
216+
Example: `ChallengeTracker.deleteById('challenge-tracker-8b814267e7dfa')`
217+
218+
### **ChallengeTracker.deleteByTitle(*title*)**
219+
Delete a Challenge Tracker by its title. Only the first Challenge Tracker with a matching title will be deleted. An open Challenge Tracker will not be closed.
220+
221+
Example: `ChallengeTracker.deleteByTitle('Challenge Tracker')`
222+
223+
### **ChallengeTracker.showAll()**
224+
Show all open Challenge Trackers to other players.
225+
226+
Example: `ChallengeTracker.showAll()`
227+
228+
### **ChallengeTracker.showById(*id*)**
229+
Show an open Challenge Tracker to other players by its ID.
230+
231+
Example: `ChallengeTracker.showByID('challenge-tracker-8b814267e7dfa')`
232+
233+
### **ChallengeTracker.showByTitle(*title*)**
234+
See also: `ChallengeTracker.show(title)`
235+
236+
Show an open Challenge Tracker to other players by its title. Only the first Challenge Tracker with a matching title will be shown.
237+
238+
Example: `ChallengeTracker.showByTitle('Challenge Tracker')`
239+
240+
### **ChallengeTracker.hideAll()**
241+
Hide all open Challenge Trackers from other players.
242+
243+
Example: `ChallengeTracker.hideAll()`
244+
245+
### **ChallengeTracker.hideById(*id*)**
246+
Hide an open Challenge Tracker by its ID.
247+
248+
Example: `ChallengeTracker.hideById('challenge-tracker-8b814267e7dfa')`
249+
250+
### **ChallengeTracker.hideByTitle(*title*)**
251+
Hide an open Challenge Tracker by its title. Only the first Challenge Tracker with a matching title will be hidden.
252+
253+
Example: `ChallengeTracker.hideByTitle('Challenge Tracker')`
254+
255+
### **ChallengeTracker.openList()**
256+
Open the Challenge Tracker list. GMs can use pass a username to the function to open that user's list.
257+
258+
Examples:
259+
- `ChallengeTracker.openList()`
260+
- `ChallengeTracker.openList('Larkinabout')`
261+
262+
# Example Challenge Trackers
47263
### Progress Clock
48264
`ChallengeTracker.open(8, 0, {show: true, title: 'Progress Clock'})`
49265

images/challenge-tracker-list.png

26.5 KB
Loading
1.3 KB
Loading

0 commit comments

Comments
 (0)