Results 1 to 4 of 4

Thread: Have Lua Scripts accept both "color" and "colour" for function names etc.

  1. #1

    Post Have Lua Scripts accept both "color" and "colour" for function names etc.

    Everywhere where there's a reference to an object's "color", could you please also accept "colour" as well? It would save a lot of confusion on my end.
    "Color and colour are different spellings of the same word. Color is the preferred spelling in American English, and colour is preferred in all other main varieties of English." - Grammarist.

    API:
    • "onPlayerChangedColor" should also accept "onPlayerChangedColour".
    • "broadcastToColor" should also accept "broadcastToColour". (The link to this is bugged... o.o)
    • "printToColor" should also accept "printToColour".
    • "stringColorToRGB" should also accept "stringColourToRGB".


    Object


    Player
    • "color" should also accept "colour".
    • "changeColor" should also accept "changeColour"

    Thanks.
    Last edited by Mark; 08-14-2016 at 01:34 PM.

  2. #2
    just use editor with code completion

    this would introduce bugs - trust me - it would, for basically no real gain.

  3. #3
    Why? I don't trust you, you haven't provided any reasons...

    In Lua, you'd just do something like this and it would allow for two ways of calling the function easily:
    Code:
    function printToColour(a, b, c)
        printToColor(a, b, c)
    end
    
    function printToColor(message, player_color, RGB)
        --printToColor code
    end
    Last edited by Mark; 08-14-2016 at 03:10 PM.

  4. #4
    I thought the need to maintain all the aliases every time you change anything in the way original function is called is pretty obvious and does not need to be spelled out. Not to mention it does not provide any benefit other than linguistic placebo, for the price of less readable and maintainable code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •