Skip to content

Commit

Permalink
Updates for Foundry v10
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolcatFVTT committed Sep 4, 2022
1 parent 568f312 commit 73759a4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This [FoundryVTT](https://foundryvtt.com/) module provides various CombatTracker

# Tested against these Dependencies
- [Star Trek Adventures 2d20 system](https://foundryvtt.com/packages/sta) by FullMetalSeraph - Version 1.1.6 ([Manifest](https://raw.githubusercontent.com/mkscho63/sta/master/src/system.json))
- [Lancer Initiative](https://foundryvtt.com/packages/lancer-initiative) by Bolts - Version 24 ([Manifest](https://github.com/BoltsJ/lancer-initiative/releases/download/v24/module.json))
- [LibWrapper](https://foundryvtt.com/packages/lib-wrapper) by ruipin - Version 1.12.4.0 ([Manifest](https://github.com/ruipin/fvtt-lib-wrapper/releases/download/v1.12.4.0/module.json))
- [Lancer Initiative](https://foundryvtt.com/packages/lancer-initiative) by Bolts - Version 25 ([Manifest](https://github.com/BoltsJ/lancer-initiative/releases/download/v25/module.json))
- [LibWrapper](https://foundryvtt.com/packages/lib-wrapper) by ruipin - Version 1.12.7.2 ([Manifest](https://github.com/ruipin/fvtt-lib-wrapper/releases/download/v1.12.7.2/module.json))
- [LCARS UI for Star Trek Adventures](https://foundryvtt.com/packages/sta-lcars-ui) by Fabulist - Version 0.2.2 ([Manifest](https://raw.githubusercontent.com/FabulistVtt/sta-lcars-ui/main/module.json)) (just strongly recommended, not a hard-dependency)
# Credits
Various other modules and assets have been used for the video/screenshot:
Expand Down
52 changes: 35 additions & 17 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
{
"id": "sta-initiative",
"name": "sta-initiative",
"title": "Star Trek Adventures Initiative",
"description": "CombatTracker improvements for Star Trek Adventures. Depends on the 'Lancer Initiative' module by Bolts, which does most of the work.",
"version": "0.1.3",
"author": "CoolcatFVTT",
"version": "0.2.0",
"authors": [
{ "name": "CoolcatFVTT", "url": "https://github.com/CoolcatFVTT/" }
],
"scripts": [
"sta-initiative.js"
],
"styles": [
"sta-initiative.css"
],
"dependencies": [
{
"name": "lib-wrapper"
},
{
"name": "lancer-initiative"
},
{
"name": "sta",
"type": "system"
}
],
"minimumCoreVersion": "9.242",
"compatibleCoreVersion": "9",
"relationships": {
"systems": [
{
"id": "sta",
"type": "system",
"manifest": "https://raw.githubusercontent.com/mkscho63/sta/master/src/system.json",
"compatibility": { "minimum": "1.1.6", "verified": "1.1.6" }
}
],
"requires": [
{
"id": "lib-wrapper",
"type": "module",
"manifest": "https://github.com/ruipin/fvtt-lib-wrapper/releases/latest/download/module.json",
"compatibility": { "minimum": "1.12.7.2", "verified": "1.12.7.2" }
},
{
"id": "lancer-initiative",
"type": "module",
"manifest": "https://github.com/BoltsJ/lancer-initiative/releases/latest/download/module.json",
"compatibility": { "minimum": "25", "verified": "25" }
}
]
},
"compatibility": {
"minimum": "10",
"verified": "10.284",
"maximum": "10"
},
"license": "LGPL 3.0",
"url": "https://github.com/CoolcatFVTT/StarTrekAdventures-Initiative",
"manifest": "https://raw.githubusercontent.com/CoolcatFVTT/StarTrekAdventures-Initiative/main/module.json",
"download": "https://github.com/CoolcatFVTT/StarTrekAdventures-Initiative/archive/refs/tags/v0.1.3.zip"
"download": "https://github.com/CoolcatFVTT/StarTrekAdventures-Initiative/archive/refs/tags/v0.2.0.zip"
}
13 changes: 6 additions & 7 deletions sta-initiative.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class STAInitiative {
{
if (game.user.isGM)
return true;
else if (combatant.data.name)
else if (combatant._source.name)
return true; // manual display name override in CombatTracker
else
return this.isTokenInfoVisible(combatant.token);
Expand Down Expand Up @@ -130,13 +130,12 @@ Hooks.once('setup', () =>
}, 'MIXED');

// Hide Combatant names in CombatTracker, if hidden in HUD
libWrapper.register(STAInitiative.MODULE_ID, 'Combatant.prototype.name', function(wrapped)
libWrapper.register(STAInitiative.MODULE_ID, 'Combatant.prototype.prepareDerivedData', function(wrapped)
{
if (STAInitiative.isCombatantInfoVisible(this))
return wrapped();
else
return game.i18n.localize("COMBAT.UnknownCombatant");
}, 'MIXED');
wrapped();
if (!STAInitiative.isCombatantInfoVisible(this))
this.name = game.i18n.localize("COMBAT.UnknownCombatant");
}, 'WRAPPER');

// Hide Combatant initiative in CombatTracker, when not the GameMaster (works via CSS)
libWrapper.register(STAInitiative.MODULE_ID, 'CombatTracker.prototype.activateListeners', function(wrapped, html)
Expand Down

0 comments on commit 73759a4

Please sign in to comment.