#Shape Change Macro
1 messages · Page 1 of 1 (latest)
Hi
I'm trying to modify your macro to my needs.
I want to suggest you datalist
You can use instead of your folder structure
it's pretty easy to use
let dialogue_content = `
<form>
<h2>Target Form Name</h2>
<div class="form-group">
<input list="selected_sc_list" id="selected_sc" name="selected_sc">
<datalist id="selected_sc_list">
</datalist>
</div>
<div class="form-group">
<label for="raise">Cast with a raise: </label>
<input id="raise" name="raiseBox" type="checkbox"></input>
</div>
</form>
<script>
function actorReader(folderName='${folderName}') {
let mainFolder = game.folders.getName(folderName);
let itemsLabelList = [];
for (let item of mainFolder.content) {
let itemsLabel = new Object();
itemsLabel.val = item.name;
itemsLabel.text = "(" + item.data.data.stats.size + ") " + item.name;
itemsLabelList.push(itemsLabel);
}
return itemsLabelList;
}
var list = document.getElementById('selected_sc_list');
var actorsData = actorReader();
actorsData.forEach(function(item){
var option = document.createElement('option');
option.value = item.val;
option.textContent = item.text;
list.appendChild(option);
});
</script>
</br>
`;
The one I´'m trying to make will only read one folder. You can search size.
Looking good, I'd hide the folder selection with a details tag though.
Anyway, feel free to make a pr and I'll try it out and merge it for the next version. Would be much appreciated. =)
What would you hide? I didn't understand
My bad. I didn't get what you proposed. The video was too small on mobile.
In that case I kinda fail to see the gain here. how does that make it better for the user? Most of my players don't even know the size. How is that better than seeing the names of the creatures a player could transform into?