← Back to team overview

widelands-dev team mailing list archive

Re: Text formatting questions

 

>> when working on the campaigns, I noticed that the texts are formatted
>> differently than those in the tutorial. I’d like to know whether there
>> is an interest in having the style unified and which way is preferred.
>>  
>> 1) “text” vs. [[text]]. The first one is mainly used for short texts
>> (headlines), but not always.
> 
> This is a Lua thing. [[ ]] is just a synonym to “”, but can also contain
> “ as a character and newlines. It is most useful for longer texts.

I think we should stick to [[]] for long texts and "" for short texts,
because I find the code easier to read that way.



>> 2) text .. paragraphdivider() .. text vs. p(text) .. p(text). Is there
>> a difference?

Sometimes, like e.g. within the speech() function, we are already inside
a paragraph. We then need the paragraphdivider() to close the curent
paragraph and open a new one. So, minus the font stuff, this is the
simplified rt code for what happens:

p("text") = "<p>text</p>"
paragraphdivider() = "</p><p>"



>> 3) Sometimes, long paragraphs are split in two lines:
>> _([[text]] ..
>> [[text]])
>> while other lines are rather long. Is there a maximum line length I
>> should take care of?

I did this on my big string change, because I thought I had to keep to
line length. We don't need to do this for long texts though, so putting
them back together would make the code more stable.

I recently did some partial refactoring for this (thouching the
scenarios I was working on anyway only), but the branch is still
awaiting review.

https://code.launchpad.net/~widelands-dev/widelands/bug-1298301/+merge/236966


Follow ups

References