Latest version | 1.0.1 |
---|---|
Minimum Core | 12 |
Compatible Core | 12 |
Last updated | 4 months ago |
Created | 4 years ago |
Authors | |
Languages |
Deutsch (German) English Español Français Italian Português (Brasil) 日本語 한국어 (Korean) |
Systems | All systems |
Project source | Project URL |
Report bugs | Bug tracker URL |
Read-me | Readme URL |
Changelog | Changelog URL |
A Foundry VTT module that displays the Actor's portrait images on the chat messages.
This is a upgrade of the project Chat Portrait by ShoyuVanilla ty to ShoyuVanilla
It's always easiest to install modules from the in game add-on browser.
To install this module manually:
https://raw.githubusercontent.com/p4535992/foundryvtt-chat-portrait/master/src/module.json
Since version 0.7.0, the module has been rewritten to allow for each system to have a css file to define the style and a description file of the mapping for the "ImageReplacer" feature.
Now the community can "come" to me a little, testing the css on their browser and help me understand which combination is the best, i file css si trovano nella directory degli styles, here a example for the dnd5e system
So the steps to follow to create or update a system are:
chat-portrait-style-XXX.css
nomenclature where XXX is the system id e.g. "dnd5e".NOTE: You can use other modules like Custom CSS for manage the css classes, the module help you by defining two css classes you can customize for the purpose of this module chat-portrait-text-size-name
for the text chat message (the 'Setup additional custom styling on the text chat message' setting) and chat-portrait-image-size-name
for the image prepend the text chat message (the 'Setup additional custom styling on the image prepend the text chat message' setting)
The module will continue to allow the use of custom CSS if desired.
Integration multisystem it's very hard to find the time for this, for now i'm supporting only the system i use or ask by issue request, but anyone can point out what system has problem. i have prepared a base code for support multysistem, i will not actively developing on the short term.
Better integration with midi-qol and CUB for their mechanism of Unknown creature, but there is no conflict because it's just css and html modification on the chat message so you can use without any issue beyween this modules
ChatPortraitEnabled
is called before the interaction with the chat is executed. When any of executed hooks return false
the interaction is aborted with the default one of foundry.
ChatPortraitReplaceData
is called like a replacement to the standard chat portrait recovery image, so any system or GM can use a customized version for a specific module.
const chatPortraitCustomData = {
// url or file string reference to the image portrait path
customIconPortraitImage,
// [DEPRECATED use instead the 'customImageReplacerData'] Customize your own imageReplacer (Record<string,string>)
customImageReplacer,
// Customize your own imageReplacer ( array of { name: string; icon: string;})
customImageReplacerData: imageReplacerData,
}
/// WARNING: internal data - do not use if possible
// data schema is defined in: src/scripts/ChatPortraitModels.ts (or scripts/ChatPortraitModels.js)
Use your own code to enable/disable the module chat-portrait...
Hooks.call('ChatPortraitEnabled', chatMessage, html, speakerInfo);
// DO SOME CHECK 'BEFORE' APPLY THE CHAT PORTRAIT STYLING
How you can use this on your code....
Hooks.on('ChatPortraitEnabled', chatMessage, html, speakerInfo) => {
// DO SOMETHING AND RETURN OR TRUE OR FALSE FOR ENABLE THE MODULE CHAT PORTRAIT
})
Use your own code for give me a customized image reference to put on the portrait , if you want you can give me a specific image reference for the 'Image Replacer" feature.
const chatPortraitCustomData = {
customIconPortraitImage: "http://myimageurl/test.png", // url or file string reference to the image portrait path
customImageReplacer: imageReplacer, // [DEPRECATED use instead the 'customImageReplacerData'] Customize your own imageReplacer (Record<string,string>)
customImageReplacerData: imageReplacerData, // Customize your own imageReplacer ( array of { name: string; icon: string;})
};
Hooks.call('ChatPortraitReplaceData', chatPortraitCustomData, chatMessage);
// and then i'll do something with `chatPortraitCustomData`
const blabla = chatPortraitCustomData;
How you can use this on your code....
Hooks.on('ChatPortraitReplaceData', (chatPortraitCustomData, chatMessage) => {
// Set your own image
chatPortraitCustomData.customIconPortraitImage = ......
// DO SOMETHING AND RETURN A NEW chatPortraitCustomData
return chatPortraitCustomData; // this is blabla
})
Hooks.on('ChatPortraitReplaceData', (chatPortraitCustomData, chatMessage) => {
const speaker = ChatMessage.getSpeakerActor(chatMessage.data.speaker);
if('KW_WarfareUnitSheet' === speaker?.sheet?.constructor.name) {
chatPortraitCustomData.iconMainCustomReplacer = {
"KW_WARFARE.Power": "systems/dnd5e/icons/skills/yellow_08.jpg",
"KW_WARFARE.Attack": "systems/dnd5e/icons/skills/red_31.jpg",
"KW_WARFARE.Morale": "systems/dnd5e/icons/skills/yellow_17.jpg",
"KW_WARFARE.Command": "systems/dnd5e/icons/skills/ice_16.jpg"
};
}
return chatPortraitCustomData;
});
/// WARNING: internal data - do not use if possible
// data schema is defined in: src/module/ChatPortraitModels.ts (or module/ChatPortraitModels.js)
For now the following system are the only one i tested
any other system need some fed back from the community
Use Token Image: Use the actor's Token image instead of the actor's standard image. Note: In the event the token associated with a chat message no longer exists, it will use the actor's prototype token's name. In the event the actor no longer exists, it will try to get the avatar image of the player/GM, and the original chat message's alias (usually the actor's name) to the GM.
Do not use Token Image with the following type of actors : (e.g. character, npc, ecc. separate by character ','). Remember the actor type is case sensitive. Make sense only with the setting 'Use Token Image' set to true",
Use Token Name: Use the actor's Token name instead of the actor's standard name.
Use Avatar Player Image: Use the player's Avatar image instead of the token/actor standard image. if true ignore the first option if a avatar image is not found is going back to the standard actor/token image of the 'mistery man', this option is ignored if you are the GM or else because everything you click will have the avatar image of the GM expect for the OOC chat message. NOTE: Every OOC message by default activate this mode because make sense no token must be associated with a OOC message even for player.
Apply chat portrait on combat tracker: Apply the recovery of the image on the combat tracker.
Shows the name of the player next to the name of the actor for any IC messages
Portrait Size (px): Configure portrait image size on the chat messages. Default is 36 px
Portrait Border Shape: Configure border shape of the portraits displayed on the chat messages. Setting this as None disables other border options
Use Player Color for Portrait Border
Configure portrait border width. Default is 2 px
Change Color of Message Border: Use the actor's player's color for the border of the entire chat message
Change Color of Message Background: Use the actor's player's color for the background of the entire chat message
Display Chat Flavor Text next to Portrait
Force Name Search: If there is no Actor matching with chat message data, search for an actor of which name corresponds to the message speaker's alias. This option is needed for the compatibility with Theatre Insert module. This not work on the 'Combat Tracker feature'
Portrait Size for other images (px): Configure portrait image size for any other image on the chat message (other than the portrait one). Default is 36 px
Double Click on the image portrait or the name of the token "pan to token" on the current scene
Configure which chat message should receive custom styling, and which ones should be left as default. Changing this may require you to refresh your window:
Adds a textual tag to chat messages to easily identify whether the message is a whisper, blind roll, or self roll
Display chat message of type OTHER: Configure custom styling for message of type OTHER
Display chat message of type OOC: Configure custom styling for message of type OOC
Display chat message of type IC: Configure custom styling for message of type IC
Display chat message of type EMOTE: Configure custom styling for message of type EMOTE
Display chat message of type WHISPER: Configure custom styling for message of type WHISPER
Display chat message of type ROLL: Configure custom styling for message of type ROLL
Display chat message of whisper to other: Configure custom styling for message of whisper to other
Configure which cards should use the unknown custom styling, and which ones should be left as default. Changing this may require you to refresh your window:
Placeholder for the label unknown Actor name: by default is 'Unknown Actor' depends on the 'Display Unknown' setting
Placeholder for the label unknown item name: by default is 'Unknown Item' depends on the 'Display Unknown' setting
Placeholder for the label unknown item icon: by default is '/modules/chat-portrait/assets/inv-unidentified.png' depends on the 'Display Unknown' setting
[CSS CUSTOM SETTING] Setup additional custom styling on the text chat message : Setup additional custom styling on the text chat message with CSS language (note override any other prior property)
NOTE: You can use other modules like Custom CSS for manage the css classes, the module help you by defining two css classes you can customize for the purpose of this module chat-portrait-text-size-name
for the text chat message (the 'Setup additional custom styling on the text chat message' setting) and chat-portrait-image-size-name
for the image prepend the text chat message (the 'Setup additional custom styling on the image prepend the text chat message' setting)
.chat-portrait-text-size-name-dnd5e .chat-portrait-system-dnd5e {
display: flex;
margin: auto;
}
NOTE: You can use other modules like Custom CSS for manage the css classes, the module help you by defining two css classes you can customize for the purpose of this module chat-portrait-text-size-name
for the text chat message (the 'Setup additional custom styling on the text chat message' setting) and chat-portrait-image-size-name
for the image prepend the text chat message (the 'Setup additional custom styling on the image prepend the text chat message' setting)
.chat-portrait-image-size-name-dnd5e .chat-portrait-system-dnd5e {
display: flex;
margin: auto;
}
Image Replacer: This feature for avoid the double portrait when you roll Ability / Skills / Saving Throw / Tools, for now the support is limited to the following systems :
If you want to add your own system it's very simple!!! you can just give to me a map of strings key=value of label and image, for a live example check out what i have done for d&d5e with the english language here ImageReplacer. It's ugly but it's simple to integrated.
Disable the chat portrait if the alias of the chat message is from a GM: If enable every chat message done with a alias referenced to a GM will ot apply the chat portrait mechanism
Set up a specific image if the alias of the chat message is from a GM: If enable will use the image selected here for every chat message done with a alias referenced to a GM. If 'Disable the chat portrait if the alias of the chat message is from a GM' is enable this setting will be ignored
[ON DEVELOPING SO ANY SUGGESTION IS WELCOME]
Image Replacer Damage Types: Add some image for better identify the type of damage of the weapon, for now the support is limited to the following systems :
If you want to add your own system it's very simple!!! you can just give to me a map of strings key=value of label and image, for a live example check out what i have done for d&d5e with the english language here ImageReplacer. It's ugly but it's simple to integrated.
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: chat-portrait or copy its manifest URL:
And paste it to the input box at the bottom of your window.
You can install this package directly to your Forge account.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to deliver visitors with customized advertisements based on the pages they visited before and analyze the effectiveness of the ad campaign.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.