This commit is contained in:
vince
2025-09-14 16:47:52 -07:00
parent 7bfae25372
commit cd85b0b021
2 changed files with 116 additions and 100 deletions
+45 -25
View File
@@ -1,4 +1,6 @@
.ui-dialog .tab-content .charsheet .main {
@import url('https://fonts.googleapis.com/css2?family=Righteous&family=Stardos+Stencil:wght@400;700&display=swap');
.ui-dialog .tab-content .charsheet .main {
font-family: "Lucida Console", Monaco, monospace;
font-weight: normal;
position: relative;
@@ -129,35 +131,36 @@
}
.ui-dialog .tab-content .charsheet .logo-text {
color: red;
float: left;
font-family: Stencil Std, fantasy;
font-size: 2em;
font-weight: bold;
color: #d40c0c;
left: -3em;
margin-bottom: -2em;
position: relative;
top: -1em;
transform: rotate(-45deg);
}
.ui-dialog .tab-content .charsheet .logo-text-first-line {
text-align: center;
top: -1.25em;
transform: rotate(-35deg);
width: 12em;
z-index: -1;
}
.ui-dialog .tab-content .charsheet .logo-text-second-line {
padding-top: 10px;
.ui-dialog .tab-content .charsheet .logo-text div {
font-family: "Stardos Stencil", system-ui;
font-size: 2.5em;
font-weight: bold;
max-height: 3rem;
text-align: center;
}
.ui-dialog .tab-content .charsheet .page-title {
font-family: Impact, Charcoal, sans-serif;
font-family: "Righteous", sans-serif;
font-size: 2em;
font-weight: bold;
text-align: center;
}
.ui-dialog .tab-content .charsheet .section-title {
font-family: Impact, Charcoal, sans-serif;
font-size: 1.5em;
padding-block: .5em .5em;
font-family: "Righteous", sans-serif;
font-size: 1.95rem;
padding-block: 10px;
}
.ui-dialog .tab-content .charsheet label,
@@ -178,14 +181,16 @@
}
.ui-dialog .tab-content .charsheet nav {
display: inline-block;
display: flex;
flex-wrap: wrap;
gap: 1px;
margin-block: .5em 1em;
}
.ui-dialog .tab-content .charsheet span.tab input {
align-content: baseline;
cursor: pointer;
height: 2.25rem;
height: 2.5rem;
left: -10rem;
margin-right: -10rem;
opacity: 0;
@@ -197,28 +202,34 @@
}
.ui-dialog .tab-content .charsheet span.tab {
display: inline-block;
min-height: 2rem;
position: relative;
}
.ui-dialog .tab-content .charsheet span.tab::before {
background: #dddddd;
border: 2px solid #888888;
color: #aa0000;
color: #d40c0c;
content: attr(title);
display: inline-block;
font-family: Impact, Charcoal, sans-serif;
font-family: 'Righteous';
font-size: 1.5rem;
height: 2rem;
height: 2.25rem;
text-align: center;
width: 10rem;
}
.ui-dialog .tab-content .charsheet span.tab:checked::before {
background: #aa0000;
.ui-dialog .tab-content .charsheet span.tab:has(:checked)::before {
background: #d40c0c;
border: 2px solid #888888;
color: white;
}
.ui-dialog .tab-content .charsheet .tab:hover::before {
background-color: #dddddd75;
}
.ui-dialog .tab-content .charsheet .tab-content {
display: none;
}
@@ -522,7 +533,7 @@
}
.sheet-rolltemplate-general .sheet-fail {
color: red;
color: #d40c0c;
font-size: 1.25em;
font-weight: bold;
}
@@ -542,4 +553,13 @@
.sheet-rolltemplate-general .sheet-value {
margin-right: 0;
align-items: center;
}
.sheet-rolltemplate-general .inlinerollresult {
font-size: 1.1em;
line-height: 1em;
margin-block: 1px;
min-width: 1.5em;
padding: 0 2px 0 2px;
text-align: center;
}
+71 -75
View File
@@ -1,18 +1,14 @@
<input type="text" class="hidden" name="attr_sheet_version" value="0" title="@{sheet_version}" />
<div class='main'>
<div class='logo-text'>
<div class='logo-text-first-line'>
TOP
</div>
<div class='logo-text-second-line'>
SECRET
</div>
<div class='logo-text-first-line'>TOP</div>
<div class='logo-text-second-line'>SECRET</div>
</div>
<div class='page-title'>AGENT'S DOSSIER</div>
<div class="two-column-grid">
<div class="span-2">
<label>CHARACTER NAME <input type="text" class="name-field" name="attr_character_name" value="" title="@{character_name}"></label>
<!-- deprecated attribute -->
<!-- deprecated attribute due to attribute name-->
<input type="text" class="hidden" name="attr_CharacterName">
</div>
<div class="span-2">
@@ -151,27 +147,26 @@
</div>
<fieldset class="repeating_Languages">
<div class='two-column-grid'>
<input type='text' class='languages-known-field' name='attr_Language' title="@{Language}"/>
<input type='text' class='language-fluency-field' name='attr_LanguageFluency' title="@{LanguageFluency}"/>
<input type='text' class='languages-known-field' name='attr_Language' title="@{Language}" />
<input type='text' class='language-fluency-field' name='attr_LanguageFluency' title="@{LanguageFluency}" />
</div>
</fieldset>
</div>
<div>
<div class='section-title'>CLASSIFIED INFORMATION</div>
<label>Bureau <input type='text' name='attr_Bureau' title="@{Bureau}"/></label>
<label>Total Experience Points <input type='text' name='attr_TotalExp' title="@{TotalExp}"/></label>
<label>Level <input type='text' name='attr_Level' title="@{Level}"/></label>
<label>Fame Points <input type='text' name='attr_FamePoints' title="@{FamePoints}"/></label>
<label>Fortune Points <input type='text' name='attr_FortunePoints' title="@{FortunePoints}"/></label>
<label>Experience Points Used <input type='text' name='attr_ExpUsed' title="@{ExpUsed}"/></label>
<label>Unused Experience Points <input type='text' name='attr_UnusedExp' title="@{UnusedExp}"/></label>
<label>Bureau <input type='text' name='attr_Bureau' value="0" title="@{Bureau}"/></label>
<label>Total Experience Points <input type='text' name='attr_TotalExp' value="0" title="@{TotalExp}"/></label>
<label>Level <input type='text' name='attr_Level' value="0" title="@{Level}"/></label>
<label>Fame Points <input type='text' name='attr_FamePoints' value="0" title="@{FamePoints}"/></label>
<label>Fortune Points <input type='text' name='attr_FortunePoints' value="0" title="@{FortunePoints}"/></label>
<label>Experience Points Used <input type='text' name='attr_ExpUsed' value="0" title="@{ExpUsed}"/></label>
<label>Unused Experience Points <input type='text' name='attr_UnusedExp' value="0" title="@{UnusedExp}"/></label>
</div>
</div>
<div class='tab-content tab3'>
<div>
<div class='section-title'>WEAPONS</div>
<div class="hit-determination-grid">
<div class="span-all">
<span>
@@ -356,6 +351,8 @@
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="9" title="-130" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="10" title="-180" />
</div>
<!-- TOTAL -->
<div class="span-all">
<span style="float: right;margin-top: -2.25em;">
<span class="general-column-header" title="Does not include range modifiers.">TOTAL</span>
@@ -490,56 +487,6 @@
</div>
</div>
<div class='tab-content tab6'>
<div class="three-column-fit">
<div>
<div class='section-title'>RESIDENCE</div>
<textarea class='text-area residence-text-area' name='attr_Residence' title="@{Residence}"></textarea>
</div>
<div>
<div class='section-title'>COVER</div>
<textarea class='text-area cover-text-area' name='attr_Cover' title="@{Cover}"></textarea>
</div>
<div>
<div class='section-title'>BRIEF PERSONAL HISTORY</div>
<textarea class='text-area history-text-area' name='attr_BriefPersonalHistory' title="@{BriefPersonalHistory}"></textarea>
</div>
<div class='notes-col'>
<div class='section-title'>NOTES</div>
<textarea class='text-area notes-text-area' name='attr_Notes' title="@{Notes}"></textarea>
</div>
</div>
</div>
<div class='tab-content tab5'>
<div class="three-column-fit">
<div>
<div class='section-title'>FRIENDS</div>
<fieldset class="repeating_Friends">
<div>
<input type='text' class='full-width-element' name='attr_Name' title="@{repeating_Friends_$X_Name}"/>
</div>
</fieldset>
</div>
<div>
<div class='section-title'>CONTACTS</div>
<fieldset class="repeating_Contacts">
<div>
<input type='text' class='full-width-element' name='attr_Name' title="@{repeating_Contacts_$X_Name}"/>
</div>
</fieldset>
</div>
<div>
<div class='section-title'>ENEMIES</div>
<fieldset class="repeating_Enemies">
<div>
<input type='text' class='full-width-element' name='attr_Name' title="@{repeating_Enemies_$X_Name}"/>
</div>
</fieldset>
</div>
</div>
</div>
<div class='tab-content tab4'>
<div class='section-title'>AREAS OF KNOWLEDGE</div>
<div class='aok-grid'>
@@ -646,6 +593,56 @@
</div>
</fieldset>
</div>
<div class='tab-content tab5'>
<div class="three-column-fit">
<div>
<div class='section-title'>FRIENDS</div>
<fieldset class="repeating_Friends">
<div>
<input type='text' class='full-width-element' name='attr_Name' title="@{repeating_Friends_$X_Name}" />
</div>
</fieldset>
</div>
<div>
<div class='section-title'>CONTACTS</div>
<fieldset class="repeating_Contacts">
<div>
<input type='text' class='full-width-element' name='attr_Name' title="@{repeating_Contacts_$X_Name}" />
</div>
</fieldset>
</div>
<div>
<div class='section-title'>ENEMIES</div>
<fieldset class="repeating_Enemies">
<div>
<input type='text' class='full-width-element' name='attr_Name' title="@{repeating_Enemies_$X_Name}" />
</div>
</fieldset>
</div>
</div>
</div>
<div class='tab-content tab6'>
<div class="three-column-fit">
<div>
<div class='section-title'>RESIDENCE</div>
<textarea class='text-area residence-text-area' name='attr_Residence' title="@{Residence}"></textarea>
</div>
<div>
<div class='section-title'>COVER</div>
<textarea class='text-area cover-text-area' name='attr_Cover' title="@{Cover}"></textarea>
</div>
<div>
<div class='section-title'>BRIEF PERSONAL HISTORY</div>
<textarea class='text-area history-text-area' name='attr_BriefPersonalHistory' title="@{BriefPersonalHistory}"></textarea>
</div>
<div class='notes-col'>
<div class='section-title'>NOTES</div>
<textarea class='text-area notes-text-area' name='attr_Notes' title="@{Notes}"></textarea>
</div>
</div>
</div>
</div>
<rolltemplate class="sheet-rolltemplate-general">
@@ -1175,7 +1172,7 @@
});
});
// attack roll CRP act_attack
// Attack roll CRP act_attack
on('clicked:repeating_weapons:attack-button', (eventInfo) => {
console.log(`Change detected: ${eventInfo.sourceAttribute}`);
const trigger = eventInfo.triggerName.replace('clicked:', '').replace('attack-button', '');
@@ -1183,17 +1180,16 @@
getAttrs([`${trigger}ammo`, `${trigger}rangemodifierpb`, `${trigger}rangemodifiers`, `${trigger}rangemodifierm`, `${trigger}rangemodifierl`], (v) => {
const output = {};
const ammo = +v[`${trigger}ammo`] || 0;
let rangeModPb = v[`${trigger}rangemodifierpb`];
let rangeModS = v[`${trigger}rangemodifiers`];
let rangeModM = v[`${trigger}rangemodifierm`];
let rangeModL = v[`${trigger}rangemodifierl`];
// use to check for a valid integer (positive or negative).
const rangeModPb = v[`${trigger}rangemodifierpb`];
const rangeModS = v[`${trigger}rangemodifiers`];
const rangeModM = v[`${trigger}rangemodifierm`];
const rangeModL = v[`${trigger}rangemodifierl`];
// use regex to check for non-integers
const integerRegex = /^[+-]?\d+$/;
// Range QUERY
startRoll(`!{{template:default}}{{ask=![[?{Range to target?|PB,0|S,1|M,2|L,3}]]}}`, (question) => {
const query = question.results.ask.result;
console.log(question);
if (query === 0 && integerRegex.test(rangeModPb)) {
const roll_string = `&{template:general} {{title=@{character_name} - Attack Roll}} {{subtitle=Weapon - @{${trigger}Weapon}}} {{roll_attack=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{${trigger}BaseAccuracy} [base] + (${rangeModPb} [range]) + (@{${trigger}hit_det} [hit det]) + (?{Additional Modifier|0} [mod]) ]]}} {{base_accuracy=[[@{${trigger}BaseAccuracy}]]}} {{range_mod=[[${rangeModPb}]]}} {{targets_range=PB}} {{hit_det_mod=[[@{${trigger}hit_det}]]}} {{roll_mod=[[?{Additional Modifier|0}]]}} {{ammo=@{${trigger}ammo}}} {{ammo_max=@{${trigger}ammo|max}}}`;
// reduce ammo
@@ -1260,7 +1256,7 @@
});
});
// one-time update
// one-time update to fix attribute names
on('sheet:opened', (eventInfo) => {
console.log(`Change detected: sheet_version check`);
getSectionIDs('repeating_AreasOfKnowledge', (idArray) => {