Git Product home page Git Product logo

Comments (14)

bearbin avatar bearbin commented on May 5, 2024

Lindows or Winux?

from cuberite.

tigerw avatar tigerw commented on May 5, 2024

The penguin :)

from cuberite.

bearbin avatar bearbin commented on May 5, 2024

I don't think I get colours either, so it isn't something to do with SSHing in. It's probably windows only colours or something.

from cuberite.

madmaxoft avatar madmaxoft commented on May 5, 2024

The coloring is currently implemented only on Windows. None of us know the dev details necessary to implement coloring on Linux; we definitely don't want to use a 3rd party library dependency for that.

from cuberite.

tigerw avatar tigerw commented on May 5, 2024

Hm. Colours will be -very- useful in distinguishing between normal information and errors. And xterm must support it because it works in other programs. I shall see!

Okay, bearbin doth see.

from cuberite.

bearbin avatar bearbin commented on May 5, 2024

Easy! - just need some platform detection stuff and dump in this:

http://stackoverflow.com/questions/2616906/how-do-i-output-coloured-text-to-a-linux-terminal

Of course, for the best practice, the terminfo database should be checked with the type of terminal to make sure it's colour capable.

from cuberite.

madmaxoft avatar madmaxoft commented on May 5, 2024

So dump it into cMCLogger::SetColor(), there's already the Win32 implementation. The function gets a single byte, the upper 4 bits specify the background color and the lower 4 bits the foreground color, based on the 16-color VGA-like palette.

from cuberite.

bearbin avatar bearbin commented on May 5, 2024

The code would have to be squished around, because the setcolour function cannot modify the text it is changing the colour of. Is this ok?

from cuberite.

madmaxoft avatar madmaxoft commented on May 5, 2024

It doesn't have to - just let that function output the coloring code to the console.
Just make the function not output anything if ANDROID_NDK is defined.

from cuberite.

bearbin avatar bearbin commented on May 5, 2024

so it would be ifndef ANDROID_NDK, and then ifdef LINUX or what?

from cuberite.

madmaxoft avatar madmaxoft commented on May 5, 2024

Let's hope I got the GFM right :)

#ifdef _WIN32
  // Current Windows-specific code
#elif !defined(ANDROID_NDK)
  // Linux-specific code
#end

from cuberite.

bearbin avatar bearbin commented on May 5, 2024

I don't think I'm able to do this - it would require refactoring of the code, and I don't think I'm good enough at C++ to do it.

from cuberite.

madmaxoft avatar madmaxoft commented on May 5, 2024

I can try, but I have no way of verifying if it works.

from cuberite.

bearbin avatar bearbin commented on May 5, 2024

Fixed.

from cuberite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.