Coder Social home page Coder Social logo

fvtt-token-action-hud-core's Introduction

Downloads Forge Installs

Token Action HUD Core

Token Action HUD is a repositionable HUD of actions for a selected token.

Token Action HUD

Features

  • Make rolls directly from the HUD instead of opening your character sheet.
  • Use items from the HUD or right-click an item to open its sheet.
  • Move the HUD and choose to expand the menus up or down.
  • Unlock the HUD to customise the groups and actions.
  • Add your own macros and Journal Entry and Roll Table compendiums.

Installation

Method 1

  1. In Foundry VTT's Configuration and Setup screen, click Add-on Modules
  2. Click Install Module
  3. Search for Token Action HUD Core
  4. Click Install next to the module listing

Method 2

  1. In Foundry VTT's Configuration and Setup screen, click Add-on Modules
  2. Click Install Module
  3. In the Manifest URL field, paste: https://github.com/Larkinabout/fvtt-token-action-hud-core/releases/latest/download/module.json
  4. Click Install next to the pasted Manifest URL

Required Modules

Token Action HUD System Modules

Token Action HUD Core requires a companion Token Action HUD system module to be installed. Current system modules are:

For other systems, continue to use the Token Action HUD Classic.

socketlib

Token Action HUD Core requires the socketlib library module.

Recommended Modules

Token Action HUD uses the Color Picker library module for its color picker settings.

Support

For a guide on using Token Action HUD, go to: How to Use Token Action HUD

For questions, feature requests or bug reports, please open an issue here.

Pull requests are welcome. Please include a reason for the request or create an issue before starting one.

Acknowledgements

Thank you to the Community Helpers on Foundry's Discord who provide tireless support for people seeking help with the HUD.

License

This Foundry VTT module is licensed under a Creative Commons Attribution 4.0 International License and this work is licensed under Foundry Virtual Tabletop EULA - Limited License Agreement for module development.

fvtt-token-action-hud-core's People

Contributors

adkaiser avatar foxlee avatar jeannjeann avatar larkinabout avatar mercuryreign avatar sakusenerio avatar sp0ken avatar typhonrt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fvtt-token-action-hud-core's Issues

[FEATURE] Option to hide empty subsections

Probably a default functionality rather than an option, or an option turned by default. Can be global or per section (probably per section is best). Should be on by default for the Spells section in 5E.

image

[BUG] Errors for players that have an "Observer" permission for a token

Describe the bug
When a player in my game has an "Observer" permission for a token, they always get asserts on startup, or when the token data is updated.

I was able to trace this to the _updateHud() function. Modifying it to be as below fixes the problem.

 async _updateHud() {
        Logger.debug('Updating hud...')
        const controlledTokens = this.tokens?.controlled.filter((token) => token.isOwner);
        const character = this._getCharacter(controlledTokens)

        const multipleTokens = controlledTokens.length > 1 && !character

        if (((!character?.actor || !character.actor.isOwner) && !multipleTokens) || !this.isHudEnabled()) {
            this.close()
            return
        }

        this.actionList = await this.actionHandler.buildActionList(character)

        this.rendering = true
        this.render(true)
        Logger.debug('Hud updated')
}

Feedback: PF2 CSS compatibility with Dorako UI

I will start with a disclaimer this is not a negative feedback for the new PF2 skin, it is wonderful if a bit "thick" because of the extra borders on each item. but looks very stylish.

However, the new PF2 skin is very much in contrast with the most popular, semi-official CSS skin mod for PF2 called Dorako UI. I feel that a direct collaboration with Dorako UI is a better to approach that will work for more people. Since Dorako puts a lot of effort into making a dark-mode UX for PF2, it could allow your skin to work with his dark-mode system-wide variables.

Again, just trying to raise awareness of Dorako's work, not a hostile take on your work. Feel free to close this issue, or we could discuss it if you have an opinion. Thanks in advance.

[BUG] FVTT KeyboardManager doesn't get modifiers if button glow activated before modifier key

When I move my mouse into a HUD button it gets a glow.

