lost-in-the-canvas / WFRP-4th-Edition-FoundryVTT

Welcome all, and especially newcomers! This is the premiere system for running grim and perilious games of Warhammer Fantasy Role-play in the Foundry VTT environment. (Additional Content Included!)
http://foundryvtt.com/
Apache License 2.0
53 stars 27 forks source link

Easy table access #221

Closed SZzip closed 4 years ago

SZzip commented 5 years ago

I created a small snippit to access the tables easier. Feel free to add it to the module.

$('.roll-type-select').find('.fa-dice-d20').attr("style", 'cursor: pointer;'); $('.roll-type-select').find('.fa-dice-d20').click(function(){ let chatOptions = {user: game.user._id} if (['gmroll', 'blindroll'].includes(game.settings.get('core', 'rollMode'))) chatOptions['whisper'] = ChatMessage.getWhisperIDs('GM'); if (game.settings.get('core', 'rollMode') === 'blindroll') chatOptions['blind'] = true; var content = '/table Commands
' Object.entries(WFRP_Tables).forEach(function(value){ content += '<a data-table=\'' + value[0] + '\' class=\'table-click\'>' + value[0] + ' - ' + value[1].name + '
' }) chatOptions['content'] = content; ChatMessage.create(chatOptions,false) })

moo-man commented 5 years ago

Am I correct in that this addresses issue #145 ? Is that the purpose here or is there something else added as well?

I ask this because #146 has already been fixed, you can click on tables in the menu to roll them