Initial system development

This commit is contained in:
sladecraven 2021-01-18 17:46:39 +01:00
parent 199dc4c6ed
commit ca29af6b61
10 changed files with 1446 additions and 38 deletions

18
lang/en.json Normal file
View File

@ -0,0 +1,18 @@
{
"SHEET.TabStats": "Stats",
"SHEET.TabSkills": "Skills",
"SHEET.TabFight": "Fight",
"SHEET.TabGears": "Gears",
"SHEET.TabDescription": "Description",
"STATS.physical": "physical",
"STATS.mental": "mental",
"STATS.strength": "Strength",
"STATS.dexterity": "Dextrity",
"STATS.speed": "Speed",
"STATS.endurance": "Endurance",
"STATS.intelligence": "Intelligence",
"STATS.perception": "Perception",
"STATS.charisma": "Charisma",
"STATS.determination": "Determination"
}

View File

@ -24,6 +24,10 @@ export class SoSActorSheet extends ActorSheet {
getData() {
let data = super.getData();
console.log("stats", data);
//data.stats = duplicate(this.actor.stats);
//data.scores = duplicate(this.actor.scores);
return data;
}
@ -37,7 +41,7 @@ export class SoSActorSheet extends ActorSheet {
activateListeners(html) {
super.activateListeners(html);
HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
//HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;

View File

@ -32,7 +32,6 @@ export class SoSActor extends Actor {
return actor;
}
return super.create(data, options);
}

View File

@ -11,9 +11,7 @@
import { SoSActor } from "./actor.js";
import { SoSItemSheet } from "./item-sheet.js";
import { SoSActorSheet } from "./actor-sheet.js";
import { SoSUtility } from "./rdd-utility.js";
//import { SoSTokenHud } from "./rdd-token-hud.js";
//import { SoSCommands } from "./rdd-commands.js";
import { SoSUtility } from "./sos-utility.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
@ -36,7 +34,7 @@ Hooks.once("init", async function () {
// preload handlebars templates
SoSUtility.preloadHandlebarsTemplates();
// Create useful storage space
game.system.sos = { TMRUtility: TMRUtility }
game.system.sos = { }
/* -------------------------------------------- */
// Set an initiative formula for the system
@ -59,9 +57,9 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("foundryvtt-reve-de-dragon", SoSActorSheet, { types: ["character"], makeDefault: true });
Actors.registerSheet("foundryvtt-shadows-over-sol", SoSActorSheet, { types: ["character"], makeDefault: true });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("foundryvtt-reve-de-dragon", SoSItemSheet, { makeDefault: true });
Items.registerSheet("foundryvtt-shadows-over-sol", SoSItemSheet, { makeDefault: true });
// Patch the initiative formula
_patch_initiative();
@ -70,7 +68,7 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */
function welcomeMessage() {
ChatUtility.removeMyChatMessageContaining('<div id="welcome-message-sos">');
//ChatUtility.removeMyChatMessageContaining('<div id="welcome-message-sos">');
ChatMessage.create({
user: game.user._id,
whisper: [game.user._id],
@ -112,6 +110,6 @@ Hooks.on("chatMessage", (html, content, msg) => {
/* -------------------------------------------- */
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
RdDUtility.pushInitiativeOptions(html, options);
//SoS.pushInitiativeOptions(html, options);
}
)

View File

@ -3,11 +3,13 @@ export class SoSUtility {
/* -------------------------------------------- */
static async preloadHandlebarsTemplates() {
const templatePaths = [
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/editor-notes-gm.html',
'systems/foundryvtt-reve-de-dragon/templates/item-shet.html'
'systems/foundryvtt-shadows-over-sol/templates/actor-sheet.html',
'systems/foundryvtt-shadows-over-sol/templates/editor-notes-gm.html',
'systems/foundryvtt-shadows-over-sol/templates/stat-option-list.html',
'systems/foundryvtt-shadows-over-sol/templates/item-sheet.html'
]
return loadTemplates(templatePaths);
}
}

1371
styles/simple.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,11 @@
"name": "foundryvtt-shadows-over-sol",
"title": "Shadows over Sol",
"description": "Shadows over Sol for FoundryVTT",
"version": "0.0.1",
"version": "0.0.4",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9",
"templateVersion": 1,
"templateVersion": 4,
"author": "LeRatierBretonnien",
"esmodules": [ "module/sos-main.js" ],
"styles": ["styles/simple.css"],
@ -15,11 +15,17 @@
"packs": [
],
"library": false,
"languages": [],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
}
],
"gridDistance": 5,
"gridUnits": "ft",
"primaryTokenAttribute": "attributes.life",
"secondaryTokenAttribute": "attributes.endurance",
"primaryTokenAttribute": "",
"secondaryTokenAttribute": "",
"socket": true,
"url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-shadows-over-sol/",
"manifest": "https://gitlab.com/LeRatierBretonnien/foundryvtt-shadows-over-sol/raw/system.json",

View File

@ -2,10 +2,6 @@
"Actor": {
"types": ["character", "npc"],
"templates": {
"description": {
"description": "Description ...",
"gmnotes": "GM notes"
},
"subactors": {
"subactors": {
"followers": [],
@ -115,11 +111,11 @@
"eyes": "",
"hair": "",
"weight": "",
"sex": "",
"corp": "",
"genre": "",
"age": 0
},
"personnage": {
}
},
"character": {
"templates": [ "background", "common", "subactors" ]
},
"npc": {
@ -160,5 +156,4 @@
"price": 0
}
}
}
}

View File

@ -13,11 +13,11 @@
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="stats">Stats</a>
<a class="item" data-tab="skills">Skills</a>
<a class="item" data-tab="fight">Fight</a>
<a class="item" data-tab="gears">Gears</a>
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="stats">{{localize 'SHEET.TabStats'}}</a>
<a class="item" data-tab="skills">{{localize 'SHEET.TabSkills'}}</a>
<a class="item" data-tab="fight">{{localize 'SHEET.TabFight'}}</a>
<a class="item" data-tab="gears">{{localize 'SHEET.TabGears'}}</a>
<a class="item" data-tab="description">{{localize 'SHEET.TabDescription'}}</a>
</nav>
{{!-- Sheet Body --}}
@ -34,16 +34,20 @@
{{#each data.stats as |stat key|}}
{{#if stat.isLevelUp}}
<li class="stat flexrow xp-level-up" data-attribute="{{key}}">
<span class="stat-label flexrow tooltip tooltip-nobottom" name="data.stat.{{key}}.label">
<span class="stat-label flexrow tooltip tooltip-nobottom" name="data.stats.{{key}}.label">
<span class="tooltiptext ttt-xp">
{{localize STAT.levelUp}}
{{localize 'STAT.levelUp'}}
</span>
{{else}}
<li class="stat flexrow list-item" data-attribute="{{key}}">
{{/if}}
<a name={{key}}>{{stat.label}}</a></span>
<input class="stat-value flexrow" type="text" name="data.stat.{{key}}.value" value="{{stat.value}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}} />
<input class="stat-xp flexrow" type="text" name="data.stat.{{key}}.xp" value="{{stat.xp}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}} />
<a name={{key}}>{{localize stat.label}}</a></span>
<select class="stat-value flexrow" type="text" name="data.stats.{{key}}.value" value="{{stat.value}}" data-dtype="Number">
{{#select stat.value}}
{{>"systems/foundryvtt-shadows-over-sol/templates/stat-option-list.html"}}
{{/select}}
</select>
<input class="stat-xp flexrow" type="text" name="data.stats.{{key}}.xp" value="{{stat.xp}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}} />
</li>
{{/each}}
</ul>

View File

@ -0,0 +1,11 @@
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>