If I hold down ALT before moving the mouse into the button to create the glow, then a mouse click honours the ALT key.

If I move the mouse into the button first to create the glow, then press ALT and then do the mouse click, then the ALT key is ignored.

It works properly in the APP, but not in the Chrome browser.

If I click on a category name, then click on a subcategory name, the ALT key is completely ignored. i.e. the ALT key state is not captured by FVTT KeyboardManager.


The game system (Cypher system) calls game.keyboard.isModifierActive('Alt') to see if the Alt key is currently held down.

It seems that the glow effect of the HUD buttons is preventing the core FVTT from detecting the ALT key being pressed.

[FEATURE] Add/Remove Categories, Subcategories and Actions via Macros

Describe your idea
Add/remove categories, subcategories and actions via macro functions, e.g., addCategory({name: 'My Category'}).

Additional context
This will be tricky for multi-levelled subcategories as the user would need to provide a reference to the nested subcategory. All subcategories and actions used an id to differentiate one from another with the same name.

[FEATURE] Remove the "requiredCoreModuleVersion` check

At least one player has updated the CORE version to 1.2.0 and says that my module fails with a warning.

I think this is going to happen on a regular basis concerning the future of your Core module.

If module developers don't immediately update their json code then this warning will be displayed for a long time on those game systems - and they won't be able to use the HUD at all.

Is there some level of major/minor version where you can ensure compatibility?

e.g. Does 1.2 have a different API from 1.1 which makes the two versions incompatible?

[BUG]

When the menu is open using the 'Click to Open Categories', clicking anywhere on the canvas that is also within the horizontal band containing the open menu, I can't select a new token or click on the canvas to close the HUD.

This is the full horizontal band, even far to the right of the open menus.

image

e.g. in the above picture, I can't select the bob2 or Torah tokens, or click on the canvas between those two tokens (or to the right of the bob2 token) in order to close the HUD.

Inventory Section dynamic data

In Inventory Section, add a section title that instead of repeatring the name of the Section, i.e. Inventory, contains weight of the inventory and amount of gold owned. This will save checking for encumberance and for gold owned that currently requires the character sheet inventory tab.

Suggestion: minimize waste of vertical space with subsection titles

Using the image presented in the release changelog, I would like to ask to improve the use of vertical space (even if optional and off by default, so some people like me can use the more compact mode) by moving titles of subsections on the first line of their content rather than on the top of their content. This will save a lot of vertical space for games with lots of items/abilities/attacks (PF2 on mid/late tier for example)

Also there's no need to duplicate the section title as a header as this is a known information. In this case, I would remove the second "Actions" using subsection font.

image

How should a checkable/selectable item be initialised?

I have some entries which I want to show if they are selected or not.

What field needs adding to the action that I create?

I can see a "selected" field being set, but it doesn't change how anything is displayed in the HUD.

[SYSTEM] Twodsix - Cepheus & Traveller

Describe your idea
Add support for the Twodsix - Cepheus & Traveller system.

Additional context
If anyone would like to develop this Token Action HUD system module, please let me know. System modules can be developed in your own repos. See Token Action HUD D&D 5e for reference.

[FEATURE] Use Hooks for Registering System Module

Describe your idea
Use Foundry VTT's Hooks mechanism to allow Token Action HUD system modules to register with the Token Action HUD Core module, e.g., Hooks.once('token-action-hud-register', (core) => core.register(myVersionData, mySystemManager))

Versions

  • Token Action HUD Module: [token-action-hud-core 1.0.2]

Additional context
There are three main interactions to include when implementing a hook method:

  1. Token Action HUD Core currently checks the module version required by the system module via a dynamic import of a file on the system module side. Compatibility data does not seem to be currently available in the module data held by Foundry VTT.
  2. Token Action HUD Core uses the system module's SystemManager class to override its own class methods.
  3. Token Action HUD system modules extend core classes and use a utility class for various functions. These could be passed back to the system module via a hook or made available under game.tokenActionHud instead.

[FEATURE] Special Grid Mode for Conditions Tabs

