diff --git a/README.md b/README.md index d2fd772..771ac2e 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,16 @@ -# DeltaGreen System +# (Unofficial) Delta Green: The RPG Foundry System -This system is a Delta Green (standalone) system based on the Agent's Handbook from Arc Dream Publishing. - -# Delta Green Community License -Published by arrangement with the Delta Green Partnership. The intellectual property known as Delta Green is a trademark and copyright owned by the Delta Green Partnership, who has licensed its use here. The contents of this system are free for public use, excepting those elements that are components of the Delta Green intellectual property. +This is a fan made Foundry system for Delta Green: The RPG, based on the Agent's Handbook from Arc Dream Publishing. It is unaffiliated with Arc Dream Publishing. # Foundry VTT License This code uses the Foundry VTT and its API under the terms of the Limited License Agreement for Module Development. Foundry VTT is a Copyright of Foundry Gaming, LLC. -# Delta Green Foundry System License -The code (HTML, CSS, Javascript, etc.) in this system and any related information are provided under the MIT license, excepting that which comes via Foundry VTT -excepting that which is otherwise covered by the Delta Green Partnership and/or Arc Dream Publishing. +# Delta Green Community License +Published by arrangement with the Delta Green Partnership. The intellectual property known as Delta Green is a trademark and copyright owned by the Delta Green Partnership, who has licensed its use here. The contents of this system are licensed as detailed below, excepting those elements that are components of the Delta Green intellectual property. + +# System License +The code (HTML, CSS, Javascript, etc.) in this system and any related information are provided under the MIT license, excepting that which comes via Foundry VTT API. Copyright 2020 N. Eimers @@ -21,12 +20,12 @@ The above copyright notice and this permission notice shall be included in all c 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. -# Licenses, Citations and Shoutouts +# Other Licenses, Citations and Shoutouts System Base Code This system is built upon on Matt Smith's (AKA Asacolips) excellent Boilerplate System and corresponding tutorial. https://gitlab.com/asacolips-projects/foundry-mods/foundryvtt-system-tutorial -DIDACT GOTHIC +DIDACT GOTHIC FONT The font used in many places is Didact Gothic, by Daniel Johnson and Cyreal. https://fonts.google.com/specimen/Didact+Gothic?query=did#about diff --git a/css/deltagreen.css b/css/deltagreen.css index 8574059..b4630d8 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -263,7 +263,10 @@ a.btn-tiny{ margin-left: 5px; margin-right: 5px; font-size: 13px; - padding: 0px; + padding-top: 1px; + padding-bottom: 1px; + padding-right: 5px; + padding-left: 5px; text-decoration: none; background-color: #EEEEEE; @@ -296,6 +299,16 @@ span.max-attribute-value-label{ .deltagreen .skill-label{ margin: 5px; + align-content: flex-start; +} + +.deltagreen .skill-type-label{ + margin: 5px; +} + +input.percentile-skill-input{ + width: 25px; + min-width: 10px; } .deltagreen .sheet-header h2.profession{ @@ -308,4 +321,11 @@ span.max-attribute-value-label{ width: 100%; height: 100%; margin: 0; +} + +.typed-skill-flexrow{ + display: flex; + flex-direction: row; + margin: 5px; + padding: 5px; } \ No newline at end of file diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index ce87a21..56f74f3 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -138,6 +138,51 @@ export class DeltaGreenActorSheet extends ActorSheet { this.actor.update({"data": updatedData}); }); + html.find('.btn-add-typed-skill').click(event => { + event.preventDefault(); + + let targetskill = event.target.getAttribute("data-typeskill"); + let updatedData = duplicate(this.actor.data.data); + + // It sucks, but seems like Foundry and/or Handlebars always converts 'types' from an array to an object... + // As such normal array functions like 'push' won't work. + // So just create an array, add all existing items to it, then update the existing object. + // Handlebars doesn't seem to be broken by this sudden change of type from 'Object' to 'Array'. + let typesArr = []; + let x; + for(x in updatedData.type_skills[targetskill].types){ + if(Number.isNumeric(x)){ + typesArr.push(updatedData.type_skills[targetskill].types[x]); + } + } + + typesArr.push({specialization:"New", proficiency: 0, failure: false}); + + updatedData.type_skills[targetskill].types = typesArr; + + this.actor.update({"data": updatedData}); + }); + + html.find('.btn-remove-typed-skill').click(event => { + event.preventDefault(); + let targetskill = event.target.getAttribute("data-typeskill"); + let skillindex = event.target.getAttribute("data-index"); + let updatedData = duplicate(this.actor.data.data); + + let typesArr = []; + let x; + for(x in updatedData.type_skills[targetskill].types){ + if(Number.isNumeric(x) && x != skillindex){ + typesArr.push(updatedData.type_skills[targetskill].types[x]); + } + } + + updatedData.type_skills[targetskill].types = typesArr; + + this.actor.update({"data": updatedData}); + //console.log(targetskill); + //console.log(skillindex); + }); } /** diff --git a/template.json b/template.json index bc7bf5a..551e2da 100644 --- a/template.json +++ b/template.json @@ -222,52 +222,52 @@ }, "type_skills":{ "art": { - "label": "Art (Type)", - "hasSubtypes": true, + "label": "Art", + "examples": "Sculpting, Painting, Dance, Music, Etc.", "types":[ { - "specialization": "Painting/Dance/Sculpture/Etc.", - "proficiency": 20, + "specialization": "Painting", + "proficiency": 0, "failure": false } ] }, "craft": { - "label": "Craft (Type)", - "hasSubtypes": true, + "label": "Craft", + "examples": "Mechanic, Carpentry, Electrical, Microelectronics, Locksmith, Gunsmith, Etc.", "types":[ { - "specialization": "Carpentry/Electrical/Etc.", + "specialization": "Electrical", "proficiency": 0, "failure": false } ] }, "military_science": { - "label": "Military Science (Type)", - "hasSubtypes": true, + "label": "Military Science", + "examples": "Land, Air, Sea, Etc.", "types":[ { - "specialization": "Land/Air/Sea/Etc.", + "specialization": "Land", "proficiency": 0, "failure": false } ] }, "pilot": { - "label": "Pilot (Type)", - "hasSubtypes": true, + "label": "Pilot", + "examples": "Airplane, Drone, Small Boat, Ship, Helicopter, Space Shuttle, etc.", "types":[ { - "specialization": "Airplane/Small Boat/Helicopter/Etc.", + "specialization": "Airplane", "proficiency": 0, "failure": false } ] }, "science": { - "label": "Science (Field)", - "hasSubtypes": true, + "label": "Science", + "examples": "Biology, Chemistry, Physics, Astronomy, Geology, Mathematics, etc.", "types":[ { "specialization": "Biology/Chemistry/Physics/Etc.", @@ -278,10 +278,10 @@ }, "foreign_languages": { "label": "Foreign Languages", - "hasSubtypes": true, + "examples": "Spanish, Yiddish, Aklo, etc.", "types":[ { - "specialization": "Spanish/Yiddish/Aklo/Etc.", + "specialization": "Spanish", "proficiency": 0, "failure": false } @@ -289,7 +289,7 @@ }, "other_skills": { "label": "Other Skills, Specialties, or Training", - "hasSubtypes": true, + "examples": "Lockpicks, SCUBA Diving, Parachuting, Some Exotic Weapon, etc.", "types":[ { "specialization": "", diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 36bcb1c..bfb8821 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -98,33 +98,39 @@ {{#each data.skills as |skill key|}}