-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unofficial grimoire fix #2175
base: master
Are you sure you want to change the base?
Unofficial grimoire fix #2175
Conversation
@moo-man - this PR has been updated to latest changes. |
constructor(fields, data, resolve, options) { | ||
super(fields, data, resolve, options); | ||
|
||
this.initialFields.overchannelling = this.fields.overchannelling ?? 0; | ||
this.fields.overchannelling = this.fields.overchannelling ?? 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this isn't part of an overridden _defaultFields
function? See https://github.com/moo-man/WFRP4e-FoundryVTT/blob/master/modules/apps/roll-dialog/roll-dialog.js#L184
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will test it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
if (this.userEntry.overchannelling) { | ||
let overchannelling = parseInt(this.userEntry.overchannelling) ?? 0; | ||
this.userEntry.overchannelling = overchannelling; | ||
this.fields.overchannelling = overchannelling; | ||
context.fields.overchannelling = overchannelling; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the point of this is? This should all be handled natively as any other field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem with Numeric fields for userEntry. Maybe it's now handled better in Library. The problem was, that overchannelling was always treated as string, and in result, onFieldChange was returning either NaN as text or undefined. I will test it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved, it works fine without this change.
<label>{{localize "DIALOG.DialogModifiers"}}</label> | ||
<ul class="modifier-list"> | ||
{{#each data.scripts}} | ||
<li class="modifier {{#if this.isActive}}active {{else if this.isHidden}}hidden{{/if}}" data-tooltip="{{this.effect.name}} {{#if this.options.targeter}}(Target){{/if}}" data-tooltip-direction="RIGHT" data-index="{{@key}}" >• <a>{{this.Label}}</a></li> | ||
<li class="modifier {{#if this.isActive}}active {{else if this.isHidden}}hidden{{/if}}" data-tooltip="{{this.effect.name}} {{#if this.options.targeter}}({{localize 'Target'}}){{/if}}" data-tooltip-direction="RIGHT" data-index="{{@key}}" >• <a>{{this.Label}}</a></li> | ||
{{/each}} | ||
</ul> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably just use the partial provided by the warhammer library (which needs to be localized too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seams that none of the partial templates are being used in WFRP4e system so far. as of Lib translation, I might need to prepare PR there anyway.
<input class="input-text" type="text" name="overchannelling" value="{{fields.overchannelling}}" data-dtype="Number" title="{{localize 'DIALOG.OverchannellingTooltip'}}" /> | ||
</div> | ||
{{#if false}} | ||
<div class="form-group"> | ||
<label title="{{localize 'DIALOG.Quickcasting'}}">{{localize "DIALOG.Quickcasting"}} | ||
<input title="{{localize 'DIALOG.QuickcastingTooltip'}}" type="checkbox" name="quickcasting" data-dtype="Boolean" {{checked fields.quickcasting}} /> | ||
</label> | ||
</div> | ||
{{/if}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really use title
or data-dtype
anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-paste, i will remove those.
@moo-man - went through comments and updated PR. |
There was an issue with overcast not working due to data not being pasted from dialog to test and also calculation of user entries:
since overcast value in cast dialog is a numeric field, instead of passing it to test, it was either incremented on every input change, or treated as NaN, due to null + number calculation.
Also, minor typo and translation in base dialog.