Register

Card Hands List

An Add-on Module for Foundry Virtual Tabletop

Author: Kristian Serrano Project Source Versions 13 - 13 (Verified 13) Last Updated 1 day, 4 hours ago

Card Hands List is a system-agnostic module for Foundry VTT that provides quick access to Card Hands the user owns. The module adds a collapsible list of Card Hands placed above the Players List, blending in with the core Foundry VTT UI.

Card Hands List is a system-agnostic module for Foundry VTT that provides quick access to Card Hands the user owns. The module adds a collapsible list of Card Hands placed above the Players List, blending in with the core Foundry VTT UI.

Features

Hooks.on('renderHandActionsSheet', (sheet, html) => {
  // If Complete Card Management (CCM) is installed and active, add the scry button.
  if (game.modules.get('complete-card-management')?.active) {
    const buttonActions = sheet.options.buttonActions ?? CONFIG.CardHandsList.menuItems.handContextOptions;
    // Create a CCM Scry Context Menu Item
    const newButton = {
      name: game.i18n.localize('CardHandsList.ScryDeck'),
      icon: "<i class='fa-solid fa-eye'></i>",
      condition: (el) => {
        // If the hand has a default deck configured, display the scry button
        const hand = game.cards.get(el[0].dataset.id);
        return game.cards.get(hand.getFlag(handsModule.id, 'default-deck'));
      },
      callback: async (el) => {
        const hand = game.cards.get(el[0].dataset.id);
        const deck = game.cards.get(hand.getFlag(handsModule.id, 'default-deck'));
        // Call CCM's scry function.
        ccm.api.scry(deck);
      }
    };

    // If the new button hasn't already been added during a previous render, add it.
    if (!buttonActions.some(a => a.name === newButton.name)) {
      buttonActions.splice(2, 0, newButton);
      sheet.render();
    }
  }
});

Categories

Available Versions

  1. Version 2.2.2

    1 day, 4 hours ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  2. Version 2.2.1

    2 days, 2 hours ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  3. Version 1.13.1

    3 days, 2 hours ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  4. Version 1.5.1

    1 year, 9 months ago
    Foundry Version 10 - 11 (Verified 11) Manifest URL Read Notes