Up to Main Index Up to Journal for November, 2016 JOURNAL FOR MONDAY 28TH NOVEMBER, 2016 ______________________________________________________________________________ SUBJECT: Unified buffers & colours DATE: Mon 28 Nov 21:32:14 GMT 2016 Thank you to everybody who emailed me with comments and suggestions on the light vs dark themes and colours. It looks like for now WolfMUD will assume a dark background is being used. In order to implement colours I've had to take a step back and do some more work on the buffers. Specifically I've been unifying the in-game buffers and frontend buffers. One of the biggest changes is that buffers have been moved out of the cmd/internal package and are now in a new message package. As well as the new message package the buffer.go file has been split into buffer.go, buffers.go and msg.go as the single buffer.go was becoming rather large. The frontend has also switched over to using the new buffer Send and Append methods, the same as the main game code. A buffer now handles making sure that the player's prompt appears on a new line. This has resulted in frontend and attr.player being simplified some more. The frontend also has a new Write method for handling the player prompt in exactly the same way as attr.player does in-game. The buffer.Deliver method now takes multiple io.Writer as parameters. This allows a buffer to be setup once and then copied to the relevant receivers. This introduces a few allocations and a little overhead for making the copies but means receivers cannot tread on each others toes now. This is handled by buffer.Deliver which can manipulate the buffer directly and so the actual overhead is minimal. In the common case of there being only one receiver the copy is bypassed. On the colour front I've added processing for embedded colour codes in the greeting. Embedded colour codes take the form [COLOUR] such as [GREEN]. See text/color.go for a list of supported colour codes. There are now coloured prompts, currently magenta. I've also colour coded messages put out by the comms package. All of this is now in the public dev branch for those who want to play. Currently I'm going through the frontend and command code adding colour coded messages. Hopefully this will be pushed out to the dev branch in a few days or so. -- Diddymus Up to Main Index Up to Journal for November, 2016