Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 71 additions & 15 deletions CyberpunkRED_raycw/cyberpunkred-raycw.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ input[type=number] {
box-shadow: none;
}


.sheet-netruntoggle[value="nbi"] ~ div.sheet-nbiprogram,
.sheet-netruntoggle[value="blackice"] ~ div.sheet-blackice,
.sheet-netruntoggle[value="hardware"] ~ div.sheet-hardware {
Expand Down Expand Up @@ -868,7 +867,7 @@ select {
}

/* Configure the button styling. This example makes it look like a checkbox. */
button.sheet-toggle, button.sheet-mooktoggle {
button.sheet-toggle, button.sheet-mooktoggle, button.sheet-settings-toggle {
padding: 0;
border: none;
background: none;
Expand All @@ -885,7 +884,8 @@ button.sheet-toggle, button.sheet-mooktoggle {
font-weight: bold;
}

.sheet-settings .sheet-settings-checkbox button.sheet-mooktoggle {
.sheet-settings .sheet-settings-checkbox button.sheet-mooktoggle,
.sheet-settings .sheet-settings-checkbox button.sheet-settings-toggle {
border: 1px solid #0f0f0f;
}

Expand All @@ -898,12 +898,22 @@ input.sheet-mooktoggle:not([value="1"]) ~ div.sheet-mook-mode {
display: none;
}

/* Hide the "checked" section of the toggle if the attribute value is not "1". */
input.sheet-toggle:not([value="1"]) ~ button.sheet-toggle > span.sheet-checked {
input.sheet-settings-toggle-show-initiative-modifier:not([value="1"]) ~ div.sheet-initiative-modifier {
display: none;
}

input.sheet-settings-toggle-show-aimed-shot-button:not([value="1"]) ~ button[name="roll_aimed_shot"] {
display: none;
}

input.sheet-settings-toggle:not([value="1"]) ~ button.sheet-settings-toggle > span.sheet-checked {
display: none;
}

/* Hide the "checked" section of the toggle if the attribute value is not "1". */
input.sheet-toggle:not([value="1"]) ~ button.sheet-toggle > span.sheet-checked {
display: none;
}


.sheet-cyberware .sheet-cwtable div {
Expand Down Expand Up @@ -1482,13 +1492,19 @@ button[type="roll"].sheet-txt-btn{
box-shadow: none;
}

button[type="roll"].sheet-aimed-shot-icon{
font-weight: bold;
color: #CD272C;
font-size: 1.5rem;
margin-top: -3px;
}

.sheet-small button[type="roll"].sheet-txt-btn{
font-size: 1.3rem;
color: #fff;
font-weight:bold;
}


button[type="roll"].sheet-txt-btn:hover{
background: none;
text-decoration: underline;
Expand Down Expand Up @@ -1872,7 +1888,8 @@ td.sheet-subskill-header {
}


.sheet-main .sheet-flex-table div input{
.sheet-main .sheet-flex-table div input,
.sheet-settings .sheet-settings-value input {
margin: 0;
padding: 0;
width: 100%;
Expand All @@ -1881,7 +1898,8 @@ td.sheet-subskill-header {
min-width:0
}

.sheet-main .sheet-flex-table div input[type=number]{
.sheet-main .sheet-flex-table div input[type=number],
.sheet-settings .sheet-settings-value input[type=number] {
text-align: center;
}

Expand All @@ -1894,22 +1912,60 @@ td.sheet-subskill-header {
}

.sheet-my-settings {
display: flex;
max-width: 800px;
}

.sheet-settings-title {
.sheet-settings-row {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 15px;
}

.sheet-my-settings div {
.sheet-settings-option {
display: flex;
width: 300px;
border: 1px solid #0f0f0f;
margin: 4px;
padding: 4px;
align-items: center;
justify-content: center;
}

.sheet-settings-help {
max-width: 310px;
text-align: justify;
}

.sheet-settings-title {
flex: 1 1 auto;
}

.sheet-option {
.sheet-settings-value {
flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: center;
}

.sheet-aimed-shot-icon {
font-weight: bold;
color: #CD272C;
font-size: 1.5rem;
}

.sheet-settings-number {
width: 24px;
height: 24px;
border: 1px solid #0f0f0f;
}
background-color: var(--color-surface2);
}

.sheet-settings-checkbox {
background-color: var(--color-surface2);
}

.sheet-weapon {
background-color: #CD272C;
margin: -4px;
padding: 4px;
}
118 changes: 97 additions & 21 deletions CyberpunkRED_raycw/cyberpunkred-raycw.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@


<div class="nav">
<input type="hidden" class="mooktoggle" name="attr_mooksheet_flag" value='0' />
<input type="hidden" class="mooktoggle" name="attr_mooksheet_flag" value="0" />

<div class="character-mode"><button type="action" name="act_character" >CHARACTER</button></div>
<div class="mook-mode"><button type="action" name="act_mook" >MOOK</button></div>
<div class="character-mode"><button type="action" name="act_lifepath" >LIFEPATH & INVENTORY</button></div>
<div class="character-mode"><button type="action" name="act_cyberware" >CYBERWARE</button></div>
<div class="character-mode"><button type="action" name="act_netrunning" >NETRUNNING</button></div>
<div class="character-mode"><button type="action" name="act_journal" >JOURNAL</button></div>
<div class="character-mode"><button type="roll" name="roll_initiative" value="&{template:initiative} {{name=Initiative}} {{roll=[[d10+@{Reflex} &{tracker}]]}}">ROLL INITIATIVE</button></div>
<div class="character-mode"><button type="roll" name="roll_initiative" value="&{template:initiative} {{name=Initiative}} {{roll=[[d10+@{Reflex}+@{initiative_modifier} &{tracker}]]}}">ROLL INITIATIVE</button></div>
<div><button type="action" name="act_settings" >SETTINGS</button></div>
</div>
<input type='hidden' class='sheet-tabstoggle' name='attr_sheetTab' value='character' />
Expand Down Expand Up @@ -85,6 +85,12 @@ <h3>ROLE ABILITIES</h3><input type=text spellcheck=false name="attr_RoleAbility"
<div class="bg-white skill-name">Moto (Nomad)</div>
<div class="bg-white skill-rank"><input type="number" name="attr_rankMoto" placeholder="0"/></div>
</div>

<input type="hidden" class="settings-toggle-show-initiative-modifier" name="attr_initiative_modifier_flag" value="0" />
<div class="flex-table initiative-modifier">
<div class="bg-black-2 skill-name">Initiative Modifier</div>
<div class="bg-white skill-rank"><input type="number" name="attr_initiative_modifier" value="0"/></div>
</div>
</div>

<input type="hidden" name="attr_hp_max" />
Expand Down Expand Up @@ -906,7 +912,12 @@ <h3>ROLE ABILITIES</h3><input type=text spellcheck=false name="attr_RoleAbility"
<div class="flex-table">
<button type="roll" name="roll_weapon_dmg" style="display: none;" value="@{DMG}"></button>
<input type="hidden" name="attr_WeaponMod" value="@{Total_Melee}">
<div class="bg-white weapon-name"><button name="roll_attack" type="roll" class="txt-btn" value="&{template:attack} {{critroll=[[@{WeaponMod}+@{WeaponBonus}+10+1d10]]}} {{@{Weapontype}=true}} {{rollname=[@{Weaponname}](~repeating_weapons_weapon_dmg)}} {{failroll=[[@{WeaponMod}+@{WeaponBonus}+1-1d10]]}} {{weapontype=@{Weapontype}}} {{roll=[[@{WeaponMod}+@{WeaponBonus}+1d10]]}}">Attack:</button> <input type=text spellcheck=false name="attr_Weaponname" placeholder="Type here..."></div>
<div class="bg-white weapon-name">
<input type="hidden" class="settings-toggle-show-aimed-shot-button" name="attr_aimed_shot_flag" value="0" />
<button name="roll_aimed_shot" type="roll" class="txt-btn aimed-shot-icon" value="&{template:attack} {{critroll=[[@{WeaponMod}+@{WeaponBonus}+@{aimed_shot_penalty}+10+1d10]]}} {{@{Weapontype}=true}} {{rollname=[@{Weaponname}](~repeating_weapons_weapon_dmg)}} {{failroll=[[@{WeaponMod}+@{WeaponBonus}+@{aimed_shot_penalty}+1-1d10]]}} {{weapontype=@{Weapontype}}} {{aimed_shot=1}} {{roll=[[@{WeaponMod}+@{WeaponBonus}+@{aimed_shot_penalty}+1d10]]}}" title="Aimed Shot">⌖</button>
<button name="roll_attack" type="roll" class="txt-btn" value="&{template:attack} {{critroll=[[@{WeaponMod}+@{WeaponBonus}+10+1d10]]}} {{@{Weapontype}=true}} {{rollname=[@{Weaponname}](~repeating_weapons_weapon_dmg)}} {{failroll=[[@{WeaponMod}+@{WeaponBonus}+1-1d10]]}} {{weapontype=@{Weapontype}}} {{roll=[[@{WeaponMod}+@{WeaponBonus}+1d10]]}}">Attack:</button>
<input type=text spellcheck=false name="attr_Weaponname" placeholder="Type here...">
</div>
<div class="bg-white weapon-type">
<select name="attr_Weapontype" class="Weapontype">
<option value="-" selected>(Select Type)</option>
Expand Down Expand Up @@ -1594,24 +1605,66 @@ <h2>NOTES</h2>
</div>

<div class="settings">
<div class="my-settings">

<div class="nav">
<div><button class="options" type="action" name="act_resetbase" >RESET BASE SKILLS</button></div>
<div><button class="options" type="action" name="act_newcharacter" >TOGGLE STAT/SKILLPOINT TRACKER</button></div>
</div>
<div class="settings-row">
<h3>CHARACTER SHEET OPTIONS</h3>
<div class="nav">
<div><button class="options" type="action" name="act_resetbase" >RESET BASE SKILLS</button></div>
<div><button class="options" type="action" name="act_newcharacter" >TOGGLE STAT/SKILLPOINT TRACKER</button></div>
</div>
<div class="settings-option">
<div class="settings-title">ENABLE MOOK SHEET</div>
<div class="settings-value">
<div class="settings-checkbox">
<input type="hidden" class="mooktoggle" name="attr_mooksheet_flag" value="0" />
<button type="action" name="act_mooksheet" class="mooktoggle">
<span class="checked">✓</span>
</button>
</div>
</div>
</div>
<div class="settings-option">
<div class="settings-title">SHOW INITIATIVE MODIFIER</div>
<div class="settings-value">
<div class="settings-checkbox">
<input type="hidden" class="settings-toggle settings-toggle-show-initiative-modifier" name="attr_initiative_modifier_flag" value="0" />
<button type="action" name="act_initiative_modifier" class="settings-toggle">
<span class="checked">✓</span>
</button>
</div>
</div>
</div>
</div>

<div class="my-settings">
<div class="option">
<div class="settings-title">ENABLE MOOK SHEET</div>
<div class='settings-checkbox'>
<input type="hidden" class="mooktoggle" name="attr_mooksheet_flag" value=0/>
<button type="action" name="act_mooksheet" class="mooktoggle">
<span class="checked">✓</span>
</button>
<div class="settings-row">
<h3>AIMED SHOT OPTIONS</h3>
<div class="settings-help">
When enabled, an aimed shot button is displayed next to the "Attack" button for each weapon.
The button will be displayed as a crosshair icon that looks like this: "<span class="aimed-shot-icon">⌖</span>".
</div>
<div class="settings-option">
<div class="settings-title settings-title-show-aimed" name="title_show_aimed_button">SHOW AIMED SHOT BUTTON</div>
<div class="settings-value">
<div class="settings-checkbox">
<input type="hidden" class="settings-toggle settings-toggle-show-aimed-shot-button" name="attr_aimed_shot_flag" value="0" />
<button type="action" name="act_aimed_shot" class="settings-toggle">
<span class="checked">✓</span>
</button>
</div>
</div>
</div>
<div class="settings-option">
<div class="settings-title">AIMED SHOT PENALTY</div>
<div class="settings-value">
<div class="settings-number">
<input type="number" name="attr_aimed_shot_penalty" value="-8" />
</div>
</div>
</div>
</div>
</div>

</div>
</div>

<div class="mook">
Expand Down Expand Up @@ -1700,7 +1753,11 @@ <h2>NOTES</h2>
<div class="flex-table">
<button type="roll" name="roll_weapon_dmg" style="display: none;" value="@{DMG}"></button>
<input type="hidden" name="attr_WeaponMod" value="@{Total_Melee}">
<div class="bg-white weapon-name"><button name="roll_attack" type="roll" class="txt-btn" value="&{template:attack} {{critroll=[[@{WeaponMod}+@{WeaponBonus}+10+1d10]]}} {{@{Weapontype}=true}} {{rollname=[@{Weaponname}](~repeating_weapons_weapon_dmg)}} {{failroll=[[@{WeaponMod}+@{WeaponBonus}+1-1d10]]}} {{weapontype=@{Weapontype}}} {{roll=[[@{WeaponMod}+@{WeaponBonus}+1d10]]}}">Attack:</button> <input type=text spellcheck=false name="attr_Weaponname" placeholder="Type here..."></div>
<div class="bg-white weapon-name">
<input type="hidden" class="settings-toggle-show-aimed-shot-button" name="attr_aimed_shot_flag" value="0" />
<button name="roll_aimed_shot" type="roll" class="txt-btn aimed-shot-icon" value="&{template:attack} {{critroll=[[@{WeaponMod}+@{WeaponBonus}+@{aimed_shot_penalty}+10+1d10]]}} {{@{Weapontype}=true}} {{rollname=[@{Weaponname}](~repeating_weapons_weapon_dmg)}} {{failroll=[[@{WeaponMod}+@{WeaponBonus}+@{aimed_shot_penalty}+1-1d10]]}} {{weapontype=@{Weapontype}}} {{aimed_shot=1}} {{roll=[[@{WeaponMod}+@{WeaponBonus}+@{aimed_shot_penalty}+1d10]]}}" title="Aimed Shot">⌖</button>
<button name="roll_attack" type="roll" class="txt-btn" value="&{template:attack} {{critroll=[[@{WeaponMod}+@{WeaponBonus}+10+1d10]]}} {{@{Weapontype}=true}} {{rollname=[@{Weaponname}](~repeating_weapons_weapon_dmg)}} {{failroll=[[@{WeaponMod}+@{WeaponBonus}+1-1d10]]}} {{weapontype=@{Weapontype}}} {{roll=[[@{WeaponMod}+@{WeaponBonus}+1d10]]}}">Attack:</button>
<input type=text spellcheck=false name="attr_Weaponname" placeholder="Type here..."></div>
<div class="bg-white weapon-type">
<select name="attr_Weapontype" class="Weapontype">
<option value="Brawling">Brawling</option>
Expand Down Expand Up @@ -2411,21 +2468,21 @@ <h2>Inventory and Notes</h2>
<div class="sheet-template-container normal">
<div class="sheet-template-header"><span>{{roll}}</span></div>
<div class="sheet-template-row-subhead"><span>{{rollname}}</span></div>
<div class="sheet-template-row">{{weapontype}}</div>
<div class="sheet-template-row">{{weapontype}}{{#aimed_shot}} - Aimed Shot{{/aimed_shot}}</div>
</div>
{{/^rollWasFumble() roll}} {{/^rollWasCrit() roll}}
{{#rollWasCrit() roll}}
<div class="sheet-template-container crit">
<div class="sheet-template-header"><span>{{critroll}}</span></div>
<div class="sheet-template-row-subhead">{{rollname}}</div>
<div class="sheet-template-row">{{weapontype}}</div>
<div class="sheet-template-row">{{weapontype}}{{#aimed_shot}} - Aimed Shot{{/aimed_shot}}</div>
</div>
{{/rollWasCrit() roll}}
{{#rollWasFumble() roll}}
<div class="sheet-template-container fail">
<div class="sheet-template-header"><span>{{failroll}}</span></div>
<div class="sheet-template-row-subhead">{{rollname}}</div>
<div class="sheet-template-row">{{weapontype}}</div>
<div class="sheet-template-row">{{weapontype}}{{#aimed_shot}} - Aimed Shot{{/aimed_shot}}</div>
</div>
{{/rollWasFumble() roll}}

Expand Down Expand Up @@ -3212,7 +3269,10 @@ <h2>Inventory and Notes</h2>
});
});

const toggleList = ["cbaudio","lefteye","righteye","rightarm","leftarm","neurallink","rightleg","leftleg","mooksheet"];
const toggleList = [
"cbaudio","lefteye","righteye","rightarm","leftarm","neurallink","rightleg","leftleg","mooksheet",
"initiative_modifier"
];
toggleList.forEach(function(button) {
on(`clicked:${button}`, function() {
const flag = `${button}_flag`;
Expand All @@ -3223,6 +3283,22 @@ <h2>Inventory and Notes</h2>
});
});
});
on('clicked:aimed_shot', function() {
getAttrs(['aimed_shot_flag'], function(v) {
const flag_value = v['aimed_shot_flag'] !== "1" ? "1" : "0";
setAttrs({
['aimed_shot_flag']: flag_value
});

getSectionIDs("repeating_weapons", function(idarray) {
const output = {};
idarray.forEach(id => {
output[`repeating_weapons_${id}_aimed_shot_flag`] = flag_value;
});
setAttrs(output);
});
});
});

</script>

Expand Down