Skip to content

Commit

Permalink
Merge pull request #130 from Batziy/dev
Browse files Browse the repository at this point in the history
Top bit of Items
  • Loading branch information
AnthonyMonette authored Nov 3, 2021
2 parents f2a8d02 + 9496881 commit 21bdd52
Show file tree
Hide file tree
Showing 15 changed files with 345 additions and 289 deletions.
4 changes: 3 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"WITCHER.Armor.Reliable": "Rel.",
"WITCHER.Armor.EncumbranceValue": "Encumbrance",
"WITCHER.Armor.Resistances": "Resistances",
"WITCHER.Armor.Res": "Res",
"WITCHER.Armor.Bludgeoning": "Bludgeoning",
"WITCHER.Armor.Slashing": "Slashing",
"WITCHER.Armor.Percing": "Percing",
Expand Down Expand Up @@ -114,7 +115,7 @@
"WITCHER.Diagram.otherComponents": "Other Components",
"WITCHER.Diagram.investment": "Investment",
"WITCHER.Diagram.Learned": "Learned",
"WITCHER.Diagram.Formulae": "Formuale",
"WITCHER.Diagram.Formulae": "Formulae",

"WITCHER.Diagram.Ingredient": "Ingredient",
"WITCHER.Diagram.Weapon": "Weapon",
Expand Down Expand Up @@ -591,6 +592,7 @@
"WITCHER.Spell.Effect": "Effect",
"WITCHER.Spell.AlternateComponents": "Alternate Components",
"WITCHER.SPell.Signs": "Signs",
"WITCHER.Spell.Element": "Element",

"WITCHER.Spell.StaCost": "STA Cost",
"WITCHER.Spell.Variable": "STA Variable",
Expand Down
3 changes: 2 additions & 1 deletion scripts/TheWitcherTRPG.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function preloadHandlebarsTemplates(){
"systems/TheWitcherTRPG/templates/partials/monster-inventory-tab.html",
"systems/TheWitcherTRPG/templates/partials/monster-details-tab.html",
"systems/TheWitcherTRPG/templates/partials/monster-spell-tab.html",
"systems/TheWitcherTRPG/templates/partials/skill-display.html"
"systems/TheWitcherTRPG/templates/partials/skill-display.html",
"systems/TheWitcherTRPG/templates/partials/item-header.html"
];
return loadTemplates(templatePath);
}
Expand Down
90 changes: 90 additions & 0 deletions styles/item-sheets.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.item-header {
display: flex;
}

.item-header img{
height: 100px;
max-width: 200px;
}

.itemname {
margin-left: 5px;
}

.item-header-row {
display: table;
margin: 0 auto;
}

.item-header-first-collum {
width: 400px;
}

.item-header-second-collum {
display: table-cell;
text-align: center;
width: 100px;
}

.item-header-second-collum input {
width: 75px;
height: 27px;
}

.item-header-second-collum label {
display: block;
}

.item-header-spell {
width: 33.33%;
}

.item-options {
display: flex;
width: 501px;
height: 54px;
}

.item-option-tickbox {
height: 27px;
}

.item-option-tickbox label {
float: left;
margin-top: 5px;
}

.item-option-tickbox input {
float: right;
}

.item-collum {
text-align: center;
width: 33.33%;
}

.item-collum label{
display: block;
}

.item-row {
display: flex;
text-align: center;
}

.item-second-collum{
text-align: center;
width: 50%;
}

.item-second-collum label{
display: block;
width: 100%;
}

.----item-collum input {
width: 75px;
height: 27px;
margin-right: 5px;
margin-left: 5px;
}
1 change: 1 addition & 0 deletions styles/witcher-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@import "./loot-sheet.css";
@import "./profession-sheet.css";
@import "./crit-wounds-table.css";
@import "./item-sheets.css";

@font-face {
font-family:'Thewitcher';
Expand Down
76 changes: 76 additions & 0 deletions templates/partials/item-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<header class="item-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
<div class="item-header-first-collum">
<h1 class="itemname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
<div class="item-header-row">
{{#unless data.isSpell}}
<div class="item-header-second-collum">
<label>{{localize "WITCHER.Item.Quantity"}}</label>
<input type="text" name="data.quantity" value="{{data.quantity}}" data-dtype="Number" />
</div>
<div class="item-header-second-collum">
<label>{{localize "WITCHER.Item.Weight"}}</label>
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number" />
</div>
<div class="item-header-second-collum">
{{#if data.isMutagen}}
<label>{{localize "WITCHER.Type"}}</label>
<select name="data.type" id="type-select">
{{#select data.type}}
<option value="red">{{localize "WITCHER.Mutagen.Red"}}</option>
<option value="green">{{localize "WITCHER.Mutagen.Green"}}</option>
<option value="blue">{{localize "WITCHER.Mutagen.Blue"}}</option>
{{/select}}
</select>
{{/if}}
{{#unless data.isMutagen}}
<label>{{localize "WITCHER.Item.Cost"}}</label>
<input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
{{/unless}}
</div>
{{/unless}}
{{#if data.isSpell}}
<div class="item-header-second-collum item-header-spell">
<label>{{localize "WITCHER.Spell.type"}}</label>
<select name="data.class" id="profession-select">
{{#select data.class}}
<option value="Spells">{{localize "WITCHER.Spell.Spells"}}</option>
<option value="Invocations">{{localize "WITCHER.Spell.Invocations"}}</option>
<option value="Witcher">{{localize "WITCHER.Spell.Witcher"}}</option>
<option value="Rituals">{{localize "WITCHER.Spell.Rituals"}}</option>
<option value="Hexes">{{localize "WITCHER.Spell.Hexes"}}</option>
{{/select}}
</select>
</div>
<div class="item-header-second-collum item-header-spell">
{{#if (eq data.class "Hexes")}}
<label>{{localize "WITCHER.Spell.Danger"}}</label>
<select name="data.danger" id="level-select">
{{#select data.danger}}
<option value="Low">{{localize "WITCHER.Spell.DangerLow"}}</option>
<option value="Medium">{{localize "WITCHER.Spell.DangerMedium"}}</option>
<option value="High">{{localize "WITCHER.Spell.DangerHigh"}}</option>
{{/select}}
</select>
{{/if}}
{{#unless (eq data.class "Hexes")}}
<label>{{localize "WITCHER.Actor.Profession.Level"}}</label>
<select name="data.level" id="level-select">
{{#select data.level}}
<option value="novice">{{localize "WITCHER.Spell.Novice"}}</option>
<option value="journeyman">{{localize "WITCHER.Spell.Journeyman"}}</option>
<option value="master">{{localize "WITCHER.Spell.Master"}}</option>
{{/select}}
</select>
{{/unless}}
</div>
<div class="item-header-second-collum item-header-spell">
{{#unless (eq data.staminaIsVar true)}}
<label>{{localize "WITCHER.Spell.StaCost"}}</label>
<input class="sta-input" name="data.stamina" type="text" value="{{data.stamina}}"/>
{{/unless}}
</div>
{{/if}}
</div>
</div>
</header>
17 changes: 1 addition & 16 deletions templates/sheets/alchemical-sheet.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
<div class="resource flex">
<div class="flex">
<label>{{localize "WITCHER.Item.Quantity"}}</label>
<input type="text" name="data.quantity" value="{{data.quantity}}" data-dtype="Number" />
<label>{{localize "WITCHER.Item.Weight"}}</label>
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number" />
<label>{{localize "WITCHER.Item.Cost"}}</label>
<input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</div>
</div>
</div>
</header>
{{>"systems/TheWitcherTRPG/templates/partials/item-header.html"}}

{{!-- Attributes Tab --}}
<table>
Expand Down
37 changes: 17 additions & 20 deletions templates/sheets/armor-sheet.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
<div class="resource flex">
<div class="flex">
<label>{{localize "WITCHER.Item.Quantity"}}</label>
<input type="text" name="data.quantity" value="{{data.quantity}}" data-dtype="Number" />
<label>{{localize "WITCHER.Item.Weight"}}</label>
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number" />
<label>{{localize "WITCHER.Item.Cost"}}</label>
<input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</div>
{{>"systems/TheWitcherTRPG/templates/partials/item-header.html"}}
<div class="item-options">
<div class="item-collum">
<div class="item-option-tickbox">
<label>{{localize "WITCHER.Armor.Bludgeoning" }} {{localize "WITCHER.Armor.Res"}}</label>
<input type="checkbox" name="data.bludgeoning" {{checked data.bludgeoning}}/>
</div>
</div>
</header>
<div>
<div>
<label>{{localize "WITCHER.Armor.Resistances"}}:</label>
<label>{{localize "WITCHER.Armor.Bludgeoning"}}</label><input type="checkbox" name="data.bludgeoning" {{checked data.bludgeoning}}/>
<label>{{localize "WITCHER.Armor.Slashing"}}</label><input type="checkbox" name="data.slashing" {{checked data.slashing}} />
<label>{{localize "WITCHER.Armor.Percing"}}</label><input type="checkbox" name="data.percing" {{checked data.percing}} />
<div class="item-collum">
<div class="item-option-tickbox">
<label>{{localize "WITCHER.Armor.Slashing"}} {{localize "WITCHER.Armor.Res"}}</label>
<input type="checkbox" name="data.slashing" {{checked data.slashing}} />
</div>
</div>
<div class="item-collum">
<div class="item-option-tickbox">
<label>{{localize "WITCHER.Armor.Percing"}} {{localize "WITCHER.Armor.Res"}}</label>
<input type="checkbox" name="data.percing" {{checked data.percing}} />
</div>
</div>
</div>
{{!-- Attributes Tab --}}
Expand Down
57 changes: 24 additions & 33 deletions templates/sheets/component-sheet.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
<div class="flex">
<label>{{localize "WITCHER.Item.Quantity"}}</label>
<input type="text" name="data.quantity" value="{{data.quantity}}" data-dtype="Number" />
<label>{{localize "WITCHER.Item.Weight"}}</label>
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number" />
<label>{{localize "WITCHER.Item.Cost"}}</label>
<input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</div>
</div>
</header>
<div class="resource">
<label>{{localize "WITCHER.Type"}}</label>
<select name="data.type" id="type-select">
{{#select data.type}}
<option value="crafting-material">{{localize "WITCHER.Item.CraftingMaterial"}}</option>
<option value="animal-parts">{{localize "WITCHER.Item.Hides&AnimalParts"}}</option>
<option value="alchemical">{{localize "WITCHER.Item.AlchemicalTreatments"}}</option>
<option value="minerals">{{localize "WITCHER.Item.Ingots&Minerals"}}</option>
<option value="substances">{{localize "WITCHER.Inventory.Substances"}}</option>
{{/select}}
</select>
{{#if (eq data.type "substances")}}
<label>{{localize "WITCHER.Inventory.Substance"}} {{localize "WITCHER.Type"}} :</label>
<select name="data.substanceType" id="substanceType-select">
{{#select data.substanceType}}
{{#each config.substanceTypes as |name type|}}
<option value="{{type}}">{{localize name}}</option>
{{/each}}
{{>"systems/TheWitcherTRPG/templates/partials/item-header.html"}}
<div class="item-options">
<div class="item-collum">
<label>{{localize "WITCHER.Type"}}</label>
<select name="data.type" id="type-select">
{{#select data.type}}
<option value="crafting-material">{{localize "WITCHER.Item.CraftingMaterial"}}</option>
<option value="animal-parts">{{localize "WITCHER.Item.Hides&AnimalParts"}}</option>
<option value="alchemical">{{localize "WITCHER.Item.AlchemicalTreatments"}}</option>
<option value="minerals">{{localize "WITCHER.Item.Ingots&Minerals"}}</option>
<option value="substances">{{localize "WITCHER.Inventory.Substances"}}</option>
{{/select}}
</select>
{{/if}}
</div>
<div class="item-collum">
{{#if (eq data.type "substances")}}
<label>{{localize "WITCHER.Inventory.Substance"}}:</label>
<select name="data.substanceType" id="substanceType-select">
{{#select data.substanceType}}
{{#each config.substanceTypes as |name type|}}
<option value="{{type}}">{{localize name}}</option>
{{/each}}
{{/select}}
</select>
{{/if}}
</div>
</div>

<table>
Expand Down
Loading

0 comments on commit 21bdd52

Please sign in to comment.