Add New Ranks chceckboxes

Fix Updates for Skill/Skill Category Totals
Inventory Implementation
This commit is contained in:
Anthony Murphy 2022-09-18 21:31:15 +10:00
parent cfc645d888
commit cab5aa07f3
32 changed files with 1180 additions and 333 deletions

View File

@ -1,4 +1,4 @@
This tutorial is based on the video tutorials by Cédric Hauteville you can watch them here: https://www.youtube.com/playlist?list=PLFV9z59nkHDccUbRXVt623UdloPTclIrz parts of it were also lifted from the Foundry VTT Boilerplate system by XXX. This system is based on the video tutorials by Cédric Hauteville you can watch them here: https://www.youtube.com/playlist?list=PLFV9z59nkHDccUbRXVt623UdloPTclIrz parts of it were also lifted from the Foundry VTT Boilerplate system by XXX.
Icons have been sourced from https://game-icons.net Icons have been sourced from https://game-icons.net

View File

@ -1,27 +1,28 @@
Small Small
1. DONE - Add Relationship between skills and skill categories 1. DONE - Add Relationship between skills and skill categories
2. Remove Tables and replace with CSS Grid 2. DONE - Remove Tables from Player Sheet and replace with CSS Grid
3. Fix unaligned CSS 3. DONE - Fix unaligned CSS
4. Prevent Duplication on Drag and Drop for Skills and Skill Categories, possibly spells too. 4. Prevent Duplication on Drag and Drop for Skills and Skill Categories, possibly spells too.
DONE - Overriden _onDropItem on Player Sheet DONE - Overriden _onDropItem on Player Sheet
DONE - Skill Categories cannot be renamed if they are owned. DONE - Skill Categories cannot be renamed if they are owned.
DONE - Skills and Skill Categories are now seperate checks for Drag and Drop as some share names DONE - Skills and Skill Categories are now seperate checks for Drag and Drop as some share names
Spells ? Spells ?
5. Fix New Ranks Clickboxes - https://discord.com/channels/170995199584108546/670336275496042502/1018530650980102195 5. DONE - Fix New Ranks Clickboxes - https://discord.com/channels/170995199584108546/670336275496042502/1018530650980102195
https://github.com/megastruktur/foundryvtt-blades-in-the-dark/blob/master/templates/actor-sheet.html#L97 https://github.com/megastruktur/foundryvtt-blades-in-the-dark/blob/master/templates/actor-sheet.html#L97
https://github.com/megastruktur/foundryvtt-blades-in-the-dark/blob/00bed1cb1d222eab3ece62960941c54f3c272aac/module/blades.js#L69 https://github.com/megastruktur/foundryvtt-blades-in-the-dark/blob/00bed1cb1d222eab3ece62960941c54f3c272aac/module/blades.js#L69
6. DONE - Fix Favorites Clickboxes on Actor Page 6. DONE - Fix Favorites Clickboxes on Actor Page
DONE - Better Icon DONE - Better Icon
DONE - Make Clickable DONE - Make Clickable
7. Create Default Values for Character sheet 7. Create Default Values for Character sheet
8. Make a Localization Pass for Missed Text
Medium Medium
1. Inventory sorted by types 1. DONE Inventory sorted by types - Maybe Seperate Sections for now
i. Drag and drop should increment an item if it already exists. DONE (Will not Do - Not needed) - i. Drag and drop should increment an item if it already exists.
ii. Equipables DONE ii. Equipables
iii. Favorites DONE (Will not Do - Not Needed)iii. Favorites
2. Creature Sheet 2. Creature Sheet
3. Finish Character Sheet 3. Finish Character Sheet
Inventory Inventory
@ -29,7 +30,7 @@ Medium
Status Record (Possibly large) Status Record (Possibly large)
XP XP
4. Button to add all Skill Categories 4. Button to add all Skill Categories
5. Revisit Skill and Skill Category Progression (Pg 33) 5. Revisit Skill and Skill Category Progression (Pg 33, 69)
6. DONE - Add occupational, everyman, and restricted skill categories 6. DONE - Add occupational, everyman, and restricted skill categories
Large Large

View File

@ -130,6 +130,7 @@
"add_skillcat": "Add Skill Category" "add_skillcat": "Add Skill Category"
}, },
"pc_sheet_items": { "pc_sheet_items": {
"equipped": "Equipped",
"favorite": "Favorite", "favorite": "Favorite",
"quantity": "Quantity", "quantity": "Quantity",
"item_name": "Item Name", "item_name": "Item Name",
@ -163,7 +164,8 @@
"quantity": "Quantity", "quantity": "Quantity",
"weight": "Weight", "weight": "Weight",
"cost": "Cost", "cost": "Cost",
"prod_time": "Production Time" "prod_time": "Production Time",
"equipped": "Equipped"
}, },
"armor": { "armor": {
"at": "AT", "at": "AT",
@ -178,7 +180,8 @@
"weight": "Weight", "weight": "Weight",
"breakage_range": "B#s", "breakage_range": "B#s",
"strength": "Str", "strength": "Str",
"fumble_range": "Fumble" "fumble_range": "Fumble",
"equipped": "Equipped"
}, },
"herb_or_poison": { "herb_or_poison": {
"codes": "Codes", "codes": "Codes",

View File

@ -0,0 +1,44 @@
.armor-grid-container {
display: grid;
grid-template-columns: [name] 30% [equipped] 12% [at] 12% [quantity] 12% [weight] 12% [cost] 12% [controls] 10%;
}
.armor-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.armor-grid-container > div:nth-child(14n+1),
.armor-grid-container > div:nth-child(14n+2),
.armor-grid-container > div:nth-child(14n+3),
.armor-grid-container > div:nth-child(14n+4),
.armor-grid-container > div:nth-child(14n+5),
.armor-grid-container > div:nth-child(14n+6),
.armor-grid-container > div:nth-child(14n+7)
{
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.armor-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}

View File

@ -0,0 +1,44 @@
.herbs-grid-container {
display: grid;
grid-template-columns: [name] 30% [quantity] 11% [codes] 12% [af] 12% [weight] 12% [cost] 11% [controls] 12%;
}
.herbs-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.herbs-grid-container > div:nth-child(14n+1),
.herbs-grid-container > div:nth-child(14n+2),
.herbs-grid-container > div:nth-child(14n+3),
.herbs-grid-container > div:nth-child(14n+4),
.herbs-grid-container > div:nth-child(14n+5),
.herbs-grid-container > div:nth-child(14n+6),
.herbs-grid-container > div:nth-child(14n+7)
{
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.herbs-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}

View File

@ -0,0 +1,42 @@
.items-grid-container {
display: grid;
grid-template-columns: [name] 30% [quantity] 17% [weight] 17% [cost] 18% [controls] 18%;
}
.items-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.items-grid-container > div:nth-child(10n+1),
.items-grid-container > div:nth-child(10n+2),
.items-grid-container > div:nth-child(10n+3),
.items-grid-container > div:nth-child(10n+4),
.items-grid-container > div:nth-child(10n+5)
{
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.items-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}

View File

@ -0,0 +1,9 @@
.money-column {
flex-direction: column;
}
.money-container {
flex-direction: column;
flex-shrink: 1;
padding-left: 10px;
}

View File

@ -0,0 +1,49 @@
.skillcat-grid-container {
display: grid;
grid-template-columns: [skill-category-name] 10% [applicable-stats] 10% [dev-cost] 8% [num-ranks] 8% [new-ranks] 8% [rank-bonus] 8% [stat-bonus] 8% [prof-bonus] 8% [special-bonus-1] 8% [special-bonus-2] 8% [total-bonus] 8% [controls] 8%;
}
.skillcat-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
}
.skillcat-grid-container > div:nth-child(24n+1),
.skillcat-grid-container > div:nth-child(24n+2),
.skillcat-grid-container > div:nth-child(24n+3),
.skillcat-grid-container > div:nth-child(24n+4),
.skillcat-grid-container > div:nth-child(24n+5),
.skillcat-grid-container > div:nth-child(24n+6),
.skillcat-grid-container > div:nth-child(24n+7),
.skillcat-grid-container > div:nth-child(24n+8),
.skillcat-grid-container > div:nth-child(24n+9),
.skillcat-grid-container > div:nth-child(24n+10),
.skillcat-grid-container > div:nth-child(24n+11),
.skillcat-grid-container > div:nth-child(24n+12)
{
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.skillcat-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}

View File

@ -0,0 +1,48 @@
.skills-grid-container {
display: grid;
grid-template-columns: [favorite] 9% [skill-name] 11% [num-ranks] 9% [new-ranks] 9% [rank-bonus] 9% [category-bonus] 9% [item-bonus] 9% [special-bonus-1] 9% [special-bonus-2] 9% [total-bonus] 9% [controls] 8%;
}
.skills-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
}
.skills-grid-container > div:nth-child(22n+1),
.skills-grid-container > div:nth-child(22n+2),
.skills-grid-container > div:nth-child(22n+3),
.skills-grid-container > div:nth-child(22n+4),
.skills-grid-container > div:nth-child(22n+5),
.skills-grid-container > div:nth-child(22n+6),
.skills-grid-container > div:nth-child(22n+7),
.skills-grid-container > div:nth-child(22n+8),
.skills-grid-container > div:nth-child(22n+9),
.skills-grid-container > div:nth-child(22n+10),
.skills-grid-container > div:nth-child(22n+11)
{
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.skills-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}