One of the areas where legacy TAH had a bit of a ergonomic issue was sections of skills and conditions where the boxes having dynamic width made it very hard to tell where a specific frequently used skill or specific condition is located. In those cases UX studies suggests fixed width grids and many Foundry mods use fixed grid with labels for conditions (Monk's Little Details can do this for both 5E and PF2)

My suggestion is to add a new fixed width grid mode that will be used for specific sections only, and can be toggled on and off from the section settings. What it does is, it sets a fixed width of each grid item, so they appear in a clear and easy to visually remember matrix (up to the default or custom width in pixels). If the text string is longer than a grid width, use "..." to cut it shorter, it will still be very recognizable by icon and first few words or 12-15 symbols.

image

[BUG] Can't open HUD after updating from previous Token Action Hud module

Describe the bug
I previously used the Token Action Hud module and wanted to change over to this one and the 5e module in order to use the new features like always showing the HUD, even if no token is selected. Unfortunately, the hud does not open at all and there are errors in the console:
image

Versions:

  • Token Action HUD Core: 1.01
  • Token Action HUD System: token-action-hud-dnd5e 1.01
  • System: dnd5e 2.0.3
  • Foundry VTT: 10.291
  • Browser: Google Chrome 109.0.5414.119

[BUG] HUD does not appear in the electron app (Chrome v94)

Describe the bug
The Token Action HUD does not appear when using the electron app, and logs the following error in the console when you click on a token:

image

Steps to reproduce

  1. Run Foundry using the Electron app
  2. Place a token in a scene
  3. Click on the token
  4. Note that the HUD does not appear, and the above error is logged in the console.

Versions:

  • Token Action HUD Core: 0.1.1
  • Token Action HUD System: token-action-hud-dnd5e 0.1.2
  • System: dnd5e 2.0.3
  • Foundry VTT: 10.291
  • Browser: Chrome 94.0.4606.81

Additional context
When launching Chrome version 108.0.0.0, the HUD appears fine; but when running through the Foundry electron app which is back on v94 the HUD doesn't appear at all and throws the above error in the console.

[BUG] Menu remains open when menu re-opens

With the option 'Click to Open Categories' selected, if I open one of the categories and then click away from the token, the HUD disappears (correct).

But when I select a different token, the HUD opens, and the previously selected category is already visible.

I would expect the HUD to return to all categories being closed when the HUD disappears from the screen.

(Note that if the HUD is open and I click on a different Actor, then leaving the existing category open is OK since the HUD remains on display.)

[BUG] Unable to create subcategories for custom categories

I'm presuming this is a bug but I might be misunderstanding how categories/subcategories are supposed to work. I'm trying to create categories for "actions", "bonus actions", "reactions", and "other actions" to mimic how the hud used to work along with character actions list 5e but am running into problems . Right clicking on one of the existing categories brings up the subcategories interface as I presume it's supposed to. However, when I create a new category right clicking on the new category does not bring up the subcategories interface. There are no relevant errors in console.

Video below:
hudcore

Also, is it possible for me to set up the hud with custom categories/subcategories for my players? I used to have them click "group by action type" in settings to ensure we were seeing the same stuff. Do I now need to talk the players through the process of setting up categories or is it possible for me to sign onto their accounts and make hud changes that they'll see when they sign in?

Versions:

  • Token Action HUD Core: 1.1.1
  • Token Action HUD System: token-action-hud-dnd5e 1.1.0
  • System: dnd5e 2.1.4
  • Foundry VTT: 10.291
  • Browser: Chrome 109.0.5414.120 and firefox

Thanks for taking a look at this and for all your work on this super useful mod.

[SYSTEM] Cyberpunk RED

Describe your idea
Add support for the Cyberpunk RED system.

Additional context
If anyone would like to develop this Token Action HUD system module, please let me know. System modules can be developed in your own repos. See Token Action HUD D&D 5e for reference.

[FEATURE] Reorganize subcategory order for custom categories

I wouldn't call it a bug since it's pretty magical that the actions, bonus actions, etc auto-populate. However, the current order of the subcategories is a bit wonky. The current orders are shown below:
image
image
image
image

I don't think there's any one most logical way to order them but I guess I'd default to trying to go in about the same order as the character sheets in terms of handing innate, pact, cantrips, spell in order of level, etc. Ideally consumables would not be in the middle of the spells.

Thanks again for all your work and for considering this!

Token Action HUD Core: 1.2.1
Token Action HUD System: 5e 1.2.1
System: dnd5e 2.1.4

[BUG]

Whenever dragging a token around sound, it broadcasts the sound of where it left, not where it went. Example, I have a token next to a fire, and I hear nothing. That is because I dragged it from an area that was too far to hear it. Now if I drag it back to that spot, I will hear the fire. Reason is that it is sending the sound of the LAST spot we were in. :)

