Migration datamodels !
This commit is contained in:
298
CREATURE_SHEET_IMPROVEMENTS.md
Normal file
298
CREATURE_SHEET_IMPROVEMENTS.md
Normal file
@@ -0,0 +1,298 @@
|
||||
# Améliorations de la Fiche Créature
|
||||
|
||||
## Vue d'ensemble
|
||||
La fiche créature a été complètement alignée avec les dernières améliorations de la fiche personnage pour assurer une expérience utilisateur cohérente à travers tout le système.
|
||||
|
||||
## Changements Apportés
|
||||
|
||||
## PARTIE 1 : ONGLET ATTRIBUTS (STATS)
|
||||
|
||||
### 1. Attributs avec Liste Déroulante (Dropdown)
|
||||
**Avant:**
|
||||
```handlebars
|
||||
<input type="number" name="system.attributs.{{key}}.value" value="{{attr.value}}" />
|
||||
```
|
||||
|
||||
**Après:**
|
||||
```handlebars
|
||||
<select name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="Number">
|
||||
{{selectOptions @root.config.listeNiveauCreature selected=attr.value}}
|
||||
</select>
|
||||
```
|
||||
|
||||
**Raison:**
|
||||
- Les créatures peuvent avoir des attributs de 0 à 35 (vs 0-10 pour personnages)
|
||||
- Utilise `listeNiveauCreature` créé dynamiquement dans `wasteland-main.js`
|
||||
- Interface plus propre et empêche les valeurs invalides
|
||||
|
||||
### 2. Attributs Cliquables (Rollable)
|
||||
**Avant:**
|
||||
```handlebars
|
||||
<span class="item-name">{{attr.label}}</span>
|
||||
```
|
||||
|
||||
**Après:**
|
||||
```handlebars
|
||||
<span class="item-name">
|
||||
<a class="rollable" data-action="rollAttribut" data-attr-key="{{key}}">{{attr.label}}</a>
|
||||
</span>
|
||||
```
|
||||
|
||||
**Raison:**
|
||||
- Permet de cliquer sur le nom de l'attribut pour faire un jet
|
||||
|
||||
### 3-5. Boutons +/- pour Santé et Psyché
|
||||
Ajouté des boutons d'ajustement pour:
|
||||
- Dégâts non létaux
|
||||
- Dégâts létaux
|
||||
- Psyché actuelle
|
||||
|
||||
**Raison:**
|
||||
- Facilite l'ajustement rapide en combat
|
||||
|
||||
### 6. Terminologie
|
||||
Changé "Courante" → "Actuelle" pour la psyché
|
||||
|
||||
## PARTIE 2 : ONGLET COMBAT
|
||||
|
||||
### 7. Valeurs de Combat - Grille 2x2 avec Champs Bonus
|
||||
**Layout:**
|
||||
```
|
||||
┌──────────────────────────────┬──────────────────────────────┐
|
||||
│ Initiative 12 [+2] = 14 │ Défense 15 [+2] = 17 │
|
||||
├──────────────────────────────┼──────────────────────────────┤
|
||||
│ Vitesse 8 [+0] = 8 │ Bonus Dég. +3 [+1] = +4 │
|
||||
└──────────────────────────────┴──────────────────────────────┘
|
||||
```
|
||||
|
||||
**Code:**
|
||||
```handlebars
|
||||
<div class="grid grid-2col">
|
||||
<div class="combat-stat-row">
|
||||
<label class="stat-label">Initiative</label>
|
||||
<div class="stat-values">
|
||||
<span class="stat-base">{{combat.initBase}}</span>
|
||||
<input type="number" class="input-numeric-short" name="system.combat.initbonus"
|
||||
value="{{system.combat.initbonus}}" data-tooltip="Bonus" />
|
||||
<span class="stat-total">= {{combat.initTotal}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 3 autres similaires -->
|
||||
</div>
|
||||
```
|
||||
|
||||
**Raison:**
|
||||
- **DIFFÉRENCE IMPORTANTE AVEC PERSONNAGE**: Créatures ont besoin des champs bonus éditables
|
||||
- **Grille 2x2**: Compacte mais lisible, 2 valeurs par ligne
|
||||
- Format: Nom | Base | [Bonus] | = Total
|
||||
|
||||
### 8. Compétences avec Boutons de Roll et Dropdown Niveau
|
||||
**Avant:**
|
||||
```handlebars
|
||||
<span class="item-niveau">Niveau: {{skill.system.niveau}}</span>
|
||||
```
|
||||
|
||||
**Après:**
|
||||
```handlebars
|
||||
<select class="status-small-label color-class-common edit-item-data competence-niveau"
|
||||
data-item-field="niveau" data-dtype="Number">
|
||||
{{selectOptions @root.config.listeNiveauSkill selected=skill.system.niveau}}
|
||||
</select>
|
||||
```
|
||||
|
||||
**Raison:**
|
||||
- **Liste déroulante pour le niveau** (0-10) au lieu de texte statique
|
||||
- Modification directe depuis la liste sans ouvrir la fiche
|
||||
- Utilise le handler `edit-item-data` existant
|
||||
- Appelle `editItemField()` pour mise à jour automatique
|
||||
- **Comportement identique** à la fiche personnage
|
||||
|
||||
**Ajouts:**
|
||||
- Boutons de roll par attribut (ADR:15, PUI:12, etc.)
|
||||
- Nom cliquable pour éditer
|
||||
- Bouton "Ajouter une compétence" en bas
|
||||
|
||||
### 9. Armes avec Format Moderne
|
||||
**Avant:**
|
||||
```handlebars
|
||||
<li class="item flexrow list-item items-title-bg">
|
||||
<span class="item-name-label-header">Armes</span>
|
||||
<span>Attaque</span> <span>Défense</span> <span>Dégâts</span>
|
||||
</li>
|
||||
```
|
||||
|
||||
**Après:**
|
||||
```handlebars
|
||||
<span class="weapon-stats">
|
||||
<span class="stat-offensif" data-tooltip="Attaque">
|
||||
<i class="fas fa-crosshairs"></i> {{arme.system.totalOffensif}}
|
||||
</span>
|
||||
{{#if arme.system.isdefense}}
|
||||
<span class="stat-defensif" data-tooltip="Défense">
|
||||
<i class="fas fa-shield"></i> {{arme.system.totalDefensif}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
<button class="button-sheet-roll" data-action="rollArmeOffensif">
|
||||
<i class="fas fa-dice-d20"></i>
|
||||
</button>
|
||||
<button class="button-sheet-roll" data-action="rollArmeDegats">
|
||||
<i class="fas fa-burst"></i>
|
||||
</button>
|
||||
```
|
||||
|
||||
**Raison:**
|
||||
- Stats avec icônes visuelles (🎯 crosshairs, 🛡️ shield)
|
||||
- Boutons avec icônes au lieu de texte
|
||||
- Suppression du header colonnes
|
||||
- Nom cliquable pour éditer
|
||||
- Bouton "Ajouter une arme" en bas
|
||||
|
||||
### 10. Capacités
|
||||
**Ajouts:**
|
||||
- Nom cliquable pour éditer
|
||||
- Bouton "Ajouter une capacité" en bas
|
||||
|
||||
## Fichiers Modifiés
|
||||
|
||||
### templates/actor-creature-sheet.hbs
|
||||
- **Lignes 26-37**: Attributs avec dropdown et rollable links
|
||||
- **Lignes 39-110**: Santé et Psyché avec boutons +/-
|
||||
- **Lignes 107-146**: Valeurs combat en grille 2x2 avec inputs bonus
|
||||
- **Lignes 148-189**: Compétences avec dropdown niveau et boutons de roll
|
||||
- **Lignes 191-243**: Armes au format moderne avec icônes
|
||||
- **Lignes 245-261**: Capacités avec nom cliquable
|
||||
- **Total**: ~140 lignes modifiées/ajoutées
|
||||
|
||||
### less/actor-styles.less
|
||||
- **Lignes 279-331**: Nouveaux styles pour `.combat-stats` (grille 2x2 créatures)
|
||||
- **Total**: 52 lignes ajoutées
|
||||
|
||||
## Styles CSS Ajoutés
|
||||
|
||||
```less
|
||||
.combat-stats {
|
||||
margin-bottom: 1rem;
|
||||
|
||||
.grid-2col {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.combat-stat-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border: 1px solid #6a0606;
|
||||
border-radius: 3px;
|
||||
padding: 0.4rem 0.6rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
.stat-label {
|
||||
font-weight: bold;
|
||||
font-size: 0.85rem;
|
||||
min-width: 90px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.stat-values {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
flex: 1;
|
||||
|
||||
.stat-base { font-weight: bold; min-width: 30px; text-align: center; }
|
||||
.input-numeric-short { width: 50px; text-align: center; padding: 0.2rem; }
|
||||
.stat-total { font-weight: bold; color: #6a0606; min-width: 40px; }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Actions Utilisées
|
||||
|
||||
Toutes réutilisées depuis `base-actor-sheet.mjs`:
|
||||
- `rollAttribut` - Jets d'attributs
|
||||
- `incDecSante` - Boutons +/- santé/psyché
|
||||
- `rollCompetence` - Jets de compétence
|
||||
- `rollArmeOffensif` / `rollArmeDegats` - Jets d'arme
|
||||
- `createItem` / `editItem` / `deleteItem` - Gestion items
|
||||
|
||||
Handler spécial:
|
||||
- `edit-item-data` - Modification dropdown niveau compétence
|
||||
- Appelle `editItemField(itemId, itemType, itemField, dataType, value)` dans wasteland-actor.js
|
||||
|
||||
## Bénéfices
|
||||
|
||||
### Onglet Attributs
|
||||
1. **Cohérence**: Même interface que fiche personnage
|
||||
2. **Facilité**: Boutons +/- pour ajustements rapides
|
||||
3. **Prévention d'erreurs**: Dropdowns empêchent valeurs invalides
|
||||
4. **Ergonomie**: Attributs cliquables pour jets rapides
|
||||
|
||||
### Onglet Combat
|
||||
1. **Layout 2x2**: Valeurs de combat compactes
|
||||
2. **Champs Bonus**: Créatures peuvent ajuster leurs stats
|
||||
3. **Dropdown Niveau**: Modification compétences sans ouvrir fiche
|
||||
4. **Jets Rapides**: Boutons directement sur compétences/armes
|
||||
5. **Interface Moderne**: Icônes et layout épuré
|
||||
|
||||
## Comparaison Avant/Après
|
||||
|
||||
| Élément | Avant | Après | Bénéfice |
|
||||
|---------|-------|-------|----------|
|
||||
| **Attributs** | Input number | Select dropdown (0-35) + rollable | Prévention erreurs + jets rapides |
|
||||
| **Santé/Psyché** | Input seul | Input + boutons -/+ | Ajustement rapide en combat |
|
||||
| **Valeurs Combat** | Liste 4 lignes verticale | Grille 2x2 Base [Bonus] = Total | Layout compact + édition |
|
||||
| **Niveau Compétence** | Texte statique | Dropdown (0-10) éditable | Modification directe |
|
||||
| **Compétences** | Nom + niveau | Dropdown + boutons roll attributs | Jets + édition rapide |
|
||||
| **Armes** | Header + colonnes texte | Stats icônes + boutons icônes | Interface moderne |
|
||||
| **Capacités** | Nom statique | Nom cliquable + bouton ajout | Édition rapide |
|
||||
|
||||
## Tests Recommandés
|
||||
|
||||
### Onglet Attributs
|
||||
1. Vérifier dropdown attributs (0-35)
|
||||
2. Cliquer sur nom d'attribut pour jet
|
||||
3. Tester boutons +/- santé/psyché
|
||||
4. Vérifier sauvegarde modifications
|
||||
|
||||
### Onglet Combat
|
||||
1. Vérifier grille 2x2 valeurs combat
|
||||
2. Modifier les champs bonus
|
||||
3. **Tester dropdown niveau compétence** (nouveau)
|
||||
4. Tester boutons roll compétences
|
||||
5. Cliquer boutons attaque/dégâts armes
|
||||
6. Vérifier tooltips
|
||||
7. Tester ajout compétence/arme/capacité
|
||||
8. Cliquer noms pour éditer
|
||||
|
||||
## Notes Importantes
|
||||
|
||||
- **Aucune modification JavaScript nécessaire** (actions/handlers déjà existants)
|
||||
- **Modification CSS mineure** (52 lignes pour grille combat)
|
||||
- **Changements principalement template Handlebars**
|
||||
- **Compatible AppV2**
|
||||
- **Différence clé avec personnage**: Créatures ont champs bonus combat éditables
|
||||
- **Nouveau**: Dropdown niveau compétence avec modification directe (handler `edit-item-data`)
|
||||
|
||||
## Impact Visuel
|
||||
|
||||
```
|
||||
CRÉATURE (Valeurs Combat) - Grille 2x2:
|
||||
┌──────────────────────────────┬──────────────────────────────┐
|
||||
│ Initiative 12 [+2] = 14 │ Défense 15 [+2] = 17 │
|
||||
├──────────────────────────────┼──────────────────────────────┤
|
||||
│ Vitesse 8 [+0] = 8 │ Bonus Dég. +3 [+1] = +4 │
|
||||
└──────────────────────────────┴──────────────────────────────┘
|
||||
|
||||
CRÉATURE (Compétences):
|
||||
[🖼️] Mouvements [Dropdown 0-10: 3]
|
||||
[ADR : 15] [PUI : 12] [✏️] [🗑️]
|
||||
|
||||
PERSONNAGE (Compétences):
|
||||
[🖼️] Mouvements [Dropdown 0-10: 3]
|
||||
[ADR : 15] [PUI : 12] [✏️] [🗑️]
|
||||
Prédilections: Escalade, Course
|
||||
```
|
||||
|
||||
Total: ~140 lignes template + 52 lignes CSS = 192 lignes modifiées
|
||||
180
GITEA_RELEASE_WORKFLOW.md
Normal file
180
GITEA_RELEASE_WORKFLOW.md
Normal file
@@ -0,0 +1,180 @@
|
||||
# Workflow de Release Gitea pour Wasteland
|
||||
|
||||
## Vue d'ensemble
|
||||
|
||||
Ce workflow automatise la création de releases pour le système Wasteland dans Foundry VTT via Gitea Actions.
|
||||
|
||||
## Déclenchement
|
||||
|
||||
Le workflow se déclenche automatiquement lors de la **publication d'une release** sur Gitea :
|
||||
|
||||
```yaml
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
```
|
||||
|
||||
## Étapes du Workflow
|
||||
|
||||
### 1. Clone du Repository
|
||||
- Clone le repository Wasteland
|
||||
- Utilise `RouxAntoine/checkout@v3.5.4`
|
||||
|
||||
### 2. Extraction du Numéro de Version
|
||||
- Extrait la version depuis le tag de release
|
||||
- Exemple: tag `v1.2.3` → version `1.2.3`
|
||||
- Utilise `battila7/get-version-action@v2`
|
||||
|
||||
### 3. Substitution des URLs dans system.json
|
||||
Met à jour automatiquement le `system.json` avec :
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "1.2.3",
|
||||
"url": "https://www.uberwald.me/gitea/public/fvtt-wasteland",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/fvtt-wasteland/releases/download/latest/system.json",
|
||||
"download": "https://www.uberwald.me/gitea/public/fvtt-wasteland/releases/download/v1.2.3/fvtt-wasteland.zip"
|
||||
}
|
||||
```
|
||||
|
||||
### 4. Création du ZIP
|
||||
Crée `fvtt-wasteland.zip` contenant :
|
||||
- `system.json` (mis à jour)
|
||||
- `README.md`
|
||||
- `changelog.md`
|
||||
- `assets/`
|
||||
- `lang/`
|
||||
- `modules/`
|
||||
- `packs/`
|
||||
- `styles/`
|
||||
- `templates/`
|
||||
- `template.json`
|
||||
|
||||
**Note:** Exclut `node_modules/`, `less/`, `gulpfile.js`, etc.
|
||||
|
||||
### 5. Upload vers Gitea
|
||||
- Upload du ZIP et du system.json vers la release
|
||||
- Utilise le secret `ALLOW_PUSH_RELEASE`
|
||||
|
||||
### 6. Publication sur Foundry VTT
|
||||
- Notifie le site officiel Foundry VTT de la nouvelle version
|
||||
- Utilise le secret `FOUNDRYVTT_RELEASE_TOKEN`
|
||||
- Compatibilité: Foundry V13
|
||||
|
||||
## Secrets Requis
|
||||
|
||||
Dans les paramètres du repository Gitea, configurer :
|
||||
|
||||
1. **`ALLOW_PUSH_RELEASE`**
|
||||
- Token Gitea avec droits d'écriture sur releases
|
||||
- Généré dans : Paramètres utilisateur → Applications → Tokens
|
||||
|
||||
2. **`FOUNDRYVTT_RELEASE_TOKEN`**
|
||||
- Token du Foundry Package Creator
|
||||
- Obtenu sur : https://foundryvtt.com/packages/edit/fvtt-wasteland
|
||||
|
||||
## Comment Créer une Release
|
||||
|
||||
### Méthode 1: Via l'Interface Gitea
|
||||
|
||||
1. Aller sur `https://www.uberwald.me/gitea/public/fvtt-wasteland`
|
||||
2. Cliquer sur "Releases"
|
||||
3. Cliquer sur "New Release"
|
||||
4. Remplir :
|
||||
- **Tag version**: `v1.2.3` (respecter le format `vX.Y.Z`)
|
||||
- **Release title**: `Version 1.2.3 - Description courte`
|
||||
- **Description**: Changelog détaillé
|
||||
5. Cocher "This is a pre-release" si applicable
|
||||
6. Cliquer sur "Publish Release"
|
||||
|
||||
### Méthode 2: Via Git CLI
|
||||
|
||||
```bash
|
||||
# Créer et pousser le tag
|
||||
git tag -a v1.2.3 -m "Version 1.2.3 - Description"
|
||||
git push origin v1.2.3
|
||||
|
||||
# Puis créer la release via l'interface Gitea
|
||||
```
|
||||
|
||||
## Déroulement Automatique
|
||||
|
||||
1. ✅ Détection de la publication de release
|
||||
2. ✅ Clone du repository
|
||||
3. ✅ Extraction de la version depuis le tag
|
||||
4. ✅ Mise à jour du system.json
|
||||
5. ✅ Création du ZIP
|
||||
6. ✅ Upload sur Gitea
|
||||
7. ✅ Publication sur Foundry VTT
|
||||
|
||||
## Vérification
|
||||
|
||||
Après publication, vérifier :
|
||||
|
||||
1. **Sur Gitea** : `https://www.uberwald.me/gitea/public/fvtt-wasteland/releases`
|
||||
- Le ZIP `fvtt-wasteland.zip` est disponible
|
||||
- Le `system.json` est disponible
|
||||
- Les URLs sont correctes
|
||||
|
||||
2. **Sur Foundry VTT** : https://foundryvtt.com/packages/fvtt-wasteland
|
||||
- La nouvelle version apparaît
|
||||
- Le manifest pointe vers le bon fichier
|
||||
|
||||
3. **Dans Foundry** :
|
||||
- Installer/Mettre à jour le système
|
||||
- Vérifier que tout fonctionne
|
||||
|
||||
## URLs Importantes
|
||||
|
||||
- **Repository**: https://www.uberwald.me/gitea/public/fvtt-wasteland
|
||||
- **Releases**: https://www.uberwald.me/gitea/public/fvtt-wasteland/releases
|
||||
- **Manifest (latest)**: https://www.uberwald.me/gitea/public/fvtt-wasteland/releases/download/latest/system.json
|
||||
- **Foundry Package**: https://foundryvtt.com/packages/fvtt-wasteland
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Le workflow ne se déclenche pas
|
||||
- Vérifier que la release est bien **published** (pas draft)
|
||||
- Vérifier que le fichier `.gitea/workflows/release.yaml` existe
|
||||
|
||||
### Erreur lors de la création du ZIP
|
||||
- Vérifier que tous les dossiers existent
|
||||
- Vérifier les permissions
|
||||
|
||||
### Erreur lors de la publication Foundry
|
||||
- Vérifier que `FOUNDRYVTT_RELEASE_TOKEN` est configuré
|
||||
- Vérifier que l'ID du package est correct (`fvtt-wasteland`)
|
||||
|
||||
### Les URLs ne sont pas mises à jour
|
||||
- Vérifier le format du tag (doit être `vX.Y.Z`)
|
||||
- Vérifier que `microsoft/variable-substitution` fonctionne
|
||||
|
||||
## Exemple de Changelog
|
||||
|
||||
Pour `v1.2.3` :
|
||||
|
||||
```markdown
|
||||
# Version 1.2.3 - Améliorations Fiches Créatures
|
||||
|
||||
## Nouvelles Fonctionnalités
|
||||
- Ajout de dropdowns pour niveaux de compétences créatures
|
||||
- Message de bienvenue stylé
|
||||
- Grille 2x2 pour valeurs de combat
|
||||
|
||||
## Corrections
|
||||
- Fix dialog render error
|
||||
- Fix attribute selection
|
||||
- Fix predilection reroll
|
||||
|
||||
## Améliorations
|
||||
- Interface créature alignée avec personnage
|
||||
- Styles cohérents pour tous les messages
|
||||
- Documentation complète
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Le workflow utilise Ubuntu latest
|
||||
- Go 1.20.1+ est installé pour l'action de release
|
||||
- Le système est compatible avec Foundry V13
|
||||
- Les packs sont inclus dans le ZIP (format NeDB/LevelDB)
|
||||
35
gulpfile.js
Normal file
35
gulpfile.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const gulp = require('gulp');
|
||||
const less = require('gulp-less');
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
// Paths
|
||||
const paths = {
|
||||
styles: {
|
||||
src: 'less/**/*.less',
|
||||
dest: 'styles/'
|
||||
}
|
||||
};
|
||||
|
||||
// Compile LESS to CSS
|
||||
function styles() {
|
||||
return gulp.src('less/wasteland.less')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(less())
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(gulp.dest(paths.styles.dest));
|
||||
}
|
||||
|
||||
// Watch files
|
||||
function watchFiles() {
|
||||
gulp.watch(paths.styles.src, styles);
|
||||
}
|
||||
|
||||
// Define complex tasks
|
||||
const build = gulp.series(styles);
|
||||
const watch = gulp.series(build, watchFiles);
|
||||
|
||||
// Export tasks
|
||||
exports.styles = styles;
|
||||
exports.build = build;
|
||||
exports.watch = watch;
|
||||
exports.default = build;
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"TYPES": {
|
||||
"Item": {
|
||||
"arme": "Arme",
|
||||
@@ -6,6 +6,8 @@
|
||||
"protection": "Protection",
|
||||
"monnaie": "Monnaie",
|
||||
"equipement": "Equipement",
|
||||
"don": "Don",
|
||||
"hubris": "Hubris",
|
||||
"capacite": "Capacité",
|
||||
"origine": "Origine",
|
||||
"heritage": "Héritage",
|
||||
@@ -19,7 +21,7 @@
|
||||
},
|
||||
"Actor": {
|
||||
"personnage": "Personnage",
|
||||
"pnj": "PNJ"
|
||||
"creature": "Créature"
|
||||
}
|
||||
}
|
||||
}
|
||||
1201
less/actor-styles.less
Normal file
1201
less/actor-styles.less
Normal file
File diff suppressed because it is too large
Load Diff
859
less/chat-styles.less
Normal file
859
less/chat-styles.less
Normal file
@@ -0,0 +1,859 @@
|
||||
/* ============================================ */
|
||||
/* WASTELAND CHAT MESSAGE STYLES */
|
||||
/* Post-Apocalyptic Theme */
|
||||
/* ============================================ */
|
||||
|
||||
.wasteland-chat-result {
|
||||
background: linear-gradient(135deg, rgba(50, 40, 30, 0.95) 0%, rgba(30, 25, 20, 0.95) 100%);
|
||||
border: 2px solid #8b7355;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
font-family: "Charlemagne", serif;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
position: relative;
|
||||
|
||||
// Effet de texture sale/usée
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background:
|
||||
repeating-linear-gradient(
|
||||
0deg,
|
||||
transparent,
|
||||
transparent 2px,
|
||||
rgba(0, 0, 0, 0.03) 2px,
|
||||
rgba(0, 0, 0, 0.03) 4px
|
||||
);
|
||||
pointer-events: none;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.chat-result-header {
|
||||
background: linear-gradient(135deg, #3d2f1f 0%, #2a1f15 100%);
|
||||
border-bottom: 2px solid #8b7355;
|
||||
padding: 0.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
position: relative;
|
||||
box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.4);
|
||||
|
||||
// Effet rouille sur le bord
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 2px;
|
||||
background: linear-gradient(90deg,
|
||||
transparent 0%,
|
||||
#6a0606 20%,
|
||||
#8b7355 40%,
|
||||
#6a0606 60%,
|
||||
transparent 100%
|
||||
);
|
||||
}
|
||||
|
||||
.actor-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 2px;
|
||||
border: 2px solid #8b7355;
|
||||
object-fit: cover;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
|
||||
filter: contrast(1.1) saturate(0.9);
|
||||
}
|
||||
|
||||
.header-info {
|
||||
flex: 1;
|
||||
|
||||
.actor-name {
|
||||
margin: 0;
|
||||
color: #e8dcc4;
|
||||
font-size: 1.1rem;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
|
||||
font-family: "Charlemagne", serif;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.action-title {
|
||||
color: #c9a86a;
|
||||
font-size: 0.9rem;
|
||||
margin-top: 0.125rem;
|
||||
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
|
||||
font-style: italic;
|
||||
|
||||
i {
|
||||
margin-right: 0.25rem;
|
||||
color: #8b7355;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.result-main {
|
||||
background: linear-gradient(180deg, rgba(230, 220, 200, 0.9) 0%, rgba(210, 200, 180, 0.9) 100%);
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-bottom: 1px solid rgba(139, 115, 85, 0.5);
|
||||
position: relative;
|
||||
|
||||
&.damage {
|
||||
background: linear-gradient(180deg, rgba(200, 180, 160, 0.95) 0%, rgba(180, 160, 140, 0.95) 100%);
|
||||
}
|
||||
|
||||
.result-display {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.1875rem;
|
||||
|
||||
.dice-result,
|
||||
.total-result,
|
||||
.difficulty {
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
background: linear-gradient(180deg, rgba(50, 40, 30, 0.7) 0%, rgba(40, 30, 20, 0.8) 100%);
|
||||
padding: 0.25rem 0.375rem;
|
||||
border-radius: 2px;
|
||||
border: 2px solid #8b7355;
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
|
||||
i {
|
||||
color: #c9a86a;
|
||||
font-size: 1rem;
|
||||
display: block;
|
||||
margin-bottom: 0.125rem;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dice-value,
|
||||
.total-value,
|
||||
.difficulty-value {
|
||||
font-size: 1.5rem;
|
||||
color: #e8dcc4;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
|
||||
font-weight: bold;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.total-label,
|
||||
.difficulty-label {
|
||||
font-size: 0.75rem;
|
||||
color: #c9a86a;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
line-height: 1.1;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.damage-display {
|
||||
.damage-total {
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, rgba(60, 50, 40, 0.8) 0%, rgba(50, 40, 30, 0.9) 100%);
|
||||
padding: 0.5rem;
|
||||
border-radius: 2px;
|
||||
border: 2px solid #8b7355;
|
||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
|
||||
|
||||
i {
|
||||
color: #c9a86a;
|
||||
font-size: 1.2rem;
|
||||
display: block;
|
||||
margin-bottom: 0.25rem;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
.damage-label {
|
||||
display: block;
|
||||
font-size: 0.85rem;
|
||||
color: #c9a86a;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0.25rem;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
.damage-value {
|
||||
display: block;
|
||||
font-size: 2rem;
|
||||
color: #e8dcc4;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(200, 0, 0, 0.3);
|
||||
font-weight: bold;
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.result-badge-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 0.25rem;
|
||||
|
||||
.result-badge {
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 2px;
|
||||
font-weight: bold;
|
||||
font-size: 0.9rem;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
||||
|
||||
i {
|
||||
margin-right: 0.375rem;
|
||||
}
|
||||
|
||||
&.heroique {
|
||||
background: linear-gradient(135deg, #c9a86a 0%, #8b7355 100%);
|
||||
color: #1a1a1a;
|
||||
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
|
||||
border-color: #8b7355;
|
||||
}
|
||||
|
||||
&.success {
|
||||
background: linear-gradient(135deg, #6b8e23 0%, #4a6017 100%);
|
||||
color: #e8dcc4;
|
||||
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
|
||||
border-color: #4a6017;
|
||||
}
|
||||
|
||||
&.failure {
|
||||
background: linear-gradient(135deg, #5a4a3a 0%, #3a2a1a 100%);
|
||||
color: #c9a86a;
|
||||
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
|
||||
border-color: #3a2a1a;
|
||||
}
|
||||
|
||||
&.dramatique {
|
||||
background: linear-gradient(135deg, #4a0404 0%, #2a0202 100%);
|
||||
color: #e8dcc4;
|
||||
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
|
||||
border-color: #6a0606;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.result-details {
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(180deg, rgba(70, 60, 50, 0.6) 0%, rgba(60, 50, 40, 0.7) 100%);
|
||||
border-top: 1px solid rgba(139, 115, 85, 0.3);
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
|
||||
.details-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.1875rem;
|
||||
|
||||
.detail-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0.1875rem 0.375rem;
|
||||
background: linear-gradient(90deg, rgba(230, 220, 200, 0.6) 0%, rgba(210, 200, 180, 0.5) 100%);
|
||||
border-radius: 1px;
|
||||
font-size: 0.85rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
border-left: 2px solid #8b7355;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
|
||||
&.bonus {
|
||||
background: linear-gradient(90deg, rgba(200, 220, 180, 0.7) 0%, rgba(180, 200, 160, 0.6) 100%);
|
||||
border-left-color: #6b8e23;
|
||||
}
|
||||
|
||||
&.malus {
|
||||
background: linear-gradient(90deg, rgba(220, 180, 160, 0.7) 0%, rgba(200, 160, 140, 0.6) 100%);
|
||||
border-left-color: #8b4513;
|
||||
}
|
||||
|
||||
&.rune {
|
||||
background: linear-gradient(90deg, rgba(190, 180, 210, 0.7) 0%, rgba(170, 160, 190, 0.6) 100%);
|
||||
border-left-color: #6a5acd;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
color: #2a1f15;
|
||||
font-weight: bold;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
color: #2a1f15;
|
||||
font-weight: 500;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.result-effects {
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(180deg, rgba(80, 70, 60, 0.5) 0%, rgba(70, 60, 50, 0.6) 100%);
|
||||
border-top: 1px solid rgba(139, 115, 85, 0.4);
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
|
||||
.effect-success,
|
||||
.effect-warning,
|
||||
.effect-failure,
|
||||
.effect-damage,
|
||||
.effect-heroic {
|
||||
padding: 0.3125rem 0.5rem;
|
||||
margin-bottom: 0.3125rem;
|
||||
background: linear-gradient(90deg, rgba(230, 220, 200, 0.8) 0%, rgba(210, 200, 180, 0.7) 100%);
|
||||
border-radius: 1px;
|
||||
border-left: 3px solid;
|
||||
font-size: 0.85rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.3);
|
||||
|
||||
i {
|
||||
margin-right: 0.375rem;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.effect-success {
|
||||
border-left-color: #6b8e23;
|
||||
color: #2a1f15;
|
||||
}
|
||||
|
||||
.effect-heroic {
|
||||
border-left-color: #c9a86a;
|
||||
color: #2a1f15;
|
||||
font-weight: bold;
|
||||
background: linear-gradient(90deg, rgba(201, 168, 106, 0.3) 0%, rgba(230, 220, 200, 0.8) 100%);
|
||||
}
|
||||
|
||||
.effect-warning {
|
||||
border-left-color: #d97706;
|
||||
color: #2a1f15;
|
||||
}
|
||||
|
||||
.effect-failure {
|
||||
border-left-color: #8b4513;
|
||||
color: #2a1f15;
|
||||
}
|
||||
|
||||
.effect-damage {
|
||||
border-left-color: #6a0606;
|
||||
color: #2a1f15;
|
||||
background: linear-gradient(90deg, rgba(200, 100, 100, 0.3) 0%, rgba(210, 200, 180, 0.7) 100%);
|
||||
}
|
||||
}
|
||||
|
||||
.damage-button-section {
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(180deg, rgba(100, 70, 60, 0.5) 0%, rgba(80, 60, 50, 0.6) 100%);
|
||||
border-top: 1px solid rgba(139, 115, 85, 0.5);
|
||||
|
||||
.chat-card-button {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(to bottom, #6a0606 0%, #4a0404 100%);
|
||||
border: 2px solid #8b7355;
|
||||
border-radius: 2px;
|
||||
color: #e8dcc4;
|
||||
font-size: 0.9rem;
|
||||
font-weight: bold;
|
||||
font-family: "Charlemagne", serif;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(to bottom, #8a0808 0%, #5a0505 100%);
|
||||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
border-color: #c9a86a;
|
||||
}
|
||||
|
||||
i {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.predilection-reroll-section {
|
||||
padding: 0.75rem;
|
||||
background: linear-gradient(135deg, rgba(139, 115, 85, 0.3) 0%, rgba(100, 80, 60, 0.4) 100%);
|
||||
border: 2px solid #8b7355;
|
||||
border-radius: 2px;
|
||||
margin: 0.5rem;
|
||||
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
|
||||
// Cacher toute icône de dé qui pourrait apparaître par erreur
|
||||
.fa-dice {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.predilection-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.75rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: 1px solid rgba(139, 115, 85, 0.5);
|
||||
|
||||
i {
|
||||
color: #c9a86a;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.predilection-title {
|
||||
color: #e8dcc4;
|
||||
font-weight: bold;
|
||||
font-size: 1rem;
|
||||
font-family: "Charlemagne", serif;
|
||||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.predilection-results {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
|
||||
.predilection-roll {
|
||||
flex: 1;
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(90deg, rgba(230, 220, 200, 0.4) 0%, rgba(210, 200, 180, 0.3) 100%);
|
||||
border-radius: 2px;
|
||||
border-left: 2px solid #8b7355;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
position: relative;
|
||||
|
||||
&.kept {
|
||||
background: linear-gradient(90deg, rgba(200, 220, 180, 0.6) 0%, rgba(180, 200, 160, 0.5) 100%);
|
||||
border-left-color: #6b8e23;
|
||||
box-shadow: 0 0 8px rgba(107, 142, 35, 0.3);
|
||||
}
|
||||
|
||||
.roll-label {
|
||||
color: #2a1f15;
|
||||
font-weight: bold;
|
||||
font-size: 0.75rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
.roll-value {
|
||||
color: #2a1f15;
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
i.fa-check-circle {
|
||||
color: #6b8e23;
|
||||
font-size: 1.1rem;
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.predilection-kept {
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(90deg, rgba(200, 220, 180, 0.7) 0%, rgba(180, 200, 160, 0.6) 100%);
|
||||
border: 1px solid #6b8e23;
|
||||
border-radius: 2px;
|
||||
text-align: center;
|
||||
color: #2a1f15;
|
||||
font-size: 0.95rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
|
||||
i {
|
||||
color: #6b8e23;
|
||||
}
|
||||
|
||||
.kept-label {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
strong {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.predilection-section {
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(180deg, rgba(100, 90, 70, 0.5) 0%, rgba(80, 70, 60, 0.6) 100%);
|
||||
border-top: 1px solid rgba(139, 115, 85, 0.5);
|
||||
|
||||
.chat-card-button {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(to bottom, #5a4a3a 0%, #3a2a1a 100%);
|
||||
border: 2px solid #8b7355;
|
||||
border-radius: 2px;
|
||||
color: #e8dcc4;
|
||||
font-size: 0.9rem;
|
||||
font-weight: bold;
|
||||
font-family: "Charlemagne", serif;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(to bottom, #6a5a4a 0%, #4a3a2a 100%);
|
||||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
border-color: #c9a86a;
|
||||
}
|
||||
|
||||
i {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ============================================ */
|
||||
/* WASTELAND ITEM CHAT POSTS */
|
||||
/* ============================================ */
|
||||
|
||||
.wasteland-chat-item {
|
||||
background: linear-gradient(135deg, rgba(50, 40, 30, 0.95) 0%, rgba(30, 25, 20, 0.95) 100%);
|
||||
border: 2px solid #8b7355;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
font-family: "Charlemagne", serif;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
position: relative;
|
||||
|
||||
// Effet de texture sale/usée
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background:
|
||||
repeating-linear-gradient(
|
||||
0deg,
|
||||
transparent,
|
||||
transparent 2px,
|
||||
rgba(0, 0, 0, 0.03) 2px,
|
||||
rgba(0, 0, 0, 0.03) 4px
|
||||
);
|
||||
pointer-events: none;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.chat-item-header {
|
||||
background: linear-gradient(135deg, #3d2f1f 0%, #2a1f15 100%);
|
||||
border-bottom: 2px solid #8b7355;
|
||||
padding: 0.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
position: relative;
|
||||
box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.4);
|
||||
|
||||
// Effet rouille sur le bord
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 2px;
|
||||
background: linear-gradient(90deg,
|
||||
transparent 0%,
|
||||
#6a0606 20%,
|
||||
#8b7355 40%,
|
||||
#6a0606 60%,
|
||||
transparent 100%
|
||||
);
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 2px;
|
||||
border: 2px solid #8b7355;
|
||||
object-fit: cover;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
|
||||
filter: contrast(1.1) saturate(0.9);
|
||||
}
|
||||
|
||||
.header-info {
|
||||
flex: 1;
|
||||
|
||||
.item-name {
|
||||
margin: 0;
|
||||
color: #e8dcc4;
|
||||
font-size: 1.1rem;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
|
||||
font-weight: bold;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.item-type {
|
||||
margin-top: 0.25rem;
|
||||
color: #c9a86a;
|
||||
font-size: 0.85rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
text-transform: capitalize;
|
||||
|
||||
i {
|
||||
color: #8b7355;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chat-item-body {
|
||||
padding: 0.75rem;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
.item-description {
|
||||
color: #e8dcc4;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 0.75rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
|
||||
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-properties {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.75rem;
|
||||
padding-top: 0.75rem;
|
||||
border-top: 1px solid rgba(139, 115, 85, 0.3);
|
||||
|
||||
.property {
|
||||
background: linear-gradient(90deg, rgba(230, 220, 200, 0.6) 0%, rgba(210, 200, 180, 0.5) 100%);
|
||||
padding: 0.375rem 0.5rem;
|
||||
border-radius: 1px;
|
||||
border-left: 2px solid #8b7355;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.property-label {
|
||||
color: #2a1f15;
|
||||
font-weight: bold;
|
||||
font-size: 0.85rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
.property-value {
|
||||
color: #2a1f15;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ============================================ */
|
||||
/* WASTELAND WELCOME MESSAGE */
|
||||
/* ============================================ */
|
||||
|
||||
.wasteland-welcome-message {
|
||||
background: linear-gradient(135deg, rgba(61, 47, 31, 0.15) 0%, rgba(42, 31, 21, 0.2) 100%);
|
||||
border: 2px solid #6a0606;
|
||||
border-radius: 8px;
|
||||
padding: 0;
|
||||
margin: 8px 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
|
||||
inset 0 1px 0 rgba(201, 168, 106, 0.1);
|
||||
font-family: "Charlemagne", serif;
|
||||
|
||||
.welcome-header {
|
||||
background: linear-gradient(135deg, #6a0606 0%, #4a0404 100%);
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
border-bottom: 2px solid #c9a86a;
|
||||
position: relative;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
|
||||
.welcome-icon {
|
||||
font-size: 1.8rem;
|
||||
color: #c9a86a;
|
||||
margin-bottom: 4px;
|
||||
text-shadow: 0 0 10px rgba(201, 168, 106, 0.5);
|
||||
animation: pulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.welcome-title {
|
||||
margin: 4px 0 2px 0;
|
||||
font-size: 1.3rem;
|
||||
font-weight: bold;
|
||||
color: #e8dcc4;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
|
||||
font-family: "Charlemagne", serif;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.welcome-subtitle {
|
||||
font-size: 0.9rem;
|
||||
color: #c9a86a;
|
||||
font-style: italic;
|
||||
margin-top: 2px;
|
||||
line-height: 1.2;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
.welcome-content {
|
||||
padding: 12px;
|
||||
background: linear-gradient(180deg, rgba(230, 220, 200, 0.9) 0%, rgba(210, 200, 180, 0.85) 100%);
|
||||
|
||||
.welcome-section {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding: 8px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-radius: 4px;
|
||||
border: 1px solid #c9a86a;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.section-icon {
|
||||
flex-shrink: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #6a0606 0%, #4a0404 100%);
|
||||
color: #c9a86a;
|
||||
border-radius: 50%;
|
||||
font-size: 1rem;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
|
||||
i {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.section-text {
|
||||
flex: 1;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
color: #3d2f1f;
|
||||
margin-bottom: 4px;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
line-height: 1.4;
|
||||
color: #2a1f15;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.welcome-link {
|
||||
display: inline-block;
|
||||
margin-top: 4px;
|
||||
color: #6a0606;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
font-size: 0.9rem;
|
||||
|
||||
i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: #8b0606;
|
||||
text-shadow: 0 0 4px rgba(106, 6, 6, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.welcome-footer {
|
||||
background: linear-gradient(135deg, #4a0404 0%, #6a0606 100%);
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
color: #c9a86a;
|
||||
font-style: italic;
|
||||
font-size: 0.95rem;
|
||||
border-top: 1px solid #8b7355;
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
|
||||
font-family: "Charlemagne", serif;
|
||||
|
||||
i {
|
||||
margin: 0 8px;
|
||||
opacity: 0.7;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
span {
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
transform: scale(1.05);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
569
less/item-styles.less
Normal file
569
less/item-styles.less
Normal file
@@ -0,0 +1,569 @@
|
||||
/* ==================== Item Sheet Styles ==================== */
|
||||
|
||||
/* Item header with image and name */
|
||||
.fvtt-wasteland.item {
|
||||
/* Background pour toute la fiche d'item */
|
||||
background: url("../assets/ui/pc_sheet_bg.webp") repeat;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
/* AppV2 - Remove window content padding */
|
||||
.window-content {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* AppV2 - Main section structure */
|
||||
section {
|
||||
background: url("../assets/ui/pc_sheet_bg.webp") repeat-y;
|
||||
color: black;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* AppV2 Item Sheets - Disabled inputs readability */
|
||||
input:disabled,
|
||||
select:disabled {
|
||||
color: #000000;
|
||||
opacity: 0.8;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
/* Inputs and selects styling */
|
||||
input[type="text"],
|
||||
input[type="number"],
|
||||
select {
|
||||
color: #000000;
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
border: 1px solid #999999;
|
||||
margin: 0;
|
||||
padding: 2px 4px;
|
||||
font-family: "Charlemagne", serif;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin: 0;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin: 0 4px;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
flex: 0 0 auto;
|
||||
border-bottom: 1px solid #999;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sheet-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 0.5rem;
|
||||
background: url("../assets/ui/pc_sheet_bg.webp") repeat;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.item-sheet-img {
|
||||
flex: 0 0 100px;
|
||||
height: 100px;
|
||||
border: 2px solid #999;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.item-sheet-title {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 1.5rem;
|
||||
border-bottom: none;
|
||||
|
||||
input {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 1.5rem;
|
||||
font-family: "Charlemagne", serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.item-subtitle {
|
||||
font-size: 0.9rem;
|
||||
color: #666;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
/* Navigation tabs - Modern style */
|
||||
nav.tabs {
|
||||
display: flex;
|
||||
border-bottom: 2px solid #403f3e;
|
||||
margin: 0;
|
||||
padding: 4px 8px;
|
||||
background: linear-gradient(to bottom, #2a2520 0%, #1a1510 100%);
|
||||
flex: 0 0 auto;
|
||||
gap: 4px;
|
||||
|
||||
a.item {
|
||||
padding: 8px 16px;
|
||||
color: rgba(218, 218, 218, 0.85);
|
||||
text-decoration: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 6px 6px 0 0;
|
||||
font-family: "Charlemagne", serif;
|
||||
font-size: 0.9rem;
|
||||
font-weight: normal;
|
||||
transition: all 0.3s ease;
|
||||
background: rgba(64, 63, 62, 0.3);
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
|
||||
i {
|
||||
display: none; // Hide icons for cleaner look
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(74, 4, 4, 0.4);
|
||||
color: #f5f5f5;
|
||||
border-color: rgba(218, 218, 218, 0.2);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(to bottom, #4a0404 0%, #3a0303 100%);
|
||||
border: 1px solid transparent;
|
||||
color: #f5f5f5;
|
||||
font-weight: bold;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Tab content */
|
||||
.tab {
|
||||
display: none;
|
||||
padding: 8px 12px;
|
||||
overflow-y: auto;
|
||||
flex: 1 1 auto;
|
||||
|
||||
&.active {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sheet body - scrollable content */
|
||||
.sheet-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 1rem;
|
||||
|
||||
&[data-tab] {
|
||||
display: none;
|
||||
|
||||
&.active {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dans l'onglet details, les form-group sont horizontaux par défaut */
|
||||
&[data-tab="details"] {
|
||||
.form-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
font-size: 0.9rem;
|
||||
color: #464331;
|
||||
flex: 0 0 auto;
|
||||
min-width: 160px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="number"],
|
||||
select,
|
||||
textarea {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
flex: 0 0 auto;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
/* Checkbox avec label après (pas avant) */
|
||||
&:has(input[type="checkbox"]:first-child) {
|
||||
label {
|
||||
min-width: auto;
|
||||
flex: 1;
|
||||
order: 2;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
order: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Exception: quand le label contient lui-même le checkbox */
|
||||
label:has(input[type="checkbox"]) {
|
||||
min-width: auto;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Pour les sections avec grilles, garder le comportement vertical */
|
||||
.grid .form-group {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.25rem;
|
||||
|
||||
label {
|
||||
min-width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Form groups - comportement par défaut pour autres onglets */
|
||||
.form-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
font-size: 0.9rem;
|
||||
color: #464331;
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
|
||||
label {
|
||||
flex: 0 0 auto;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
input, select, textarea {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Grid layouts */
|
||||
.grid {
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
margin: 0.5rem 0;
|
||||
|
||||
&.grid-2col {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
&.grid-3col {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
|
||||
&.grid-4col {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Editor content */
|
||||
.editor-content {
|
||||
min-height: 200px;
|
||||
border: 1px solid #999;
|
||||
padding: 0.5rem;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Actions buttons */
|
||||
.item-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
margin-top: 1rem;
|
||||
padding-top: 0.5rem;
|
||||
border-top: 1px solid #999;
|
||||
|
||||
button {
|
||||
flex: 1;
|
||||
padding: 0.5rem 1rem;
|
||||
background: rgba(74, 4, 4, 0.8);
|
||||
color: white;
|
||||
border: 1px solid #000;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-family: "Charlemagne", serif;
|
||||
font-size: 0.9rem;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: rgba(74, 4, 4, 1);
|
||||
box-shadow: 0 0 8px rgba(74, 4, 4, 0.6);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Rollable elements */
|
||||
.rollable {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #ff6600;
|
||||
text-shadow: 0 0 8px rgba(255, 102, 0, 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
/* Item-specific sections */
|
||||
.item-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
|
||||
.detail-section {
|
||||
padding: 0.5rem;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border: 1px solid #999;
|
||||
border-radius: 4px;
|
||||
|
||||
h3 {
|
||||
margin: 0 0 0.5rem 0;
|
||||
padding-bottom: 0.25rem;
|
||||
border-bottom: 1px solid #999;
|
||||
font-size: 1.1rem;
|
||||
color: #2a1510;
|
||||
font-family: "Charlemagne", serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Specific item type styles */
|
||||
.fvtt-wasteland.item {
|
||||
&.arme-content,
|
||||
&.bouclier-content {
|
||||
.weapon-stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 0.5rem;
|
||||
|
||||
.stat-box {
|
||||
padding: 0.5rem;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border: 1px solid #999;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
|
||||
.stat-label {
|
||||
font-size: 0.8rem;
|
||||
color: #666;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.competence-content {
|
||||
.predilections-container {
|
||||
margin-top: 0.5rem;
|
||||
|
||||
.no-predilections {
|
||||
text-align: center;
|
||||
font-style: italic;
|
||||
color: #999;
|
||||
padding: 1rem;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.predilections-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 0.75rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
|
||||
.predilection-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.5rem;
|
||||
background: rgba(42, 37, 32, 0.3);
|
||||
border: 1px solid rgba(106, 6, 6, 0.3);
|
||||
border-radius: 4px;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: rgba(42, 37, 32, 0.5);
|
||||
border-color: rgba(106, 6, 6, 0.5);
|
||||
}
|
||||
|
||||
.predilection-main {
|
||||
flex: 1;
|
||||
|
||||
.predilection-name {
|
||||
width: 100%;
|
||||
padding: 0.375rem 0.5rem;
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
font-family: inherit;
|
||||
|
||||
&::placeholder {
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: #6a0606;
|
||||
box-shadow: 0 0 0 2px rgba(106, 6, 6, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.predilection-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex-shrink: 0;
|
||||
|
||||
.predilection-used {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
white-space: nowrap;
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 0.9rem;
|
||||
color: rgba(218, 218, 218, 0.85);
|
||||
}
|
||||
|
||||
&:hover span {
|
||||
color: rgba(218, 218, 218, 1);
|
||||
}
|
||||
}
|
||||
|
||||
.predilection-delete {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
padding: 0;
|
||||
background: rgba(106, 6, 6, 0.6);
|
||||
border: 1px solid rgba(106, 6, 6, 0.8);
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
i {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(106, 6, 6, 0.9);
|
||||
border-color: #6a0606;
|
||||
transform: scale(1.05);
|
||||
|
||||
i {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add-predilection-btn {
|
||||
width: 100%;
|
||||
padding: 0.5rem 1rem;
|
||||
background: linear-gradient(to bottom, #4a0404 0%, #3a0303 100%);
|
||||
border: 1px solid #6a0606;
|
||||
border-radius: 4px;
|
||||
color: rgba(218, 218, 218, 0.95);
|
||||
font-family: "Charlemagne", serif;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
|
||||
i {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(to bottom, #5a0505 0%, #4a0404 100%);
|
||||
border-color: #8a0808;
|
||||
color: #fff;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
311
less/roll-dialog-styles.less
Normal file
311
less/roll-dialog-styles.less
Normal file
@@ -0,0 +1,311 @@
|
||||
/* ============================================ */
|
||||
/* WASTELAND ROLL DIALOG STYLES */
|
||||
/* ============================================ */
|
||||
|
||||
.wasteland-roll-dialog {
|
||||
background: url("../assets/ui/pc_sheet_bg.webp") repeat;
|
||||
|
||||
.window-content {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(to bottom, #4a0404 0%, #3a0303 100%);
|
||||
border-bottom: 2px solid #6a0606;
|
||||
margin: -0.5rem -0.5rem 0.5rem -0.5rem;
|
||||
|
||||
.actor-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 2px solid #6a0606;
|
||||
border-radius: 4px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
flex: 1;
|
||||
color: #f5f5f5;
|
||||
|
||||
h3 {
|
||||
margin: 0 0 0.15rem 0;
|
||||
font-size: 1rem;
|
||||
font-family: "Charlemagne", serif;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.competence-name {
|
||||
font-size: 0.85rem;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-style: italic;
|
||||
|
||||
.attribut-info {
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
padding: 0 0.5rem 0.5rem 0.5rem;
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 0.4rem;
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 0.2rem;
|
||||
font-weight: bold;
|
||||
font-size: 0.85rem;
|
||||
color: #2a1510;
|
||||
font-family: "Charlemagne", serif;
|
||||
}
|
||||
|
||||
select,
|
||||
input[type="number"] {
|
||||
width: 100%;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border: 1px solid #6a0606;
|
||||
border-radius: 3px;
|
||||
padding: 0.3rem 0.4rem;
|
||||
font-size: 0.85rem;
|
||||
color: #1a1510;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
border-color: #aa0a0a;
|
||||
box-shadow: 0 0 4px rgba(170, 10, 10, 0.3);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modifiers-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.4rem;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.attributes-section {
|
||||
background: rgba(106, 6, 6, 0.1);
|
||||
border: 1px solid #6a0606;
|
||||
border-radius: 4px;
|
||||
padding: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
label {
|
||||
color: #6a0606;
|
||||
}
|
||||
}
|
||||
|
||||
.special-option {
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
background: rgba(106, 6, 6, 0.05);
|
||||
border: 2px solid #6a0606;
|
||||
border-radius: 4px;
|
||||
|
||||
.checkbox-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
|
||||
&.highlight {
|
||||
span {
|
||||
font-weight: bold;
|
||||
color: #6a0606;
|
||||
font-family: "Charlemagne", serif;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
cursor: pointer;
|
||||
accent-color: #6a0606;
|
||||
}
|
||||
|
||||
span {
|
||||
flex: 1;
|
||||
font-size: 0.85rem;
|
||||
color: #2a1510;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Weapon Section */
|
||||
.weapon-section {
|
||||
background: rgba(139, 101, 8, 0.1);
|
||||
padding: 0.5rem;
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(139, 101, 8, 0.4);
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
.weapon-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.4rem 0.5rem;
|
||||
background: rgba(139, 101, 8, 0.15);
|
||||
border-radius: 3px;
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
.weapon-label {
|
||||
font-weight: bold;
|
||||
font-size: 0.9rem;
|
||||
color: #2a1510;
|
||||
font-family: "Charlemagne", serif;
|
||||
}
|
||||
|
||||
.weapon-bonus {
|
||||
font-size: 0.85rem;
|
||||
color: #8b0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.defense-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.4rem 0.5rem;
|
||||
background: rgba(0, 100, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
.defense-label {
|
||||
font-size: 0.85rem;
|
||||
color: #2a1510;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.defense-value {
|
||||
font-size: 1rem;
|
||||
color: #006400;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Combat Modifiers */
|
||||
.combat-modifiers,
|
||||
.ranged-combat-section {
|
||||
background: rgba(139, 69, 19, 0.1);
|
||||
padding: 0.5rem;
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(139, 69, 19, 0.4);
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
h4 {
|
||||
margin: 0 0 0.5rem 0;
|
||||
color: #2a1510;
|
||||
font-size: 0.9rem;
|
||||
font-weight: bold;
|
||||
font-family: "Charlemagne", serif;
|
||||
text-transform: uppercase;
|
||||
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.checkbox-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
padding: 0.3rem 0.4rem;
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 0.3rem;
|
||||
transition: background 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: auto;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
accent-color: #8b4513;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #2a1510;
|
||||
font-size: 0.85rem;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
||||
.info-message {
|
||||
padding: 0.4rem 0.6rem;
|
||||
background: rgba(201, 168, 106, 0.2);
|
||||
border-left: 3px solid rgba(201, 168, 106, 0.8);
|
||||
border-radius: 3px;
|
||||
font-size: 0.85rem;
|
||||
color: #2a1510;
|
||||
margin-bottom: 0.5rem;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
.modifiers-columns {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.3rem 0.6rem;
|
||||
}
|
||||
}
|
||||
|
||||
// Styles pour les boutons du dialog
|
||||
.dialog-buttons {
|
||||
display: flex;
|
||||
gap: 0.4rem;
|
||||
padding: 0.5rem;
|
||||
border-top: 1px solid #6a0606;
|
||||
margin: 0.5rem -0.5rem -0.5rem -0.5rem;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
|
||||
button {
|
||||
flex: 1;
|
||||
padding: 0.5rem 0.75rem;
|
||||
background: linear-gradient(to bottom, #4a0404 0%, #3a0303 100%);
|
||||
border: 1px solid #6a0606;
|
||||
border-radius: 3px;
|
||||
color: #f5f5f5;
|
||||
font-size: 0.85rem;
|
||||
font-weight: bold;
|
||||
font-family: "Charlemagne", serif;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(to bottom, #5a0505 0%, #4a0404 100%);
|
||||
box-shadow: 0 0 6px rgba(106, 6, 6, 0.6);
|
||||
}
|
||||
|
||||
&.default {
|
||||
border-width: 2px;
|
||||
border-color: #aa0a0a;
|
||||
}
|
||||
|
||||
i {
|
||||
margin-right: 0.4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1365
less/simple-converted.less
Normal file
1365
less/simple-converted.less
Normal file
File diff suppressed because it is too large
Load Diff
8
less/wasteland.less
Normal file
8
less/wasteland.less
Normal file
@@ -0,0 +1,8 @@
|
||||
// Main LESS file for Wasteland system
|
||||
// Importing base styles and component-specific styles
|
||||
|
||||
@import "simple-converted";
|
||||
@import "item-styles";
|
||||
@import "actor-styles";
|
||||
@import "roll-dialog-styles";
|
||||
@import "chat-styles";
|
||||
27
modules/applications/sheets/_module.mjs
Normal file
27
modules/applications/sheets/_module.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Index des applications AppV2 pour Wasteland
|
||||
* Ce fichier centralise tous les exports des applications
|
||||
*/
|
||||
|
||||
// Applications de feuilles d'acteurs
|
||||
export { default as WastelandPersonnageSheet } from './wasteland-personnage-sheet.mjs';
|
||||
export { default as WastelandCreatureSheet } from './wasteland-creature-sheet.mjs';
|
||||
|
||||
// Applications de feuilles d'items
|
||||
export { default as WastelandArmeSheet } from './wasteland-arme-sheet.mjs';
|
||||
export { default as WastelandArtifexSheet } from './wasteland-artifex-sheet.mjs';
|
||||
export { default as WastelandBouclierSheet } from './wasteland-bouclier-sheet.mjs';
|
||||
export { default as WastelandCapaciteSheet } from './wasteland-capacite-sheet.mjs';
|
||||
export { default as WastelandCharmeSheet } from './wasteland-charme-sheet.mjs';
|
||||
export { default as WastelandCompetenceSheet } from './wasteland-competence-sheet.mjs';
|
||||
export { default as WastelandDonSheet } from './wasteland-don-sheet.mjs';
|
||||
export { default as WastelandEquipementSheet } from './wasteland-equipement-sheet.mjs';
|
||||
export { default as WastelandHeritageSheet } from './wasteland-heritage-sheet.mjs';
|
||||
export { default as WastelandHubrisSheet } from './wasteland-hubris-sheet.mjs';
|
||||
export { default as WastelandMetierSheet } from './wasteland-metier-sheet.mjs';
|
||||
export { default as WastelandMonnaieSheet } from './wasteland-monnaie-sheet.mjs';
|
||||
export { default as WastelandMutationSheet } from './wasteland-mutation-sheet.mjs';
|
||||
export { default as WastelandOrigineSheet } from './wasteland-origine-sheet.mjs';
|
||||
export { default as WastelandPeupleSheet } from './wasteland-peuple-sheet.mjs';
|
||||
export { default as WastelandPouvoirSheet } from './wasteland-pouvoir-sheet.mjs';
|
||||
export { default as WastelandProtectionSheet } from './wasteland-protection-sheet.mjs';
|
||||
382
modules/applications/sheets/base-actor-sheet.mjs
Normal file
382
modules/applications/sheets/base-actor-sheet.mjs
Normal file
@@ -0,0 +1,382 @@
|
||||
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||
|
||||
import { WastelandUtility } from "../../wasteland-utility.js"
|
||||
|
||||
export default class WastelandActorSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ActorSheetV2) {
|
||||
/**
|
||||
* Different sheet modes.
|
||||
* @enum {number}
|
||||
*/
|
||||
static SHEET_MODES = { EDIT: 0, PLAY: 1 }
|
||||
|
||||
constructor(options = {}) {
|
||||
super(options)
|
||||
this.#dragDrop = this.#createDragDropHandlers()
|
||||
this._sheetMode = this.constructor.SHEET_MODES.PLAY
|
||||
}
|
||||
|
||||
#dragDrop
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["fvtt-wasteland", "sheet", "actor"],
|
||||
position: {
|
||||
width: 650,
|
||||
height: 720,
|
||||
},
|
||||
form: {
|
||||
submitOnChange: true,
|
||||
closeOnSubmit: false,
|
||||
},
|
||||
window: {
|
||||
resizable: true,
|
||||
},
|
||||
tabs: [
|
||||
{
|
||||
navSelector: 'nav[data-group="primary"]',
|
||||
contentSelector: "section.sheet-body",
|
||||
initial: "stats",
|
||||
},
|
||||
],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
|
||||
actions: {
|
||||
editImage: WastelandActorSheet.#onEditImage,
|
||||
toggleSheet: WastelandActorSheet.#onToggleSheet,
|
||||
editItem: WastelandActorSheet.#onEditItem,
|
||||
deleteItem: WastelandActorSheet.#onDeleteItem,
|
||||
createItem: WastelandActorSheet.#onCreateItem,
|
||||
equipItem: WastelandActorSheet.#onEquipItem,
|
||||
modifyQuantity: WastelandActorSheet.#onModifyQuantity,
|
||||
incDecSante: WastelandActorSheet.#onIncDecSante,
|
||||
rollAttribut: WastelandActorSheet.#onRollAttribut,
|
||||
rollCompetence: WastelandActorSheet.#onRollCompetence,
|
||||
rollCharme: WastelandActorSheet.#onRollCharme,
|
||||
rollPouvoir: WastelandActorSheet.#onRollPouvoir,
|
||||
rollArmeOffensif: WastelandActorSheet.#onRollArmeOffensif,
|
||||
rollArmeDegats: WastelandActorSheet.#onRollArmeDegats,
|
||||
resetPredilections: WastelandActorSheet.#onResetPredilections,
|
||||
rollAssommer: WastelandActorSheet.#onRollAssommer,
|
||||
rollFuir: WastelandActorSheet.#onRollFuir,
|
||||
rollImmobiliser: WastelandActorSheet.#onRollImmobiliser,
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the sheet currently in 'Play' mode?
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isPlayMode() {
|
||||
if (this._sheetMode === undefined) this._sheetMode = this.constructor.SHEET_MODES.PLAY
|
||||
return this._sheetMode === this.constructor.SHEET_MODES.PLAY
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the sheet currently in 'Edit' mode?
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isEditMode() {
|
||||
if (this._sheetMode === undefined) this._sheetMode = this.constructor.SHEET_MODES.PLAY
|
||||
return this._sheetMode === this.constructor.SHEET_MODES.EDIT
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab groups state
|
||||
* @type {object}
|
||||
*/
|
||||
tabGroups = { primary: "stats" }
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const actor = this.document
|
||||
|
||||
const context = {
|
||||
actor: actor,
|
||||
system: actor.system,
|
||||
source: actor.toObject(),
|
||||
fields: actor.schema.fields,
|
||||
systemFields: actor.system.schema.fields,
|
||||
isEditable: this.isEditable,
|
||||
isEditMode: this.isEditMode,
|
||||
isPlayMode: this.isPlayMode,
|
||||
isGM: game.user.isGM,
|
||||
config: game.system.wasteland.config,
|
||||
enrichedDescription: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.description || "", { async: true }),
|
||||
enrichedComportement: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.comportement || "", { async: true }),
|
||||
enrichedHabitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.habitat || "", { async: true }),
|
||||
}
|
||||
return context
|
||||
}
|
||||
|
||||
/** @override */
|
||||
_onRender(context, options) {
|
||||
super._onRender(context, options)
|
||||
this.#dragDrop.forEach((d) => d.bind(this.element))
|
||||
|
||||
// Handle edit-item-data changes
|
||||
this.element.querySelectorAll('.edit-item-data').forEach(element => {
|
||||
element.addEventListener('change', async (event) => {
|
||||
const target = event.currentTarget
|
||||
const itemElement = target.closest('[data-item-id]')
|
||||
if (!itemElement) return
|
||||
|
||||
const itemId = itemElement.dataset.itemId
|
||||
const itemType = itemElement.dataset.itemType
|
||||
const itemField = target.dataset.itemField
|
||||
const dataType = target.dataset.dtype
|
||||
const value = target.value
|
||||
|
||||
await this.document.editItemField(itemId, itemType, itemField, dataType, value)
|
||||
})
|
||||
})
|
||||
|
||||
// Activate tab navigation manually
|
||||
const nav = this.element.querySelector('nav.tabs[data-group]')
|
||||
if (nav) {
|
||||
const group = nav.dataset.group
|
||||
// Activate the current tab
|
||||
const activeTab = this.tabGroups[group] || "stats"
|
||||
nav.querySelectorAll('[data-tab]').forEach(link => {
|
||||
const tab = link.dataset.tab
|
||||
link.classList.toggle('active', tab === activeTab)
|
||||
link.addEventListener('click', (event) => {
|
||||
event.preventDefault()
|
||||
this.tabGroups[group] = tab
|
||||
this.render()
|
||||
})
|
||||
})
|
||||
|
||||
// Show/hide tab content
|
||||
this.element.querySelectorAll('[data-group="' + group + '"][data-tab]').forEach(content => {
|
||||
content.classList.toggle('active', content.dataset.tab === activeTab)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// #region Drag-and-Drop Workflow
|
||||
/**
|
||||
* Create drag-and-drop workflow handlers for this Application
|
||||
*/
|
||||
#createDragDropHandlers() {
|
||||
return []
|
||||
}
|
||||
|
||||
// #region Actions
|
||||
|
||||
/**
|
||||
* Handle editing the actor image
|
||||
* @param {Event} event - The triggering event
|
||||
*/
|
||||
static async #onEditImage(event) {
|
||||
event.preventDefault()
|
||||
const sheet = this
|
||||
const filePicker = new FilePicker({
|
||||
type: "image",
|
||||
current: sheet.document.img,
|
||||
callback: (path) => {
|
||||
sheet.document.update({ img: path })
|
||||
},
|
||||
})
|
||||
filePicker.browse()
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle toggling the sheet mode
|
||||
* @param {Event} event - The triggering event
|
||||
*/
|
||||
static async #onToggleSheet(event) {
|
||||
event.preventDefault()
|
||||
const sheet = this
|
||||
sheet._sheetMode = sheet._sheetMode === sheet.constructor.SHEET_MODES.PLAY ? sheet.constructor.SHEET_MODES.EDIT : sheet.constructor.SHEET_MODES.PLAY
|
||||
sheet.render()
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle editing an item
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onEditItem(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
if (!itemId) return
|
||||
const item = this.actor.items.get(itemId)
|
||||
if (item) item.sheet.render(true)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deleting an item
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onDeleteItem(event, target) {
|
||||
const li = target.closest(".item")
|
||||
await WastelandUtility.confirmDelete(this, li)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle creating an item
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onCreateItem(event, target) {
|
||||
const itemType = target.dataset.type
|
||||
await this.actor.createEmbeddedDocuments("Item", [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle equipping an item
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onEquipItem(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
if (!itemId) return
|
||||
await this.actor.equipItem(itemId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle modifying item quantity
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onModifyQuantity(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
if (!itemId) return
|
||||
|
||||
const item = this.actor.items.get(itemId)
|
||||
if (!item) return
|
||||
|
||||
const qty = parseInt(target.dataset.qty) || 0
|
||||
const currentQty = item.system.quantite || 0
|
||||
const newQty = Math.max(0, currentQty + qty)
|
||||
|
||||
await item.update({ 'system.quantite': newQty })
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle modifying santé/psyché
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onIncDecSante(event, target) {
|
||||
const field = target.dataset.field
|
||||
const value = parseInt(target.dataset.value) || 0
|
||||
|
||||
if (field === 'psyche') {
|
||||
await this.actor.update({ 'system.psyche.value': this.actor.system.psyche.value + value })
|
||||
} else if (field === 'nonletaux') {
|
||||
await this.actor.update({ 'system.sante.nonletaux': this.actor.system.sante.nonletaux + value })
|
||||
} else if (field === 'letaux') {
|
||||
await this.actor.update({ 'system.sante.letaux': this.actor.system.sante.letaux + value })
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle rolling an attribute
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollAttribut(event, target) {
|
||||
const attrKey = target.dataset.attrKey
|
||||
await this.actor.rollAttribut(attrKey)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle rolling a competence
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollCompetence(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
const attrKey = target.dataset.attrKey
|
||||
if (!itemId) return
|
||||
await this.actor.rollCompetence(attrKey, itemId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle rolling a charme
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollCharme(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
if (!itemId) return
|
||||
await this.actor.rollCharme(itemId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle rolling a pouvoir
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollPouvoir(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
if (!itemId) return
|
||||
await this.actor.rollPouvoir(itemId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle rolling weapon attack
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollArmeOffensif(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
if (!itemId) return
|
||||
await this.actor.rollArmeOffensif(itemId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle rolling weapon damage
|
||||
* @param {Event} event - The triggering event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollArmeDegats(event, target) {
|
||||
const li = target.closest(".item")
|
||||
const itemId = li?.dataset.itemId
|
||||
if (!itemId) return
|
||||
await this.actor.rollArmeDegats(itemId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle resetting all predilections
|
||||
* @param {Event} event - The originating click event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onResetPredilections(event, target) {
|
||||
await this.actor.resetAllPredilections()
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle Assommer roll
|
||||
* @param {Event} event - The originating click event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollAssommer(event, target) {
|
||||
await this.actor.rollAssommer()
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle Fuir roll
|
||||
* @param {Event} event - The originating click event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollFuir(event, target) {
|
||||
await this.actor.rollFuir()
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle Immobiliser roll
|
||||
* @param {Event} event - The originating click event
|
||||
* @param {HTMLElement} target - The target element
|
||||
*/
|
||||
static async #onRollImmobiliser(event, target) {
|
||||
await this.actor.rollImmobiliser()
|
||||
}
|
||||
}
|
||||
158
modules/applications/sheets/base-item-sheet.mjs
Normal file
158
modules/applications/sheets/base-item-sheet.mjs
Normal file
@@ -0,0 +1,158 @@
|
||||
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||
|
||||
export default class WastelandItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
||||
constructor(options = {}) {
|
||||
super(options)
|
||||
this.#dragDrop = this.#createDragDropHandlers()
|
||||
}
|
||||
|
||||
#dragDrop
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["fvtt-wasteland", "item"],
|
||||
position: {
|
||||
width: 620,
|
||||
height: 600,
|
||||
},
|
||||
form: {
|
||||
submitOnChange: true,
|
||||
},
|
||||
window: {
|
||||
resizable: true,
|
||||
},
|
||||
tabs: [
|
||||
{
|
||||
navSelector: 'nav[data-group="primary"]',
|
||||
contentSelector: "section.sheet-body",
|
||||
initial: "description",
|
||||
},
|
||||
],
|
||||
dragDrop: [{ dragSelector: "[data-drag]", dropSelector: null }],
|
||||
actions: {
|
||||
editImage: WastelandItemSheet.#onEditImage,
|
||||
postItem: WastelandItemSheet.#onPostItem,
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab groups state
|
||||
* @type {object}
|
||||
*/
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = {
|
||||
fields: this.document.schema.fields,
|
||||
systemFields: this.document.system.schema.fields,
|
||||
item: this.document,
|
||||
system: this.document.system,
|
||||
source: this.document.toObject(),
|
||||
enrichedDescription: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true }),
|
||||
isEditMode: true,
|
||||
isEditable: this.isEditable,
|
||||
isGM: game.user.isGM,
|
||||
config: game.system.wasteland.config,
|
||||
}
|
||||
return context
|
||||
}
|
||||
|
||||
/** @override */
|
||||
_onRender(context, options) {
|
||||
super._onRender(context, options)
|
||||
this.#dragDrop.forEach((d) => d.bind(this.element))
|
||||
|
||||
// Activate tab navigation manually
|
||||
const nav = this.element.querySelector('nav.tabs[data-group]')
|
||||
if (nav) {
|
||||
const group = nav.dataset.group
|
||||
// Activate the current tab
|
||||
const activeTab = this.tabGroups[group] || "description"
|
||||
nav.querySelectorAll('[data-tab]').forEach(link => {
|
||||
const tab = link.dataset.tab
|
||||
link.classList.toggle('active', tab === activeTab)
|
||||
link.addEventListener('click', (event) => {
|
||||
event.preventDefault()
|
||||
this.tabGroups[group] = tab
|
||||
this.render()
|
||||
})
|
||||
})
|
||||
|
||||
// Show/hide tab content
|
||||
this.element.querySelectorAll('[data-group="' + group + '"][data-tab]').forEach(content => {
|
||||
content.classList.toggle('active', content.dataset.tab === activeTab)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// #region Drag-and-Drop Workflow
|
||||
/**
|
||||
* Create drag-and-drop workflow handlers for this Application
|
||||
*/
|
||||
#createDragDropHandlers() {
|
||||
return []
|
||||
}
|
||||
|
||||
// #region Actions
|
||||
|
||||
/**
|
||||
* Handle editing the item image
|
||||
* @param {Event} event - The triggering event
|
||||
*/
|
||||
static async #onEditImage(event) {
|
||||
event.preventDefault()
|
||||
const filePicker = new FilePicker({
|
||||
type: "image",
|
||||
current: this.document.img,
|
||||
callback: (path) => {
|
||||
this.document.update({ img: path })
|
||||
},
|
||||
})
|
||||
filePicker.browse()
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle posting the item to chat
|
||||
* @param {Event} event - The triggering event
|
||||
*/
|
||||
static async #onPostItem(event) {
|
||||
event.preventDefault()
|
||||
|
||||
// Prepare chat data
|
||||
const chatData = {
|
||||
name: this.document.name,
|
||||
img: this.document.img,
|
||||
type: this.document.type,
|
||||
system: this.document.system,
|
||||
}
|
||||
|
||||
// Add actor reference if item is owned
|
||||
if (this.document.actor) {
|
||||
chatData.actor = { id: this.document.actor.id }
|
||||
}
|
||||
|
||||
// Don't post any image for the item if the default image is used
|
||||
if (chatData.img && chatData.img.includes("/blank.png")) {
|
||||
chatData.img = null
|
||||
}
|
||||
|
||||
// JSON object for easy creation
|
||||
chatData.jsondata = JSON.stringify({
|
||||
compendium: "postedItem",
|
||||
payload: chatData,
|
||||
})
|
||||
|
||||
// Render the chat card template
|
||||
const html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-wasteland/templates/post-item.hbs', chatData)
|
||||
|
||||
// Create the chat message
|
||||
const chatOptions = {
|
||||
user: game.user.id,
|
||||
content: html,
|
||||
speaker: ChatMessage.getSpeaker({ actor: this.document.actor })
|
||||
}
|
||||
|
||||
ChatMessage.create(chatOptions)
|
||||
}
|
||||
}
|
||||
49
modules/applications/sheets/wasteland-arme-sheet.mjs
Normal file
49
modules/applications/sheets/wasteland-arme-sheet.mjs
Normal file
@@ -0,0 +1,49 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandArmeSheet extends WastelandItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["arme"],
|
||||
position: {
|
||||
width: 620,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["arme-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-wasteland/templates/item-arme-sheet.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
tabGroups = {
|
||||
primary: "details",
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare an array of form header tabs.
|
||||
* @returns {Record<string, Partial<ApplicationTab>>}
|
||||
*/
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-artifex-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-artifex-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandArtifexSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["artifex"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["artifex-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-artifex-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-bouclier-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-bouclier-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandBouclierSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["bouclier"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["bouclier-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-bouclier-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
32
modules/applications/sheets/wasteland-capacite-sheet.mjs
Normal file
32
modules/applications/sheets/wasteland-capacite-sheet.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandCapaciteSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["capacite"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["capacite-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-capacite-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-charme-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-charme-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandCharmeSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["charme"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["charme-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-charme-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
72
modules/applications/sheets/wasteland-competence-sheet.mjs
Normal file
72
modules/applications/sheets/wasteland-competence-sheet.mjs
Normal file
@@ -0,0 +1,72 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandCompetenceSheet extends WastelandItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["competence"],
|
||||
position: {
|
||||
width: 620,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["competence-content"],
|
||||
},
|
||||
actions: {
|
||||
"add-predilection": this.#onAddPredilection,
|
||||
"delete-predilection": this.#onDeletePredilection
|
||||
}
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-wasteland/templates/item-competence-sheet.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
tabGroups = {
|
||||
primary: "details",
|
||||
}
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle adding a new predilection
|
||||
* @param {PointerEvent} event - The triggering event
|
||||
* @param {HTMLElement} target - The button element
|
||||
*/
|
||||
static async #onAddPredilection(event, target) {
|
||||
const predilections = foundry.utils.duplicate(this.document.system.predilections)
|
||||
predilections.push({ name: "Nouvelle prédilection", used: false })
|
||||
await this.document.update({ "system.predilections": predilections })
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deleting a predilection
|
||||
* @param {PointerEvent} event - The triggering event
|
||||
* @param {HTMLElement} target - The delete button element
|
||||
*/
|
||||
static async #onDeletePredilection(event, target) {
|
||||
const index = parseInt(target.dataset.index)
|
||||
const predilections = foundry.utils.duplicate(this.document.system.predilections)
|
||||
predilections.splice(index, 1)
|
||||
await this.document.update({ "system.predilections": predilections })
|
||||
}
|
||||
}
|
||||
40
modules/applications/sheets/wasteland-creature-sheet.mjs
Normal file
40
modules/applications/sheets/wasteland-creature-sheet.mjs
Normal file
@@ -0,0 +1,40 @@
|
||||
import WastelandActorSheet from "./base-actor-sheet.mjs"
|
||||
|
||||
export default class WastelandCreatureSheet extends WastelandActorSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
...super.DEFAULT_OPTIONS,
|
||||
classes: [...super.DEFAULT_OPTIONS.classes, "creature"],
|
||||
window: {
|
||||
...super.DEFAULT_OPTIONS.window,
|
||||
title: "Feuille de Créature",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
sheet: {
|
||||
template: "systems/fvtt-wasteland/templates/actor-creature-sheet.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
tabGroups = {
|
||||
primary: "stats",
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
const actor = this.document
|
||||
|
||||
// Add creature-specific data
|
||||
context.skills = actor.getSkills()
|
||||
context.armes = foundry.utils.duplicate(actor.getWeapons())
|
||||
context.protections = foundry.utils.duplicate(actor.getArmors())
|
||||
context.capacites = foundry.utils.duplicate(actor.getCapacites())
|
||||
context.combat = actor.getCombatValues()
|
||||
|
||||
return context
|
||||
}
|
||||
}
|
||||
32
modules/applications/sheets/wasteland-don-sheet.mjs
Normal file
32
modules/applications/sheets/wasteland-don-sheet.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandDonSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["don"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["don-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-don-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-equipement-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-equipement-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandEquipementSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["equipement"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["equipement-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-equipement-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
32
modules/applications/sheets/wasteland-heritage-sheet.mjs
Normal file
32
modules/applications/sheets/wasteland-heritage-sheet.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandHeritageSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["heritage"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["heritage-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-heritage-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-hubris-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-hubris-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandHubrisSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["hubris"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["hubris-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-hubris-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
32
modules/applications/sheets/wasteland-metier-sheet.mjs
Normal file
32
modules/applications/sheets/wasteland-metier-sheet.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandMetierSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["metier"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["metier-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-metier-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-monnaie-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-monnaie-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandMonnaieSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["monnaie"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["monnaie-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-monnaie-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
32
modules/applications/sheets/wasteland-mutation-sheet.mjs
Normal file
32
modules/applications/sheets/wasteland-mutation-sheet.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandMutationSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["mutation"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["mutation-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-mutation-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
32
modules/applications/sheets/wasteland-origine-sheet.mjs
Normal file
32
modules/applications/sheets/wasteland-origine-sheet.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandOrigineSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["origine"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["origine-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-origine-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
59
modules/applications/sheets/wasteland-personnage-sheet.mjs
Normal file
59
modules/applications/sheets/wasteland-personnage-sheet.mjs
Normal file
@@ -0,0 +1,59 @@
|
||||
import WastelandActorSheet from "./base-actor-sheet.mjs"
|
||||
|
||||
export default class WastelandPersonnageSheet extends WastelandActorSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
...super.DEFAULT_OPTIONS,
|
||||
classes: [...super.DEFAULT_OPTIONS.classes, "personnage"],
|
||||
window: {
|
||||
...super.DEFAULT_OPTIONS.window,
|
||||
title: "Feuille de Personnage",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
sheet: {
|
||||
template: "systems/fvtt-wasteland/templates/actor-personnage-sheet.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
tabGroups = {
|
||||
primary: "stats",
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
const actor = this.document
|
||||
|
||||
// Add personnage-specific data
|
||||
context.skills = actor.getSkills()
|
||||
context.armes = foundry.utils.duplicate(actor.getWeapons())
|
||||
context.protections = foundry.utils.duplicate(actor.getArmors())
|
||||
context.pouvoirs = foundry.utils.duplicate(actor.getPouvoirs())
|
||||
context.dons = foundry.utils.duplicate(actor.getDons())
|
||||
context.hubrises = foundry.utils.duplicate(actor.getHubris())
|
||||
context.tours = foundry.utils.duplicate(actor.getTours())
|
||||
context.artifex = foundry.utils.duplicate(actor.getArtifex())
|
||||
context.charmes = foundry.utils.duplicate(actor.getCharmes())
|
||||
context.peuple = foundry.utils.duplicate(actor.getPeuple() || {})
|
||||
context.origine = foundry.utils.duplicate(actor.getOrigine() || {})
|
||||
context.heritage = foundry.utils.duplicate(actor.getHeritage() || {})
|
||||
context.metier = foundry.utils.duplicate(actor.getMetier() || {})
|
||||
context.combat = actor.getCombatValues()
|
||||
context.capacites = foundry.utils.duplicate(actor.getCapacites())
|
||||
context.equipements = foundry.utils.duplicate(actor.getEquipments())
|
||||
context.monnaies = foundry.utils.duplicate(actor.getMonnaies())
|
||||
context.mutations = foundry.utils.duplicate(actor.getMutations())
|
||||
|
||||
// Enrich HTML fields for biodata
|
||||
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.notes || "", { async: true })
|
||||
context.enrichedGMNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.gmnotes || "", { async: true })
|
||||
context.enrichedSequelles = await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.sequelles || "", { async: true })
|
||||
context.enrichedTraumatismes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.traumatismes || "", { async: true })
|
||||
|
||||
return context
|
||||
}
|
||||
}
|
||||
32
modules/applications/sheets/wasteland-peuple-sheet.mjs
Normal file
32
modules/applications/sheets/wasteland-peuple-sheet.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandPeupleSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["peuple"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["peuple-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-peuple-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "description" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-pouvoir-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-pouvoir-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandPouvoirSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["pouvoir"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["pouvoir-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-pouvoir-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
33
modules/applications/sheets/wasteland-protection-sheet.mjs
Normal file
33
modules/applications/sheets/wasteland-protection-sheet.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
import WastelandItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class WastelandProtectionSheet extends WastelandItemSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["protection"],
|
||||
position: { width: 620 },
|
||||
window: { contentClasses: ["protection-content"] },
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
main: { template: "systems/fvtt-wasteland/templates/item-protection-sheet.hbs" },
|
||||
}
|
||||
|
||||
tabGroups = { primary: "details" }
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
details: { id: "details", group: "primary", label: "Détails" },
|
||||
description: { id: "description", group: "primary", label: "Description" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
return context
|
||||
}
|
||||
}
|
||||
156
modules/applications/wasteland-roll-dialog.mjs
Normal file
156
modules/applications/wasteland-roll-dialog.mjs
Normal file
@@ -0,0 +1,156 @@
|
||||
import { WastelandUtility } from "../wasteland-utility.js"
|
||||
|
||||
/**
|
||||
* Dialogue de jet de dé pour Wasteland - Version DialogV2
|
||||
*/
|
||||
export class WastelandRollDialog {
|
||||
|
||||
/**
|
||||
* Create and display the roll dialog
|
||||
* @param {WastelandActor} actor - The actor making the roll
|
||||
* @param {Object} rollData - Data for the roll
|
||||
* @returns {Promise<WastelandRollDialog>}
|
||||
*/
|
||||
static async create(actor, rollData) {
|
||||
// Préparer le contexte pour le template
|
||||
const context = {
|
||||
...rollData,
|
||||
difficulte: String(rollData.difficulte || 0),
|
||||
img: actor.img,
|
||||
name: actor.name,
|
||||
config: game.system.wasteland.config,
|
||||
}
|
||||
|
||||
// Rendre le template en HTML
|
||||
const content = await foundry.applications.handlebars.renderTemplate(
|
||||
"systems/fvtt-wasteland/templates/roll-dialog-v2.hbs",
|
||||
context
|
||||
)
|
||||
|
||||
// Utiliser DialogV2.wait avec le HTML rendu
|
||||
return foundry.applications.api.DialogV2.wait({
|
||||
window: { title: "Test de Capacité", icon: "fa-solid fa-dice-d20" },
|
||||
classes: ["wasteland-roll-dialog"],
|
||||
position: { width: 500 },
|
||||
modal: false,
|
||||
content,
|
||||
buttons: rollData.charme ? [
|
||||
{
|
||||
action: "roll",
|
||||
label: "Lancer",
|
||||
icon: "fa-solid fa-dice-d20",
|
||||
default: true,
|
||||
callback: (event, button, dialog) => {
|
||||
this._updateRollDataFromForm(rollData, button.form.elements, actor)
|
||||
WastelandUtility.rollWasteland(rollData)
|
||||
}
|
||||
}
|
||||
] : [
|
||||
{
|
||||
action: "rolld10",
|
||||
label: "Lancer 1d10",
|
||||
icon: "fa-solid fa-dice-d10",
|
||||
default: true,
|
||||
callback: (event, button, dialog) => {
|
||||
this._updateRollDataFromForm(rollData, button.form.elements, actor)
|
||||
rollData.mainDice = "1d10"
|
||||
WastelandUtility.rollWasteland(rollData)
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "rolld20",
|
||||
label: "Lancer 1d20",
|
||||
icon: "fa-solid fa-dice-d20",
|
||||
callback: (event, button, dialog) => {
|
||||
this._updateRollDataFromForm(rollData, button.form.elements, actor)
|
||||
rollData.mainDice = "1d20"
|
||||
WastelandUtility.rollWasteland(rollData)
|
||||
}
|
||||
},
|
||||
],
|
||||
rejectClose: false,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Mettre à jour rollData avec les valeurs du formulaire
|
||||
* @param {Object} rollData - L'objet rollData à mettre à jour
|
||||
* @param {HTMLFormControlsCollection} formElements - Les éléments du formulaire
|
||||
* @param {WastelandActor} actor - L'acteur pour récupérer les attributs
|
||||
* @private
|
||||
*/
|
||||
static _updateRollDataFromForm(rollData, formElements, actor) {
|
||||
// Attributs
|
||||
if (formElements.attrKey) {
|
||||
rollData.attrKey = formElements.attrKey.value
|
||||
if (rollData.attrKey !== "tochoose" && actor) {
|
||||
rollData.attr = foundry.utils.duplicate(actor.system.attributs[rollData.attrKey])
|
||||
}
|
||||
}
|
||||
|
||||
// Modificateurs de base
|
||||
if (formElements.difficulte) {
|
||||
rollData.difficulte = Number(formElements.difficulte.value)
|
||||
}
|
||||
if (formElements.modificateur) {
|
||||
rollData.modificateur = Number(formElements.modificateur.value)
|
||||
}
|
||||
|
||||
// Charme
|
||||
if (formElements.charmeDice) {
|
||||
rollData.charmeDice = String(formElements.charmeDice.value)
|
||||
}
|
||||
|
||||
// Combat mêlée
|
||||
if (formElements.typeAttaque) {
|
||||
rollData.typeAttaque = String(formElements.typeAttaque.value)
|
||||
rollData.typeAttaqueLabel = rollData.config.attaques[rollData.typeAttaque]
|
||||
}
|
||||
if (formElements.isMonte !== undefined) {
|
||||
rollData.isMonte = formElements.isMonte.checked
|
||||
}
|
||||
|
||||
// Combat distance
|
||||
if (formElements.visee !== undefined) {
|
||||
rollData.visee = formElements.visee.checked
|
||||
}
|
||||
if (formElements.cibleconsciente !== undefined) {
|
||||
rollData.cibleconsciente = formElements.cibleconsciente.checked
|
||||
}
|
||||
if (formElements.ciblecourt !== undefined) {
|
||||
rollData.ciblecourt = formElements.ciblecourt.checked
|
||||
}
|
||||
if (formElements.typeCouvert) {
|
||||
rollData.typeCouvert = String(formElements.typeCouvert.value)
|
||||
const couvert = rollData.config.couverts[rollData.typeCouvert]
|
||||
if (rollData.typeCouvert !== "aucun" && couvert) {
|
||||
rollData.typeCouvertLabel = couvert.name
|
||||
rollData.typeCouvertValue = couvert.value
|
||||
}
|
||||
}
|
||||
|
||||
// Désavantages (avantages tactiques)
|
||||
if (!rollData.desavantages) rollData.desavantages = {}
|
||||
|
||||
if (formElements.cibleausol !== undefined) {
|
||||
rollData.desavantages.cibleausol = formElements.cibleausol.checked
|
||||
}
|
||||
if (formElements.cibledesarmee !== undefined) {
|
||||
rollData.desavantages.cibledesarmee = formElements.cibledesarmee.checked
|
||||
}
|
||||
if (formElements.ciblerestreint !== undefined) {
|
||||
rollData.desavantages.ciblerestreint = formElements.ciblerestreint.checked
|
||||
}
|
||||
if (formElements.cibleimmobilisée !== undefined) {
|
||||
rollData.desavantages.cibleimmobilisée = formElements.cibleimmobilisée.checked
|
||||
}
|
||||
if (formElements.ciblesurplomb !== undefined) {
|
||||
rollData.desavantages.ciblesurplomb = formElements.ciblesurplomb.checked
|
||||
}
|
||||
|
||||
// Double D20
|
||||
if (formElements.doubleD20 !== undefined) {
|
||||
rollData.doubleD20 = formElements.doubleD20.checked
|
||||
}
|
||||
}
|
||||
}
|
||||
26
modules/models/arme.mjs
Normal file
26
modules/models/arme.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Data model pour les armes
|
||||
*/
|
||||
export default class ArmeDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
typearme: new fields.StringField({ initial: "" }),
|
||||
isdefense: new fields.BooleanField({ initial: false }),
|
||||
bonusmaniementoff: new fields.NumberField({ initial: 0, integer: true }),
|
||||
bonusmaniementdef: new fields.NumberField({ initial: 0, integer: true }),
|
||||
nobonusdegats: new fields.BooleanField({ initial: false }),
|
||||
degats: new fields.StringField({ initial: "" }),
|
||||
nonletaux: new fields.BooleanField({ initial: false }),
|
||||
deuxmains: new fields.BooleanField({ initial: false }),
|
||||
courte: new fields.NumberField({ initial: 0, integer: true }),
|
||||
moyenne: new fields.NumberField({ initial: 0, integer: true }),
|
||||
longue: new fields.NumberField({ initial: 0, integer: true }),
|
||||
tr: new fields.NumberField({ initial: 0, integer: true }),
|
||||
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||
prix: new fields.NumberField({ initial: 0, integer: true }),
|
||||
equipped: new fields.BooleanField({ initial: false })
|
||||
};
|
||||
}
|
||||
}
|
||||
18
modules/models/artifex.mjs
Normal file
18
modules/models/artifex.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Data model pour les artifex
|
||||
*/
|
||||
export default class ArtifexDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
artifextype: new fields.StringField({ initial: "vapeur" }),
|
||||
competence: new fields.StringField({ initial: "" }),
|
||||
complexite: new fields.NumberField({ initial: 0, integer: true }),
|
||||
dureerealisation: new fields.StringField({ initial: "" }),
|
||||
tempsmiseenroute: new fields.StringField({ initial: "" }),
|
||||
defautcourant: new fields.StringField({ initial: "" }),
|
||||
prix: new fields.NumberField({ initial: 0, integer: true })
|
||||
};
|
||||
}
|
||||
}
|
||||
17
modules/models/bouclier.mjs
Normal file
17
modules/models/bouclier.mjs
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Data model pour les boucliers
|
||||
*/
|
||||
export default class BouclierDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
bonusdefense: new fields.NumberField({ initial: 0, integer: true }),
|
||||
degats: new fields.StringField({ initial: "" }),
|
||||
nonletaux: new fields.BooleanField({ initial: false }),
|
||||
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||
prix: new fields.NumberField({ initial: 0, integer: true }),
|
||||
equipped: new fields.BooleanField({ initial: false })
|
||||
};
|
||||
}
|
||||
}
|
||||
11
modules/models/capacite.mjs
Normal file
11
modules/models/capacite.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Data model pour les capacités
|
||||
*/
|
||||
export default class CapaciteDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
25
modules/models/charme.mjs
Normal file
25
modules/models/charme.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Data model pour les charmes
|
||||
*/
|
||||
export default class CharmeDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
charmetype: new fields.StringField({ initial: "tour" }),
|
||||
resultats: new fields.ArrayField(new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: -1, integer: true }),
|
||||
description: new fields.StringField({ initial: "" })
|
||||
}), {
|
||||
initial: [
|
||||
{ value: -1, description: "" },
|
||||
{ value: -1, description: "" },
|
||||
{ value: -1, description: "" },
|
||||
{ value: -1, description: "" },
|
||||
{ value: -1, description: "" },
|
||||
{ value: -1, description: "" }
|
||||
]
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
21
modules/models/competence.mjs
Normal file
21
modules/models/competence.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Data model pour les compétences
|
||||
*/
|
||||
export default class CompetenceDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||
attribut1: new fields.StringField({ initial: "" }),
|
||||
attribut2: new fields.StringField({ initial: "" }),
|
||||
attribut3: new fields.StringField({ initial: "" }),
|
||||
doublebonus: new fields.BooleanField({ initial: false }),
|
||||
predilections: new fields.ArrayField(new fields.SchemaField({
|
||||
name: new fields.StringField({ initial: "" }),
|
||||
description: new fields.StringField({ initial: "" }),
|
||||
used: new fields.BooleanField({ initial: false })
|
||||
}), { initial: [] })
|
||||
};
|
||||
}
|
||||
}
|
||||
99
modules/models/creature.mjs
Normal file
99
modules/models/creature.mjs
Normal file
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Data model pour les créatures
|
||||
*/
|
||||
export default class CreatureDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
// Template biodata
|
||||
biodata: new fields.SchemaField({
|
||||
name: new fields.StringField({ initial: "" }),
|
||||
age: new fields.NumberField({ initial: 0, integer: true }),
|
||||
alignement: new fields.StringField({ initial: "" }),
|
||||
poids: new fields.StringField({ initial: "" }),
|
||||
taille: new fields.StringField({ initial: "" }),
|
||||
cheveux: new fields.StringField({ initial: "" }),
|
||||
sexe: new fields.StringField({ initial: "" }),
|
||||
yeux: new fields.StringField({ initial: "" }),
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
habitat: new fields.StringField({ initial: "" }),
|
||||
comportement: new fields.StringField({ initial: "" }),
|
||||
psychemultiplier: new fields.NumberField({ initial: 1, integer: true }),
|
||||
notes: new fields.HTMLField({ initial: "" }),
|
||||
gmnotes: new fields.HTMLField({ initial: "" })
|
||||
}),
|
||||
// Template core
|
||||
terreur: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: -1, integer: true })
|
||||
}),
|
||||
protection: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
ressource: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
|
||||
attributs: new fields.SchemaField({
|
||||
adr: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Adresse" }),
|
||||
labelnorm: new fields.StringField({ initial: "adresse" }),
|
||||
abbrev: new fields.StringField({ initial: "adr" }),
|
||||
value: new fields.NumberField({ initial: 1, integer: true })
|
||||
}),
|
||||
pui: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Puissance" }),
|
||||
labelnorm: new fields.StringField({ initial: "puissance" }),
|
||||
abbrev: new fields.StringField({ initial: "pui" }),
|
||||
value: new fields.NumberField({ initial: 1, integer: true })
|
||||
}),
|
||||
cla: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Clairvoyance" }),
|
||||
labelnorm: new fields.StringField({ initial: "clairvoyance" }),
|
||||
abbrev: new fields.StringField({ initial: "cla" }),
|
||||
value: new fields.NumberField({ initial: 1, integer: true })
|
||||
}),
|
||||
pre: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Présence" }),
|
||||
labelnorm: new fields.StringField({ initial: "presence" }),
|
||||
abbrev: new fields.StringField({ initial: "pre" }),
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
tre: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Trempe" }),
|
||||
labelnorm: new fields.StringField({ initial: "trempe" }),
|
||||
abbrev: new fields.StringField({ initial: "tre" }),
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
})
|
||||
}),
|
||||
bonneaventure: new fields.SchemaField({
|
||||
base: new fields.NumberField({ initial: 0, integer: true }),
|
||||
actuelle: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
experience: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
eclat: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
sante: new fields.SchemaField({
|
||||
base: new fields.NumberField({ initial: 0, integer: true }),
|
||||
bonus: new fields.NumberField({ initial: 0, integer: true }),
|
||||
nonletaux: new fields.NumberField({ initial: 0, integer: true }),
|
||||
letaux: new fields.NumberField({ initial: 0, integer: true }),
|
||||
sequelles: new fields.StringField({ initial: "" })
|
||||
}),
|
||||
psyche: new fields.SchemaField({
|
||||
fullmax: new fields.NumberField({ initial: 0, integer: true }),
|
||||
currentmax: new fields.NumberField({ initial: 0, integer: true }),
|
||||
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||
traumatismes: new fields.StringField({ initial: "" })
|
||||
}),
|
||||
combat: new fields.SchemaField({
|
||||
initbonus: new fields.NumberField({ initial: 0, integer: true }),
|
||||
vitessebonus: new fields.NumberField({ initial: 0, integer: true }),
|
||||
bonusdegats: new fields.NumberField({ initial: 0, integer: true }),
|
||||
defensebonus: new fields.NumberField({ initial: 0, integer: true })
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
12
modules/models/don.mjs
Normal file
12
modules/models/don.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Data model pour les dons
|
||||
*/
|
||||
export default class DonDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
coutpsyche: new fields.NumberField({ initial: 0, integer: true })
|
||||
};
|
||||
}
|
||||
}
|
||||
14
modules/models/equipement.mjs
Normal file
14
modules/models/equipement.mjs
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Data model pour les équipements
|
||||
*/
|
||||
export default class EquipementDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
quantite: new fields.NumberField({ initial: 1, integer: true, min: 0 }),
|
||||
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||
prix: new fields.NumberField({ initial: 0, integer: true })
|
||||
};
|
||||
}
|
||||
}
|
||||
11
modules/models/heritage.mjs
Normal file
11
modules/models/heritage.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Data model pour les héritages
|
||||
*/
|
||||
export default class HeritageDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
12
modules/models/hubris.mjs
Normal file
12
modules/models/hubris.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Data model pour les hubris
|
||||
*/
|
||||
export default class HubrisDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
hubristype: new fields.StringField({ initial: "mental" })
|
||||
};
|
||||
}
|
||||
}
|
||||
27
modules/models/index.mjs
Normal file
27
modules/models/index.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Index des DataModels pour Wasteland
|
||||
* Ce fichier centralise tous les exports des modèles de données
|
||||
*/
|
||||
|
||||
// Modèles d'items
|
||||
export { default as ArmeDataModel } from './arme.mjs';
|
||||
export { default as BouclierDataModel } from './bouclier.mjs';
|
||||
export { default as CapaciteDataModel } from './capacite.mjs';
|
||||
export { default as CompetenceDataModel } from './competence.mjs';
|
||||
export { default as DonDataModel } from './don.mjs';
|
||||
export { default as EquipementDataModel } from './equipement.mjs';
|
||||
export { default as HeritageDataModel } from './heritage.mjs';
|
||||
export { default as MetierDataModel } from './metier.mjs';
|
||||
export { default as MonnaieDataModel } from './monnaie.mjs';
|
||||
export { default as OrigineDataModel } from './origine.mjs';
|
||||
export { default as ProtectionDataModel } from './protection.mjs';
|
||||
export { default as MutationDataModel } from './mutation.mjs';
|
||||
export { default as PouvoirDataModel } from './pouvoir.mjs';
|
||||
export { default as CharmeDataModel } from './charme.mjs';
|
||||
export { default as ArtifexDataModel } from './artifex.mjs';
|
||||
export { default as PeupleDataModel } from './peuple.mjs';
|
||||
export { default as HubrisDataModel } from './hubris.mjs';
|
||||
|
||||
// Modèles d'acteurs
|
||||
export { default as PersonnageDataModel } from './personnage.mjs';
|
||||
export { default as CreatureDataModel } from './creature.mjs';
|
||||
11
modules/models/metier.mjs
Normal file
11
modules/models/metier.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Data model pour les métiers
|
||||
*/
|
||||
export default class MetierDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
13
modules/models/monnaie.mjs
Normal file
13
modules/models/monnaie.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Data model pour les monnaies
|
||||
*/
|
||||
export default class MonnaieDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
quantite: new fields.NumberField({ initial: 0, integer: true }),
|
||||
unite: new fields.StringField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
11
modules/models/mutation.mjs
Normal file
11
modules/models/mutation.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Data model pour les mutations
|
||||
*/
|
||||
export default class MutationDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
11
modules/models/origine.mjs
Normal file
11
modules/models/origine.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Data model pour les origines
|
||||
*/
|
||||
export default class OrigineDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
100
modules/models/personnage.mjs
Normal file
100
modules/models/personnage.mjs
Normal file
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* Data model pour les personnages
|
||||
*/
|
||||
export default class PersonnageDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
// Template biodata
|
||||
biodata: new fields.SchemaField({
|
||||
name: new fields.StringField({ initial: "" }),
|
||||
age: new fields.NumberField({ initial: 0, integer: true }),
|
||||
alignement: new fields.StringField({ initial: "" }),
|
||||
poids: new fields.StringField({ initial: "" }),
|
||||
taille: new fields.StringField({ initial: "" }),
|
||||
cheveux: new fields.StringField({ initial: "" }),
|
||||
sexe: new fields.StringField({ initial: "" }),
|
||||
yeux: new fields.StringField({ initial: "" }),
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
habitat: new fields.StringField({ initial: "" }),
|
||||
comportement: new fields.StringField({ initial: "" }),
|
||||
psychemultiplier: new fields.NumberField({ initial: 1, integer: true }),
|
||||
notes: new fields.HTMLField({ initial: "" }),
|
||||
gmnotes: new fields.HTMLField({ initial: "" })
|
||||
}),
|
||||
// Template core
|
||||
terreur: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: -1, integer: true })
|
||||
}),
|
||||
protection: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
ressource: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
|
||||
attributs: new fields.SchemaField({
|
||||
adr: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Adresse" }),
|
||||
labelnorm: new fields.StringField({ initial: "adresse" }),
|
||||
abbrev: new fields.StringField({ initial: "adr" }),
|
||||
value: new fields.NumberField({ initial: 1, integer: true })
|
||||
}),
|
||||
pui: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Puissance" }),
|
||||
labelnorm: new fields.StringField({ initial: "puissance" }),
|
||||
abbrev: new fields.StringField({ initial: "pui" }),
|
||||
value: new fields.NumberField({ initial: 1, integer: true })
|
||||
}),
|
||||
cla: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Clairvoyance" }),
|
||||
labelnorm: new fields.StringField({ initial: "clairvoyance" }),
|
||||
abbrev: new fields.StringField({ initial: "cla" }),
|
||||
value: new fields.NumberField({ initial: 1, integer: true })
|
||||
}),
|
||||
pre: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Présence" }),
|
||||
labelnorm: new fields.StringField({ initial: "presence" }),
|
||||
abbrev: new fields.StringField({ initial: "pre" }),
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
tre: new fields.SchemaField({
|
||||
label: new fields.StringField({ initial: "Trempe" }),
|
||||
labelnorm: new fields.StringField({ initial: "trempe" }),
|
||||
abbrev: new fields.StringField({ initial: "tre" }),
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
})
|
||||
}),
|
||||
bonneaventure: new fields.SchemaField({
|
||||
base: new fields.NumberField({ initial: 0, integer: true }),
|
||||
actuelle: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
experience: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
eclat: new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true })
|
||||
}),
|
||||
sante: new fields.SchemaField({
|
||||
base: new fields.NumberField({ initial: 0, integer: true }),
|
||||
bonus: new fields.NumberField({ initial: 0, integer: true }),
|
||||
nonletaux: new fields.NumberField({ initial: 0, integer: true }),
|
||||
letaux: new fields.NumberField({ initial: 0, integer: true }),
|
||||
sequelles: new fields.StringField({ initial: "" })
|
||||
}),
|
||||
psyche: new fields.SchemaField({
|
||||
fullmax: new fields.NumberField({ initial: 0, integer: true }),
|
||||
currentmax: new fields.NumberField({ initial: 0, integer: true }),
|
||||
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||
traumatismes: new fields.StringField({ initial: "" })
|
||||
}),
|
||||
combat: new fields.SchemaField({
|
||||
initbonus: new fields.NumberField({ initial: 0, integer: true }),
|
||||
vitessebonus: new fields.NumberField({ initial: 0, integer: true }),
|
||||
bonusdegats: new fields.NumberField({ initial: 0, integer: true }),
|
||||
defensebonus: new fields.NumberField({ initial: 0, integer: true }),
|
||||
monte: new fields.BooleanField({ initial: false })
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
11
modules/models/peuple.mjs
Normal file
11
modules/models/peuple.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Data model pour les peuples
|
||||
*/
|
||||
export default class PeupleDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
20
modules/models/pouvoir.mjs
Normal file
20
modules/models/pouvoir.mjs
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Data model pour les pouvoirs
|
||||
*/
|
||||
export default class PouvoirDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
chemin: new fields.StringField({ initial: "force" }),
|
||||
attribut1: new fields.StringField({ initial: "cla" }),
|
||||
competence: new fields.StringField({ initial: "" }),
|
||||
seuil: new fields.NumberField({ initial: 0, integer: true }),
|
||||
coutpsyche: new fields.NumberField({ initial: 0, integer: true }),
|
||||
cible: new fields.StringField({ initial: "" }),
|
||||
duree: new fields.StringField({ initial: "" }),
|
||||
formulesimple: new fields.StringField({ initial: "" }),
|
||||
formuleetendue: new fields.StringField({ initial: "" })
|
||||
};
|
||||
}
|
||||
}
|
||||
15
modules/models/protection.mjs
Normal file
15
modules/models/protection.mjs
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Data model pour les protections
|
||||
*/
|
||||
export default class ProtectionDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
protection: new fields.NumberField({ initial: 0, integer: true }),
|
||||
equipped: new fields.BooleanField({ initial: false }),
|
||||
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||
prix: new fields.NumberField({ initial: 0, integer: true })
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
|
||||
import { WastelandUtility } from "./wasteland-utility.js";
|
||||
import { WastelandRollDialog } from "./wasteland-roll-dialog.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class WastelandActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["fvtt-wasteland", "sheet", "actor"],
|
||||
template: "systems/fvtt-wasteland/templates/actor-sheet.html",
|
||||
width: 640,
|
||||
height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
|
||||
editScore: false
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = foundry.utils.duplicate(this.object)
|
||||
let actorData = objectData
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: actorData.system,
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
limited: this.object.limited,
|
||||
skills: this.actor.getSkills(),
|
||||
armes: foundry.utils.duplicate(this.actor.getWeapons()),
|
||||
protections: foundry.utils.duplicate(this.actor.getArmors()),
|
||||
pouvoirs:foundry.utils.duplicate(this.actor.getPouvoirs()),
|
||||
dons: foundry.utils.duplicate(this.actor.getDons()),
|
||||
hubrises: foundry.utils.duplicate(this.actor.getHubris()),
|
||||
tours:foundry.utils.duplicate(this.actor.getTours()),
|
||||
artifex: foundry.utils.duplicate(this.actor.getArtifex()),
|
||||
charmes:foundry.utils.duplicate(this.actor.getCharmes()),
|
||||
peuple: foundry.utils.duplicate(this.actor.getPeuple() || {}),
|
||||
origine: foundry.utils.duplicate(this.actor.getOrigine() || {}),
|
||||
heritage: foundry.utils.duplicate(this.actor.getHeritage() || {}),
|
||||
metier: foundry.utils.duplicate(this.actor.getMetier() || {}),
|
||||
combat: this.actor.getCombatValues(),
|
||||
config: foundry.utils.duplicate(game.system.wasteland.config),
|
||||
capacites: foundry.utils.duplicate(this.actor.getCapacites()),
|
||||
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
|
||||
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
|
||||
mutations: foundry.utils.duplicate(this.actor.getMutations()),
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, {async: true}),
|
||||
comportement: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.comportement, {async: true}),
|
||||
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, {async: true}),
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
editScore: this.options.editScore,
|
||||
isGM: game.user.isGM,
|
||||
config: game.system.wasteland.config
|
||||
}
|
||||
this.formData = formData;
|
||||
|
||||
console.log("PC : ", formData, this.object);
|
||||
return formData;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
const item = this.actor.items.get( itemId )
|
||||
item.sheet.render(true)
|
||||
})
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
WastelandUtility.confirmDelete(this, li);
|
||||
})
|
||||
html.find('.edit-item-data').change(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
let itemType = li.data("item-type")
|
||||
let itemField = $(ev.currentTarget).data("item-field")
|
||||
let dataType = $(ev.currentTarget).data("dtype")
|
||||
let value = ev.currentTarget.value
|
||||
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
|
||||
})
|
||||
|
||||
html.find('.quantity-minus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.incDecQuantity( li.data("item-id"), -1 );
|
||||
} );
|
||||
html.find('.quantity-plus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.incDecQuantity( li.data("item-id"), +1 );
|
||||
} );
|
||||
|
||||
html.find('.roll-attribut').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let attrKey = li.data("attr-key")
|
||||
this.actor.rollAttribut(attrKey)
|
||||
})
|
||||
html.find('.roll-competence').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let attrKey = $(event.currentTarget).data("attr-key")
|
||||
let compId = li.data("item-id")
|
||||
this.actor.rollCompetence(attrKey, compId)
|
||||
})
|
||||
html.find('.roll-charme').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let charmeId = li.data("item-id")
|
||||
this.actor.rollCharme(charmeId)
|
||||
})
|
||||
|
||||
html.find('.roll-pouvoir').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let pouvoirId = li.data("item-id")
|
||||
this.actor.rollPouvoir(pouvoirId)
|
||||
})
|
||||
html.find('.roll-arme-offensif').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let armeId = li.data("item-id")
|
||||
this.actor.rollArmeOffensif(armeId)
|
||||
})
|
||||
html.find('.roll-arme-degats').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let armeId = li.data("item-id")
|
||||
this.actor.rollArmeDegats(armeId)
|
||||
})
|
||||
html.find('.quantity-modify').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
const value = Number($(event.currentTarget).data("quantite-value"))
|
||||
this.actor.incDecQuantity( li.data("item-id"), value );
|
||||
})
|
||||
html.find('.item-add').click((event) => {
|
||||
const itemType = $(event.currentTarget).data("type")
|
||||
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
||||
})
|
||||
|
||||
|
||||
html.find('.lock-unlock-sheet').click((event) => {
|
||||
this.options.editScore = !this.options.editScore;
|
||||
this.render(true);
|
||||
});
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.equipItem( li.data("item-id") );
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
setPosition(options = {}) {
|
||||
const position = super.setPosition(options);
|
||||
const sheetBody = this.element.find(".sheet-body");
|
||||
const bodyHeight = position.height - 192;
|
||||
sheetBody.css("height", bodyHeight);
|
||||
return position;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/*async _onDropItem(event, dragData) {
|
||||
let item = await WastelandUtility.searchItem( dragData)
|
||||
this.actor.preprocessItem( event, item, true )
|
||||
super._onDropItem(event, dragData)
|
||||
}*/
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
// Update the Actor
|
||||
return this.object.update(formData);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -------------------------------------------- */
|
||||
import { WastelandUtility } from "./wasteland-utility.js";
|
||||
import { WastelandRollDialog } from "./wasteland-roll-dialog.js";
|
||||
import { WastelandRollDialog } from "./applications/wasteland-roll-dialog.mjs";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
|
||||
@@ -53,6 +53,7 @@ export class WastelandActor extends Actor {
|
||||
arme = foundry.utils.duplicate(arme)
|
||||
let combat = this.getCombatValues()
|
||||
if (arme.system.typearme == "contact" || arme.system.typearme == "contactjet") {
|
||||
arme.system.isMelee = true
|
||||
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
|
||||
arme.system.attrKey = "pui"
|
||||
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
|
||||
@@ -62,6 +63,7 @@ export class WastelandActor extends Actor {
|
||||
}
|
||||
}
|
||||
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
|
||||
arme.system.isDistance = true
|
||||
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
|
||||
arme.system.attrKey = "adr"
|
||||
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
|
||||
@@ -296,6 +298,10 @@ export class WastelandActor extends Actor {
|
||||
changeEclat(value) {
|
||||
let newE = this.system.eclat.value
|
||||
newE += value
|
||||
// Empêcher que l'éclat devienne négatif
|
||||
if (newE < 0) {
|
||||
newE = 0
|
||||
}
|
||||
this.update({ 'system.eclat.value': newE })
|
||||
}
|
||||
|
||||
@@ -382,6 +388,32 @@ export class WastelandActor extends Actor {
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: compId, 'system.predilections': pred }])
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async resetAllPredilections() {
|
||||
let updates = []
|
||||
for (let item of this.items) {
|
||||
if (item.type === "competence" && item.system.predilections && item.system.predilections.length > 0) {
|
||||
let pred = foundry.utils.duplicate(item.system.predilections)
|
||||
let hasUsed = false
|
||||
for (let p of pred) {
|
||||
if (p.used) {
|
||||
p.used = false
|
||||
hasUsed = true
|
||||
}
|
||||
}
|
||||
if (hasUsed) {
|
||||
updates.push({ _id: item.id, 'system.predilections': pred })
|
||||
}
|
||||
}
|
||||
}
|
||||
if (updates.length > 0) {
|
||||
await this.updateEmbeddedDocuments('Item', updates)
|
||||
ui.notifications.info(`${updates.length} prédilection(s) réinitialisée(s) pour ${this.name}`)
|
||||
} else {
|
||||
ui.notifications.info(`Aucune prédilection à réinitialiser pour ${this.name}`)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getInitiativeScore( ) {
|
||||
return Number(this.system.attributs.adr.value) + Number(this.system.combat.initbonus)
|
||||
@@ -414,10 +446,12 @@ export class WastelandActor extends Actor {
|
||||
rollData.actorId = this.id
|
||||
rollData.tokenId = this.token?.id
|
||||
rollData.img = this.img
|
||||
rollData.canEclatDoubleD20 = true // Always true in Wastelan
|
||||
rollData.canEclatDoubleD20 = this.getEclat() >= 1 // Vérifier que l'acteur a au moins 1 point d'éclat
|
||||
rollData.doubleD20 = false
|
||||
rollData.attributs = WastelandUtility.getAttributs()
|
||||
rollData.config = foundry.utils.duplicate(game.system.wasteland.config)
|
||||
rollData.desavantages = {}
|
||||
rollData.isMonte = this.system.combat.monte
|
||||
|
||||
if (attrKey) {
|
||||
rollData.attrKey = attrKey
|
||||
@@ -440,8 +474,7 @@ export class WastelandActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async launchRoll(rollData) {
|
||||
console.log("RollData", rollData)
|
||||
let rollDialog = await WastelandRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await WastelandRollDialog.create(this, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
rollAttribut(attrKey) {
|
||||
@@ -467,7 +500,7 @@ export class WastelandActor extends Actor {
|
||||
async rollPouvoir(pouvoirId) {
|
||||
let pouvoir = foundry.utils.duplicate(this.items.get(pouvoirId) || {})
|
||||
if (pouvoir?.system) {
|
||||
let rollData = this.getCommonRollData(pouvoir.system.attribut, undefined, pouvoir.system.competence)
|
||||
let rollData = this.getCommonRollData(pouvoir.system.attribut1, undefined, pouvoir.system.competence)
|
||||
if (!rollData.competence) {
|
||||
ui.notifications.error("Le pouvoir " + pouvoir.name + " n'a pas de compétence associée. Editez le pouvoir avec la compétence associée.")
|
||||
return
|
||||
@@ -488,6 +521,12 @@ export class WastelandActor extends Actor {
|
||||
}
|
||||
let rollData = this.getCommonRollData(arme.system.attrKey, arme.system.competence._id)
|
||||
rollData.arme = arme
|
||||
rollData.typeAttaque = "assaut"
|
||||
rollData.typeCouvert = "aucun"
|
||||
rollData.hasDesavantageBonus = true
|
||||
rollData.visee = false
|
||||
rollData.ciblecourt = false
|
||||
rollData.cibleconsciente = false
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
@@ -511,8 +550,52 @@ export class WastelandActor extends Actor {
|
||||
actionImg: arme.img,
|
||||
}
|
||||
WastelandUtility.createChatWithRollMode(rollData.alias, {
|
||||
content: await renderTemplate(`systems/fvtt-wasteland/templates/chat-degats-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-wasteland/templates/chat-degats-result-v2.hbs`, rollData)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollAssommer() {
|
||||
let rollData = this.getCommonRollData("adr", undefined, "Mouvements")
|
||||
rollData.specialAction = "Assommer"
|
||||
rollData.typeAttaque = "assommer"
|
||||
rollData.typeCouvert = "aucun"
|
||||
rollData.hasDesavantageBonus = true
|
||||
if (rollData.defender) {
|
||||
rollData.selectDifficulte = false
|
||||
rollData.difficulte = rollData.defender.system.attributs.tre.value * 2
|
||||
}
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollFuir() {
|
||||
let rollData = this.getCommonRollData("adr", undefined, "Mouvements")
|
||||
rollData.specialAction = "Fuir"
|
||||
rollData.typeAttaque = "fuir"
|
||||
rollData.typeCouvert = "aucun"
|
||||
rollData.hasDesavantageBonus = true
|
||||
if (rollData.defender) {
|
||||
rollData.selectDifficulte = false
|
||||
let comp = rollData.defender.items.find(it => it.type == "competence" && it.name.toLowerCase() == "mouvements")
|
||||
rollData.difficulte = rollData.defender.system.attributs.adr.value + ((comp) ? comp.system.niveau : rollData.defender.system.attributs.adr.value)
|
||||
}
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollImmobiliser() {
|
||||
let rollData = this.getCommonRollData("pui", undefined, "Mêlée")
|
||||
rollData.specialAction = "Immobiliser"
|
||||
rollData.typeAttaque = "immobiliser"
|
||||
rollData.typeCouvert = "aucun"
|
||||
rollData.hasDesavantageBonus = true
|
||||
if (rollData.defender) {
|
||||
rollData.selectDifficulte = false
|
||||
rollData.difficulte = rollData.armeDefense ? rollData.armeDefense.system.totalDefensif : 10
|
||||
}
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* -------------------------------------------- */
|
||||
|
||||
import { WastelandUtility } from "./wasteland-utility.js";
|
||||
import { WastelandRollDialog } from "./wasteland-roll-dialog.js";
|
||||
import { WastelandRollDialog } from "./applications/wasteland-roll-dialog.mjs";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class WastelandCommands {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
export const WASTELAND_CONFIG = {
|
||||
|
||||
attributs: {
|
||||
"adr": "Adresse",
|
||||
"pui": "Puissance",
|
||||
"cla": "Clairvoyance",
|
||||
"pre": "Présence",
|
||||
"tre": "Trempe"
|
||||
},
|
||||
cheminpouvoir : {
|
||||
"force": "Chemin des Forces",
|
||||
"forge": "Chemin des Forges",
|
||||
@@ -44,13 +51,54 @@ export const WASTELAND_CONFIG = {
|
||||
tir: "Arme de Tir",
|
||||
special: "Spécial (capacité/don)"
|
||||
},
|
||||
attaques: {
|
||||
assaut: "Assaut",
|
||||
precise: "Attaque Précise",
|
||||
feinte: "Feinte",
|
||||
coupbas: "Coup Bas",
|
||||
charger: "Charger",
|
||||
contenir: "Contenir",
|
||||
desarmer: "Désarmer"
|
||||
},
|
||||
couverts: {
|
||||
aucun: { name: "Aucun", value: 0 },
|
||||
rondache: { name: "Couvert Léger", value: -2 },
|
||||
pavois: { name: "Couvert Moyen", value: -5 },
|
||||
complet: { name: "Couvert Complet", value: -10 },
|
||||
},
|
||||
listePortees: {
|
||||
"10": "Moins que Courte",
|
||||
"15": "Courte ou plus",
|
||||
"20": "Moyenne ou plus",
|
||||
"25": "Longue ou plus"
|
||||
},
|
||||
difficulteOptions: {
|
||||
"0": "Aucune/Inconnue",
|
||||
"5": "Facile (5)",
|
||||
"6": "(6)",
|
||||
"7": "(7)",
|
||||
"8": "(8)",
|
||||
"9": "(9)",
|
||||
"10": "Moyenne (10)",
|
||||
"11": "(11)",
|
||||
"12": "(12)",
|
||||
"13": "(13)",
|
||||
"14": "(14)",
|
||||
"15": "Ardue (15)",
|
||||
"16": "(16)",
|
||||
"17": "(17)",
|
||||
"18": "(18)",
|
||||
"19": "(19)",
|
||||
"20": "Hasardeuse (20)",
|
||||
"21": "(21)",
|
||||
"22": "(22)",
|
||||
"23": "(23)",
|
||||
"24": "(24)",
|
||||
"25": "Insensée (25)",
|
||||
"26": "(26)",
|
||||
"27": "(27)",
|
||||
"28": "(28)",
|
||||
"29": "(29)",
|
||||
"30": "Pure Folie (30)"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Extend the basic ActorSheet with some very simple modifications
|
||||
* @extends {ActorSheet}
|
||||
*/
|
||||
|
||||
import { WastelandUtility } from "./wasteland-utility.js";
|
||||
import { WastelandActorSheet } from "./wasteland-actor-sheet.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class WastelandCreatureSheet extends WastelandActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["fvtt-wasteland", "sheet", "creature"],
|
||||
template: "systems/fvtt-wasteland/templates/creature-sheet.html",
|
||||
width: 640,
|
||||
height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
|
||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
|
||||
editScore: false
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
import { WastelandUtility } from "./wasteland-utility.js";
|
||||
|
||||
/**
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class WastelandItemSheet extends foundry.appv1.sheets.ItemSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["fvtt-wasteland", "sheet", "item"],
|
||||
template: "systems/fvtt-wasteland/templates/item-sheet.html",
|
||||
dragDrop: [{ dragSelector: null, dropSelector: null }],
|
||||
width: 620,
|
||||
height: 550
|
||||
//tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_getHeaderButtons() {
|
||||
let buttons = super._getHeaderButtons();
|
||||
// Add "Post to chat" button
|
||||
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
|
||||
buttons.unshift(
|
||||
{
|
||||
class: "post",
|
||||
icon: "fas fa-comment",
|
||||
onclick: ev => { }
|
||||
})
|
||||
return buttons
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
setPosition(options = {}) {
|
||||
const position = super.setPosition(options);
|
||||
const sheetBody = this.element.find(".sheet-body");
|
||||
const bodyHeight = position.height - 192;
|
||||
sheetBody.css("height", bodyHeight);
|
||||
if (this.item.type.includes('weapon')) {
|
||||
position.width = 640;
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = foundry.utils.duplicate(this.object)
|
||||
let itemData = objectData
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: this.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
attributs: WastelandUtility.getAttributs(),
|
||||
config: foundry.utils.duplicate(game.system.wasteland.config),
|
||||
data: itemData.system,
|
||||
system: itemData.system,
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
|
||||
isGM: game.user.isGM
|
||||
}
|
||||
|
||||
console.log("ITEM DATA", formData, this);
|
||||
return formData;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_getHeaderButtons() {
|
||||
let buttons = super._getHeaderButtons();
|
||||
buttons.unshift({
|
||||
class: "post",
|
||||
icon: "fas fa-comment",
|
||||
onclick: ev => this.postItem()
|
||||
});
|
||||
return buttons
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
postItem() {
|
||||
let chatData = foundry.utils.duplicate(WastelandUtility.data(this.item));
|
||||
if (this.actor) {
|
||||
chatData.actor = { id: this.actor.id };
|
||||
}
|
||||
// Don't post any image for the item (which would leave a large gap) if the default image is used
|
||||
if (chatData.img.includes("/blank.png")) {
|
||||
chatData.img = null;
|
||||
}
|
||||
// JSON object for easy creation
|
||||
chatData.jsondata = JSON.stringify(
|
||||
{
|
||||
compendium: "postedItem",
|
||||
payload: chatData,
|
||||
});
|
||||
|
||||
renderTemplate('systems/fvtt-Wasteland-rpg/templates/post-item.html', chatData).then(html => {
|
||||
let chatOptions = WastelandUtility.chatDataSetup(html);
|
||||
ChatMessage.create(chatOptions)
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
const item = this.object.options.actor.getOwnedItem(li.data("item-id"))
|
||||
item.sheet.render(true);
|
||||
});
|
||||
|
||||
html.find('.delete-subitem').click(ev => {
|
||||
this.deleteSubitem(ev);
|
||||
})
|
||||
html.find('.edit-prediction').change(ev => {
|
||||
const li = $(ev.currentTarget).parents(".prediction-item")
|
||||
let index = li.data("prediction-index")
|
||||
let pred = foundry.utils.duplicate(this.object.system.predilections)
|
||||
pred[index].name = ev.currentTarget.value
|
||||
this.object.update( { 'data.predilections': pred })
|
||||
})
|
||||
html.find('.delete-prediction').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".prediction-item")
|
||||
let index = li.data("prediction-index")
|
||||
let pred = foundry.utils.duplicate(this.object.system.predilections)
|
||||
pred.splice(index,1)
|
||||
this.object.update( { 'data.predilections': pred })
|
||||
})
|
||||
html.find('.use-prediction').change(ev => {
|
||||
const li = $(ev.currentTarget).parents(".prediction-item")
|
||||
let index = li.data("prediction-index")
|
||||
let pred = foundry.utils.duplicate(this.object.system.predilections)
|
||||
pred[index].used = ev.currentTarget.checked
|
||||
this.object.update( { 'data.predilections': pred })
|
||||
})
|
||||
html.find('#add-predilection').click(ev => {
|
||||
let pred = foundry.utils.duplicate(this.object.system.predilections)
|
||||
pred.push( { name: "Nouvelle prédilection", used: false })
|
||||
this.object.update( { 'data.predilections': pred })
|
||||
})
|
||||
// Update Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
let itemId = li.data("item-id");
|
||||
let itemType = li.data("item-type");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
get template() {
|
||||
let type = this.item.type;
|
||||
return `systems/fvtt-wasteland/templates/item-${type}-sheet.html`;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
return this.object.update(formData);
|
||||
}
|
||||
}
|
||||
@@ -9,14 +9,17 @@
|
||||
/* -------------------------------------------- */
|
||||
// Import Modules
|
||||
import { WastelandActor } from "./wasteland-actor.js";
|
||||
import { WastelandItemSheet } from "./wasteland-item-sheet.js";
|
||||
import { WastelandActorSheet } from "./wasteland-actor-sheet.js";
|
||||
import { WastelandCreatureSheet } from "./wasteland-creature-sheet.js";
|
||||
import { WastelandUtility } from "./wasteland-utility.js";
|
||||
import { WastelandCombat } from "./wasteland-combat.js";
|
||||
import { WastelandItem } from "./wasteland-item.js";
|
||||
import { WASTELAND_CONFIG } from "./wasteland-config.js";
|
||||
|
||||
// Import DataModels
|
||||
import * as models from "./models/index.mjs";
|
||||
|
||||
// Import AppV2 Sheets
|
||||
import * as sheets from "./applications/sheets/_module.mjs";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Foundry VTT Initialization */
|
||||
/* -------------------------------------------- */
|
||||
@@ -45,35 +48,112 @@ Hooks.once("init", async function () {
|
||||
// Define custom Entity classes
|
||||
CONFIG.Combat.documentClass = WastelandCombat
|
||||
CONFIG.Actor.documentClass = WastelandActor
|
||||
CONFIG.Item.documentClass = WastelandItem
|
||||
game.system.wasteland = {
|
||||
config: WASTELAND_CONFIG
|
||||
CONFIG.Actor.dataModels = {
|
||||
personnage: models.PersonnageDataModel,
|
||||
creature: models.CreatureDataModel
|
||||
}
|
||||
|
||||
CONFIG.Item.documentClass = WastelandItem
|
||||
CONFIG.Item.dataModels = {
|
||||
arme: models.ArmeDataModel,
|
||||
artifex: models.ArtifexDataModel,
|
||||
bouclier: models.BouclierDataModel,
|
||||
capacite: models.CapaciteDataModel,
|
||||
charme: models.CharmeDataModel,
|
||||
competence: models.CompetenceDataModel,
|
||||
don: models.DonDataModel,
|
||||
equipement: models.EquipementDataModel,
|
||||
heritage: models.HeritageDataModel,
|
||||
hubris: models.HubrisDataModel,
|
||||
metier: models.MetierDataModel,
|
||||
monnaie: models.MonnaieDataModel,
|
||||
mutation: models.MutationDataModel,
|
||||
origine: models.OrigineDataModel,
|
||||
peuple: models.PeupleDataModel,
|
||||
pouvoir: models.PouvoirDataModel,
|
||||
protection: models.ProtectionDataModel
|
||||
}
|
||||
|
||||
game.system.wasteland = {
|
||||
config: WASTELAND_CONFIG,
|
||||
models,
|
||||
sheets
|
||||
}
|
||||
|
||||
// Initialize dynamic config options that need to be available immediately
|
||||
// Create option lists inline to ensure they're available
|
||||
const listeNiveauSkill = {}
|
||||
for (let i = 0; i <= 10; i++) {
|
||||
listeNiveauSkill[`${i}`] = `${i}`
|
||||
}
|
||||
game.system.wasteland.config.listeNiveauSkill = listeNiveauSkill
|
||||
|
||||
const listeNiveauAttribut = {}
|
||||
for (let i = 0; i <= 10; i++) {
|
||||
listeNiveauAttribut[`${i}`] = `${i}`
|
||||
}
|
||||
game.system.wasteland.config.listeNiveauAttribut = listeNiveauAttribut
|
||||
|
||||
const listeNiveauCreature = {}
|
||||
for (let i = 0; i <= 35; i++) {
|
||||
listeNiveauCreature[`${i}`] = `${i}`
|
||||
}
|
||||
game.system.wasteland.config.listeNiveauCreature = listeNiveauCreature
|
||||
|
||||
const modificateurOptions = []
|
||||
for (let i = -15; i <= 15; i++) {
|
||||
modificateurOptions.push({ key: i, label: `${i >= 0 ? '+' : ''}${i}` })
|
||||
}
|
||||
game.system.wasteland.config.modificateurOptions = modificateurOptions
|
||||
|
||||
const pointsAmeOptions = {}
|
||||
for (let i = 0; i <= 20; i++) {
|
||||
pointsAmeOptions[`${i}`] = `${i}`
|
||||
}
|
||||
game.system.wasteland.config.pointsAmeOptions = pointsAmeOptions
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Register sheet application classes
|
||||
|
||||
// Register AppV2 Actor Sheets
|
||||
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-wasteland", WastelandActorSheet, { types: ["personnage"], makeDefault: true })
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-wasteland", WastelandCreatureSheet, { types: ["creature"], makeDefault: false });
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-wasteland", sheets.WastelandPersonnageSheet, { types: ["personnage"], makeDefault: true });
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-wasteland", sheets.WastelandCreatureSheet, { types: ["creature"], makeDefault: true });
|
||||
|
||||
// Register AppV2 Item Sheets
|
||||
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", WastelandItemSheet, { makeDefault: true })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandArmeSheet, { types: ["arme"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandArtifexSheet, { types: ["artifex"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandBouclierSheet, { types: ["bouclier"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandCapaciteSheet, { types: ["capacite"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandCharmeSheet, { types: ["charme"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandCompetenceSheet, { types: ["competence"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandDonSheet, { types: ["don"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandEquipementSheet, { types: ["equipement"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandHeritageSheet, { types: ["heritage"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandHubrisSheet, { types: ["hubris"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandMetierSheet, { types: ["metier"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandMonnaieSheet, { types: ["monnaie"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandMutationSheet, { types: ["mutation"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandOrigineSheet, { types: ["origine"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandPeupleSheet, { types: ["peuple"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandPouvoirSheet, { types: ["pouvoir"], makeDefault: true });
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-wasteland", sheets.WastelandProtectionSheet, { types: ["protection"], makeDefault: true });
|
||||
|
||||
WastelandUtility.init();
|
||||
|
||||
});
|
||||
|
||||
/* -------------------------------------------- */
|
||||
function welcomeMessage() {
|
||||
async function welcomeMessage() {
|
||||
const templateData = {};
|
||||
const html = await foundry.applications.handlebars.renderTemplate("systems/fvtt-wasteland/templates/chat-welcome-message.hbs", templateData);
|
||||
|
||||
ChatMessage.create({
|
||||
user: game.user.id,
|
||||
whisper: [game.user.id],
|
||||
content: `<div id="welcome-message-Wasteland"><span class="rdd-roll-part">
|
||||
<strong>Bienvenue dans les Wasteland !</strong>
|
||||
<p>Les livres de Wasteland sont nécessaires pour jouer : https://www.titam-france.fr</p>
|
||||
<p>Wasteland est jeu de rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.</p>
|
||||
<p>Système développé par LeRatierBretonnien, avec le support de Prêtre. Plus d'infos et aides sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
|
||||
` });
|
||||
content: html
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
import { WastelandUtility } from "./wasteland-utility.js";
|
||||
|
||||
export class WastelandRollDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async create(actor, rollData) {
|
||||
|
||||
let options = { classes: ["WastelandDialog"], width: 340, height: 'fit-content', 'z-index': 99999 };
|
||||
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-wasteland/templates/roll-dialog-generic.html', rollData);
|
||||
|
||||
return new WastelandRollDialog(actor, rollData, html, options);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(actor, rollData, html, options, close = undefined) {
|
||||
let buttons = {
|
||||
rolld10: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Lancer 1d10",
|
||||
callback: () => { this.roll("1d10") }
|
||||
},
|
||||
rolld20: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Lancer 1d20",
|
||||
callback: () => { this.roll("1d20") }
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Annuler",
|
||||
callback: () => { this.close() }
|
||||
}
|
||||
}
|
||||
if (rollData.charme) {
|
||||
buttons = {
|
||||
roll: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Lancer",
|
||||
callback: () => { this.roll() }
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Annuler",
|
||||
callback: () => { this.close() }
|
||||
}
|
||||
}
|
||||
}
|
||||
let conf = {
|
||||
title: "Test de Capacité",
|
||||
content: html,
|
||||
buttons: buttons,
|
||||
close: close
|
||||
}
|
||||
|
||||
super(conf, options);
|
||||
|
||||
this.actor = actor
|
||||
this.rollData = rollData
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
roll(dice) {
|
||||
this.rollData.mainDice = dice
|
||||
WastelandUtility.rollWasteland(this.rollData)
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
function onLoad() {
|
||||
}
|
||||
$(function () { onLoad(); });
|
||||
|
||||
html.find('#modificateur').change(async (event) => {
|
||||
this.rollData.modificateur = Number(event.currentTarget.value)
|
||||
})
|
||||
html.find('#difficulte').change(async (event) => {
|
||||
this.rollData.difficulte = Number(event.currentTarget.value)
|
||||
})
|
||||
html.find('#attrKey').change(async (event) => {
|
||||
this.rollData.attrKey = String(event.currentTarget.value)
|
||||
})
|
||||
html.find('#runemode').change(async (event) => {
|
||||
this.rollData.runemode = String(event.currentTarget.value)
|
||||
})
|
||||
html.find('#runeame').change(async (event) => {
|
||||
this.rollData.runeame = Number(event.currentTarget.value)
|
||||
})
|
||||
html.find('#doubleD20').change(async (event) => {
|
||||
this.rollData.doubleD20 = event.currentTarget.checked
|
||||
})
|
||||
html.find('#charmeDice').change(async (event) => {
|
||||
this.rollData.charmeDice = String(event.currentTarget.value)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ export class WastelandUtility {
|
||||
/* -------------------------------------------- */
|
||||
static async init() {
|
||||
Hooks.on('renderChatLog', (log, html, data) => WastelandUtility.chatListeners(html))
|
||||
Hooks.on('renderChatMessageHTML', (message, html, data) => WastelandUtility.chatListeners(html))
|
||||
Hooks.on("getChatMessageContextOptions", (html, options) => WastelandUtility.chatRollMenu(html, options))
|
||||
|
||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
||||
@@ -112,11 +113,8 @@ export class WastelandUtility {
|
||||
const skills = await WastelandUtility.loadCompendium("fvtt-wasteland.skills")
|
||||
this.skills = skills.map(i => i.toObject())
|
||||
|
||||
game.system.wasteland.config.listeNiveauSkill = WastelandUtility.createDirectOptionList(0, 10)
|
||||
game.system.wasteland.config.listeNiveauCreature = WastelandUtility.createDirectOptionList(0, 35)
|
||||
game.system.wasteland.config.modificateurOptions = WastelandUtility.createArrayOptionList(-15, 15)
|
||||
game.system.wasteland.config.pointsAmeOptions = WastelandUtility.createDirectOptionList(0, 20)
|
||||
|
||||
// Note: listeNiveauSkill, listeNiveauCreature, etc. are now created in init hook
|
||||
// to be available immediately when sheets are opened
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -160,9 +158,35 @@ export class WastelandUtility {
|
||||
let message = game.messages.get(messageId)
|
||||
let rollData = message.getFlag("world", "wasteland-roll")
|
||||
let actor = WastelandUtility.getActorFromRollData(rollData)
|
||||
|
||||
// Sauvegarder le résultat précédent
|
||||
let previousResult = {
|
||||
diceResult: rollData.diceResult,
|
||||
finalResult: rollData.finalResult,
|
||||
diceFormula: rollData.diceFormula
|
||||
}
|
||||
|
||||
// Récupérer la prédilection utilisée
|
||||
let predilectionUsed = foundry.utils.duplicate(rollData.competence.system.predilections[predIdx])
|
||||
|
||||
// Marquer la prédilection comme utilisée
|
||||
await actor.setPredilectionUsed(rollData.competence._id, predIdx)
|
||||
|
||||
// Mettre à jour la compétence dans rollData
|
||||
rollData.competence = foundry.utils.duplicate(actor.getCompetence(rollData.competence._id))
|
||||
await WastelandUtility.rollWasteland(rollData)
|
||||
|
||||
// Lancer le reroll avec prédilection
|
||||
await WastelandUtility.rollWastelandPredilection(rollData, predilectionUsed, previousResult)
|
||||
})
|
||||
|
||||
$(html).on("click", '.arme-roll-degats', async event => {
|
||||
let messageId = WastelandUtility.findChatMessageId(event.currentTarget)
|
||||
let message = game.messages.get(messageId)
|
||||
let rollData = message.getFlag("world", "wasteland-roll")
|
||||
if (rollData && rollData.arme) {
|
||||
let actor = WastelandUtility.getActorFromRollData(rollData)
|
||||
await actor.rollArmeDegats(rollData.arme._id)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -170,8 +194,10 @@ export class WastelandUtility {
|
||||
static async preloadHandlebarsTemplates() {
|
||||
|
||||
const templatePaths = [
|
||||
'systems/fvtt-wasteland/templates/editor-notes-gm.html',
|
||||
'systems/fvtt-wasteland/templates/partial-item-description.html'
|
||||
'systems/fvtt-wasteland/templates/editor-notes-gm.hbs',
|
||||
'systems/fvtt-wasteland/templates/partial-item-description.hbs',
|
||||
'systems/fvtt-wasteland/templates/partial-item-header.hbs',
|
||||
'systems/fvtt-wasteland/templates/partial-item-nav.hbs'
|
||||
]
|
||||
return foundry.applications.handlebars.loadTemplates(templatePaths);
|
||||
}
|
||||
@@ -356,16 +382,19 @@ export class WastelandUtility {
|
||||
if (rollData.attrKey == "tochoose") { // No attr selected, force address
|
||||
rollData.attrKey = "adr"
|
||||
}
|
||||
if (!rollData.attr) {
|
||||
rollData.actionImg = "systems/fvtt-wasteland/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
|
||||
if (!rollData.attr && actor && actor.system.attributs && actor.system.attributs[rollData.attrKey]) {
|
||||
rollData.attr = foundry.utils.duplicate(actor.system.attributs[rollData.attrKey])
|
||||
if (rollData.attr.labelnorm) {
|
||||
rollData.actionImg = "systems/fvtt-wasteland/assets/icons/" + rollData.attr.labelnorm + ".webp"
|
||||
}
|
||||
}
|
||||
|
||||
if (rollData.charme) {
|
||||
rollData.diceFormula = rollData.charmeDice
|
||||
} else {
|
||||
rollData.diceFormula = rollData.mainDice
|
||||
if (rollData.doubleD20) { // Multiply result !
|
||||
// Double D20 ne s'applique que si on lance un D20, pas un D10
|
||||
if (rollData.doubleD20 && rollData.mainDice === "1d20") {
|
||||
rollData.diceFormula += "*2"
|
||||
if (!rollData.isReroll) {
|
||||
actor.changeEclat(-1)
|
||||
@@ -377,14 +406,55 @@ export class WastelandUtility {
|
||||
if (rollData.competence) {
|
||||
rollData.predilections = foundry.utils.duplicate(rollData.competence.system.predilections.filter(pred => !pred.used) || [])
|
||||
let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0
|
||||
rollData.diceFormula += `+${rollData.attr.value}+${rollData.competence.system.niveau}+${rollData.modificateur}+${compmod}`
|
||||
let attrValue = rollData.attr?.value || 0
|
||||
rollData.diceFormula += `+${attrValue}+${rollData.competence.system.niveau}+${rollData.modificateur}+${compmod}`
|
||||
} else {
|
||||
rollData.diceFormula += `+${rollData.attr.value}*2+${rollData.modificateur}`
|
||||
let attrValue = rollData.attr?.value || 0
|
||||
rollData.diceFormula += `+${attrValue}*2+${rollData.modificateur}`
|
||||
}
|
||||
if (rollData.arme && rollData.arme.type == "arme") {
|
||||
rollData.diceFormula += `+${rollData.arme.system.bonusmaniementoff}`
|
||||
}
|
||||
|
||||
// Apply desavantages (tactical advantages)
|
||||
let desavantagesBonus = 0
|
||||
if (rollData.desavantages) {
|
||||
for (let desavantage in rollData.desavantages) {
|
||||
if (rollData.desavantages[desavantage]) {
|
||||
desavantagesBonus += 5
|
||||
}
|
||||
}
|
||||
desavantagesBonus = Math.min(15, desavantagesBonus)
|
||||
if (desavantagesBonus > 0) {
|
||||
rollData.diceFormula += `+${desavantagesBonus}`
|
||||
}
|
||||
}
|
||||
|
||||
// Monté ?
|
||||
if (rollData.isMonte) {
|
||||
rollData.diceFormula += "+5"
|
||||
}
|
||||
|
||||
// Specific modifiers for ranged combat
|
||||
if (rollData.arme?.system?.isDistance) {
|
||||
if (rollData.visee) {
|
||||
rollData.diceFormula += "+5"
|
||||
}
|
||||
if (rollData.cibleconsciente && rollData.defender) {
|
||||
rollData.diceFormula += `-${rollData.defender.system.attributs.adr.value}`
|
||||
}
|
||||
if (rollData.ciblecourt) {
|
||||
if (rollData.difficulte <= 15) { // Portée courte ou moins
|
||||
rollData.diceFormula += `-5`
|
||||
} else {
|
||||
rollData.diceFormula += `-10`
|
||||
}
|
||||
}
|
||||
if (rollData.typeCouvert && rollData.typeCouvert != "aucun" && rollData.config.couverts[rollData.typeCouvert]) {
|
||||
rollData.diceFormula += `+${rollData.config.couverts[rollData.typeCouvert].value}`
|
||||
}
|
||||
}
|
||||
|
||||
let myRoll = await new Roll(rollData.diceFormula).roll()
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
rollData.roll = foundry.utils.duplicate(myRoll)
|
||||
@@ -395,7 +465,7 @@ export class WastelandUtility {
|
||||
await this.computeResult(rollData, actor)
|
||||
|
||||
this.createChatWithRollMode(rollData.alias, {
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-wasteland/templates/chat-generic-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-wasteland/templates/chat-generic-result-v2.hbs`, rollData)
|
||||
}, rollData)
|
||||
|
||||
}
|
||||
@@ -413,11 +483,137 @@ export class WastelandUtility {
|
||||
await this.computeResult(rollData)
|
||||
|
||||
this.createChatWithRollMode(rollData.alias, {
|
||||
content: await renderTemplate(`systems/fvtt-wasteland/templates/chat-generic-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-wasteland/templates/chat-generic-result-v2.hbs`, rollData)
|
||||
}, rollData)
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async rollWastelandPredilection(rollData, predilectionUsed, previousResult) {
|
||||
// Sauvegarder le premier résultat
|
||||
rollData.firstRoll = {
|
||||
diceResult: previousResult.diceResult,
|
||||
finalResult: previousResult.finalResult,
|
||||
diceFormula: previousResult.diceFormula
|
||||
}
|
||||
rollData.predilectionUsed = predilectionUsed
|
||||
rollData.isPredilectionReroll = true
|
||||
|
||||
let actor = WastelandUtility.getActorFromRollData(rollData)
|
||||
if (rollData.attrKey == "tochoose") {
|
||||
rollData.attrKey = "adr"
|
||||
}
|
||||
if (!rollData.attr && actor && actor.system.attributs && actor.system.attributs[rollData.attrKey]) {
|
||||
rollData.attr = foundry.utils.duplicate(actor.system.attributs[rollData.attrKey])
|
||||
if (rollData.attr.labelnorm) {
|
||||
rollData.actionImg = "systems/fvtt-wasteland/assets/icons/" + rollData.attr.labelnorm + ".webp"
|
||||
}
|
||||
}
|
||||
|
||||
if (rollData.charme) {
|
||||
rollData.diceFormula = rollData.charmeDice
|
||||
} else {
|
||||
rollData.diceFormula = rollData.mainDice
|
||||
// Double D20 ne s'applique que si on lance un D20, pas un D10
|
||||
if (rollData.doubleD20 && rollData.mainDice === "1d20") {
|
||||
rollData.diceFormula += "*2"
|
||||
}
|
||||
}
|
||||
|
||||
if (rollData.competence) {
|
||||
rollData.predilections = foundry.utils.duplicate(rollData.competence.system.predilections.filter(pred => !pred.used) || [])
|
||||
let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0
|
||||
let attrValue = rollData.attr?.value || 0
|
||||
rollData.diceFormula += `+${attrValue}+${rollData.competence.system.niveau}+${rollData.modificateur}+${compmod}`
|
||||
} else {
|
||||
let attrValue = rollData.attr?.value || 0
|
||||
rollData.diceFormula += `+${attrValue}*2+${rollData.modificateur}`
|
||||
}
|
||||
if (rollData.arme && rollData.arme.type == "arme") {
|
||||
rollData.diceFormula += `+${rollData.arme.system.bonusmaniementoff}`
|
||||
}
|
||||
|
||||
// Apply desavantages (tactical advantages)
|
||||
if (rollData.desavantages) {
|
||||
let totalDesavantage = 0
|
||||
for (let key in rollData.desavantages) {
|
||||
if (rollData.desavantages[key]) {
|
||||
totalDesavantage += 5
|
||||
}
|
||||
}
|
||||
totalDesavantage = Math.min(totalDesavantage, 15)
|
||||
if (totalDesavantage > 0) {
|
||||
rollData.diceFormula += `+${totalDesavantage}`
|
||||
}
|
||||
}
|
||||
|
||||
// Apply mounted bonus
|
||||
if (rollData.isMonte) {
|
||||
rollData.diceFormula += `+5`
|
||||
}
|
||||
|
||||
// Apply ranged combat modifiers
|
||||
if (rollData.arme && rollData.arme.system && rollData.arme.system.isDistance) {
|
||||
if (rollData.visee) {
|
||||
rollData.diceFormula += `+5`
|
||||
}
|
||||
if (rollData.cibleconsciente && rollData.defender) {
|
||||
let adrMalus = -(rollData.defender.system?.attributs?.adr?.value || 0)
|
||||
rollData.diceFormula += `${adrMalus}`
|
||||
}
|
||||
if (rollData.ciblecourt) {
|
||||
if (rollData.portee === "portee-courte" || rollData.portee === "portee-moyenne") {
|
||||
rollData.diceFormula += `-5`
|
||||
} else {
|
||||
rollData.diceFormula += `-10`
|
||||
}
|
||||
}
|
||||
if (rollData.couvert && rollData.typeCouvertValue) {
|
||||
rollData.diceFormula += `${rollData.typeCouvertValue}`
|
||||
}
|
||||
}
|
||||
|
||||
// Nouveau jet de dé
|
||||
let myRoll = await new Roll(rollData.diceFormula).roll()
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
rollData.roll = foundry.utils.duplicate(myRoll)
|
||||
rollData.diceResult = myRoll.total
|
||||
|
||||
rollData.bonusFormula = "0"
|
||||
if (rollData.charme && rollData.charme.system.bonusmajeur > 0) {
|
||||
rollData.bonusFormula = `${rollData.charme.system.bonusmajeur}d6`
|
||||
rollData.textBonus = "Bonus de Charme"
|
||||
}
|
||||
|
||||
rollData.finalResult = rollData.diceResult
|
||||
let bonusRoll = await new Roll(rollData.bonusFormula).roll()
|
||||
await this.showDiceSoNice(bonusRoll, game.settings.get("core", "rollMode"))
|
||||
rollData.bonusRoll = foundry.utils.duplicate(bonusRoll)
|
||||
rollData.finalResult += rollData.bonusRoll.total
|
||||
|
||||
// Comparer avec le premier jet et garder le meilleur
|
||||
rollData.secondRoll = {
|
||||
diceResult: rollData.diceResult,
|
||||
finalResult: rollData.finalResult
|
||||
}
|
||||
|
||||
if (rollData.firstRoll.finalResult > rollData.finalResult) {
|
||||
// Garder le premier résultat
|
||||
rollData.diceResult = rollData.firstRoll.diceResult
|
||||
rollData.finalResult = rollData.firstRoll.finalResult
|
||||
rollData.keptRoll = "first"
|
||||
} else {
|
||||
// Garder le second résultat
|
||||
rollData.keptRoll = "second"
|
||||
}
|
||||
|
||||
await this.computeResult(rollData)
|
||||
|
||||
this.createChatWithRollMode(rollData.alias, {
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-wasteland/templates/chat-generic-result-v2.hbs`, rollData)
|
||||
}, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getUsers(filter) {
|
||||
return game.users.filter(filter).map(user => user.data._id);
|
||||
@@ -508,6 +704,7 @@ export class WastelandUtility {
|
||||
pointAmeOptions: this.getPointAmeOptions(),
|
||||
difficulte: 0,
|
||||
modificateur: 0,
|
||||
config: game.system.wasteland.config,
|
||||
}
|
||||
WastelandUtility.updateWithTarget(rollData)
|
||||
return rollData
|
||||
@@ -519,6 +716,7 @@ export class WastelandUtility {
|
||||
if (target) {
|
||||
rollData.defenderTokenId = target.id
|
||||
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
|
||||
rollData.defender = defender.toObject() // For template access
|
||||
rollData.armeDefense = defender.getBestDefenseValue()
|
||||
if (rollData.armeDefense) {
|
||||
rollData.difficulte = rollData.armeDefense.system.totalDefensif
|
||||
@@ -567,6 +765,85 @@ export class WastelandUtility {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static cancelBlessure(li) {
|
||||
let msgId = $(li).data("message-id")
|
||||
let msg = game.messages.get(msgId)
|
||||
if (msg) {
|
||||
let rollData = msg.getFlag("world", "wasteland-roll")
|
||||
let actor = WastelandUtility.getActorFromRollData(rollData)
|
||||
|
||||
// Vérifier que l'acteur a au moins 1 point d'éclat
|
||||
if (actor.getEclat() < 1) {
|
||||
ui.notifications.warn("Pas assez de points d'Éclat")
|
||||
return
|
||||
}
|
||||
|
||||
// Déduire 1 point d'éclat
|
||||
actor.changeEclat(-1)
|
||||
|
||||
// Annuler la dernière blessure (incrémenter la santé)
|
||||
let currentSante = actor.system.sante.value
|
||||
let maxSante = actor.system.sante.max
|
||||
if (currentSante < maxSante) {
|
||||
actor.update({ 'system.sante.value': currentSante + 1 })
|
||||
ui.notifications.info("Blessure annulée - 1 Point d'Éclat dépensé")
|
||||
} else {
|
||||
ui.notifications.warn("Vous êtes déjà en pleine santé")
|
||||
// Rembourser le point d'éclat
|
||||
actor.changeEclat(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static reloadBA(li) {
|
||||
let msgId = $(li).data("message-id")
|
||||
let msg = game.messages.get(msgId)
|
||||
if (msg) {
|
||||
let rollData = msg.getFlag("world", "wasteland-roll")
|
||||
let actor = WastelandUtility.getActorFromRollData(rollData)
|
||||
|
||||
// Vérifier que l'acteur a au moins 1 point d'éclat
|
||||
if (actor.getEclat() < 1) {
|
||||
ui.notifications.warn("Pas assez de points d'Éclat")
|
||||
return
|
||||
}
|
||||
|
||||
// Déduire 1 point d'éclat
|
||||
actor.changeEclat(-1)
|
||||
|
||||
// Recharger les points de Bonne Aventure au maximum
|
||||
let maxBA = actor.system.bonneaventure.base
|
||||
actor.update({ 'system.bonneaventure.actuelle': maxBA })
|
||||
ui.notifications.info(`Points de Bonne Aventure rechargés à ${maxBA} - 1 Point d'Éclat dépensé`)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static incDecSante(li, value, costBA) {
|
||||
let msgId = $(li).data("message-id")
|
||||
let msg = game.messages.get(msgId)
|
||||
if (msg) {
|
||||
let rollData = msg.getFlag("world", "wasteland-roll")
|
||||
let actor = WastelandUtility.getActorFromRollData(rollData)
|
||||
|
||||
// Vérifier que l'acteur a assez de points de Bonne Aventure
|
||||
if (actor.getBonneAventure() < costBA) {
|
||||
ui.notifications.warn("Pas assez de points de Bonne Aventure")
|
||||
return
|
||||
}
|
||||
|
||||
// Déduire les points de Bonne Aventure
|
||||
actor.changeBonneAventure(-costBA)
|
||||
|
||||
// Incrémenter la santé
|
||||
actor.incDecSante(value)
|
||||
|
||||
ui.notifications.info(`+${value} Point(s) de Santé - ${costBA} Point(s) de Bonne Aventure dépensé(s)`)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static chatRollMenu(html, options) {
|
||||
let canApply = li => canvas.tokens.controlled.length && li.find(".wasteland-roll").length
|
||||
@@ -640,7 +917,7 @@ export class WastelandUtility {
|
||||
name: "Gain de 1 Point de Santé / 24 heure (1 point de Bonne Aventure)",
|
||||
icon: "<i class='fas fa-user-plus'></i>",
|
||||
condition: canApply && hasBA,
|
||||
callback: li => WastelandUtility.incDecSante(1)
|
||||
callback: li => WastelandUtility.incDecSante(li, 1, 1)
|
||||
}
|
||||
)
|
||||
options.push(
|
||||
@@ -648,7 +925,7 @@ export class WastelandUtility {
|
||||
name: "Gain de 2 Points de Santé / 24 heure (2 points de Bonne Aventure)",
|
||||
icon: "<i class='fas fa-user-plus'></i>",
|
||||
condition: canApply && hasBA2,
|
||||
callback: li => WastelandUtility.incDecSante(2)
|
||||
callback: li => WastelandUtility.incDecSante(li, 2, 2)
|
||||
}
|
||||
)
|
||||
options.push(
|
||||
@@ -704,30 +981,24 @@ export class WastelandUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async confirmDelete(actorSheet, li) {
|
||||
let itemId = li.data("item-id");
|
||||
let msgTxt = "<p>Are you sure to remove this Item ?";
|
||||
let buttons = {
|
||||
delete: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Yes, remove it",
|
||||
callback: () => {
|
||||
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
icon: '<i class="fas fa-times"></i>',
|
||||
label: "Cancel"
|
||||
}
|
||||
const itemId = li.dataset.itemId
|
||||
if (!itemId) return
|
||||
|
||||
const item = actorSheet.document.items.get(itemId)
|
||||
if (!item) return
|
||||
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: { title: "Confirmer la suppression" },
|
||||
content: `<p>Êtes-vous sûr de vouloir supprimer <strong>${item.name}</strong> ?</p>`,
|
||||
rejectClose: false,
|
||||
modal: true,
|
||||
yes: { label: "Supprimer", icon: "fa-trash" },
|
||||
no: { label: "Annuler", icon: "fa-times" }
|
||||
})
|
||||
|
||||
if (confirmed) {
|
||||
await actorSheet.document.deleteEmbeddedDocuments("Item", [itemId])
|
||||
}
|
||||
msgTxt += "</p>";
|
||||
let d = new Dialog({
|
||||
title: "Confirm removal",
|
||||
content: msgTxt,
|
||||
buttons: buttons,
|
||||
default: "cancel"
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
}
|
||||
1
node_modules/.bin/acorn
generated
vendored
Symbolic link
1
node_modules/.bin/acorn
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../acorn/bin/acorn
|
||||
1
node_modules/.bin/atob
generated
vendored
Symbolic link
1
node_modules/.bin/atob
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../atob/bin/atob.js
|
||||
1
node_modules/.bin/color-support
generated
vendored
Symbolic link
1
node_modules/.bin/color-support
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../color-support/bin.js
|
||||
1
node_modules/.bin/errno
generated
vendored
Symbolic link
1
node_modules/.bin/errno
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../errno/cli.js
|
||||
1
node_modules/.bin/gulp
generated
vendored
Symbolic link
1
node_modules/.bin/gulp
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../gulp/bin/gulp.js
|
||||
1
node_modules/.bin/image-size
generated
vendored
Symbolic link
1
node_modules/.bin/image-size
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../image-size/bin/image-size.js
|
||||
1
node_modules/.bin/lessc
generated
vendored
Symbolic link
1
node_modules/.bin/lessc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../less/bin/lessc
|
||||
1
node_modules/.bin/mime
generated
vendored
Symbolic link
1
node_modules/.bin/mime
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../mime/cli.js
|
||||
1
node_modules/.bin/needle
generated
vendored
Symbolic link
1
node_modules/.bin/needle
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../needle/bin/needle
|
||||
1
node_modules/.bin/resolve
generated
vendored
Symbolic link
1
node_modules/.bin/resolve
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../resolve/bin/resolve
|
||||
1
node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver
|
||||
1
node_modules/.bin/which
generated
vendored
Symbolic link
1
node_modules/.bin/which
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../which/bin/which
|
||||
4965
node_modules/.package-lock.json
generated
vendored
Normal file
4965
node_modules/.package-lock.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
node_modules/@gulp-sourcemaps/identity-map/LICENSE
generated
vendored
Normal file
21
node_modules/@gulp-sourcemaps/identity-map/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
40
node_modules/@gulp-sourcemaps/identity-map/README.md
generated
vendored
Normal file
40
node_modules/@gulp-sourcemaps/identity-map/README.md
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# @gulp-sourcemaps/identity-map
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Gulp plugin for generating an identity sourcemap for a file.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var identityMap = require('@gulp-sourcemaps/identity-map');
|
||||
|
||||
gulp.src(...)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(identityMap()) // .js and .css files will get a generated sourcemap
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(...))
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `identityMap()`
|
||||
|
||||
Returns an `objectMode` Transform stream that processes each file with a `.sourceMap` property and buffered contents. A sourcemap is generated and attached for each `.js` and `.css` file.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/@gulp-sourcemaps/identity-map.svg
|
||||
[npm-url]: https://npmjs.org/package/@gulp-sourcemaps/identity-map
|
||||
[npm-image]: http://img.shields.io/npm/v/@gulp-sourcemaps/identity-map.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulp-sourcemaps/identity-map
|
||||
[travis-image]: http://img.shields.io/travis/gulp-sourcemaps/identity-map.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/phated/identity-map
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/phated/identity-map.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulp-sourcemaps/identity-map
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulp-sourcemaps/identity-map.svg
|
||||
35
node_modules/@gulp-sourcemaps/identity-map/index.js
generated
vendored
Normal file
35
node_modules/@gulp-sourcemaps/identity-map/index.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
var through = require('through2');
|
||||
var normalizePath = require('normalize-path');
|
||||
|
||||
var generate = require('./lib/generate');
|
||||
|
||||
function identityMap() {
|
||||
|
||||
function transform(file, _, cb) {
|
||||
if (!file.sourceMap || !file.isBuffer()) {
|
||||
return cb(null, file);
|
||||
}
|
||||
|
||||
var sourcePath = normalizePath(file.relative);
|
||||
var contents = file.contents.toString();
|
||||
|
||||
switch (file.extname) {
|
||||
case '.js': {
|
||||
file.sourceMap = generate.js(sourcePath, contents);
|
||||
break;
|
||||
}
|
||||
case '.css': {
|
||||
file.sourceMap = generate.css(sourcePath, contents);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cb(null, file);
|
||||
}
|
||||
|
||||
return through.obj(transform);
|
||||
}
|
||||
|
||||
module.exports = identityMap;
|
||||
53
node_modules/@gulp-sourcemaps/identity-map/lib/generate.js
generated
vendored
Normal file
53
node_modules/@gulp-sourcemaps/identity-map/lib/generate.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
'use strict';
|
||||
|
||||
var acorn = require('acorn');
|
||||
var postcss = require('postcss');
|
||||
var SourceMapGenerator = require('source-map').SourceMapGenerator;
|
||||
|
||||
function generateJs(sourcePath, fileContent) {
|
||||
var generator = new SourceMapGenerator({ file: sourcePath });
|
||||
var tokenizer = acorn.tokenizer(fileContent, {
|
||||
allowHashBang: true,
|
||||
locations: true,
|
||||
});
|
||||
|
||||
/* eslint no-constant-condition: 0 */
|
||||
while (true) {
|
||||
var token = tokenizer.getToken();
|
||||
|
||||
if (token.type.label === 'eof') {
|
||||
break;
|
||||
}
|
||||
var mapping = {
|
||||
original: token.loc.start,
|
||||
generated: token.loc.start,
|
||||
source: sourcePath,
|
||||
};
|
||||
if (token.type.label === 'name') {
|
||||
mapping.name = token.value;
|
||||
}
|
||||
generator.addMapping(mapping);
|
||||
}
|
||||
generator.setSourceContent(sourcePath, fileContent);
|
||||
|
||||
return generator.toJSON();
|
||||
}
|
||||
|
||||
var postcssSourceMapOptions = {
|
||||
inline: false,
|
||||
prev: false,
|
||||
sourcesContent: true,
|
||||
annotation: false,
|
||||
};
|
||||
|
||||
function generateCss(sourcePath, fileContent) {
|
||||
var root = postcss.parse(fileContent, { from: sourcePath });
|
||||
var result = root.toResult({ to: sourcePath, map: postcssSourceMapOptions });
|
||||
|
||||
return result.map.toJSON();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
js: generateJs,
|
||||
css: generateCss,
|
||||
};
|
||||
9
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/LICENSE.md
generated
vendored
Normal file
9
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
**Copyright (c) Rod Vagg (the "Original Author") and additional contributors**
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
134
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/README.md
generated
vendored
Normal file
134
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/README.md
generated
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
# through2
|
||||
|
||||
[](https://nodei.co/npm/through2/)
|
||||
|
||||
**A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise**
|
||||
|
||||
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
|
||||
|
||||
***Note: Users of Node.js 0.10 and 0.12 should install `through2@2.x`. As of through2@3.x, readable-stream@3 is being used and is not compatible with older versions of Node.js.*** _v2.x support is being maintained on the [v2.x](https://github.com/rvagg/through2/tree/v2.x) branch._
|
||||
|
||||
```js
|
||||
fs.createReadStream('ex.txt')
|
||||
.pipe(through2(function (chunk, enc, callback) {
|
||||
for (var i = 0; i < chunk.length; i++)
|
||||
if (chunk[i] == 97)
|
||||
chunk[i] = 122 // swap 'a' for 'z'
|
||||
|
||||
this.push(chunk)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.pipe(fs.createWriteStream('out.txt'))
|
||||
.on('finish', () => doSomethingSpecial())
|
||||
```
|
||||
|
||||
Or object streams:
|
||||
|
||||
```js
|
||||
var all = []
|
||||
|
||||
fs.createReadStream('data.csv')
|
||||
.pipe(csv2())
|
||||
.pipe(through2.obj(function (chunk, enc, callback) {
|
||||
var data = {
|
||||
name : chunk[0]
|
||||
, address : chunk[3]
|
||||
, phone : chunk[10]
|
||||
}
|
||||
this.push(data)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.on('data', (data) => {
|
||||
all.push(data)
|
||||
})
|
||||
.on('end', () => {
|
||||
doSomethingSpecial(all)
|
||||
})
|
||||
```
|
||||
|
||||
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
|
||||
|
||||
## API
|
||||
|
||||
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
|
||||
|
||||
Consult the **[stream.Transform](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
|
||||
|
||||
### options
|
||||
|
||||
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
|
||||
|
||||
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2({ objectMode: true, allowHalfOpen: false },
|
||||
(chunk, enc, cb) => {
|
||||
cb(null, 'wut?') // note we can use the second argument on the callback
|
||||
// to provide data as an alternative to this.push('wut?')
|
||||
}
|
||||
))
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'))
|
||||
```
|
||||
|
||||
### transformFunction
|
||||
|
||||
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
|
||||
|
||||
To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
|
||||
|
||||
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
|
||||
|
||||
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
|
||||
|
||||
### flushFunction
|
||||
|
||||
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2(
|
||||
(chunk, enc, cb) => cb(null, chunk), // transform is a noop
|
||||
function (cb) { // flush function
|
||||
this.push('tacking on an extra buffer to the end');
|
||||
cb();
|
||||
}
|
||||
))
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'));
|
||||
```
|
||||
|
||||
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
|
||||
|
||||
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
|
||||
|
||||
```js
|
||||
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
|
||||
if (record.temp != null && record.unit == "F") {
|
||||
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
|
||||
record.unit = "C"
|
||||
}
|
||||
this.push(record)
|
||||
callback()
|
||||
})
|
||||
|
||||
// Create instances of FToC like so:
|
||||
var converter = new FToC()
|
||||
// Or:
|
||||
var converter = FToC()
|
||||
// Or specify/override options when you instantiate, if you prefer:
|
||||
var converter = FToC({objectMode: true})
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
|
||||
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
|
||||
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
|
||||
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
|
||||
- the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one
|
||||
|
||||
## License
|
||||
|
||||
**through2** is Copyright (c) Rod Vagg and additional contributors and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
|
||||
32
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/package.json
generated
vendored
Normal file
32
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "through2",
|
||||
"version": "3.0.2",
|
||||
"description": "A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise",
|
||||
"main": "through2.js",
|
||||
"scripts": {
|
||||
"test": "nyc node test/test.js | faucet && nyc report"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rvagg/through2.git"
|
||||
},
|
||||
"keywords": [
|
||||
"stream",
|
||||
"streams2",
|
||||
"through",
|
||||
"transform"
|
||||
],
|
||||
"author": "Rod Vagg <r@va.gg> (https://github.com/rvagg)",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.4",
|
||||
"readable-stream": "2 || 3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bl": "~2.0.1",
|
||||
"faucet": "0.0.1",
|
||||
"nyc": "~13.1.0",
|
||||
"stream-spigot": "~3.0.6",
|
||||
"tape": "~4.9.1"
|
||||
}
|
||||
}
|
||||
95
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/through2.js
generated
vendored
Normal file
95
node_modules/@gulp-sourcemaps/identity-map/node_modules/through2/through2.js
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
var Transform = require('readable-stream').Transform
|
||||
, inherits = require('inherits')
|
||||
|
||||
function DestroyableTransform(opts) {
|
||||
Transform.call(this, opts)
|
||||
this._destroyed = false
|
||||
}
|
||||
|
||||
inherits(DestroyableTransform, Transform)
|
||||
|
||||
DestroyableTransform.prototype.destroy = function(err) {
|
||||
if (this._destroyed) return
|
||||
this._destroyed = true
|
||||
|
||||
var self = this
|
||||
process.nextTick(function() {
|
||||
if (err)
|
||||
self.emit('error', err)
|
||||
self.emit('close')
|
||||
})
|
||||
}
|
||||
|
||||
// a noop _transform function
|
||||
function noop (chunk, enc, callback) {
|
||||
callback(null, chunk)
|
||||
}
|
||||
|
||||
|
||||
// create a new export function, used by both the main export and
|
||||
// the .ctor export, contains common logic for dealing with arguments
|
||||
function through2 (construct) {
|
||||
return function (options, transform, flush) {
|
||||
if (typeof options == 'function') {
|
||||
flush = transform
|
||||
transform = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
if (typeof transform != 'function')
|
||||
transform = noop
|
||||
|
||||
if (typeof flush != 'function')
|
||||
flush = null
|
||||
|
||||
return construct(options, transform, flush)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// main export, just make me a transform stream!
|
||||
module.exports = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(options)
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
|
||||
|
||||
// make me a reusable prototype that I can `new`, or implicitly `new`
|
||||
// with a constructor call
|
||||
module.exports.ctor = through2(function (options, transform, flush) {
|
||||
function Through2 (override) {
|
||||
if (!(this instanceof Through2))
|
||||
return new Through2(override)
|
||||
|
||||
this.options = Object.assign({}, options, override)
|
||||
|
||||
DestroyableTransform.call(this, this.options)
|
||||
}
|
||||
|
||||
inherits(Through2, DestroyableTransform)
|
||||
|
||||
Through2.prototype._transform = transform
|
||||
|
||||
if (flush)
|
||||
Through2.prototype._flush = flush
|
||||
|
||||
return Through2
|
||||
})
|
||||
|
||||
|
||||
module.exports.obj = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(Object.assign({ objectMode: true, highWaterMark: 16 }, options))
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
49
node_modules/@gulp-sourcemaps/identity-map/package.json
generated
vendored
Normal file
49
node_modules/@gulp-sourcemaps/identity-map/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "@gulp-sourcemaps/identity-map",
|
||||
"version": "2.0.1",
|
||||
"description": "Gulp plugin for generating an identity sourcemap for a file.",
|
||||
"author": "Gulp-sourcemaps Team",
|
||||
"contributors": [
|
||||
"Blaine Bublitz <blaine.bublitz@gmail.com>"
|
||||
],
|
||||
"repository": "gulp-sourcemaps/identity-map",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"pretest": "npm run lint",
|
||||
"test": "nyc mocha --async-only",
|
||||
"coveralls": "nyc report --reporter=text-lcov | coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": "^6.4.1",
|
||||
"normalize-path": "^3.0.0",
|
||||
"postcss": "^7.0.16",
|
||||
"source-map": "^0.6.0",
|
||||
"through2": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^3.0.3",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-gulp": "^3.0.1",
|
||||
"expect": "^1.19.0",
|
||||
"mississippi": "^4.0.0",
|
||||
"mocha": "^6.1.4",
|
||||
"nyc": "^14.1.0",
|
||||
"vinyl": "^2.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"sourcemap",
|
||||
"identity",
|
||||
"generate",
|
||||
"stream"
|
||||
]
|
||||
}
|
||||
21
node_modules/@gulp-sourcemaps/map-sources/LICENSE
generated
vendored
Normal file
21
node_modules/@gulp-sourcemaps/map-sources/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
52
node_modules/@gulp-sourcemaps/map-sources/README.md
generated
vendored
Normal file
52
node_modules/@gulp-sourcemaps/map-sources/README.md
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
# @gulp-sourcemaps/map-sources
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Gulp plugin for mapping sources of a sourcemap.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var mapSources = require('@gulp-sourcemaps/map-sources');
|
||||
|
||||
gulp.src(...)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(mapSources(function(sourcePath, file) {
|
||||
return '../' + sourcePath;
|
||||
}))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest(...))
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `mapSources(mapFn)`
|
||||
|
||||
Takes a map function as the only argument. Returns an `objectMode` Transform stream.
|
||||
|
||||
#### `mapFn(sourcePath, file)`
|
||||
|
||||
The map function is called once per value of the `sources` array of a `sourceMap` attached to each [`Vinyl`][vinyl-url] object passed through the stream. The map function is called with the `sourcePath` string from the `sources` array and the `file` object it originated from. The return value replaces the original value in the array.
|
||||
|
||||
If a `Vinyl` object doesn't have a `sourceMap` or `sourceMap.sources` property, the file is passed through the stream without having the `mapFn` called.
|
||||
|
||||
All `sources` are normalized to use `/` instead of `\\` as path separators.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[vinyl-url]: https://github.com/gulpjs/vinyl
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/@gulp-sourcemaps/map-sources.svg
|
||||
[npm-url]: https://npmjs.org/package/@gulp-sourcemaps/map-sources
|
||||
[npm-image]: http://img.shields.io/npm/v/@gulp-sourcemaps/map-sources.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulp-sourcemaps/map-sources
|
||||
[travis-image]: http://img.shields.io/travis/gulp-sourcemaps/map-sources.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/phated/map-sources
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/phated/map-sources.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulp-sourcemaps/map-sources
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulp-sourcemaps/map-sources.svg
|
||||
30
node_modules/@gulp-sourcemaps/map-sources/index.js
generated
vendored
Normal file
30
node_modules/@gulp-sourcemaps/map-sources/index.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
var through = require('through2');
|
||||
var normalize = require('normalize-path');
|
||||
|
||||
function mapSources(mapFn) {
|
||||
|
||||
function transform(file, _, cb) {
|
||||
if (!file.sourceMap || !file.sourceMap.sources) {
|
||||
return cb(null, file);
|
||||
}
|
||||
|
||||
function mapper(sourcePath) {
|
||||
var result = sourcePath;
|
||||
if (typeof mapFn === 'function') {
|
||||
result = mapFn(sourcePath, file);
|
||||
}
|
||||
|
||||
return normalize(result);
|
||||
}
|
||||
|
||||
file.sourceMap.sources = file.sourceMap.sources.map(mapper);
|
||||
|
||||
cb(null, file);
|
||||
}
|
||||
|
||||
return through.obj(transform);
|
||||
}
|
||||
|
||||
module.exports = mapSources;
|
||||
21
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/LICENSE
generated
vendored
Normal file
21
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
92
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/README.md
generated
vendored
Normal file
92
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/README.md
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
# normalize-path [](https://www.npmjs.com/package/normalize-path) [](https://npmjs.org/package/normalize-path) [](https://npmjs.org/package/normalize-path) [](https://travis-ci.org/jonschlinkert/normalize-path)
|
||||
|
||||
> Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save normalize-path
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var normalize = require('normalize-path');
|
||||
|
||||
normalize('\\foo\\bar\\baz\\');
|
||||
//=> '/foo/bar/baz'
|
||||
|
||||
normalize('./foo/bar/baz/');
|
||||
//=> './foo/bar/baz'
|
||||
```
|
||||
|
||||
Pass `false` as the last argument to **keep** trailing slashes:
|
||||
|
||||
```js
|
||||
normalize('./foo/bar/baz/', false);
|
||||
//=> './foo/bar/baz/'
|
||||
|
||||
normalize('foo\\bar\\baz\\', false);
|
||||
//=> 'foo/bar/baz/'
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.")
|
||||
* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.")
|
||||
* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.")
|
||||
* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.")
|
||||
* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.")
|
||||
* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.")
|
||||
* [path-segments](https://www.npmjs.com/package/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc. | [homepage](https://github.com/jonschlinkert/path-segments "Get n specific segments of a file path, e.g. first 2, last 3, etc.")
|
||||
* [rewrite-ext](https://www.npmjs.com/package/rewrite-ext): Automatically re-write the destination extension of a filepath based on the source extension. e.g… [more](https://github.com/jonschlinkert/rewrite-ext) | [homepage](https://github.com/jonschlinkert/rewrite-ext "Automatically re-write the destination extension of a filepath based on the source extension. e.g `.coffee` => `.js`. This will only rename the ext, no other path parts are modified.")
|
||||
* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 31 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 1 | [phated](https://github.com/phated) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 29, 2017._
|
||||
19
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/index.js
generated
vendored
Normal file
19
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/index.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/*!
|
||||
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
var removeTrailingSeparator = require('remove-trailing-separator');
|
||||
|
||||
module.exports = function normalizePath(str, stripTrailing) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError('expected a string');
|
||||
}
|
||||
str = str.replace(/[\\\/]+/g, '/');
|
||||
if (stripTrailing !== false) {
|
||||
str = removeTrailingSeparator(str);
|
||||
}
|
||||
return str;
|
||||
};
|
||||
78
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/package.json
generated
vendored
Normal file
78
node_modules/@gulp-sourcemaps/map-sources/node_modules/normalize-path/package.json
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "normalize-path",
|
||||
"description": "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.",
|
||||
"version": "2.1.1",
|
||||
"homepage": "https://github.com/jonschlinkert/normalize-path",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://twitter.com/BlaineBublitz)",
|
||||
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)"
|
||||
],
|
||||
"repository": "jonschlinkert/normalize-path",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/normalize-path/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"remove-trailing-separator": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"benchmarked": "^0.1.1",
|
||||
"gulp-format-md": "^0.1.11",
|
||||
"minimist": "^1.2.0",
|
||||
"mocha": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"backslash",
|
||||
"file",
|
||||
"filepath",
|
||||
"fix",
|
||||
"forward",
|
||||
"fp",
|
||||
"fs",
|
||||
"normalize",
|
||||
"path",
|
||||
"slash",
|
||||
"slashes",
|
||||
"trailing",
|
||||
"unix",
|
||||
"urix"
|
||||
],
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"contains-path",
|
||||
"ends-with",
|
||||
"is-absolute",
|
||||
"is-relative",
|
||||
"parse-filepath",
|
||||
"path-ends-with",
|
||||
"path-segments",
|
||||
"rewrite-ext",
|
||||
"unixify"
|
||||
],
|
||||
"description": "Other useful libraries for working with paths in node.js:"
|
||||
},
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
||||
9
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/LICENSE.md
generated
vendored
Normal file
9
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
**Copyright (c) Rod Vagg (the "Original Author") and additional contributors**
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
134
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/README.md
generated
vendored
Normal file
134
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/README.md
generated
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
# through2
|
||||
|
||||
[](https://nodei.co/npm/through2/)
|
||||
|
||||
**A tiny wrapper around Node streams.Transform (Streams2/3) to avoid explicit subclassing noise**
|
||||
|
||||
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
|
||||
|
||||
Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**.
|
||||
|
||||
```js
|
||||
fs.createReadStream('ex.txt')
|
||||
.pipe(through2(function (chunk, enc, callback) {
|
||||
for (var i = 0; i < chunk.length; i++)
|
||||
if (chunk[i] == 97)
|
||||
chunk[i] = 122 // swap 'a' for 'z'
|
||||
|
||||
this.push(chunk)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.pipe(fs.createWriteStream('out.txt'))
|
||||
.on('finish', () => doSomethingSpecial())
|
||||
```
|
||||
|
||||
Or object streams:
|
||||
|
||||
```js
|
||||
var all = []
|
||||
|
||||
fs.createReadStream('data.csv')
|
||||
.pipe(csv2())
|
||||
.pipe(through2.obj(function (chunk, enc, callback) {
|
||||
var data = {
|
||||
name : chunk[0]
|
||||
, address : chunk[3]
|
||||
, phone : chunk[10]
|
||||
}
|
||||
this.push(data)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.on('data', (data) => {
|
||||
all.push(data)
|
||||
})
|
||||
.on('end', () => {
|
||||
doSomethingSpecial(all)
|
||||
})
|
||||
```
|
||||
|
||||
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
|
||||
|
||||
## API
|
||||
|
||||
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
|
||||
|
||||
Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
|
||||
|
||||
### options
|
||||
|
||||
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
|
||||
|
||||
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2({ objectMode: true, allowHalfOpen: false },
|
||||
(chunk, enc, cb) => {
|
||||
cb(null, 'wut?') // note we can use the second argument on the callback
|
||||
// to provide data as an alternative to this.push('wut?')
|
||||
}
|
||||
)
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'))
|
||||
```
|
||||
|
||||
### transformFunction
|
||||
|
||||
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
|
||||
|
||||
To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
|
||||
|
||||
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
|
||||
|
||||
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
|
||||
|
||||
### flushFunction
|
||||
|
||||
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2(
|
||||
(chunk, enc, cb) => cb(null, chunk), // transform is a noop
|
||||
function (cb) { // flush function
|
||||
this.push('tacking on an extra buffer to the end');
|
||||
cb();
|
||||
}
|
||||
))
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'));
|
||||
```
|
||||
|
||||
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
|
||||
|
||||
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
|
||||
|
||||
```js
|
||||
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
|
||||
if (record.temp != null && record.unit == "F") {
|
||||
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
|
||||
record.unit = "C"
|
||||
}
|
||||
this.push(record)
|
||||
callback()
|
||||
})
|
||||
|
||||
// Create instances of FToC like so:
|
||||
var converter = new FToC()
|
||||
// Or:
|
||||
var converter = FToC()
|
||||
// Or specify/override options when you instantiate, if you prefer:
|
||||
var converter = FToC({objectMode: true})
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
|
||||
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
|
||||
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
|
||||
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
|
||||
- the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one
|
||||
|
||||
## License
|
||||
|
||||
**through2** is Copyright (c) Rod Vagg [@rvagg](https://twitter.com/rvagg) and additional contributors and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
|
||||
33
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/package.json
generated
vendored
Normal file
33
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/package.json
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "through2",
|
||||
"version": "2.0.5",
|
||||
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
|
||||
"main": "through2.js",
|
||||
"scripts": {
|
||||
"test": "node test/test.js | faucet"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rvagg/through2.git"
|
||||
},
|
||||
"keywords": [
|
||||
"stream",
|
||||
"streams2",
|
||||
"through",
|
||||
"transform"
|
||||
],
|
||||
"author": "Rod Vagg <r@va.gg> (https://github.com/rvagg)",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"readable-stream": "~2.3.6",
|
||||
"xtend": "~4.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bl": "~2.0.1",
|
||||
"faucet": "0.0.1",
|
||||
"nyc": "~13.1.0",
|
||||
"safe-buffer": "~5.1.2",
|
||||
"stream-spigot": "~3.0.6",
|
||||
"tape": "~4.9.1"
|
||||
}
|
||||
}
|
||||
96
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/through2.js
generated
vendored
Normal file
96
node_modules/@gulp-sourcemaps/map-sources/node_modules/through2/through2.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
var Transform = require('readable-stream').Transform
|
||||
, inherits = require('util').inherits
|
||||
, xtend = require('xtend')
|
||||
|
||||
function DestroyableTransform(opts) {
|
||||
Transform.call(this, opts)
|
||||
this._destroyed = false
|
||||
}
|
||||
|
||||
inherits(DestroyableTransform, Transform)
|
||||
|
||||
DestroyableTransform.prototype.destroy = function(err) {
|
||||
if (this._destroyed) return
|
||||
this._destroyed = true
|
||||
|
||||
var self = this
|
||||
process.nextTick(function() {
|
||||
if (err)
|
||||
self.emit('error', err)
|
||||
self.emit('close')
|
||||
})
|
||||
}
|
||||
|
||||
// a noop _transform function
|
||||
function noop (chunk, enc, callback) {
|
||||
callback(null, chunk)
|
||||
}
|
||||
|
||||
|
||||
// create a new export function, used by both the main export and
|
||||
// the .ctor export, contains common logic for dealing with arguments
|
||||
function through2 (construct) {
|
||||
return function (options, transform, flush) {
|
||||
if (typeof options == 'function') {
|
||||
flush = transform
|
||||
transform = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
if (typeof transform != 'function')
|
||||
transform = noop
|
||||
|
||||
if (typeof flush != 'function')
|
||||
flush = null
|
||||
|
||||
return construct(options, transform, flush)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// main export, just make me a transform stream!
|
||||
module.exports = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(options)
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
|
||||
|
||||
// make me a reusable prototype that I can `new`, or implicitly `new`
|
||||
// with a constructor call
|
||||
module.exports.ctor = through2(function (options, transform, flush) {
|
||||
function Through2 (override) {
|
||||
if (!(this instanceof Through2))
|
||||
return new Through2(override)
|
||||
|
||||
this.options = xtend(options, override)
|
||||
|
||||
DestroyableTransform.call(this, this.options)
|
||||
}
|
||||
|
||||
inherits(Through2, DestroyableTransform)
|
||||
|
||||
Through2.prototype._transform = transform
|
||||
|
||||
if (flush)
|
||||
Through2.prototype._flush = flush
|
||||
|
||||
return Through2
|
||||
})
|
||||
|
||||
|
||||
module.exports.obj = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
47
node_modules/@gulp-sourcemaps/map-sources/package.json
generated
vendored
Normal file
47
node_modules/@gulp-sourcemaps/map-sources/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "@gulp-sourcemaps/map-sources",
|
||||
"version": "1.0.0",
|
||||
"description": "Gulp plugin for mapping sources of a sourcemap.",
|
||||
"author": "Gulp-sourcemaps Team",
|
||||
"contributors": [
|
||||
"Blaine Bublitz <blaine.bublitz@gmail.com>"
|
||||
],
|
||||
"repository": "gulp-sourcemaps/map-sources",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint . && jscs index.js test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha --async-only",
|
||||
"cover": "istanbul cover _mocha --report lcovonly",
|
||||
"coveralls": "npm run cover && istanbul-coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"normalize-path": "^2.0.1",
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^1.7.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"expect": "^1.19.0",
|
||||
"istanbul": "^0.4.3",
|
||||
"istanbul-coveralls": "^1.0.3",
|
||||
"jscs": "^2.3.5",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mississippi": "^1.3.0",
|
||||
"mocha": "^2.4.5",
|
||||
"vinyl": "^2.0.1"
|
||||
},
|
||||
"keywords": [
|
||||
"sourcemap",
|
||||
"sources",
|
||||
"stream"
|
||||
]
|
||||
}
|
||||
550
node_modules/acorn/CHANGELOG.md
generated
vendored
Normal file
550
node_modules/acorn/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,550 @@
|
||||
## 6.4.0 (2019-11-26)
|
||||
|
||||
### New features
|
||||
|
||||
Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
|
||||
|
||||
## 6.3.0 (2019-08-12)
|
||||
|
||||
### New features
|
||||
|
||||
`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.
|
||||
|
||||
## 6.2.1 (2019-07-21)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
|
||||
|
||||
Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
|
||||
|
||||
## 6.2.0 (2019-07-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
|
||||
|
||||
Disallow binding `let` in patterns.
|
||||
|
||||
### New features
|
||||
|
||||
Support bigint syntax with `ecmaVersion` >= 10.
|
||||
|
||||
Support dynamic `import` syntax with `ecmaVersion` >= 10.
|
||||
|
||||
Upgrade to Unicode version 12.
|
||||
|
||||
## 6.1.1 (2019-02-27)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug that caused parsing default exports of with names to fail.
|
||||
|
||||
## 6.1.0 (2019-02-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix scope checking when redefining a `var` as a lexical binding.
|
||||
|
||||
### New features
|
||||
|
||||
Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
|
||||
|
||||
## 6.0.7 (2019-02-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Check that exported bindings are defined.
|
||||
|
||||
Don't treat `\u180e` as a whitespace character.
|
||||
|
||||
Check for duplicate parameter names in methods.
|
||||
|
||||
Don't allow shorthand properties when they are generators or async methods.
|
||||
|
||||
Forbid binding `await` in async arrow function's parameter list.
|
||||
|
||||
## 6.0.6 (2019-01-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The content of class declarations and expressions is now always parsed in strict mode.
|
||||
|
||||
Don't allow `let` or `const` to bind the variable name `let`.
|
||||
|
||||
Treat class declarations as lexical.
|
||||
|
||||
Don't allow a generator function declaration as the sole body of an `if` or `else`.
|
||||
|
||||
Ignore `"use strict"` when after an empty statement.
|
||||
|
||||
Allow string line continuations with special line terminator characters.
|
||||
|
||||
Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
|
||||
|
||||
Fix bug with parsing `yield` in a `for` loop initializer.
|
||||
|
||||
Implement special cases around scope checking for functions.
|
||||
|
||||
## 6.0.5 (2019-01-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
|
||||
|
||||
Don't treat `let` as a keyword when the next token is `{` on the next line.
|
||||
|
||||
Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
|
||||
|
||||
## 6.0.4 (2018-11-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Further improvements to tokenizing regular expressions in corner cases.
|
||||
|
||||
## 6.0.3 (2018-11-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
|
||||
|
||||
Remove stray symlink in the package tarball.
|
||||
|
||||
## 6.0.2 (2018-09-26)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
|
||||
|
||||
## 6.0.1 (2018-09-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix wrong value in `version` export.
|
||||
|
||||
## 6.0.0 (2018-09-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
|
||||
|
||||
Forbid `new.target` in top-level arrow functions.
|
||||
|
||||
Fix issue with parsing a regexp after `yield` in some contexts.
|
||||
|
||||
### New features
|
||||
|
||||
The package now comes with TypeScript definitions.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default value of the `ecmaVersion` option is now 9 (2018).
|
||||
|
||||
Plugins work differently, and will have to be rewritten to work with this version.
|
||||
|
||||
The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
|
||||
|
||||
## 5.7.3 (2018-09-10)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix failure to tokenize regexps after expressions like `x.of`.
|
||||
|
||||
Better error message for unterminated template literals.
|
||||
|
||||
## 5.7.2 (2018-08-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Properly handle `allowAwaitOutsideFunction` in for statements.
|
||||
|
||||
Treat function declarations at the top level of modules like let bindings.
|
||||
|
||||
Don't allow async function declarations as the only statement under a label.
|
||||
|
||||
## 5.7.0 (2018-06-15)
|
||||
|
||||
### New features
|
||||
|
||||
Upgraded to Unicode 11.
|
||||
|
||||
## 5.6.0 (2018-05-31)
|
||||
|
||||
### New features
|
||||
|
||||
Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
|
||||
|
||||
Allow binding-less catch statements when ECMAVersion >= 10.
|
||||
|
||||
Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
|
||||
|
||||
## 5.5.3 (2018-03-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
|
||||
|
||||
## 5.5.2 (2018-03-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.
|
||||
|
||||
## 5.5.1 (2018-03-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix misleading error message for octal escapes in template strings.
|
||||
|
||||
## 5.5.0 (2018-02-27)
|
||||
|
||||
### New features
|
||||
|
||||
The identifier character categorization is now based on Unicode version 10.
|
||||
|
||||
Acorn will now validate the content of regular expressions, including new ES9 features.
|
||||
|
||||
## 5.4.0 (2018-02-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow duplicate or escaped flags on regular expressions.
|
||||
|
||||
Disallow octal escapes in strings in strict mode.
|
||||
|
||||
### New features
|
||||
|
||||
Add support for async iteration.
|
||||
|
||||
Add support for object spread and rest.
|
||||
|
||||
## 5.3.0 (2017-12-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix parsing of floating point literals with leading zeroes in loose mode.
|
||||
|
||||
Allow duplicate property names in object patterns.
|
||||
|
||||
Don't allow static class methods named `prototype`.
|
||||
|
||||
Disallow async functions directly under `if` or `else`.
|
||||
|
||||
Parse right-hand-side of `for`/`of` as an assignment expression.
|
||||
|
||||
Stricter parsing of `for`/`in`.
|
||||
|
||||
Don't allow unicode escapes in contextual keywords.
|
||||
|
||||
### New features
|
||||
|
||||
Parsing class members was factored into smaller methods to allow plugins to hook into it.
|
||||
|
||||
## 5.2.1 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a token context corruption bug.
|
||||
|
||||
## 5.2.0 (2017-10-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix token context tracking for `class` and `function` in property-name position.
|
||||
|
||||
Make sure `%*` isn't parsed as a valid operator.
|
||||
|
||||
Allow shorthand properties `get` and `set` to be followed by default values.
|
||||
|
||||
Disallow `super` when not in callee or object position.
|
||||
|
||||
### New features
|
||||
|
||||
Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
|
||||
|
||||
## 5.1.2 (2017-09-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disable parsing of legacy HTML-style comments in modules.
|
||||
|
||||
Fix parsing of async methods whose names are keywords.
|
||||
|
||||
## 5.1.1 (2017-07-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix problem with disambiguating regexp and division after a class.
|
||||
|
||||
## 5.1.0 (2017-07-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
|
||||
|
||||
Parse zero-prefixed numbers with non-octal digits as decimal.
|
||||
|
||||
Allow object/array patterns in rest parameters.
|
||||
|
||||
Don't error when `yield` is used as a property name.
|
||||
|
||||
Allow `async` as a shorthand object property.
|
||||
|
||||
### New features
|
||||
|
||||
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
|
||||
|
||||
## 5.0.3 (2017-04-01)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix spurious duplicate variable definition errors for named functions.
|
||||
|
||||
## 5.0.2 (2017-03-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
|
||||
|
||||
## 5.0.0 (2017-03-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Raise an error for duplicated lexical bindings.
|
||||
|
||||
Fix spurious error when an assignement expression occurred after a spread expression.
|
||||
|
||||
Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
|
||||
|
||||
Allow labels in front or `var` declarations, even in strict mode.
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
|
||||
|
||||
## 4.0.11 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow all forms of member expressions to be parenthesized as lvalue.
|
||||
|
||||
## 4.0.10 (2017-02-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't expect semicolons after default-exported functions or classes, even when they are expressions.
|
||||
|
||||
Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
|
||||
|
||||
## 4.0.9 (2017-02-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
|
||||
|
||||
## 4.0.8 (2017-02-03)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
|
||||
|
||||
## 4.0.7 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Accept invalidly rejected code like `(x).y = 2` again.
|
||||
|
||||
Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
|
||||
|
||||
## 4.0.6 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
|
||||
|
||||
## 4.0.5 (2017-02-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Disallow parenthesized pattern expressions.
|
||||
|
||||
Allow keywords as export names.
|
||||
|
||||
Don't allow the `async` keyword to be parenthesized.
|
||||
|
||||
Properly raise an error when a keyword contains a character escape.
|
||||
|
||||
Allow `"use strict"` to appear after other string literal expressions.
|
||||
|
||||
Disallow labeled declarations.
|
||||
|
||||
## 4.0.4 (2016-12-19)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix crash when `export` was followed by a keyword that can't be
|
||||
exported.
|
||||
|
||||
## 4.0.3 (2016-08-16)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
|
||||
|
||||
Properly parse properties named `async` in ES2017 mode.
|
||||
|
||||
Fix bug where reserved words were broken in ES2017 mode.
|
||||
|
||||
## 4.0.2 (2016-08-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't ignore period or 'e' characters after octal numbers.
|
||||
|
||||
Fix broken parsing for call expressions in default parameter values of arrow functions.
|
||||
|
||||
## 4.0.1 (2016-08-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix false positives in duplicated export name errors.
|
||||
|
||||
## 4.0.0 (2016-08-07)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default `ecmaVersion` option value is now 7.
|
||||
|
||||
A number of internal method signatures changed, so plugins might need to be updated.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The parser now raises errors on duplicated export names.
|
||||
|
||||
`arguments` and `eval` can now be used in shorthand properties.
|
||||
|
||||
Duplicate parameter names in non-simple argument lists now always produce an error.
|
||||
|
||||
### New features
|
||||
|
||||
The `ecmaVersion` option now also accepts year-style version numbers
|
||||
(2015, etc).
|
||||
|
||||
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
|
||||
|
||||
Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
|
||||
|
||||
## 3.3.0 (2016-07-25)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix bug in tokenizing of regexp operator after a function declaration.
|
||||
|
||||
Fix parser crash when parsing an array pattern with a hole.
|
||||
|
||||
### New features
|
||||
|
||||
Implement check against complex argument lists in functions that enable strict mode in ES7.
|
||||
|
||||
## 3.2.0 (2016-06-07)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve handling of lack of unicode regexp support in host
|
||||
environment.
|
||||
|
||||
Properly reject shorthand properties whose name is a keyword.
|
||||
|
||||
### New features
|
||||
|
||||
Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
|
||||
|
||||
## 3.1.0 (2016-04-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Properly tokenize the division operator directly after a function expression.
|
||||
|
||||
Allow trailing comma in destructuring arrays.
|
||||
|
||||
## 3.0.4 (2016-02-25)
|
||||
|
||||
### Fixes
|
||||
|
||||
Allow update expressions as left-hand-side of the ES7 exponential operator.
|
||||
|
||||
## 3.0.2 (2016-02-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
|
||||
|
||||
## 3.0.0 (2016-02-10)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The default value of the `ecmaVersion` option is now 6 (used to be 5).
|
||||
|
||||
Support for comprehension syntax (which was dropped from the draft spec) has been removed.
|
||||
|
||||
### Fixes
|
||||
|
||||
`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
|
||||
|
||||
A parenthesized class or function expression after `export default` is now parsed correctly.
|
||||
|
||||
### New features
|
||||
|
||||
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
|
||||
|
||||
The identifier character ranges are now based on Unicode 8.0.0.
|
||||
|
||||
Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
|
||||
|
||||
## 2.7.0 (2016-01-04)
|
||||
|
||||
### Fixes
|
||||
|
||||
Stop allowing rest parameters in setters.
|
||||
|
||||
Disallow `y` rexexp flag in ES5.
|
||||
|
||||
Disallow `\00` and `\000` escapes in strict mode.
|
||||
|
||||
Raise an error when an import name is a reserved word.
|
||||
|
||||
## 2.6.2 (2015-11-10)
|
||||
|
||||
### Fixes
|
||||
|
||||
Don't crash when no options object is passed.
|
||||
|
||||
## 2.6.0 (2015-11-09)
|
||||
|
||||
### Fixes
|
||||
|
||||
Add `await` as a reserved word in module sources.
|
||||
|
||||
Disallow `yield` in a parameter default value for a generator.
|
||||
|
||||
Forbid using a comma after a rest pattern in an array destructuring.
|
||||
|
||||
### New features
|
||||
|
||||
Support parsing stdin in command-line tool.
|
||||
|
||||
## 2.5.0 (2015-10-27)
|
||||
|
||||
### Fixes
|
||||
|
||||
Fix tokenizer support in the command-line tool.
|
||||
|
||||
Stop allowing `new.target` outside of functions.
|
||||
|
||||
Remove legacy `guard` and `guardedHandler` properties from try nodes.
|
||||
|
||||
Stop allowing multiple `__proto__` properties on an object literal in strict mode.
|
||||
|
||||
Don't allow rest parameters to be non-identifier patterns.
|
||||
|
||||
Check for duplicate paramter names in arrow functions.
|
||||
19
node_modules/acorn/LICENSE
generated
vendored
Normal file
19
node_modules/acorn/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2012-2018 by various contributors (see AUTHORS)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
269
node_modules/acorn/README.md
generated
vendored
Normal file
269
node_modules/acorn/README.md
generated
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
# Acorn
|
||||
|
||||
A tiny, fast JavaScript parser written in JavaScript.
|
||||
|
||||
## Community
|
||||
|
||||
Acorn is open source software released under an
|
||||
[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).
|
||||
|
||||
You are welcome to
|
||||
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
|
||||
requests on [github](https://github.com/acornjs/acorn). For questions
|
||||
and discussion, please use the
|
||||
[Tern discussion forum](https://discuss.ternjs.net).
|
||||
|
||||
## Installation
|
||||
|
||||
The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
npm install acorn
|
||||
```
|
||||
|
||||
Alternately, you can download the source and build acorn yourself:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/acornjs/acorn.git
|
||||
cd acorn
|
||||
npm install
|
||||
```
|
||||
|
||||
## Interface
|
||||
|
||||
**parse**`(input, options)` is the main interface to the library. The
|
||||
`input` parameter is a string, `options` can be undefined or an object
|
||||
setting some of the options listed below. The return value will be an
|
||||
abstract syntax tree object as specified by the [ESTree
|
||||
spec](https://github.com/estree/estree).
|
||||
|
||||
```javascript
|
||||
let acorn = require("acorn");
|
||||
console.log(acorn.parse("1 + 1"));
|
||||
```
|
||||
|
||||
When encountering a syntax error, the parser will raise a
|
||||
`SyntaxError` object with a meaningful message. The error object will
|
||||
have a `pos` property that indicates the string offset at which the
|
||||
error occurred, and a `loc` object that contains a `{line, column}`
|
||||
object referring to that same position.
|
||||
|
||||
Options can be provided by passing a second argument, which should be
|
||||
an object containing any of these fields:
|
||||
|
||||
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
|
||||
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial
|
||||
support). This influences support for strict mode, the set of
|
||||
reserved words, and support for new syntax features. Default is 9.
|
||||
|
||||
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
|
||||
implemented by Acorn. Other proposed new features can be implemented
|
||||
through plugins.
|
||||
|
||||
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
||||
either `"script"` or `"module"`. This influences global strict mode
|
||||
and parsing of `import` and `export` declarations.
|
||||
|
||||
**NOTE**: If set to `"module"`, then static `import` / `export` syntax
|
||||
will be valid, even if `ecmaVersion` is less than 6.
|
||||
|
||||
- **onInsertedSemicolon**: If given a callback, that callback will be
|
||||
called whenever a missing semicolon is inserted by the parser. The
|
||||
callback will be given the character offset of the point where the
|
||||
semicolon is inserted as argument, and if `locations` is on, also a
|
||||
`{line, column}` object representing this position.
|
||||
|
||||
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
|
||||
commas.
|
||||
|
||||
- **allowReserved**: If `false`, using a reserved word will generate
|
||||
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
|
||||
versions. When given the value `"never"`, reserved words and
|
||||
keywords can also not be used as property names (as in Internet
|
||||
Explorer's old parser).
|
||||
|
||||
- **allowReturnOutsideFunction**: By default, a return statement at
|
||||
the top level raises an error. Set this to `true` to accept such
|
||||
code.
|
||||
|
||||
- **allowImportExportEverywhere**: By default, `import` and `export`
|
||||
declarations can only appear at a program's top level. Setting this
|
||||
option to `true` allows them anywhere where a statement is allowed.
|
||||
|
||||
- **allowAwaitOutsideFunction**: By default, `await` expressions can
|
||||
only appear inside `async` functions. Setting this option to
|
||||
`true` allows to have top-level `await` expressions. They are
|
||||
still not allowed in non-`async` functions, though.
|
||||
|
||||
- **allowHashBang**: When this is enabled (off by default), if the
|
||||
code starts with the characters `#!` (as in a shellscript), the
|
||||
first line will be treated as a comment.
|
||||
|
||||
- **locations**: When `true`, each node has a `loc` object attached
|
||||
with `start` and `end` subobjects, each of which contains the
|
||||
one-based line and zero-based column numbers in `{line, column}`
|
||||
form. Default is `false`.
|
||||
|
||||
- **onToken**: If a function is passed for this option, each found
|
||||
token will be passed in same format as tokens returned from
|
||||
`tokenizer().getToken()`.
|
||||
|
||||
If array is passed, each found token is pushed to it.
|
||||
|
||||
Note that you are not allowed to call the parser from the
|
||||
callback—that will corrupt its internal state.
|
||||
|
||||
- **onComment**: If a function is passed for this option, whenever a
|
||||
comment is encountered the function will be called with the
|
||||
following parameters:
|
||||
|
||||
- `block`: `true` if the comment is a block comment, false if it
|
||||
is a line comment.
|
||||
- `text`: The content of the comment.
|
||||
- `start`: Character offset of the start of the comment.
|
||||
- `end`: Character offset of the end of the comment.
|
||||
|
||||
When the `locations` options is on, the `{line, column}` locations
|
||||
of the comment’s start and end are passed as two additional
|
||||
parameters.
|
||||
|
||||
If array is passed for this option, each found comment is pushed
|
||||
to it as object in Esprima format:
|
||||
|
||||
```javascript
|
||||
{
|
||||
"type": "Line" | "Block",
|
||||
"value": "comment text",
|
||||
"start": Number,
|
||||
"end": Number,
|
||||
// If `locations` option is on:
|
||||
"loc": {
|
||||
"start": {line: Number, column: Number}
|
||||
"end": {line: Number, column: Number}
|
||||
},
|
||||
// If `ranges` option is on:
|
||||
"range": [Number, Number]
|
||||
}
|
||||
```
|
||||
|
||||
Note that you are not allowed to call the parser from the
|
||||
callback—that will corrupt its internal state.
|
||||
|
||||
- **ranges**: Nodes have their start and end characters offsets
|
||||
recorded in `start` and `end` properties (directly on the node,
|
||||
rather than the `loc` object, which holds line/column data. To also
|
||||
add a
|
||||
[semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
|
||||
`range` property holding a `[start, end]` array with the same
|
||||
numbers, set the `ranges` option to `true`.
|
||||
|
||||
- **program**: It is possible to parse multiple files into a single
|
||||
AST by passing the tree produced by parsing the first file as the
|
||||
`program` option in subsequent parses. This will add the toplevel
|
||||
forms of the parsed file to the "Program" (top) node of an existing
|
||||
parse tree.
|
||||
|
||||
- **sourceFile**: When the `locations` option is `true`, you can pass
|
||||
this option to add a `source` attribute in every node’s `loc`
|
||||
object. Note that the contents of this option are not examined or
|
||||
processed in any way; you are free to use whatever format you
|
||||
choose.
|
||||
|
||||
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
|
||||
will be added (regardless of the `location` option) directly to the
|
||||
nodes, rather than the `loc` object.
|
||||
|
||||
- **preserveParens**: If this option is `true`, parenthesized expressions
|
||||
are represented by (non-standard) `ParenthesizedExpression` nodes
|
||||
that have a single `expression` property containing the expression
|
||||
inside parentheses.
|
||||
|
||||
**parseExpressionAt**`(input, offset, options)` will parse a single
|
||||
expression in a string, and return its AST. It will not complain if
|
||||
there is more of the string left after the expression.
|
||||
|
||||
**tokenizer**`(input, options)` returns an object with a `getToken`
|
||||
method that can be called repeatedly to get the next token, a `{start,
|
||||
end, type, value}` object (with added `loc` property when the
|
||||
`locations` option is enabled and `range` property when the `ranges`
|
||||
option is enabled). When the token's type is `tokTypes.eof`, you
|
||||
should stop calling the method, since it will keep returning that same
|
||||
token forever.
|
||||
|
||||
In ES6 environment, returned result can be used as any other
|
||||
protocol-compliant iterable:
|
||||
|
||||
```javascript
|
||||
for (let token of acorn.tokenizer(str)) {
|
||||
// iterate over the tokens
|
||||
}
|
||||
|
||||
// transform code to array of tokens:
|
||||
var tokens = [...acorn.tokenizer(str)];
|
||||
```
|
||||
|
||||
**tokTypes** holds an object mapping names to the token type objects
|
||||
that end up in the `type` properties of tokens.
|
||||
|
||||
**getLineInfo**`(input, offset)` can be used to get a `{line,
|
||||
column}` object for a given program string and offset.
|
||||
|
||||
### The `Parser` class
|
||||
|
||||
Instances of the **`Parser`** class contain all the state and logic
|
||||
that drives a parse. It has static methods `parse`,
|
||||
`parseExpressionAt`, and `tokenizer` that match the top-level
|
||||
functions by the same name.
|
||||
|
||||
When extending the parser with plugins, you need to call these methods
|
||||
on the extended version of the class. To extend a parser with plugins,
|
||||
you can use its static `extend` method.
|
||||
|
||||
```javascript
|
||||
var acorn = require("acorn");
|
||||
var jsx = require("acorn-jsx");
|
||||
var JSXParser = acorn.Parser.extend(jsx());
|
||||
JSXParser.parse("foo(<bar/>)");
|
||||
```
|
||||
|
||||
The `extend` method takes any number of plugin values, and returns a
|
||||
new `Parser` class that includes the extra parser logic provided by
|
||||
the plugins.
|
||||
|
||||
## Command line interface
|
||||
|
||||
The `bin/acorn` utility can be used to parse a file from the command
|
||||
line. It accepts as arguments its input file and the following
|
||||
options:
|
||||
|
||||
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
|
||||
to parse. Default is version 9.
|
||||
|
||||
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
|
||||
|
||||
- `--locations`: Attaches a "loc" object to each node with "start" and
|
||||
"end" subobjects, each of which contains the one-based line and
|
||||
zero-based column numbers in `{line, column}` form.
|
||||
|
||||
- `--allow-hash-bang`: If the code starts with the characters #! (as
|
||||
in a shellscript), the first line will be treated as a comment.
|
||||
|
||||
- `--compact`: No whitespace is used in the AST output.
|
||||
|
||||
- `--silent`: Do not output the AST, just return the exit status.
|
||||
|
||||
- `--help`: Print the usage information and quit.
|
||||
|
||||
The utility spits out the syntax tree as JSON data.
|
||||
|
||||
## Existing plugins
|
||||
|
||||
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
|
||||
|
||||
Plugins for ECMAScript proposals:
|
||||
|
||||
- [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
|
||||
- [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
|
||||
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
|
||||
- [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator)
|
||||
- [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n
|
||||
4
node_modules/acorn/bin/acorn
generated
vendored
Executable file
4
node_modules/acorn/bin/acorn
generated
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
require('../dist/bin.js');
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user