Skip to content

Commit

Permalink
Merge perception to skills; rename as Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
iBoMbY committed May 13, 2023
1 parent df96931 commit 1e4e499
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"LMRTFY.MessagePlaceholder": "Roll to see if you find any traps...",
"LMRTFY.SavingThrows": "Saving Throws:",
"LMRTFY.SavingThrow": "Saving Throw: ",
"LMRTFY.SkillChecks": "Skill Checks:",
"LMRTFY.Checks": "Checks:",
"LMRTFY.SkillCheck": "Skill Check: ",
"LMRTFY.RequestRolls": "Request Rolls!",
"LMRTFY.SaveRequest": "Save Request as Macro",
Expand Down
13 changes: 12 additions & 1 deletion src/requestor.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class LMRTFYRequestor extends FormApplication {
(Object.keys(a_skills).map(key => a_skills[key]).filter(skill => !LMRTFY.skills[skill.slug])).map(skill => skills[skill.slug] = skill.label);
});

skills["perception"] = "LMRTFY.Perception";

const extraRollOptions = game.settings.get('lmrtfy_pf2e', 'extraRollOptions')

return {
Expand Down Expand Up @@ -134,6 +136,15 @@ class LMRTFYRequestor extends FormApplication {
const { mode, title, message, extraRollOptions } = formData;
const traits = formData.traits;

let perception = formData['extra-perception'];

const index = skills.indexOf("perception");

if (index > -1) {
perception = true;
delete skills[index];
}

let dc = undefined;
const dcValue = parseInt(formData.dc);

Expand Down Expand Up @@ -168,7 +179,7 @@ class LMRTFYRequestor extends FormApplication {
mode,
title,
message,
perception: formData['extra-perception'],
perception,
"flat-check": formData['extra-flat-check'],
chooseOne: formData['choose-one'],
dc,
Expand Down
23 changes: 1 addition & 22 deletions templates/request-rolls.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,27 +122,6 @@
<button type="button" class="add-extra-roll-note" name="submit" value="1"><i class="fas fa-plus-square"></i>{{localize "LMRTFY.AddRoleNote"}}</button>
</fieldset>

<fieldset>
<div class="form-group">
<label>{{localize "LMRTFY.Extras"}}</label>

<div class="lmrtfy-extras">
{{#if specialRolls.perception}}
<div class="lmrtfy-extra-perception">
<input type="checkbox" name="extra-perception" id="lmrtf-extra-perception" data-dtype="Boolean" {{#if (lmrtfy-isSelected "perception")}}checked{{/if}} />
<label for="lmrtf-extra-perception">{{localize "LMRTFY.Perception"}}</label>
</div>
{{/if}}
{{#if specialRolls.flat-check}}
<div class="lmrtfy-extra-flat-check">
<input type="checkbox" name="extra-flat-check" id="lmrtf-extra-flat-check" data-dtype="Boolean" {{#if (lmrtfy-isSelected "flat-check")}}checked{{/if}} />
<label for="lmrtf-extra-flat-check">{{localize "PF2E.FlatCheck"}}</label>
</div>
{{/if}}
</div>
</div>
</fieldset>

<fieldset>
<div class="form-group">
<label>{{localize "LMRTFY.SavingThrows"}}</label>
Expand All @@ -160,7 +139,7 @@

<fieldset>
<div class="form-group">
<label>{{localize "LMRTFY.SkillChecks"}}</label>
<label>{{localize "LMRTFY.Checks"}}</label>
<select name="skills" id="lmrtf-skills" data-placeholder="Begin typing a name to filter..." multiple class="chosen-select" data-dtype="String">
<option value=""></option>
{{#each skills as |name key|}}
Expand Down

0 comments on commit 1e4e499

Please sign in to comment.