Reset HUD error

In settings I get the following error when I check "Reset HUD"
image

[SYSTEM] Warhammer 40,000 Wrath & Glory

Describe your idea
Add support for Warhammer 40,000 Wrath & Glory system.

Additional context
If anyone would like to develop this Token Action HUD system module, please let me know. System modules can be developed in your own repos. See Token Action HUD D&D 5e for reference.

[BUG] Documentation Issues

  • The actions for addActionsToActionList is missing information about the 'img' property.

  • The document for doRenderItem doesn't mention that the action's name must be "itemMacro" in order for this to work.

  • The documentation for getImage doesn't mention that it only returns the image if the HUD Core option Display Icons is selected.

  • The section Import Token Action HUD Core Classes Example would look better if it used JS like:

import { ActionHandler, CategoryManager, RollHandler, SystemManager, Utils } from '../../token-action-hud-core/scripts/token-action-hud-core.min.js'
  • The 'delimiter property is missing from the description of ActionHandler class. It would be good if this value was also available in the RollHandler class (for use by encodedValue.split(...)).

[SYSTEM] Dungeon Crawl Classics

Describe your idea
Add support for the Dungeon Crawl Classics system.

Additional context
If anyone would like to develop this Token Action HUD system module, please let me know. System modules can be developed in your own repos. See Token Action HUD D&D 5e for reference

[SYSTEM] Shadowrun 5e

Describe your idea
Add support for the Shadowrun 5e system.

Additional context
If anyone would like to develop this Token Action HUD system module, please let me know. System modules can be developed in your own repos. See Token Action HUD D&D 5e for reference.

[FEATURE] Allow Any Actions to be Added to Any Subcategory

Describe your idea
Allow macro actions to be added into any subcategory.

Additional context
Currently, macro actions are added to the HUD by creating a custom subcategory. By allowing them to be viewed and added to any subcategory, alongside the actions available for that subcategory, it frees up custom subcategories to be used for organising the HUD instead.

[FEATURE] Allow TAH System Modules to Add HUD Styles

Just an idea inspired by your PF2 CSS system, it might be more logical to bundle CSS themes with system plugins instead of the core, and allow systems to have one or multiple themes that they can register with the core.

Items with Spells sprouts duplicates in spell menu

I used the Items with Spells module to load a staff with 18 spells. It causes multiple copies of each spell to show up in the Token Action HUD, beginning with 18 duplicates of Fire Bolt.

Versions:

  • Token Action HUD Core: 1.2.1
  • Token Action HUD System: dnd5e 1.2.0
  • Items with Spells: 1.3.1
  • System: dnd5e 2.1.4
  • Foundry VTT: 10.291
  • Browser: Google Chrome 109.0.5414.120

staff-of-surging

items-with-spells-token-action-HUD

[FEATURE] Search Field mode for sections

This is a bit involved, but if implemented will solve all issues with vertical space for excessive high-end games with hundreds of items, mainly Inventory issues.

If the Search Filter mode is turned on in the section settings, when the section is opened it will show a text field for dynamic real-time filtering at bottom (or the top) of the main bar. The field is auto-focused for immediate typing.

As the user types few characters the contents of the section (that may be overflowing at first) redraw with the filtered items that the user wants to engage with.

[SYSTEM] Old School Essentials

Describe your idea
Add support for the Old School Essentials system.

