wesnoth.message colours?
Moderator: Forum Moderators
wesnoth.message colours?
I know you can make it so a wesnoth.message looks like it's sent by a player in-game, but would it be possible to change the colour to something else than white, too? Either through lua or wesnoth (I'm not very good at lua, so I don't know)
Re: wesnoth.message colours?
I looked relevant source code, and this can only be possible by defining new color(after 9) and using that as side. Though not sure if you can specify side who is saying that even.
Re: wesnoth.message colours?
Thanks. That's what I'm after, showing a chat message with a certain side colour, but it doesn't seem to be possible? I guess the Pango markup formatting codes you can use for [message] tags etc wouldn't work, since this is lua text?
- Celtic_Minstrel
- Developer
- Posts: 2274
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: wesnoth.message colours?
Pango formatting almost certainly won't work, but it has nothing to do with Lua. In-game chat is one of the few places still using the old text rendering engine, which doesn't know anything about Pango. I suppose there's a chance that the old-style formatting codes could work, but I wouldn't count on it,
I think what Ravana meant is that you could create a hidden side, assign it the colour you want, and instruct the message() call to pretend the message came from that side. I'm not sure if that actually works though.
I think what Ravana meant is that you could create a hidden side, assign it the colour you want, and instruct the message() call to pretend the message came from that side. I'm not sure if that actually works though.
Re: wesnoth.message colours?
Old style formatting code?Celtic_Minstrel wrote: ↑February 27th, 2018, 1:30 am Pango formatting almost certainly won't work, but it has nothing to do with Lua. In-game chat is one of the few places still using the old text rendering engine, which doesn't know anything about Pango. I suppose there's a chance that the old-style formatting codes could work, but I wouldn't count on it,
Yeah, but how could I instruct the message() call?Celtic_Minstrel wrote: ↑February 27th, 2018, 1:30 am I think what Ravana meant is that you could create a hidden side, assign it the colour you want, and instruct the message() call to pretend the message came from that side. I'm not sure if that actually works though.
- Celtic_Minstrel
- Developer
- Posts: 2274
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: wesnoth.message colours?
That's what I'm not sure about since I haven't looked up what parameters it takes on the wiki.
About old-style formatting codes, it was something used in older versions of the game, before Pango formatting was a thing. It involved putting certain special characters at the start of your string. I don't recall what characters were used though, and the chances it'll actually still work even in chat in 1.13 are pretty slim (it definitely wouldn't work anywhere else).
About old-style formatting codes, it was something used in older versions of the game, before Pango formatting was a thing. It involved putting certain special characters at the start of your string. I don't recall what characters were used though, and the chances it'll actually still work even in chat in 1.13 are pretty slim (it definitely wouldn't work anywhere else).
Re: wesnoth.message colours?
Oh, you haven't? Well, I, obviously, did so I know there is no such parameter to supply it with. Oh well. Ravana said the mod this would be for passes the Turing test anyhow, so I suppose it's not that bad.