UIChatChannelColorDictionary - jimdroberts/FishMMO GitHub Wiki

Description

A serializable dictionary mapping chat channels to their display colors in the FishMMO client UI. Used to customize the color of messages for each chat channel in the chat system.


API Access

Inherits

  • SerializableDictionary<ChatChannel, Color>

    Provides dictionary functionality for mapping ChatChannel enum values to Color objects.


Basic Usage

Setup

  1. Use UIChatChannelColorDictionary to assign or retrieve colors for specific chat channels.
  2. Integrate with the chat UI to display messages in the appropriate color for each channel.

Example

// Example usage
UIChatChannelColorDictionary channelColors = new UIChatChannelColorDictionary();
channelColors[ChatChannel.World] = Color.cyan;
Color worldColor = channelColors[ChatChannel.World];

Best Practices

  • Use this dictionary to keep chat channel color assignments centralized and easily configurable.
  • Assign colors in the Unity Inspector or via code for each chat channel as needed.
  • Integrate with the chat UI to ensure consistent color usage across all chat messages.
⚠️ **GitHub.com Fallback** ⚠️