Skip to content

Commit 96dbdde

Browse files
authored
Merge pull request #413 from mclemente/V13-Update
Foundry V13 update
2 parents 7645887 + eadc02f commit 96dbdde

File tree

14 files changed

+292
-221
lines changed

14 files changed

+292
-221
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ module.exports = {
178178
GURPS: false,
179179
JournalTextPageSheet: false,
180180
ProseMirror: false,
181+
TomSelect: false,
181182
Tour: false,
182183
},
183184

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
Talk to others using a language you can speak and scrambles text you can't understand, into several fantasy scripts.
99

1010
## How to Use
11-
### As a GM
11+
### Set Up
12+
#### As a GM
1213
- Check the module settings to configure it according to your preferences.
13-
- Select tokens to speak as them.
14-
- Change the default editor of the Journal Sheet to TinyMCE if you intend to use the Journal feature.
14+
- Check the Tour under the Tour Management window.
1515
- Check the [wiki](https://github.com/mclemente/fvtt-module-polyglot/wiki) for more in-depth information.
1616

17-
### As a Player
17+
#### As a Player
1818
- Assign a character on the User Configuration window.
19-
- Talk as your character. Select other owned tokens to read and speak as them.
19+
20+
### Using
21+
- Select tokens to speak and read messages as them.
22+
- Right-click the chat selector to enable/disable speaking in a language.
2023

2124
## Attribution
2225

gulpfile.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,20 @@ async function copyFiles() {
7474
}
7575
}
7676

77-
function select2() {
78-
return gulp.src(["node_modules/select2/dist/js/select2.min.js", "node_modules/select2/dist/css/select2.min.css"]).pipe(gulp.dest("dist/lib/select2"));
77+
function tomSelect() {
78+
return gulp.src([
79+
"node_modules/tom-select/dist/js/tom-select.complete.min.js",
80+
"node_modules/tom-select/dist/js/tom-select.complete.min.js.map",
81+
"node_modules/tom-select/dist/css/tom-select.min.css",
82+
"node_modules/tom-select/dist/css/tom-select.min.css.map",
83+
]).pipe(gulp.dest("dist/lib/tom-select"));;
7984
}
8085

8186
/**
8287
* Watch for changes for each build step
8388
*/
8489
export function watch() {
85-
select2();
90+
tomSelect();
8691
gulp.watch(`${sourceDirectory}/**/*.${sourceFileExtension}`, { ignoreInitial: false }, buildCode);
8792
gulp.watch(`${stylesDirectory}/**/*.${stylesExtension}`, { ignoreInitial: false }, buildStyles);
8893
gulp.watch(
@@ -92,7 +97,7 @@ export function watch() {
9297
);
9398
}
9499

95-
export const build = gulp.series(clean, gulp.parallel(buildCode, buildStyles, select2, copyFiles));
100+
export const build = gulp.series(clean, gulp.parallel(buildCode, buildStyles, tomSelect, copyFiles));
96101

97102
/********************/
98103
/* CLEAN */

package-lock.json

Lines changed: 61 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"husky": "^8.0.3",
2323
"lint-staged": "^14.0.1",
2424
"rollup": "^2.79.2",
25-
"select2": "^4.1.0-rc.0",
25+
"tom-select": "^2.4.3",
2626
"vinyl-buffer": "^1.0.1",
2727
"vinyl-source-stream": "^2.0.0",
2828
"yargs": "^17.7.2"

src/lang/en.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"Font": "Font",
1313
"Fonts": "Fonts",
1414
"FontSize": "Font Size (%)",
15-
"KnownLanguages": "Known Languages",
16-
"UnknownLanguages": "Unknown Languages",
15+
"KnownLanguages": "Known",
16+
"UnknownLanguages": "Unknown",
1717
"AlphabeticOnly": "Only Alphabetic",
1818
"Logographical": "Logographical",
1919
"AllowOOC": {
@@ -40,10 +40,6 @@
4040
"hint": "Enables all the chat features, such as the language selector in the chat and message scrambling.",
4141
"title": "Enable Chat Features"
4242
},
43-
"DisplayCheckbox": {
44-
"hint": "Removes the checkbox from the chat section.",
45-
"title": "Display Checkbox"
46-
},
4743
"DisplayTranslated.hint": "For languages that are translated in the chat window, display the original text and a translation below.",
4844
"DisplayTranslated.title": "Display Translations",
4945
"enableAllFonts": {
@@ -108,6 +104,7 @@
108104
},
109105
"ScrambleGM.hint": "Don't translate the text for the GM (refer to the globe's color for the token's understanding).",
110106
"ScrambleGM.title": "Scramble Messages for GM",
107+
"SpeakingIn": "Speaking in {language}",
111108
"Truespeech.hint": "Set a language whose speaker understands all spoken languages (can't read Journals) and which is understood by all creatures. An actor will be able to read all chat messages and to write messages in a language that is understood by all.",
112109
"Truespeech.title": "Omnispeech Language",
113110
"Translation": "Translation",
@@ -129,14 +126,14 @@
129126
"Title": "Language Selector",
130127
"Content": "The <span class='reference'>Language Selector</span> is where you can select which language you want to speak in, scrambling the messages sent while it is active."
131128
},
132-
"LanguageSelectorCheckbox": {
133-
"Title": "Language Selector's Checkbox",
134-
"Content": "The <span class='reference'>Checkbox</span> toggles the scrambling. Any user who unchecks it will speak as if the module was disabled."
135-
},
136129
"LanguageSelectorSelect": {
137130
"Title": "Language Selector's Dropdown",
138131
"Content": "The <span class='reference'>Dropdown</span> contains all the languages in your world.<br>Depending on your game system, the languages may have already been set, while in other game systems, you may need to configure them in the <span class='reference'>Game Settings</span>.<br>It will display languages between the ones Known and Unknown by your players' actors."
139132
},
133+
"LanguageSelectorSelect2": {
134+
"Title": "Language Selector's Dropdown",
135+
"Content": "Right-clicking the <span class='reference'>Dropdown</span> toggles the scrambling, allowing users to speak as if the module was disabled."
136+
},
140137
"LanguageSelectorPips": {
141138
"Title": "Language Selector's Pips",
142139
"Content": "A <span class='reference'>Pip</span>, similar to the ones shown on the Players List, will be displayed right next to known languages for each player who has at least one actor that understands it. Hovering over a Pip will display the user's name and the list of actors providing access to the language."

src/module.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
}
1111
],
1212
"compatibility": {
13-
"minimum": "12",
14-
"verified": "12"
13+
"minimum": "13",
14+
"verified": "13"
1515
},
1616
"esmodules": ["module/polyglot.js"],
17-
"scripts": ["lib/select2/select2.min.js"],
18-
"styles": ["lib/select2/select2.min.css", "styles/fonts.css", "styles/polyglot.css"],
17+
"scripts": ["lib/tom-select/tom-select.complete.min.js"],
18+
"styles": ["lib/tom-select/tom-select.min.css", "styles/fonts.css", "styles/polyglot.css"],
1919
"languages": [
2020
{
2121
"lang": "en",

src/module/forms/GeneralSettings.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export class PolyglotGeneralSettings extends FormApplication {
115115
if (game.settings.get("polyglot", "enableChatFeatures")) {
116116
data.settings.chat = {
117117
...data.settings.chat,
118-
displayCheckbox: this._prepSetting("displayCheckbox"),
119118
"display-translated": this._prepSetting("display-translated"),
120119
hideTranslation: this._prepSetting("hideTranslation"),
121120
allowOOC: this._prepSetting("allowOOC"),
@@ -171,7 +170,6 @@ export class PolyglotGeneralSettings extends FormApplication {
171170
"comprehendLanguages",
172171
"truespeech",
173172
"enableChatFeatures",
174-
"displayCheckbox",
175173
"display-translated",
176174
"hideTranslation",
177175
"allowOOC",
@@ -208,8 +206,8 @@ export class PolyglotGeneralSettings extends FormApplication {
208206
let s = game.settings.settings.get(`polyglot.${k}`);
209207
let current = game.user.isGM ? game.settings.get(s.namespace, s.key) : game.user.getFlag("polyglot", k);
210208
if (v === current) continue;
211-
requiresClientReload ||= s.scope === "client" && s.requiresReload;
212-
requiresWorldReload ||= s.scope === "world" && s.requiresReload;
209+
requiresClientReload ||= (s.scope !== CONST.SETTING_SCOPES.WORLD) && s.requiresReload;
210+
requiresWorldReload ||= (s.scope === CONST.SETTING_SCOPES.WORLD) && s.requiresReload;
213211
if (game.user.isGM) {
214212
await game.settings.set(s.namespace, s.key, v);
215213
} else {

0 commit comments

Comments
 (0)