[CHAT] ProperCaps.

Discussion in 'Archived: Plugin Requests' started by Stevensaurus, Aug 16, 2012.

  1. Offline

    Stevensaurus

    Plugin category: [CHAT]

    Suggested name: ProperCaps.

    What I want: I'd like this to be an Anti-Caps plugin that puts all the other to shame.

    We've all seen the plugins that make all messages 100% lowercase, and the ones that use a percentage.

    This one would be better than that; It would automatically caps any letter that comes after any punctuation (excluding apostrophes, commas, etc) and lowercase everything else. Similiar to RuneScape (if you played that).

    Ideas for commands: No commands needed for this plugin.

    Ideas for permissions: ProperCaps.bypass

    When I'd like it by: As soon as possible, please.
     
  2. Offline

    Njol

    For any dev who might be interested in making this plugin here's my method to fix capitalization:
    Code:
        /**
         * Capitalizes the first character of the string and all characters that follow periods.
         * 
         * @param string
         * @return
         */
        public static String fixCapitalization(final String string) {
            final char[] s = string.toCharArray();
            int c = 0;
            while (c != -1) {
                while (c < s.length && (s[c] == '.' || s[c] == '!' || s[c] == '?' || Character.isWhitespace(s[c])))
                    c++;
                if (c == s.length)
                    return new String(s);
                if (c == 0 || s[c - 1] != '.') // don't capitalize directly after a dot - fixes URLs
                    s[c] = Character.toUpperCase(s[c]);
                c = indexOf(s, '.', c + 1);
            }
            return new String(s);
        }
    
    It does not lowercase any letters, but this can be done easily by adding a .toLowerCase() in the right spot ;)
     
  3. Offline

    chaseoes

    Do you use SkitChat? It does this minus the lowercase-everything-else part (which could be added?).
     
  4. Offline

    Stevensaurus

    No, I use EssentialsChat, and I'm not looking to make a switch anytime soon.
     
  5. Offline

    Barinade

    I used this, but the line:
    c = indexOf(s, '.', c + 1);
    Needed to be:
    c = string.indexOf('.', c + 1);

    Here's the outcome:
    http://www.sendspace.com/file/ryamat
    http://www.sendspace.com/file/y23zlr
    First one didn't decapitalize, this one does. My bad.

    A short clip:
    http://i.imgur.com/ErGgs.gif
     
    Stevensaurus likes this.
  6. Offline

    Gladius_Crafter

  7. Offline

    Stevensaurus

    Oh wow, a lot of answers. I'm sure one of them will suit my needs; likes to you all!

    Will this change caps?

    Same for this, will it un-capitalize?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  8. Offline

    Barinade

    Was the one I posted not what you wanted?
     
  9. Offline

    Stevensaurus

    Oh, I was just checking. Haven't tested them yet.
     
  10. Offline

    cxsnull

    What about names, places, brands etc?
    They need proper capitalization but it would be impossible for a plugin to detect such things.
     
  11. Offline

    Stevensaurus

    Notice how I didn't include that in the request?

    That's because it's not possible.
     
  12. Offline

    Kodfod

    Do You Just Hate Improper Capitalization? I Know That I Sure Do!

    *sigh*

    Has anyone picked this up?
     
  13. Offline

    Barinade

    It's quite possible, it would probably just lag the server a lot and not be 100% accurate...
     
  14. Offline

    Woobie

    ForcedGrammar will do this, it starts every sentence with capital, and ends the sentence to dot (i dont know the fancy name of dot :D)
    If i remember right, you can even change some of the words.
    Example: player tries to say "Your mum sucks” it will change the "Your” to "My"
    So instead of "Your mum sucks” it will say "My mum sucks”
     
  15. Offline

    Kodfod

    Period
     
  16. Offline

    Stevensaurus

  17. If you read the description you'll get your answer ;)
     
  18. Offline

    Stevensaurus

    From the examples it seems that it makes everything lowercase; this is not what I want.
     

Share This Page