fix a bug in primaries (#6567)

This commit is contained in:
Cassie Levett
2020-05-25 09:52:23 -04:00
committed by GitHub
parent e1986cdc50
commit 0fb7dab0b8
3 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
<input name="attr_version" type="hidden" value="1.02"/><input class="sheet_type" name="attr_sheet_type" type="hidden" value="pc"/><input class="character-type" name="attr_flag_special" type="hidden" value="mundane"/><div class="pc"><div class="tabs"><img alt="Shadowrun" src="https://raw.githubusercontent.com/clevett/roll20-character-sheets/shadowrun4ev1/Shadowrun4thEdition/src/imgs/ShadowrunLogo.png"/><h1 data-i18n="character">Character</h1><label data-i18n-title="character name" title="character name"><input type="text" name="attr_character_name" placeholder="Character name" title="@{character_name}"/></label><h1 data-i18n="player">Player</h1><label data-i18n-title="player name" title="player name"><input type="text" name="attr_player_name" placeholder="Player name" title="@{player_name}"/></label><h2 data-i18n-title="/w GM">/w GM</h2><label class="switch" data-i18n-title="whisper rolls to gm" title="whisper rolls to gm"><input class="whisper-toggle" name="attr_gm_toggle" type="checkbox" value="/w gm"/><span class="slider"></span></label><h2 data-i18n-title="wounds">wounds</h2><label class="switch" data-i18n-title="wounds" title="wounds"><input class="whisper-toggle" name="attr_wounds_toggle" type="checkbox" value="@{wounds}"/><span class="slider"></span></label><h2 data-i18n-title="modifiers">modifiers</h2><label class="switch" data-i18n-title="modifiers" title="modifiers"><input class="whisper-toggle" name="attr_modifiers_toggle" type="checkbox" value="?{Modifiers +/-|0}"/><span class="slider"></span></label><h2 data-i18n-title="edge">edge</h2><label class="switch" data-i18n-title="edge" title="edge"><input class="whisper-toggle" name="attr_edge_toggle" type="checkbox" value="@{edge}"/><span class="slider"></span></label><button name="d6" title="Roll D6s" type="roll" value="@{gm_toggle} &{template:rolls}{{header=^{d6}}}{{base=^{d6}}}{{dice=[[(?{d6s|0}d6>5@{explode_toggle})]]}}">L</button><input name="attr_tab" type="hidden" value="options"/><button class="pictos" name="act_tab_options" title="@{tab}" type="action">y</button><button data-i18n="core" name="act_tab_core" type="action" title="@{tab}">core</button><button data-i18n="arms" name="act_tab_arms" type="action" title="@{tab}">arms</button><button data-i18n="augs" name="act_tab_augs" type="action" title="@{tab}">augs</button><button data-i18n="gear" name="act_tab_gear" type="action" title="@{tab}">gear</button><button data-i18n="magic" name="act_tab_magic" type="action" title="@{tab}">magic</button><button data-i18n="matrix" name="act_tab_matrix" type="action" title="@{tab}">matrix</button><button data-i18n="social" name="act_tab_social" type="action" title="@{tab}">social</button><button data-i18n="vehicle" name="act_tab_vehicle" type="action" title="@{tab}">vehicle</button></div><input class="options_toggle" name="attr_tab" type="hidden" value="options"/><div class="static pc-col">
<input name="attr_version" type="hidden" value="1.03"/><input class="sheet_type" name="attr_sheet_type" type="hidden" value="pc"/><input class="character-type" name="attr_flag_special" type="hidden" value="mundane"/><div class="pc"><div class="tabs"><img alt="Shadowrun" src="https://raw.githubusercontent.com/clevett/roll20-character-sheets/shadowrun4ev1/Shadowrun4thEdition/src/imgs/ShadowrunLogo.png"/><h1 data-i18n="character">Character</h1><label data-i18n-title="character name" title="character name"><input type="text" name="attr_character_name" placeholder="Character name" title="@{character_name}"/></label><h1 data-i18n="player">Player</h1><label data-i18n-title="player name" title="player name"><input type="text" name="attr_player_name" placeholder="Player name" title="@{player_name}"/></label><h2 data-i18n-title="/w GM">/w GM</h2><label class="switch" data-i18n-title="whisper rolls to gm" title="whisper rolls to gm"><input class="whisper-toggle" name="attr_gm_toggle" type="checkbox" value="/w gm"/><span class="slider"></span></label><h2 data-i18n-title="wounds">wounds</h2><label class="switch" data-i18n-title="wounds" title="wounds"><input class="whisper-toggle" name="attr_wounds_toggle" type="checkbox" value="@{wounds}"/><span class="slider"></span></label><h2 data-i18n-title="modifiers">modifiers</h2><label class="switch" data-i18n-title="modifiers" title="modifiers"><input class="whisper-toggle" name="attr_modifiers_toggle" type="checkbox" value="?{Modifiers +/-|0}"/><span class="slider"></span></label><h2 data-i18n-title="edge">edge</h2><label class="switch" data-i18n-title="edge" title="edge"><input class="whisper-toggle" name="attr_edge_toggle" type="checkbox" value="@{edge}"/><span class="slider"></span></label><button name="d6" title="Roll D6s" type="roll" value="@{gm_toggle} &{template:rolls}{{header=^{d6}}}{{base=^{d6}}}{{dice=[[(?{d6s|0}d6>5@{explode_toggle})]]}}">L</button><input name="attr_tab" type="hidden" value="options"/><button class="pictos" name="act_tab_options" title="@{tab}" type="action">y</button><button data-i18n="core" name="act_tab_core" type="action" title="@{tab}">core</button><button data-i18n="arms" name="act_tab_arms" type="action" title="@{tab}">arms</button><button data-i18n="augs" name="act_tab_augs" type="action" title="@{tab}">augs</button><button data-i18n="gear" name="act_tab_gear" type="action" title="@{tab}">gear</button><button data-i18n="magic" name="act_tab_magic" type="action" title="@{tab}">magic</button><button data-i18n="matrix" name="act_tab_matrix" type="action" title="@{tab}">matrix</button><button data-i18n="social" name="act_tab_social" type="action" title="@{tab}">social</button><button data-i18n="vehicle" name="act_tab_vehicle" type="action" title="@{tab}">vehicle</button></div><input class="options_toggle" name="attr_tab" type="hidden" value="options"/><div class="static pc-col">
<div class="pc-row core-info">
<div class="header"><div class="triangle"></div><h1 data-i18n="personal">Personal Data</h1></div>
<div class="border-box">
@@ -1284,18 +1284,18 @@ const updateRepeatingPrimary = (eventinfo, type) => {
if (eventinfo.newValue === undefined) {
return false
} else if (eventinfo.newValue === 'primary') {
const constructedAttributes = type === 'armor' ? shadowrunFunctions.addRepRow(repRowID, sheetAttributes.armorAttributes) : shadowrunFunctions.contructRepeatingWeaponAttributes(repRowID, type);
const constructedAttributes = type === 'armor' ? processingFunctions.shadowrun.addRepRow(repRowID, sheetAttributes.armorAttributes) : processingFunctions.shadowrun.contructRepeatingWeaponAttributes(repRowID, type);
//get the attributes to update primary
getAttrs(constructedAttributes, attrs => {
const update = type === 'armor' ? shadowrunFunctions.updatePrimaryArmor(attrs) : shadowrunFunctions.updatePrimaryWeapons(attrs);
const update = type === 'armor' ? processingFunctions.shadowrun.updatePrimaryArmor(attrs) : processingFunctions.shadowrun.updatePrimaryWeapons(attrs);
processingFunctions.setAttributes(update)
})
//Reset all the other primaries
shadowrunFunctions.resetRepeatingFieldsPrimaries(`repeating_${type}`, repRowID)
processingFunctions.shadowrun.resetRepeatingFieldsPrimaries(`repeating_${type}`, repRowID)
} else {
const update = type === 'armor' ? shadowrunFunctions.resetPrimaryArmor() : shadowrunFunctions.resetPrimaryWeapon(type);
const update = type === 'armor' ? processingFunctions.shadowrun.resetPrimaryArmor() : processingFunctions.shadowrun.resetPrimaryWeapon(type);
processingFunctions.setAttributes(update)
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
input(name='attr_version' type='hidden' value='1.02')
input(name='attr_version' type='hidden' value='1.03')
//- CHARACTER SHEET PAGE
input.sheet_type(name='attr_sheet_type' type='hidden' value='pc')
+4 -4
View File
@@ -55,18 +55,18 @@ const updateRepeatingPrimary = (eventinfo, type) => {
if (eventinfo.newValue === undefined) {
return false
} else if (eventinfo.newValue === 'primary') {
const constructedAttributes = type === 'armor' ? shadowrunFunctions.addRepRow(repRowID, sheetAttributes.armorAttributes) : shadowrunFunctions.contructRepeatingWeaponAttributes(repRowID, type);
const constructedAttributes = type === 'armor' ? processingFunctions.shadowrun.addRepRow(repRowID, sheetAttributes.armorAttributes) : processingFunctions.shadowrun.contructRepeatingWeaponAttributes(repRowID, type);
//get the attributes to update primary
getAttrs(constructedAttributes, attrs => {
const update = type === 'armor' ? shadowrunFunctions.updatePrimaryArmor(attrs) : shadowrunFunctions.updatePrimaryWeapons(attrs);
const update = type === 'armor' ? processingFunctions.shadowrun.updatePrimaryArmor(attrs) : processingFunctions.shadowrun.updatePrimaryWeapons(attrs);
processingFunctions.setAttributes(update)
})
//Reset all the other primaries
shadowrunFunctions.resetRepeatingFieldsPrimaries(`repeating_${type}`, repRowID)
processingFunctions.shadowrun.resetRepeatingFieldsPrimaries(`repeating_${type}`, repRowID)
} else {
const update = type === 'armor' ? shadowrunFunctions.resetPrimaryArmor() : shadowrunFunctions.resetPrimaryWeapon(type);
const update = type === 'armor' ? processingFunctions.shadowrun.resetPrimaryArmor() : processingFunctions.shadowrun.resetPrimaryWeapon(type);
processingFunctions.setAttributes(update)
}
}