Initial Import

This commit is contained in:
LeRatierBretonnien 2023-01-04 22:21:49 +01:00
parent da4efccad5
commit 405539e077
10 changed files with 1570 additions and 1565 deletions

View File

@ -10,11 +10,11 @@ const __saveFirstToKey = { r: "reflex", f: "fortitude", w: "willpower"}
export class WarheroCommands {
static init() {
if (!game.system.cruciblerpg.commands) {
if (!game.system.warhero.commands) {
const crucibleCommands = new WarheroCommands();
crucibleCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => WarheroCommands.rollTarget(msg, params), descr: "Launch the target roll window" });
crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => WarheroCommands.rollSave(msg, params), descr: "Performs a save roll" });
game.system.cruciblerpg.commands = crucibleCommands;
//crucibleCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => WarheroCommands.rollTarget(msg, params), descr: "Launch the target roll window" });
//crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => WarheroCommands.rollSave(msg, params), descr: "Performs a save roll" });
game.system.warhero.commands = crucibleCommands;
}
}

View File

@ -63,10 +63,9 @@ export class WarheroItemSheet extends ItemSheet {
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
weaponSkills: WarheroUtility.getWeaponSkills(),
shieldSkills: WarheroUtility.getShieldSkills(),
config: game.system.warhero.config,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
data: itemData,
system: itemData,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,

View File

@ -17,6 +17,7 @@ import { WarheroCombat } from "./warhero-combat.js";
import { WarheroItem } from "./warhero-item.js";
import { WarheroHotbar } from "./warhero-hotbar.js"
import { WarheroCommands } from "./warhero-commands.js"
import { WARHERO_CONFIG } from "./warhero-config.js"
/* -------------------------------------------- */
/* Foundry VTT Initialization */
@ -27,9 +28,10 @@ Hooks.once("init", async function () {
console.log(`Initializing Warhero RPG`);
game.system.cruciblerpg = {
game.system.warhero = {
WarheroHotbar,
WarheroCommands
WarheroCommands,
config: WARHERO_CONFIG
}
/* -------------------------------------------- */

View File

@ -67,33 +67,6 @@ export class WarheroUtility {
}) */
}
/*-------------------------------------------- */
static addDiceColors() {
game.dice3d.addColorset({
name: 'warhero-orange',
category: "crucible",
foreground: '#9F8003',
background: "#FFA500",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'warhero-purple',
category: "crucible",
foreground: '#9F8003',
background: "#800080",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'warhero-darkgreen',
category: "crucible",
foreground: '#9F8003',
background: "#006400",
visibility: 'visible'
}, "preferred");
}
/*-------------------------------------------- */
static upperFirst(text) {
if (typeof text !== 'string') return text
@ -115,16 +88,6 @@ export class WarheroUtility {
/* -------------------------------------------- */
static async ready() {
const skills = await WarheroUtility.loadCompendium("fvtt-warhero.skills")
this.skills = skills.map(i => i.toObject())
this.weaponSkills = duplicate(this.skills.filter(item => item.system.isweaponskill))
this.shieldSkills = duplicate(this.skills.filter(item => item.system.isshieldskill))
const rollTables = await WarheroUtility.loadCompendium("fvtt-warhero.rolltables")
this.rollTables = rollTables.map(i => i.toObject())
this.addDiceColors()
}
/* -------------------------------------------- */

View File

@ -39,26 +39,41 @@
text-align: justify;
font-size: 16px;
letter-spacing: 1px;
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
}
/* Fonts */
.sheet header.sheet-header h1 input, .window-app .window-header, #actors .directory-list, #navigation #scene-list .scene.nav-item {
font-size: 1.0rem;
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
} /* For title, sidebar character and scene */
.sheet nav.sheet-tabs {
font-size: 0.8rem;
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
} /* For nav and title */
.window-app input, .foundryvtt-vadentis .item-form, .sheet header.sheet-header .flex-group-center.flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle {
.window-app input, .fvtt-warhero .item-form, .sheet header.sheet-header .flex-group-center.flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle {
font-size: 0.8rem;
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
}
.window-header{
background: rgba(0,0,0,0.75);
}
.dialog .window-content {
color: #ccdbe6;
}
.dialog-content, .dialog-buttons, .form-fields {
color: #ccdbe6;
}
.window-app.sheet .window-content {
margin: 0;
padding: 0;
color: #ccdbe6;
}
.strong-text{
font-weight: bold;
@ -67,6 +82,14 @@
.tabs .item.active, .blessures-list li ul li:first-child:hover, a:hover {
text-shadow: 1px 0px 0px #ff6600;
}
select {
background: rgba(228, 240, 240, 0.75);
color: rgba(66, 66, 64, 0.95);
}
select option {
background: rgba(228, 240, 240, 0.75);
color: rgba(66, 66, 64, 0.95);
}
.rollable:hover, .rollable:focus {
color: #000;
@ -193,7 +216,7 @@ table {border: 1px solid #7a7971;}
/* Styles limited to foundryvtt-vadentis sheets */
.fvtt-crucible-rpg .sheet-header {
.fvtt-warhero .sheet-header {
-webkit-box-flex: 0;
-ms-flex: 0 0 210px;
flex: 0 0 210px;
@ -213,16 +236,17 @@ table {border: 1px solid #7a7971;}
margin-bottom: 10px;
}
.fvtt-crucible-rpg .sheet-header .profile-img {
.fvtt-warhero .sheet-header .profile-img {
-webkit-box-flex: 0;
-ms-flex: 0 0 128px;
flex: 0 0 128px;
width: 196px;
-ms-flex: 0 0 96px;
flex: 0 0 96px;
width: 96px;
height: auto;
max-height:260px;
max-height:96px;
margin-top: 0px;
margin-right: 10px;
object-fit: cover;
border-width: 0px;
object-position: 50% 0;
}
@ -255,34 +279,34 @@ table {border: 1px solid #7a7971;}
vertical-align: bottom;
}
.fvtt-crucible-rpg .sheet-header .header-fields {
.fvtt-warhero .sheet-header .header-fields {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
}
.fvtt-crucible-rpg .sheet-header h1.charname {
.fvtt-warhero .sheet-header h1.charname {
height: 50px;
padding: 0px;
margin: 5px 0;
border-bottom: 0;
}
.fvtt-crucible-rpg .sheet-header h1.charname input {
.fvtt-warhero .sheet-header h1.charname input {
width: 100%;
height: 100%;
margin: 0;
}
.fvtt-crucible-rpg .sheet-tabs {
.fvtt-warhero .sheet-tabs {
-webkit-box-flex: 0;
-ms-flex: 0;
flex: 0;
}
.fvtt-crucible-rpg .sheet-body,
.fvtt-crucible-rpg .sheet-body .tab,
.fvtt-crucible-rpg .sheet-body .tab .editor {
.fvtt-warhero .sheet-body,
.fvtt-warhero .sheet-body .tab,
.fvtt-warhero .sheet-body .tab .editor {
height: 100%;
font-size: 0.8rem;
}
@ -305,70 +329,70 @@ table {border: 1px solid #7a7971;}
padding: 0 3px;
}
.fvtt-crucible-rpg .tox .tox-editor-container {
.fvtt-warhero .tox .tox-editor-container {
background: #fff;
}
.fvtt-crucible-rpg .tox .tox-edit-area {
.fvtt-warhero .tox .tox-edit-area {
padding: 0 8px;
}
.fvtt-crucible-rpg .resource-label {
.fvtt-warhero .resource-label {
font-weight: bold;
text-transform: uppercase;
}
.fvtt-crucible-rpg .tabs {
.fvtt-warhero .tabs {
height: 40px;
border-top: 1px solid #AAA;
border-bottom: 1px solid #AAA;
color: #000000;
}
.fvtt-crucible-rpg .tabs .item {
.fvtt-warhero .tabs .item {
line-height: 40px;
font-weight: bold;
}
.fvtt-crucible-rpg .tabs .item.active {
.fvtt-warhero .tabs .item.active {
text-decoration: underline;
text-shadow: none;
}
.fvtt-crucible-rpg .items-list {
.fvtt-warhero .items-list {
list-style: none;
margin: 1px 0;
padding: 0;
overflow-y: auto;
}
.fvtt-crucible-rpg .items-list .item-header {
.fvtt-warhero .items-list .item-header {
font-weight: bold;
}
.fvtt-crucible-rpg .items-list .item {
.fvtt-warhero .items-list .item {
height: 30px;
line-height: 24px;
padding: 1px 0;
border-bottom: 1px solid #BBB;
}
.fvtt-crucible-rpg .items-list .item .item-image {
.fvtt-warhero .items-list .item .item-image {
-webkit-box-flex: 0;
-ms-flex: 0 0 24px;
flex: 0 0 24px;
margin-right: 5px;
}
.fvtt-crucible-rpg .items-list .item img {
.fvtt-warhero .items-list .item img {
display: block;
}
.fvtt-crucible-rpg .items-list .item-name {
.fvtt-warhero .items-list .item-name {
margin: 0;
}
.fvtt-crucible-rpg .items-list .item-controls {
.fvtt-warhero .items-list .item-controls {
-webkit-box-flex: 0;
-ms-flex: 0 0 86px;
flex: 0 0 86px;
@ -385,24 +409,24 @@ table {border: 1px solid #7a7971;}
/*color: rgba(168, 139, 139, 0.5);*/
.window-app.sheet .window-content .sheet-header input[type="text"], .window-app.sheet .window-content .sheet-header input[type="number"], .window-app.sheet .window-content .sheet-header input[type="password"], .window-app.sheet .window-content .sheet-header input[type="date"], .window-app.sheet .window-content .sheet-header input[type="time"] {
color: rgba(36, 37, 37, 0.75);
background: rgba(245, 245, 241, 0.95);
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
border: 1 none;
margin-bottom: 0.25rem;
margin-left: 2px;
}
.window-app.sheet .window-content .sheet-body input[type="text"], .window-app.sheet .window-content .sheet-body input[type="number"], .window-app.sheet .window-content .sheet-body input[type="password"], .window-app.sheet .window-content .sheet-body input[type="date"], .window-app.sheet .window-content .sheet-body input[type="time"] {
color: rgba(36, 37, 37, 0.75);
background: rgba(245, 245, 241, 0.95);
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
border: 1 none;
margin-bottom: 0.25rem;
margin-left: 2px;
}
.window-app.sheet .window-content .sheet-body select, .window-app.sheet .window-content .sheet-header select {
color: rgba(36, 37, 37, 0.75);
background: rgba(245, 245, 241, 0.95);
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
border: 1 none;
margin-bottom: 0.25rem;
margin-left: 2px;
@ -411,6 +435,8 @@ table {border: 1px solid #7a7971;}
.window-app .window-content, .window-app.sheet .window-content .sheet-body{
font-size: 0.8rem;
background: url("../images/ui/pc_sheet_bg.webp") repeat left top;
color: rgba(228, 240, 240, 0.75);
background: rgba(66, 66, 64, 0.95);
}
/* background: rgba(245,245,240,0.6) url("../images/ui/sheet_background.webp") left top;*/
@ -544,7 +570,7 @@ ul, li {
}
.list-item-shadow {
background:rgba(87, 60, 32, 0.35);
flex-grow: 0;
/*flex-grow: 0;*/
flex-wrap: nowrap;
justify-content: flex-start;
}
@ -1441,19 +1467,34 @@ Focus FOC: #ff0084
}
.item-field-label-short {
flex-grow:1;
margin-top: 4px;
max-width: 4rem;
min-width: 4rem;
}
.item-field-label-medium {
flex-grow:1;
margin-top: 4px;
max-width: 6rem;
min-width: 6rem;
}
.item-field-label-long {
flex-grow:1;
margin-top: 4px;
max-width: 8rem;
min-width: 8rem;
}
.item-field-label-vlong {
flex-grow:1;
margin-top: 4px;
max-width: 14rem;
min-width: 14rem;
}
.item-field-label-vlong2 {
flex-grow:1;
margin-top: 4px;
max-width: 22rem;
min-width: 22rem;
}
.item-control-end {
align-self: flex-end;
}

View File

@ -18,22 +18,22 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="system.armortype" value="{{system.armortype}}" data-dtype="String">
<li class="flexrow"><label class="item-field-label-medium ">Type</label>
<select class="item-field-label-medium " type="text" name="system.armortype" value="{{system.armortype}}" data-dtype="String">
{{#select system.armortype}}
{{#each config.armorTypes as |type key|}}
<option value="{{key}}">{{localiser type.label}}</option>
<option value="{{key}}">{{localize type.label}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
<li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="item-field-label-medium checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
<li class="flexrow"><label class="item-field-label-medium ">Cost</label>
<input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li>
</ul>

View File

@ -15,14 +15,14 @@
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
<li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="item-field-label-medium checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Quantity</label>
<input type="text" class="input-numeric-short padd-right" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
<li class="flexrow"><label class="item-field-label-medium ">Quantity</label>
<input type="text" class="item-field-label-medium " name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
<input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li>
</ul>
</div>

View File

@ -15,11 +15,11 @@
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Quantity</label>
<input type="text" class="input-numeric-short padd-right" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
<li class="flexrow"><label class="item-field-label-medium ">Quantity</label>
<input type="text" class="item-field-label-medium " name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Unit value</label>
<input type="text" class="input-numeric-short padd-right" name="system.value" value="{{system.value}}" data-dtype="Number"/>
<input type="text" class="item-field-label-medium " name="system.value" value="{{system.value}}" data-dtype="Number"/>
</li>
</ul>
</div>

View File

@ -18,22 +18,22 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Shield typer</label>
<select class="competence-base flexrow" type="text" name="system.shieldtype" value="{{system.shieldtype}}" data-dtype="String">
<li class="flexrow"><label class="item-field-label-medium ">Shield typer</label>
<select class="item-field-label-medium " type="text" name="system.shieldtype" value="{{system.shieldtype}}" data-dtype="String">
{{#select system.shieldtype}}
{{#each config.armorTypes as |type key|}}
<option value="{{key}}">{{localiser type.label}}</option>
<option value="{{key}}">{{localize type.label}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
<li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="item-field-label-medium "><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
<li class="flexrow"><label class="item-field-label-medium ">Cost</label>
<input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li>
</ul>

View File

@ -18,26 +18,26 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="system.weapontype" value="{{system.weapontype}}" data-dtype="String">
<li class="flexrow"><label class="item-field-label-medium ">Type</label>
<select class="item-field-label-medium " type="text" name="system.weapontype" value="{{system.weapontype}}" data-dtype="String">
{{#select system.weapontype}}
{{#each config.weaponTypes as |type key|}}
<option value="{{key}}">{{localiser type.label}}</option>
<option value="{{key}}">{{localize type.label}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Damage</label>
<input type="text" class="right" name="system.damage" value="{{system.damage}}" data-dtype="String"/>
<li class="flexrow"><label class="item-field-label-medium ">Damage</label>
<input type="text" class="item-field-label-medium " name="system.damage" value="{{system.damage}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
<li class="flexrow"><label class="item-field-label-medium ">Equipped ?</label>
<label class="item-field-label-medium checkbox"><input type="checkbox" name="system.equipped" {{checked system.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
<li class="flexrow"><label class="item-field-label-medium ">Cost</label>
<input type="text" class="item-field-label-medium " name="system.cost" value="{{system.cost}}" data-dtype="Number"/>
</li>
</ul>