View File

@ -0,0 +1,46 @@
.weapons-grid-container {
display: grid;
grid-template-columns: [name] 30% [equipped] 8% [breakage_range] 9% [fumble_range] 9% [strength] 9% [quantity] 9% [weight] 9% [cost] 9% [controls] 8%;
}
.weapons-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.weapons-grid-container > div:nth-child(18n+1),
.weapons-grid-container > div:nth-child(18n+2),
.weapons-grid-container > div:nth-child(18n+3),
.weapons-grid-container > div:nth-child(18n+4),
.weapons-grid-container > div:nth-child(18n+5),
.weapons-grid-container > div:nth-child(18n+6),
.weapons-grid-container > div:nth-child(18n+7),
.weapons-grid-container > div:nth-child(18n+8),
.weapons-grid-container > div:nth-child(18n+9)
{
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.weapons-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}

View File

@ -0,0 +1,157 @@
// General Elements
.container {
display: flex;
}
// Header CSS
.actor-icon {
flex-shrink: 1;
}
.header-container {
flex-grow: 2;
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.header-text {
display: flex;
align-items: center;
padding: 1px;
}
// Resource Elements in Headers
.resource-container {
display: flex;
flex-direction: row;
flex-grow: 3;
text-align: -webkit-center;
}
.resource-container > * {
flex: 1 1 0;
}
.resource-entry {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.resource-entry input{
width: 50px;
border: none;
}
.stat-container {
flex-direction: column;
flex-shrink: 1;
}
.stat-row {
align-items: center;
}
.equipment-container {
flex-direction: column;
flex-grow: 1;
}
.stat-block {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.stat-name, .money-name {
width: 75px;
border: none;
font-family: Signika, sans-serif;
font-size: 12px;
}
.stat-name input {
border: none;
}
.stat-header {
font-family: Signika, sans-serif;
font-size: 12px;
}
// Fixed Info CSS
.fixed-info-container {
flex-grow: 3;
flex-direction: row;
font-family: Signika, sans-serif;
font-size: 12px;
}
.fixed-info-section {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.armor-block {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.race-stat-fixed-info-block {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.role-traits-block {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.background-info-block {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
.resistance-block {
outline: 1px solid; /* use instead of border */
margin-top: 1px;
margin-left: 1px;
padding: 5px;
}
// Debugging
.red {
background-color: orangered;
}
.blue {
background-color: lightblue;
}
.grey {
background-color: lightgrey;
}
.green {
background-color: lightseagreen;
}

View File

@ -1,6 +1,21 @@
// Actor Sheet
@import "./actor-sheet/actor-sheet-skillcat.less";
@import "./actor-sheet/actor-sheet.less";
@import "./actor-sheet/actor-sheet-skills.less";
@import "./actor-sheet/actor-sheet-money.less";
@import "./actor-sheet/actor-sheet-items.less";
@import "./actor-sheet/actor-sheet-weapons.less";
@import "./actor-sheet/actor-sheet-armor.less";
@import "./actor-sheet/actor-sheet-herbs.less";
//Skill Category Sheet
@import "./skillcat-sheet/skillcat-sheet.less";
@import "./skillcat-sheet/applicable-stats-grid.less";
// Generics
@import "./item-sheet.less"; @import "./item-sheet.less";
@import "./actor-sheet.less"; //@import "./table.less";
@import "./skillcat-sheet.less";
@import "./money-sheet.less";
@import "./table.less";
@import "./grid.less";

View File

@ -0,0 +1,19 @@
.applicable-stats-grid-container {
display: grid;
grid-template-columns: [app-stat-1] 33% [app-stat-2] 33% [app-stat-3] 33%;
}
.applicable-stats-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
}

View File

@ -0,0 +1,23 @@
.skillcat-name, .skill-name, .item-name {
font-family: Signika, sans-serif;
font-size: 12px;
font-weight: bold;
text-align: center;
}
.skillcat-entry, .skill-entry, .item-entry {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}
.skillcat-headeritem, .skill-headeritem, .item-headeritem {
text-align: center;
font-weight: bold;
}
.skillcat-controls, .skill-controls, .item-controls {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}

View File

@ -53,8 +53,8 @@ rmss.stats = {
}; };
rmss.skill_designations = { rmss.skill_designations = {
none: "None", None: "None",
occupational: "Occupational", Occupational: "Occupational",
everyman: "Everyman", Everyman: "Everyman",
restricted: "Restricted" Restricted: "Restricted"
}; };

View File

@ -146,26 +146,17 @@ export class RMSSActor extends Actor {
// For each skill category return an object in this format. // For each skill category return an object in this format.
// {{ _id: "skill category name"}} // {{ _id: "skill category name"}}
// This is the format that the select helper on the skill sheet needs // This is the format that the select helper on the skill sheet needs
getOwnedSkillCategories() {
var ownedSkillCategories = {None: "None"}; getOwnedItemsByType(item_type) {
console.log("rmss | actor.js | Getting owned skill categories for: " + this.name); var ownedItems = {None: "None"};
console.log("rmss | actor.js | Getting owned " + item_type + " for: " + this.name);
for (const item of this.items) { for (const item of this.items) {
if (item.type === "skill_category") { if (item.type === item_type) {
ownedSkillCategories[item._id] = item.name; ownedItems[item._id] = item.name;
} }
} }
return(ownedSkillCategories); return(ownedItems);
} }
getOwnedSkills() {
var ownedSkills = {None: "None"};
console.log("rmss | actor.js | Getting owned skills for: " + this.name);
for (const item of this.items) {
if (item.type === "skill") {
ownedSkills[item._id] = item.name;
}
}
return(ownedSkills);
}
} }

View File

@ -45,9 +45,7 @@ export default class RMSSPlayerSheet extends ActorSheet {
if (itemData.type === "skill_category"){ if (itemData.type === "skill_category"){
// Get the already owned Items from the actor and push into an array // Get the already owned Items from the actor and push into an array
const owneditems = this.object.getOwnedSkillCategories(); const owneditems = this.object.getOwnedItemsByType("skill_category");
console.log(owneditems);
var ownedskillcatlist = Object.values(owneditems); var ownedskillcatlist = Object.values(owneditems);
@ -58,9 +56,7 @@ export default class RMSSPlayerSheet extends ActorSheet {
} }
} else if ( itemData.type === "skill") { } else if ( itemData.type === "skill") {
// Get the already owned Items from the actor and push into an array // Get the already owned Items from the actor and push into an array
const owneditems = this.object.getOwnedSkills(); const owneditems = this.object.getOwnedItemsByType("skill");
console.log(owneditems);
var ownedskilllist = Object.values(owneditems); var ownedskilllist = Object.values(owneditems);
@ -84,14 +80,23 @@ export default class RMSSPlayerSheet extends ActorSheet {
const gear = []; const gear = [];
const playerskill= []; const playerskill= [];
const skillcat = []; const skillcat = [];
const weapons = [];
const equipables = [];
const herbs = [];
// Iterate through items, allocating to containers // Iterate through items, allocating to containers
for (let i of context.items) { for (let i of context.items) {
i.img = i.img || DEFAULT_TOKEN; i.img = i.img || DEFAULT_TOKEN;
// Append to gear. // Append to gear.
if (i.type === 'item' || i.type === 'armor' || i.type === 'weapon' || i.type === 'herb_or_poison') { if (i.type === 'item') {
gear.push(i); gear.push(i);
} }
else if (i.type === 'weapon') {
weapons.push(i);
}
else if (i.type === 'herb_or_poison') {
herbs.push(i);
}
// Append to skill categories. // Append to skill categories.
else if (i.type === 'skill_category') { else if (i.type === 'skill_category') {
skillcat.push(i); skillcat.push(i);
@ -100,7 +105,11 @@ export default class RMSSPlayerSheet extends ActorSheet {
else if (i.type === 'skill') { else if (i.type === 'skill') {
playerskill.push(i); playerskill.push(i);
} }
else if (i.type === 'armor') {
equipables.push(i);
} }
}
// Sort Skill/Skillcat Arrays // Sort Skill/Skillcat Arrays
skillcat.sort(function (a, b){ skillcat.sort(function (a, b){
@ -128,13 +137,14 @@ export default class RMSSPlayerSheet extends ActorSheet {
context.gear = gear; context.gear = gear;
context.skillcat = skillcat; context.skillcat = skillcat;
context.playerskill = playerskill; context.playerskill = playerskill;
context.weapons = weapons;
context.equipables = equipables;
context.herbs = herbs;
} }
activateListeners(html) { activateListeners(html) {
super.activateListeners(html); super.activateListeners(html);
// NOTE: Can you do skill/item favorites this way?
// Render the item sheet for viewing/editing prior to the editable check. // Render the item sheet for viewing/editing prior to the editable check.
html.find('.item-edit').click(ev => { html.find('.item-edit').click(ev => {
const item = this.actor.items.get(ev.currentTarget.getAttribute("data-item-id")); const item = this.actor.items.get(ev.currentTarget.getAttribute("data-item-id"));
@ -151,8 +161,8 @@ export default class RMSSPlayerSheet extends ActorSheet {
// Delete Item // Delete Item
html.find('.item-delete').click(ev => { html.find('.item-delete').click(ev => {
console.log(ev.currentTarget.getAttribute("data-item-id"));
const item = this.actor.items.get(ev.currentTarget.getAttribute("data-item-id")); const item = this.actor.items.get(ev.currentTarget.getAttribute("data-item-id"));
//console.log(ev.currentTarget.getAttribute("data-item-id"));
item.delete(); item.delete();
}); });
@ -170,6 +180,52 @@ export default class RMSSPlayerSheet extends ActorSheet {
} }
console.log("After change: " + item.system.favorite); console.log("After change: " + item.system.favorite);
}); });
// Equip/Unequip Item
html.find('.equippable').click(ev => {
const item = this.actor.items.get(ev.currentTarget.getAttribute("data-item-id"));
console.log(item);
console.log("Before change: " + item.system.equipped);
if (item.system.equipped === true) {
console.log("Setting False");
item.update({system: {"equipped": false}});
} else {
console.log("Setting True");
item.update({system: {"equipped": true}});
}
console.log("After change: " + item.system.equipped);
});
// Change New Ranks value when clicked in player sheet. From 0-3.
html.find('.skill-newrank').click(ev => {
const item = this.actor.items.get(ev.currentTarget.getAttribute("data-item-id"));
console.log("Firing in the Player Sheet");
console.log(ev.currentTarget.getAttribute("value"));
console.log(ev.currentTarget.getAttribute("data-item-id"));
switch(ev.currentTarget.getAttribute("value")) {
case "0":
console.log("Skill NewRanks is 0 setting to 1");
item.update({system: {new_ranks:{ "value": 1 }}});
break;
case "1":
console.log("Skill NewRanks is 1 setting to 2");
item.update({system: {new_ranks:{ "value": 2 }}});
break;
case "2":
console.log("Skill NewRanks is 2 setting to 3");
item.update({system: {new_ranks:{ "value": 3 }}});
break;
case "3":
console.log("Skill NewRanks is 3 setting to 0");
item.update({system: {new_ranks:{ "value": 0 }}});
break;
}
});
} }
async _onItemCreate(event) { async _onItemCreate(event) {

View File

@ -21,17 +21,16 @@ export default class RMSSSkillCategorySheet extends ItemSheet {
const context = await super.getData(); const context = await super.getData();
// Get a list of stats that can be used as applicable stats // Get a list of stats that can be used as applicable stats
var applicable_stat_list = this.prepareApplicableStatValues(CONFIG); var applicableStatList = this.prepareApplicableStatNames(CONFIG);
//Get the currently selected value for all three applicable stats //Get the currently selected value for all three applicable stats
var applicable_stat_1_selected = this.prepareApplicableSelectedStat("app_stat_1"); var firstApplicableStat = this.prepareApplicableSelectedStat("app_stat_1");
var applicable_stat_2_selected = this.prepareApplicableSelectedStat("app_stat_2"); var secondApplicableStat = this.prepareApplicableSelectedStat("app_stat_2");
var applicable_stat_3_selected = this.prepareApplicableSelectedStat("app_stat_3"); var thirdApplicableStat = this.prepareApplicableSelectedStat("app_stat_3");
// Build and apply the display string for Applicable Stats // Build and apply the display string for Applicable Stats
var applicable_stat_text = this.buildApplicableStatsText(applicable_stat_1_selected, applicable_stat_2_selected, applicable_stat_3_selected); var applicableStatText = this.buildApplicableStatsText(firstApplicableStat, secondApplicableStat, thirdApplicableStat);
//context.item.system['applicable_stats'] = applicable_stat_text; context.item.system.applicable_stats = applicableStatText;
context.item.system.applicable_stats = applicable_stat_text;
var enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, {async: true}); var enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, {async: true});
@ -41,55 +40,57 @@ export default class RMSSSkillCategorySheet extends ItemSheet {
item: context.item, item: context.item,
system: context.item.system, system: context.item.system,
config: CONFIG.rmss, config: CONFIG.rmss,
applicable_stat_list: applicable_stat_list, applicable_stat_list: applicableStatList,
applicable_stat_1_selected: applicable_stat_1_selected, applicable_stat_1_selected: firstApplicableStat,
applicable_stat_2_selected: applicable_stat_2_selected, applicable_stat_2_selected: secondApplicableStat,
applicable_stat_3_selected: applicable_stat_3_selected, applicable_stat_3_selected: thirdApplicableStat,
enrichedDescription: enrichedDescription enrichedDescription: enrichedDescription
}; };
return sheetData; return sheetData;
} }
async _setApplicableStat(item, ev) { async _setApplicableStat(item, ev) {
// Build a JSON Object from the select tag value and select name (item data attribute key) // Build a JSON Object from the selected tag value and selected name (item data attribute key)
var update_key = ev.currentTarget.getAttribute("name"); var updateKey = ev.currentTarget.getAttribute("name");
var update_data = ev.target.value; var updateData = ev.target.value;
// Update Item Data // Update Item Data
await item.update({[update_key]: update_data}); await item.update({[updateKey]: updateData});
} }
prepareApplicableStatValues(CONFIG) { // Each Skill Category can have up to three Applicable Stats that apply to it. We need to get a list of
var applicable_stat_list = {None: "None"}; // the Stat Shortnames from Config so the user can select which stats are applicable to this Skill Category
prepareApplicableStatNames(config) {
// Get a list of stat shortnames from the config var applicableStatList = {None: "None"};
for (const item in CONFIG.rmss.stats) { for (const item in config.rmss.stats) {
applicable_stat_list[CONFIG.rmss.stats[item].shortname] = CONFIG.rmss.stats[item].shortname; applicableStatList[config.rmss.stats[item].shortname] = config.rmss.stats[item].shortname;
} }
return applicable_stat_list; return applicableStatList;
} }
// Determine which Stat is selected for applicable stats // Get the values for the currently selected Applicable Stat so we can display it on the Skill Category Sheet
prepareApplicableSelectedStat(app_stat) { // If nothing is selected return an empty string.
var applicable_stat_selected = ""; prepareApplicableSelectedStat(appStat) {
applicable_stat_selected = this.item.system[app_stat]; var applicableStatSelected = "";
return applicable_stat_selected; applicableStatSelected = this.item.system[appStat];
return applicableStatSelected;
} }
// Build the text that is displayed in the Applicable Stats field // The character sheet has an information field that displays the applicable stats in the following format
buildApplicableStatsText(app_stat_1, app_stat_2, app_stat_3) { // St/Ag/St. This method checks the current applicable stats and builds that field so
// it can be displayed to the user.
if (app_stat_1 === "None") { buildApplicableStatsText(firstAppStat, secondAppStat, thirdAppStat) {
if (firstAppStat === "None") {
return("None"); return("None");
} }
else if (app_stat_1 !== "None" && app_stat_2 === "None") { else if (firstAppStat !== "None" && secondAppStat === "None") {
return(app_stat_1); return(firstAppStat);
} }
else if (app_stat_1 !== "None" && app_stat_2 !== "None" && app_stat_3 === "None" ) { else if (firstAppStat !== "None" && secondAppStat !== "None" && thirdAppStat === "None" ) {
return(app_stat_1 + "/" + app_stat_2 ); return(firstAppStat + "/" + secondAppStat );
} }
else if (app_stat_1 !== "None" && app_stat_2 !== "None" && app_stat_3 !== "None" ) { else if (firstAppStat !== "None" && secondAppStat !== "None" && thirdAppStat !== "None" ) {
return(app_stat_1 + "/" + app_stat_2 + "/" + app_stat_3 ); return(firstAppStat + "/" + secondAppStat + "/" + thirdAppStat );
} }
else { else {
return("None"); return("None");
@ -103,7 +104,8 @@ export default class RMSSSkillCategorySheet extends ItemSheet {
// Everything below here is only needed if the sheet is editable // Everything below here is only needed if the sheet is editable
if (!this.isEditable) return; if (!this.isEditable) return;
// Update Applicable Stats for Skill Categories // Every time the user selects one of the Applicable Stat dropdowns
// fire an event to change the value in the Skill Category
html.find('.stat-selector').change(ev => { html.find('.stat-selector').change(ev => {
this._setApplicableStat(this.item, ev); this._setApplicableStat(this.item, ev);
}); });

View File

@ -22,16 +22,11 @@ export default class RMSSSkillSheet extends ItemSheet {
var enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, {async: true}); var enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, {async: true});
// Get a list of stats that can be used as applicable stats
var designations = this.getSkillDesignations(CONFIG);
// Get a list of the parent item's skill categories for the dropdown // Get a list of the parent item's skill categories for the dropdown
var owned_skillcats = this.prepareSkillCategoryValues(); var ownedSkillCategories = this.prepareSkillCategoryValues();
// Figure out if a valid Skill Category is already selected // Figure out if a valid Skill Category is already selected
var selected_skillcat = this.prepareSelectedSkillCategory(owned_skillcats, this.object.system.category); var selectedSkillCategory = this.prepareSelectedSkillCategory(ownedSkillCategories, this.object.system.category);
//this.prepareSelectedSkillCategoryBonus(selected_skillcat);
let sheetData = { let sheetData = {
owner: this.item.isOwner, owner: this.item.isOwner,
@ -39,53 +34,68 @@ export default class RMSSSkillSheet extends ItemSheet {
item: baseData.item, item: baseData.item,
system: baseData.item.system, system: baseData.item.system,
config: CONFIG.rmss, config: CONFIG.rmss,
owned_skillcats: owned_skillcats, owned_skillcats: ownedSkillCategories,
enrichedDescription: enrichedDescription, enrichedDescription: enrichedDescription,
selected_skillcat: selected_skillcat, selected_skillcat: selectedSkillCategory,
designations: designations designations: CONFIG.rmss.skill_designations
}; };
return sheetData; return sheetData;
} }
activateListeners(html) {
super.activateListeners(html);
// Catch the event when the user clicks one of the New Ranks Checkboxes.
// It will increment by one or wrap back to zero on a value of three
html.find('.skillsheet-newrank').click(ev => {
switch(ev.currentTarget.getAttribute("value")) {
case "0":
this.object.update({system: {new_ranks:{ "value": 1 }}});
break;
case "1":
this.object.update({system: {new_ranks:{ "value": 2 }}});
break;
case "2":
this.object.update({system: {new_ranks:{ "value": 3 }}});
break;
case "3":
this.object.update({system: {new_ranks:{ "value": 0 }}});
break;
}
});
}
// Skills are related to Skill Categories so we need something to allow the user to choose that relationship
// If this Skill is owned then we will return a list of Skill Categories and allow them to choose
// Otherwise we'll just return 'Skill has no owner'
prepareSkillCategoryValues() { prepareSkillCategoryValues() {
// If there is no player owning this Skill then we cannot assign a category. var skillNoOwner = {None: "Skill Has No Owner", };
var skillcat_list = {None: "Skill Has No Owner", };
if (this.item.isEmbedded === null) { if (this.item.isEmbedded === null) {
return(skillcat_list); return(skillNoOwner);
} }
else else
{ {
const skillcats = this.item.parent.getOwnedSkillCategories(); const skillCategories = this.item.parent.getOwnedItemsByType("skill_category");
return(skillcats); return(skillCategories);
} }
} }
getSkillDesignations(CONFIG) { // Determine which Skill Category is selected and test that it is in the current list of categories.
var designations = {}; // If it isn't set it to None.
prepareSelectedSkillCategory(ownedSkillCategories, selectedSkillCategory) {
// Get a list of designations from the config var defaultSelectedCategory = "None";
for (const item in CONFIG.rmss.skill_designations) { if (Object.keys(ownedSkillCategories).includes(selectedSkillCategory)) {
designations[CONFIG.rmss.skill_designations[item]] = CONFIG.rmss.skill_designations[item]; return(selectedSkillCategory);
}
return designations;
}
// Determine which Stat is selected and test that it is in the current list of categories.
prepareSelectedSkillCategory(ownedskillcats, selected_category) {
// Start By setting the owned category to None, if nothing happens this will be the default
var default_selected_category = "None";
// Get a list of keys from the currently owned skill categories and compare to the current value
if (Object.keys(ownedskillcats).includes(selected_category)) {
return(selected_category);
} else { } else {
return(default_selected_category); return(defaultSelectedCategory);
} }
} }
// Populate the Skill Category Bonus field on the Skill Sheet.
// Iterate through the owned skill categories and if one of them matches the item id of currently select skill category
// then set the Skill Category Bonus field to the Total Bonus field of the Skill Category
prepareSelectedSkillCategoryBonus(selected_skillcat) { prepareSelectedSkillCategoryBonus(selected_skillcat) {
if (this.item.isEmbedded === null) { if (this.item.isEmbedded === null) {
console.log("Skill has no owner"); console.log("Skill has no owner");

View File

@ -1,14 +1,47 @@
.sheet form { .skillcat-grid-container {
display: flex; display: grid;
flex-direction: column; grid-template-columns: [skill-category-name] 10% [applicable-stats] 10% [dev-cost] 8% [num-ranks] 8% [new-ranks] 8% [rank-bonus] 8% [stat-bonus] 8% [prof-bonus] 8% [special-bonus-1] 8% [special-bonus-2] 8% [total-bonus] 8% [controls] 8%;
} }
.sheet .sheet-content { .skillcat-grid-container > div {
height: 100%; font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex; display: flex;
justify-content: flex-end;
flex-direction: column; flex-direction: column;
justify-content: center;
} }
.sheet .sheet-content .editor { .skillcat-grid-container > div:nth-child(24n+1),
height: 100%; .skillcat-grid-container > div:nth-child(24n+2),
.skillcat-grid-container > div:nth-child(24n+3),
.skillcat-grid-container > div:nth-child(24n+4),
.skillcat-grid-container > div:nth-child(24n+5),
.skillcat-grid-container > div:nth-child(24n+6),
.skillcat-grid-container > div:nth-child(24n+7),
.skillcat-grid-container > div:nth-child(24n+8),
.skillcat-grid-container > div:nth-child(24n+9),
.skillcat-grid-container > div:nth-child(24n+10),
.skillcat-grid-container > div:nth-child(24n+11),
.skillcat-grid-container > div:nth-child(24n+12) {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.skillcat-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
} }
.container { .container {
display: flex; display: flex;
@ -26,8 +59,8 @@
} }
.header-text { .header-text {
display: flex; display: flex;
flex-direction: row; align-items: center;
justify-content: center; padding: 1px;
} }
.resource-container { .resource-container {
display: flex; display: flex;
@ -53,6 +86,9 @@
flex-direction: column; flex-direction: column;
flex-shrink: 1; flex-shrink: 1;
} }
.stat-row {
align-items: center;
}
.equipment-container { .equipment-container {
flex-direction: column; flex-direction: column;
flex-grow: 1; flex-grow: 1;
@ -138,102 +174,6 @@
.green { .green {
background-color: lightseagreen; background-color: lightseagreen;
} }
.skillcat-name,
.skill-name,
.item-name {
font-family: Signika, sans-serif;
font-size: 12px;
font-weight: bold;
text-align: center;
}
.skillcat-entry,
.skill-entry,
.item-entry {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}
.skillcat-headeritem,
.skill-headeritem,
.item-headeritem {
text-align: center;
font-weight: bold;
}
.skillcat-controls,
.skill-controls,
.item-controls {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}
.money-column {
flex-direction: column;
}
.money-container {
flex-direction: column;
flex-shrink: 1;
}
.table-font {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}
.table-bold {
font-weight: bold;
}
.table-center {
text-align: center;
}
.table-controls {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}
.skillcat-grid-container {
display: grid;
grid-template-columns: [skill-category-name] 10% [applicable-stats] 10% [dev-cost] 8% [num-ranks] 8% [new-ranks] 8% [rank-bonus] 8% [stat-bonus] 8% [prof-bonus] 8% [special-bonus-1] 8% [special-bonus-2] 8% [total-bonus] 8% [controls] 8%;
}
.skillcat-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
}
.skillcat-grid-container > div:nth-child(24n+1),
.skillcat-grid-container > div:nth-child(24n+2),
.skillcat-grid-container > div:nth-child(24n+3),
.skillcat-grid-container > div:nth-child(24n+4),
.skillcat-grid-container > div:nth-child(24n+5),
.skillcat-grid-container > div:nth-child(24n+6),
.skillcat-grid-container > div:nth-child(24n+7),
.skillcat-grid-container > div:nth-child(24n+8),
.skillcat-grid-container > div:nth-child(24n+9),
.skillcat-grid-container > div:nth-child(24n+10),
.skillcat-grid-container > div:nth-child(24n+11),
.skillcat-grid-container > div:nth-child(24n+12) {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: column;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.skillcat-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.skills-grid-container { .skills-grid-container {
display: grid; display: grid;
grid-template-columns: [favorite] 9% [skill-name] 11% [num-ranks] 9% [new-ranks] 9% [rank-bonus] 9% [category-bonus] 9% [item-bonus] 9% [special-bonus-1] 9% [special-bonus-2] 9% [total-bonus] 9% [controls] 8%; grid-template-columns: [favorite] 9% [skill-name] 11% [num-ranks] 9% [new-ranks] 9% [rank-bonus] 9% [category-bonus] 9% [item-bonus] 9% [special-bonus-1] 9% [special-bonus-2] 9% [total-bonus] 9% [controls] 8%;
@ -278,9 +218,205 @@
border-bottom: 1px solid; border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0); background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
} }
.money-column {
flex-direction: column;
}
.money-container {
flex-direction: column;
flex-shrink: 1;
padding-left: 10px;
}
.items-grid-container {
display: grid;
grid-template-columns: [name] 30% [quantity] 17% [weight] 17% [cost] 18% [controls] 18%;
}
.items-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.items-grid-container > div:nth-child(10n+1),
.items-grid-container > div:nth-child(10n+2),
.items-grid-container > div:nth-child(10n+3),
.items-grid-container > div:nth-child(10n+4),
.items-grid-container > div:nth-child(10n+5) {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.items-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.weapons-grid-container {
display: grid;
grid-template-columns: [name] 30% [equipped] 8% [breakage_range] 9% [fumble_range] 9% [strength] 9% [quantity] 9% [weight] 9% [cost] 9% [controls] 8%;
}
.weapons-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.weapons-grid-container > div:nth-child(18n+1),
.weapons-grid-container > div:nth-child(18n+2),
.weapons-grid-container > div:nth-child(18n+3),
.weapons-grid-container > div:nth-child(18n+4),
.weapons-grid-container > div:nth-child(18n+5),
.weapons-grid-container > div:nth-child(18n+6),
.weapons-grid-container > div:nth-child(18n+7),
.weapons-grid-container > div:nth-child(18n+8),
.weapons-grid-container > div:nth-child(18n+9) {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.weapons-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.armor-grid-container {
display: grid;
grid-template-columns: [name] 30% [equipped] 12% [at] 12% [quantity] 12% [weight] 12% [cost] 12% [controls] 10%;
}
.armor-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.armor-grid-container > div:nth-child(14n+1),
.armor-grid-container > div:nth-child(14n+2),
.armor-grid-container > div:nth-child(14n+3),
.armor-grid-container > div:nth-child(14n+4),
.armor-grid-container > div:nth-child(14n+5),
.armor-grid-container > div:nth-child(14n+6),
.armor-grid-container > div:nth-child(14n+7) {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.armor-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.herbs-grid-container {
display: grid;
grid-template-columns: [name] 30% [quantity] 11% [codes] 12% [af] 12% [weight] 12% [cost] 11% [controls] 12%;
}
.herbs-grid-container > div {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
}
.herbs-grid-container > div:nth-child(14n+1),
.herbs-grid-container > div:nth-child(14n+2),
.herbs-grid-container > div:nth-child(14n+3),
.herbs-grid-container > div:nth-child(14n+4),
.herbs-grid-container > div:nth-child(14n+5),
.herbs-grid-container > div:nth-child(14n+6),
.herbs-grid-container > div:nth-child(14n+7) {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
border-bottom: 1px solid;
padding-top: 3px;
padding-bottom: 3px;
display: flex;
justify-content: flex-end;
flex-direction: row;
justify-content: center;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.herbs-grid-heading {
font-weight: bold;
border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.skillcat-name,
.skill-name,
.item-name {
font-family: Signika, sans-serif;
font-size: 12px;
font-weight: bold;
text-align: center;
}
.skillcat-entry,
.skill-entry,
.item-entry {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}
.skillcat-headeritem,
.skill-headeritem,
.item-headeritem {
text-align: center;
font-weight: bold;
}
.skillcat-controls,
.skill-controls,
.item-controls {
font-family: Signika, sans-serif;
font-size: 12px;
text-align: center;
}
.applicable-stats-grid-container { .applicable-stats-grid-container {
display: grid; display: grid;
grid-template-columns: [app-stat-1] 33% [app-stat-2] 33% [dapp-stat-3] 33%; grid-template-columns: [app-stat-1] 33% [app-stat-2] 33% [app-stat-3] 33%;
} }
.applicable-stats-grid-container > div { .applicable-stats-grid-container > div {
font-family: Signika, sans-serif; font-family: Signika, sans-serif;
@ -294,3 +430,15 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
} }
.sheet form {
display: flex;
flex-direction: column;
}
.sheet .sheet-content {
height: 100%;
display: flex;
flex-direction: column;
}
.sheet .sheet-content .editor {
height: 100%;
}

View File

@ -34,9 +34,12 @@ async function preloadHandlebarsTemplates() {
"systems/rmss/templates/sheets/actors/parts/actor-skills.html", "systems/rmss/templates/sheets/actors/parts/actor-skills.html",
"systems/rmss/templates/sheets/actors/parts/actor-fav-skills.html", "systems/rmss/templates/sheets/actors/parts/actor-fav-skills.html",
"systems/rmss/templates/sheets/actors/parts/actor-items.html", "systems/rmss/templates/sheets/actors/parts/actor-items.html",
"systems/rmss/templates/sheets/actors/parts/actor-weapons.html",
"systems/rmss/templates/sheets/actors/parts/actor-money.html", "systems/rmss/templates/sheets/actors/parts/actor-money.html",
"systems/rmss/templates/sheets/actors/parts/actor-skill-categories.html", "systems/rmss/templates/sheets/actors/parts/actor-skill-categories.html",
"systems/rmss/templates/sheets/actors/parts/actor-skills.html" "systems/rmss/templates/sheets/actors/parts/actor-skills.html",
"systems/rmss/templates/sheets/actors/parts/actor-armor.html",
"systems/rmss/templates/sheets/actors/parts/actor-herbs.html"
]; ];
return loadTemplates(templatePaths); return loadTemplates(templatePaths);
} }
@ -88,4 +91,17 @@ Hooks.once("init", function () {
// Preload Handlebars Templates // Preload Handlebars Templates
console.log("rmss | Preloading Handlebars Templates"); console.log("rmss | Preloading Handlebars Templates");
preloadHandlebarsTemplates(); preloadHandlebarsTemplates();
// Handlebars Helpers
Handlebars.registerHelper('switch', function(value, options) {
this.switch_value = value;
return options.fn(this);
});
Handlebars.registerHelper('case', function(value, options) {
if (value == this.switch_value) {
return options.fn(this);
}
});
}); });

View File

@ -171,6 +171,7 @@
} }
} }
}, },
"money": {
"money": { "money": {
"mithril": 1, "mithril": 1,
"platinum": 2, "platinum": 2,
@ -181,6 +182,7 @@
"tin": 7, "tin": 7,
"iron": 8 "iron": 8
} }
}
}, },
"character": { "character": {
@ -234,6 +236,7 @@
}, },
"armor": { "armor": {
"templates": ["base"], "templates": ["base"],
"equipped": false,
"quantity": 1, "quantity": 1,
"weight": 0, "weight": 0,
"cost": 0, "cost": 0,
@ -242,6 +245,7 @@
}, },
"weapon": { "weapon": {
"templates": ["base"], "templates": ["base"],
"equipped": false,
"quantity": 1, "quantity": 1,
"cost": 0, "cost": 0,
"weight": 0, "weight": 0,
@ -265,7 +269,11 @@
"templates": ["base"], "templates": ["base"],
"category" : "", "category" : "",
"ranks": 0, "ranks": 0,
"new_ranks": 0, "new_ranks": {
"value": [0],
"max": 3,
"max_default": 3
},
"rank_bonus": -15, "rank_bonus": -15,
"category_bonus": 0, "category_bonus": 0,
"item_bonus": 0, "item_bonus": 0,
@ -283,7 +291,11 @@
"app_stat_3": "None", "app_stat_3": "None",
"development_cost": "0", "development_cost": "0",
"ranks": 0, "ranks": 0,
"new_ranks": 0, "new_ranks": {
"value": 0,
"max": 3,
"max_default": 3
},
"rank_bonus": -15, "rank_bonus": -15,
"stat_bonus": 0, "stat_bonus": 0,
"prof_bonus": 0, "prof_bonus": 0,

View File

@ -0,0 +1,29 @@
<div class="armor-grid-container">
<!-- LOCALIZE THE LAST STRINGS IN THIS PAGE. ALSO SKILLS AND SKILL CATEGORIES-->
<div class="armor-grid-heading">{{ localize "rmss.pc_sheet_items.item_name" }}</div>
<div class="armor-grid-heading">{{ localize "rmss.pc_sheet_items.equipped" }}</div>
<div class="armor-grid-heading">{{ localize "rmss.armor.at" }}</div>
<div class="armor-grid-heading">{{ localize "rmss.pc_sheet_items.quantity" }}</div>
<div class="armor-grid-heading">{{ localize "rmss.pc_sheet_items.weight" }}</div>
<div class="armor-grid-heading">{{ localize "rmss.pc_sheet_items.cost" }}</div>
<div class="armor-grid-heading">
<a class="item-control item-create" title="Create Item" data-type="armor"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_items.add_item" }}</a>
</div>
{{#each equipables as |equipable id|}}
<div>{{equipable.name}}</div>
{{#if equipable.system.equipped}}
<div><a class="equippable" data-item-id="{{equipable._id}}"><i class="fa-regular fa-square-check"></i></a></div>
{{else}}
<div><a class="equippable" data-item-id="{{equipable._id}}"><i class="fa-regular fa-square"></i></a></div>
{{/if}}
<div>{{equipable.system.at}}</div>
<div>{{equipable.system.quantity}}</div>
<div>{{equipable.system.weight}}</div>
<div>{{equipable.system.cost}}</div>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item" data-item-id="{{equipable._id}}"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item" data-item-id="{{equipable._id}}"><i class="fas fa-trash"></i></a>
</div>
{{/each}}
</div>

View File

@ -0,0 +1,25 @@
<div class="herbs-grid-container">
<!-- LOCALIZE THE LAST STRINGS IN THIS PAGE. ALSO SKILLS AND SKILL CATEGORIES-->
<div class="herbs-grid-heading">{{ localize "rmss.pc_sheet_items.item_name" }}</div>
<div class="herbs-grid-heading">{{ localize "rmss.pc_sheet_items.quantity" }}</div>
<div class="herbs-grid-heading">{{ localize "rmss.herb_or_poison.codes" }}</div>
<div class="herbs-grid-heading">{{ localize "rmss.herb_or_poison.af" }}</div>
<div class="herbs-grid-heading">{{ localize "rmss.pc_sheet_items.weight" }}</div>
<div class="herbs-grid-heading">{{ localize "rmss.pc_sheet_items.cost" }}</div>
<div class="herbs-grid-heading">
<a class="item-control item-create" title="Create Item" data-type="herb_or_poison"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_items.add_item" }}</a>
</div>
{{#each herbs as |herb id|}}
<div>{{herb.name}}</div>
<div>{{herb.system.quantity}}</div>
<div>{{herb.system.codes}}</div>
<div>{{herb.system.af}}</div>
<div>{{herb.system.weight}}</div>
<div>{{herb.system.cost}}</div>
<div>
<a class="item-control item-edit" title="Edit Item" data-item-id="{{herb._id}}"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item" data-item-id="{{herb._id}}"><i class="fas fa-trash"></i></a>
</div>
{{/each}}
</div>

View File

@ -1,28 +1,21 @@
<table> <div class="items-grid-container">
<!-- LOCALIZE THE LAST STRINGS IN THIS PAGE. ALSO SKILLS AND SKILL CATEGORIES--> <!-- LOCALIZE THE LAST STRINGS IN THIS PAGE. ALSO SKILLS AND SKILL CATEGORIES-->
<div class="items-grid-heading">{{ localize "rmss.pc_sheet_items.item_name" }}</div>
<th><div class="item-name item-headeritem">{{ localize "rmss.pc_sheet_items.favorite" }}</div></th> <div class="items-grid-heading">{{ localize "rmss.pc_sheet_items.quantity" }}</div>
<th><div class="item-entry item-headeritem">{{ localize "rmss.pc_sheet_items.quantity" }}</div></th> <div class="items-grid-heading">{{ localize "rmss.pc_sheet_items.weight" }}</div>
<th><div class="item-name item-headeritem">{{ localize "rmss.pc_sheet_items.item_name" }}</div></th> <div class="items-grid-heading">{{ localize "rmss.pc_sheet_items.cost" }}</div>
<th><div class="item-entry item-headeritem">{{ localize "rmss.pc_sheet_items.weight" }}</div></th> <div class="items-grid-heading">
<th><div class="item-entry item-headeritem">{{ localize "rmss.pc_sheet_items.cost" }}</div></th>
<th><div class="item-controls">
<a class="item-control item-create" title="Create Item" data-type="item"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_items.add_item" }}</a> <a class="item-control item-create" title="Create Item" data-type="item"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_items.add_item" }}</a>
</div></th> </div>
{{#each gear as |item id|}} {{#each gear as |item id|}}
<tr class="item" data-item-id="{{item._id}}"> <div>{{item.name}}</div>
<td><div class="item-entry item-prop"><input type="checkbox" name="system.favorite" {{checked item.system.favorite}}/></div></td> <div>{{item.system.quantity}}</div>
<td><div class="item-entry item-prop">{{item.system.quantity}}</div></td> <div>{{item.system.weight}}</div>
<td><div class="item-name"> <div>{{item.system.cost}}</div>
<h4>{{item.name}}</h4> <div>
</div></td> <a class="item-control item-edit" title="Edit Item" data-item-id="{{item._id}}"><i class="fas fa-edit"></i></a>
<td><div class="item-entry item-prop">{{item.system.weight}}</div></td> <a class="item-control item-delete" title="Delete Item" data-item-id="{{item._id}}"><i class="fas fa-trash"></i></a>
<td><div class="item-entry item-prop">{{item.system.cost}}</div></td> </div>
<td><div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div></td>
</tr>
{{/each}} {{/each}}
</table> </div>

View File

@ -21,7 +21,15 @@
<!--<div><input type="checkbox" name="system.favorite" {{checked skill.system.favorite}}/></div>--> <!--<div><input type="checkbox" name="system.favorite" {{checked skill.system.favorite}}/></div>-->
<div>{{skill.name}}</div> <div>{{skill.name}}</div>
<div>{{skill.system.ranks}}</div> <div>{{skill.system.ranks}}</div>
<div>{{skill.system.new_ranks}}</div> <div>
{{#switch skill.system.new_ranks.value}}
{{#case 0}} <a class="skill-newrank" data-item-id="{{skill._id}}" value="{{skill.system.new_ranks.value}}"><i class="fa-regular fa-square"></i> <i class="fa-regular fa-square"></i> <i class="fa-regular fa-square"></i></a> {{/case}}
{{#case 1}} <a class="skill-newrank" data-item-id="{{skill._id}}" value="{{skill.system.new_ranks.value}}"><i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square"></i> <i class="fa-regular fa-square"></i></a> {{/case}}
{{#case 2}} <a class="skill-newrank" data-item-id="{{skill._id}}" value="{{skill.system.new_ranks.value}}"><i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square"></i></a> {{/case}}
{{#case 3}} <a class="skill-newrank" data-item-id="{{skill._id}}" value="{{skill.system.new_ranks.value}}"><i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square-check"></i></a> {{/case}}
{{/switch}}
</div>
<div>{{skill.system.rank_bonus}}</div> <div>{{skill.system.rank_bonus}}</div>
<div>{{skill.system.category_bonus}}</div> <div>{{skill.system.category_bonus}}</div>
<div>{{skill.system.item_bonus}}</div> <div>{{skill.system.item_bonus}}</div>

View File

@ -1,6 +1,6 @@
<section class="stat-block"> <section class="stat-block">
<ol> <ol>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-header">{{ localize "rmss.player_character.attribute_headers.stat" }}</div> <div class="stat-header">{{ localize "rmss.player_character.attribute_headers.stat" }}</div>
<div class="stat-header">{{ localize "rmss.player_character.attribute_headers.temp" }}</div> <div class="stat-header">{{ localize "rmss.player_character.attribute_headers.temp" }}</div>
<div class="stat-header">{{ localize "rmss.player_character.attribute_headers.pot" }}</div> <div class="stat-header">{{ localize "rmss.player_character.attribute_headers.pot" }}</div>
@ -10,7 +10,7 @@
<div class="stat-header">{{ localize "rmss.player_character.attribute_headers.stat_bonus" }}</div> <div class="stat-header">{{ localize "rmss.player_character.attribute_headers.stat_bonus" }}</div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.agility" }} {{ localize "rmss.player_character.attribute.agility" }}
</div> </div>
@ -40,7 +40,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.constitution" }} {{ localize "rmss.player_character.attribute.constitution" }}
</div> </div>
@ -70,7 +70,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.memory" }} {{ localize "rmss.player_character.attribute.memory" }}
</div> </div>
@ -100,7 +100,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.reasoning" }} {{ localize "rmss.player_character.attribute.reasoning" }}
</div> </div>
@ -130,7 +130,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.self_discipline" }} {{ localize "rmss.player_character.attribute.self_discipline" }}
</div> </div>
@ -160,7 +160,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.empathy" }} {{ localize "rmss.player_character.attribute.empathy" }}
</div> </div>
@ -190,7 +190,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.intuition" }} {{ localize "rmss.player_character.attribute.intuition" }}
</div> </div>
@ -220,7 +220,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.presence" }} {{ localize "rmss.player_character.attribute.presence" }}
</div> </div>
@ -250,7 +250,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.quickness" }} {{ localize "rmss.player_character.attribute.quickness" }}
</div> </div>
@ -280,7 +280,7 @@
</div> </div>
</li> </li>
<li class="flexrow"> <li class="flexrow stat-row">
<div class="stat-name"> <div class="stat-name">
{{ localize "rmss.player_character.attribute.strength" }} {{ localize "rmss.player_character.attribute.strength" }}
</div> </div>

View File

@ -0,0 +1,33 @@
<div class="weapons-grid-container">
<!-- LOCALIZE THE LAST STRINGS IN THIS PAGE. ALSO SKILLS AND SKILL CATEGORIES-->
<div class="weapons-grid-heading">{{ localize "rmss.pc_sheet_items.item_name" }}</div>
<div class="weapons-grid-heading">{{ localize "rmss.pc_sheet_items.equipped" }}</div>
<div class="weapons-grid-heading">{{ localize "rmss.weapon.breakage_range" }}</div>
<div class="weapons-grid-heading">{{ localize "rmss.weapon.fumble_range" }}</div>
<div class="weapons-grid-heading">{{ localize "rmss.weapon.strength" }}</div>
<div class="weapons-grid-heading">{{ localize "rmss.pc_sheet_items.quantity" }}</div>
<div class="weapons-grid-heading">{{ localize "rmss.pc_sheet_items.weight" }}</div>
<div class="weapons-grid-heading">{{ localize "rmss.pc_sheet_items.cost" }}</div>
<div class="weapons-grid-heading">
<a class="item-control item-create" title="Create Item" data-type="weapon"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_items.add_item" }}</a>
</div>
{{#each weapons as |weapon id|}}
<div>{{weapon.name}}</div>
{{#if weapon.system.equipped}}
<div><a class="equippable" data-item-id="{{weapon._id}}"><i class="fa-regular fa-square-check"></i></a></div>
{{else}}
<div><a class="equippable" data-item-id="{{weapon._id}}"><i class="fa-regular fa-square"></i></a></div>
{{/if}}
<div>{{weapon.system.breakage_range}}</div>
<div>{{weapon.system.fumble_range}}</div>
<div>{{weapon.system.strength}}</div>
<div>{{weapon.system.quantity}}</div>
<div>{{weapon.system.weight}}</div>
<div>{{weapon.system.cost}}</div>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item" data-item-id="{{weapon._id}}"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item" data-item-id="{{weapon._id}}"><i class="fas fa-trash"></i></a>
</div>
{{/each}}
</div>

View File

@ -96,9 +96,18 @@
<div class="tab equipment" data-group="primary" data-tab="Equipment"> <div class="tab equipment" data-group="primary" data-tab="Equipment">
<div class="container"> <div class="container">
<div class="equipment-container"> <div class="equipment-container">
<h2>Items</h2>
{{> "systems/rmss/templates/sheets/actors/parts/actor-items.html" }} {{> "systems/rmss/templates/sheets/actors/parts/actor-items.html" }}
<h2>Weapons</h2>
{{> "systems/rmss/templates/sheets/actors/parts/actor-weapons.html" }}
<h2>Armor and Equipables</h2>
{{> "systems/rmss/templates/sheets/actors/parts/actor-armor.html" }}
<h2>Herbs and Poisons</h2>
{{> "systems/rmss/templates/sheets/actors/parts/actor-herbs.html" }}
</div> </div>
<div class="money-container"> <div class="money-container">
<h2>Wealth</h2>
{{> "systems/rmss/templates/sheets/actors/parts/actor-money.html" }} {{> "systems/rmss/templates/sheets/actors/parts/actor-money.html" }}
</div> </div>
</div> </div>

View File

@ -7,12 +7,16 @@
<div> <div>
<table> <table>
<tr> <tr>
<th>{{localize "rmss.item.equipped"}}</th>
<th>{{localize "rmss.item.quantity"}}</th> <th>{{localize "rmss.item.quantity"}}</th>
<th>{{localize "rmss.armor.weight"}}</th> <th>{{localize "rmss.armor.weight"}}</th>
<th>{{localize "rmss.armor.cost"}}</th> <th>{{localize "rmss.armor.cost"}}</th>
<th>{{localize "rmss.armor.prod_time"}}</th> <th>{{localize "rmss.armor.prod_time"}}</th>
<th>{{localize "rmss.armor.at"}}</th> <th>{{localize "rmss.armor.at"}}</th>
</tr> </tr>
<td>
<input type="checkbox" name="system.equipped" {{checked system.equipped}}/>
</td>
<td> <td>
<input name="system.quantity" type="text" value="{{system.quantity}}" data-dtype="Number"/> <input name="system.quantity" type="text" value="{{system.quantity}}" data-dtype="Number"/>
</td> </td>

View File

@ -7,6 +7,7 @@
<div> <div>
<table> <table>
<tr> <tr>
<th>{{localize "rmss.weapon.equipped"}}</th>
<th>{{localize "rmss.item.quantity"}}</th> <th>{{localize "rmss.item.quantity"}}</th>
<th>{{localize "rmss.weapon.cost"}}</th> <th>{{localize "rmss.weapon.cost"}}</th>
<th>{{localize "rmss.weapon.type"}}</th> <th>{{localize "rmss.weapon.type"}}</th>
@ -17,6 +18,9 @@
<th>{{localize "rmss.weapon.fumble_range"}}</th> <th>{{localize "rmss.weapon.fumble_range"}}</th>
</tr> </tr>
<td>
<input type="checkbox" name="system.equipped" {{checked system.equipped}}/>
</td>
<td> <td>
<input name="system.quantity" type="text" value="{{system.quantity}}" data-dtype="Number"/> <input name="system.quantity" type="text" value="{{system.quantity}}" data-dtype="Number"/>
</td> </td>

View File

@ -36,7 +36,14 @@
<input name="system.ranks" type="text" value="{{system.ranks}}" data-dtype="Number"/> <input name="system.ranks" type="text" value="{{system.ranks}}" data-dtype="Number"/>
</td> </td>
<td> <td>
<input name="system.new_ranks" type="text" value="{{system.new_ranks}}" data-dtype="Number"/> <div>
{{#switch system.new_ranks.value}}
{{#case 0}} <a class="skillsheet-newrank" data-item-id="{{item._id}}" value="{{system.new_ranks.value}}"><i class="fa-regular fa-square"></i> <i class="fa-regular fa-square"></i> <i class="fa-regular fa-square"></i></a> {{/case}}
{{#case 1}} <a class="skillsheet-newrank" data-item-id="{{item._id}}" value="{{system.new_ranks.value}}"><i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square"></i> <i class="fa-regular fa-square"></i></a> {{/case}}
{{#case 2}} <a class="skillsheet-newrank" data-item-id="{{item._id}}" value="{{system.new_ranks.value}}"><i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square"></i></a> {{/case}}
{{#case 3}} <a class="skillsheet-newrank" data-item-id="{{item._id}}" value="{{system.new_ranks.value}}"><i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square-check"></i> <i class="fa-regular fa-square-check"></i></a> {{/case}}
{{/switch}}
</div>
</td> </td>
<td> <td>
<input name="system.rank_bonus" type="text" value="{{system.rank_bonus}}" data-dtype="Number"/> <input name="system.rank_bonus" type="text" value="{{system.rank_bonus}}" data-dtype="Number"/>