A truly better chat

Discussion in 'Bukkit Discussion' started by ZanderMan9, Jul 5, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ZanderMan9

    Hey everyone, I've decided to begin work on a plugin which will make chat actually look decent... Let me explain to you my issue with the current chat:
    [Doof] Doofus: Pointless chatter
    [NotADoof] Moderator3434243: Not pointless chatter
    I drew a line between the colons separating the name and chat, I'd have a VERY slanted line. This makes chat hard to read when you have short and long names. We need to align this chat so that all the chat starts at the same point, like so:
    Code:
    [Doof] Doofus       : Chatter
    [NotADoof] Moderator: Chatter
    This is going to require some semi-complicated string editing, which I can learn, but I'd like to work with others who have more experience, so that I can have a bit of guidance.

    For the Java people interested, here's the concept I'm going to use:
    Code:java
    1. ]if (getDisplayName.length() > x)
    2. {
    3. //trim getDisplayName.length() - x off of the end
    4. //append ChatColor.WHITE + ": " + getChatMessage() (Or however it's gotten...) onto it
    5. }
    6. else
    7. {
    8. if (getDisplayName.length() < x)
    9. {
    10. //append x - getDisplayName.length() onto it, as well as the message etc.
    11. }
    12. else //this must mean that it is exactly the right length
    13. {
    14. //append only the colon and chat message on
    15. }


    Edit: This is only the beginning; I hope to add all kinds of chat features which, as of yet, don't exist

    Finally got that spacing right ;)
    If you are interested in helping or have ideas, post a reply

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  2. Offline

    timtower Administrator Administrator Moderator

    ZanderMan9 You do need to know the length off all prefixes, suffixes and players names though. If somebody joins with a longer name then you would need to react on that
     
  3. Offline

    ZanderMan9

    Won't DisplayName work for that, since things like PEX change that (I think)?
     
  4. Offline

    Maximvdw

    the sad thing about minecraft is that there are resource packs having different fonts, etc.. even in the default font you wont be able to get the alignment 'exact'.

    Gotta love "Courier New"
     
Thread Status:
Not open for further replies.

Share This Page