-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature - Api Wrapper #71
Comments
Created PR #72 |
Example usage - using PartyResources to manage cooking ingredients from the Pathfinder Kingmaker AP new Dialog({
title:'Add resource',
content:`
<form>
<div class="form-group">
<label>Basic ingredient</label>
<input type='number' name='basicIngredient'></input>
</div>
<div class="form-group">
<label>Special ingredient</label>
<input type='number' name='specialIngredient'></input>
</div>
</form>`,
buttons:{
yes: {
icon: "<i class='fas fa-check'></i>",
label: `Apply Changes`
}},
default:'yes',
close: html => {
let basicIngredient = html.find('input[name=\'basicIngredient\']');
if (basicIngredient.val()!== '') {
PartyResources.incrementByName('Basic Ingredient', Number(basicIngredient.val()));
}
let specialIngredient = html.find('input[name=\'specialIngredient\']');
if (specialIngredient.val()!== '') {
PartyResources.incrementByName('Special Ingredient', Number(specialIngredient.val()));
}
}
}).render(true);``` |
@DawidIzydor There already is a public-facing API, it's outlined in the FAQ. |
That's true but this wrapper makes it more intuitive to use |
@DawidIzydor Sorry for taking this long to respond, got a lot on my plate at the moment. I reviewed this in more detail and will redact my previous comment. |
Feature: add api wrapper for easier interactions with this module through macros
I have this feature already implemented, will create a PR shortly
The text was updated successfully, but these errors were encountered: