Giter VIP home page Giter VIP logo

foundryvtt-token-factions's Introduction

Tokens Faction

Latest Release Download Count

Forge Installs

Foundry Core Compatible Version

Latest Version

Foundry Hub Endorsements

GitHub all releases

Translation status

If you want to buy me a coffee alt-text

This module will allow you to assign tokens to factions by using the token's disposition colors, the token actor's folder color, or defining your own custom replacement colors for token dispositions.

alt text

Artwork and assets kindly provided by and used with permission of Caeora. www.caeora.com

This is a keeping up to date of the idea of Voldemalort and is project Token Factions (original) wishing him all the best possible

NOTE: This module is under maintenance, I have no plans to update or add features. However, I will try to fix any bugs as possible. Any contribution is welcome.

Part of the code of this is module is inspired from the wonderful work done by kandashi with its Border-Control and Levels module. If you want to support more modules of this kind, I invite you to go and support his patreon.

alt-text

NOTE: If you are a javascript developer and not a typescript developer, you can just use the javascript files under the dist folder

Installation

It's always easiest to install modules from the in game add-on browser.

To install this module manually:

  1. Inside the Foundry "Configuration and Setup" screen, click "Add-on Modules"
  2. Click "Install Module"
  3. In the "Manifest URL" field, paste the following url: https://raw.githubusercontent.com/p4535992/foundryvtt-token-factions/master/src/module.json
  4. Click 'Install' and wait for installation to complete
  5. Don't forget to enable the module in game using the "Manage Module" button

libWrapper

This module uses the libWrapper library for wrapping core methods. It is a hard dependency and it is recommended for the best experience and compatibility with other modules.

Known issue

Configuration

alt text

Generate Token Faction Color From

  • A Token's Disposition
  • An Actor's Folder Color
  • A Custom Color Set For Token Disposition

Default: A Token's Disposition

This option uses the default Token Disposition color to render the token base and frame. Token Disposition can be seen on a token's Character tab. Tokens with actors controlled by players are colored in a fourth, distinct color.

alt text

An Actor's Folder Color

This option uses the color of the folder a token's actor belongs in. A color of #000000, or the default color of a new actor folder, is treated as if there is no folder that will prevent a base and frame from being rendered for contained actor tokens.

alt text

[ON DEVELOPING] A Custom Color Set For Token Disposition

This option reveals additional configuration options allowing you to customize colors associated with each token disposition.

alt text

Choose shape of your faction

Token frames (rings, square, hex) are layered above token graphics.

img1

img2

img3

img4

alt text

You can override this setting on a per-token basis on a token's Image tab if you use a mix of round and irregular tokens.

alt text

Frame Render Style

[FOR NOW IS THE ONLY AVAIABLE OPTION] Default: Flat

This option renders the frame in a flat color.

alt text

[ON DEVELOPING] Beveled

This option renders the frame in a beveled style typically seen surrounding round tokens.

alt text

Frame/Border Width (Percent of Grid Unit)

This allows you to change the thickness of the rendered frame. The percentage is based on the width of a single grid unit, not the token width, so larger and smaller tokens will have a consistent frame size.

alt text

Base Opacity

Setting this value to anything lower than 1 will allow the map background to be seen through the base. Setting this value to 0 will disable drawing the base entirely.

Frame Opacity

Setting this value to anything lower than 1 will allow the map background or token to be seen through the frame. Setting this value to 0 will disable drawing the frame entirely.

Enable/Disable the faction on the single token on the canvas

  • Left click: You can enable/disable the faction style for single token with a new hud button
  • Right click: Open a dialog for customize the border color

img7

API

game.modules.get('token-factions').api.retrieveBorderFactionsColorFromToken(tokenIdOrName:string) ⇒ string

A method to retrieve the string color hex border of a token on the canvas founded by id or name

Returns: string

Param Type Description Default
tokenIdOrName string The oken id or name (if founded) #000000

async game.modules.get('token-factions').api.disableDrawBorderFactionsFromTokens(tokenIdsOrNames:string[]) ⇒ Promise<void>

A method to disable the draw border factions on a array of tokens on the canvas founded by id or name

Returns: Promise<void>

Param Type Description Default
tokenIdsOrNames string[] The array of token ids or names (if founded) undefined

async game.modules.get('token-factions').api.disableDrawBorderFactionsFromToken(tokenIdOrName:string) ⇒ Promise<void>

A method to disable the draw border factions on a token founded by id or name

Returns: Promise<void>

Param Type Description Default
tokenIdOrName string The token id or name (if founded) undefined

async game.modules.get('token-factions').api.enableDrawBorderFactionsFromTokens(tokenIdsOrNames:string[]) ⇒ Promise<void>

A method to enable the draw border factions on a array of tokens on the canvas founded by id or name

Returns: Promise<void>

Param Type Description Default
tokenIdsOrNames string[] The array of token ids or names (if founded) undefined

async game.modules.get('token-factions').api.enableDrawBorderFactionsFromToken(tokenIdOrName:string) ⇒ Promise<void>

A method to enable the draw border factions on a token founded by id or name

Returns: Promise<void>

Param Type Description Default
tokenIdOrName string The token id or name (if founded) undefined

Build

Install all packages

npm install

npm build scripts

Build

Install all packages

npm install

dev

dev will let you develop you own code with hot reloading on the browser

npm run dev

build

build will build and set up a symlink between dist and your dataPath.

npm run build

build:watch

build:watch will build and watch for changes, rebuilding automatically.

npm run build:watch

prettier-format

prettier-format launch the prettier plugin based on the configuration here

npm run-script prettier-format

lint

lint launch the eslint process based on the configuration here

npm run-script lint

lint:fix

lint:fix launch the eslint process with the fix argument

npm run-script lint:fix

prettier-format

prettier-format launch the prettier plugin based on the configuration here

npm run-script prettier-format

Issues

Any issues, bugs, or feature requests are always welcome to be reported directly to the Issue Tracker, or using the Bug Reporter Module.

License

This package is under an MIT license and the Foundry Virtual Tabletop Limited License Agreement for module development.

Credit

Thanks to anyone who helps me with this code! I appreciate the user community's feedback on this project!

foundryvtt-token-factions's People

Contributors

p4535992 avatar voldemalort avatar dev7355608 avatar erithtotl avatar lebombjames avatar

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.