Additional context
If anyone would like to develop this Token Action HUD system module, please let me know. System modules can be developed in your own repos. See Token Action HUD D&D 5e for reference.

[FEATURE] Add option to ignore "Always Show HUD" for GM

Describe your idea
I love the "Always Show HUD" feature for my players, so that the hud is always shown, whether they have tokens on the scene or not. As a GM however, it always keeps the hud for the last token selected on the screen. I would love to have the option to disable this behavior and only show the hud for the GM when a token is selected.

[BUG] hud not appearing in 5e v1.2

Upon opening foundry or refreshing the browser I get an error message indicating:
image

The hud is not appearing for any tokens; presumably as a result of the version conflict.

Versions:

  • Token Action HUD Core: [1.2.1; issue also present with 1.2.0]
  • Token Action HUD System: [5e 1.2.0]
  • System: dnd5e 2.1.4
  • Foundry chrome and firefox]
    -hosted on the forge

[BUG] Lag when selecting token

Describe the bug
Reported by fabio32 on Foundry VTT's Discord. The HUD will take 1 to 2 seconds to update when selecting between tokens.

Original Token Action HUD
https://user-images.githubusercontent.com/105953297/210102174-21ea559b-07ed-4adb-a9d6-fcf20d14926f.mp4

Token Action HUD Core
https://user-images.githubusercontent.com/105953297/210102218-c30c94df-f9f8-49c2-aeeb-a77319253303.mp4

Steps to reproduce

  1. Select a token on the canvas.

Versions:

  • Token Action HUD Core: 0 1.1
  • Token Action HUD System: token-action-hud-dnd5e 0.1.2
  • System: dnd5e 2.0.3
  • Foundry VTT: 10.291
  • Browser: Brave and Google Chrome

Additional context
Creating a new world with empty actors will reduce the lag significantly. The issue persists with no other modules enabled.

[FEATURE] Simple automatic direction flow choice (optional, on by default)

Instead of choosing your direction flow (up or down) it will help players who are not used to Settings pane or who change browsers often and lose the cookie, if there was an automated way to choose direction based on distance to upper and bottom corners.

If within the bottom 1/3 to 1/4 of the screen, flow up. If within the top 1/3 to 1/4 of the screen, flow down.

The middle position that very few people use, it chooses what is set in the settings or the default if not changed by player.

[FEATURE] ESC Interaction While HUD Has Focus

Describe your idea
As with application windows, the ESC key's default interaction of deselecting tokens and opening the ESC menu is disabled while Token Action HUD has focus. This happens when clicking on the HUD. As the HUD is intended to always be open, it would be better for the ESC key to keep its default interactions.

Versions

  • Token Action HUD System: [e.g. token-action-hud-core 1.0.2]

Additional context
Possible solutions include: returning focus to the canvas after each time the HUD is clicked or replicating the default ESC key interactions with events on key press.

[FEATURE] Checkboxes to improve dungeon master experience

Describe your idea
A checkbox to separate ability checks and saving throws into two different categories to avoid pop up navigation.

When Checked, the Attributes menus Would read [Saves] [Ability Checks] [Skills] (or in order of usability Saves, Skills, Ability Checks).

Also, a companion Checkbox for "Always Show two Rolls regardless of advantage", to avoid the second pop up.
We lose the change to add manual situational bonus, but as a tradeoff we see instant results.

+notice that, if combined, when rolling checks for multiple creatures, instead of asking things for each one, the results will instead appear on the chat, saving lots of time.

Finally, a checkbox that enforces "Always roll hidden" (gm only see results).(alternatively, this could enable rolling in the same manner as the Default roll mode, for more versatility, but probably harder to program...)

Versions

  • Token Action HUD System: [ token-action-hud-dnd5e]
  • System: [dnd5e] (or any?)

Additional context
This module is incredibly good, but I find that pop ups interrupt the flow of the game too much, especially in large scale combats, or when multiple creatures are made to save, for example).

Allowing the program to roll hidden, will also make it double as an excellent gm Screen!

prototype mockup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.