listitem needs paragraphdivider() before its first entry

Bug #1366580 reported by wl-zocker on 2014-09-07
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Low
Unassigned

Bug Description

When writing the text for a scenario and using a list, there needs to be a paragraphdivider(). Otherwise, the first entry of the list is not shown. For example, the following code snippet will only show "text" and "• bullet2":
rt(
   [[text]] ..
   -- paragraphdivider() .. // commented out. This is the line I plan to add.
   listitem_bullet([[bullet1]]) ..
   listitem_bullet([[bullet2]])
)

This is quite bad because it is often used in the tutorial to tell the player what to do next.
Since I am going to work on the tutorial anyway, I can add it where necessary. However, if someone is interested in writing a more general solution, he may take the task.

Related branches

SirVer (sirver) wrote :

not sure what the underlying cause of this is.

Changed in widelands:
status: New → Confirmed
GunChleoc (gunchleoc) wrote :

The listitem assumes that you have opened a paragraph already with <p line-spacing=3 font-size=12>

Wrapping all this RT stuff is a bit tricky, so not everything I've fiddled with there might be optimal. If anybody can refactor this into a better solution, I won't object.

The definitions for this stuff are in scripting/format_scenario.lua

wl-zocker (wl-zocker) on 2014-09-19
Changed in widelands:
status: Confirmed → In Progress
wl-zocker (wl-zocker) wrote :

While working on this, I found a probably better solution:
- write the listitem into its own paragraph, i.e. return "<p line-spacing=3 font-size=12>"..symbol.." "..text.."<br></p><p font-size=8> <br></p>" (the size of the empty line can be adjusted)
- to avoid further problems, remove the p(body) resp. p(text) from speech() and from objective_text(). Instead, make the scripter open paragraphs himself.

The latter point has two consequences:
These two functions now have the same syntax as message_box, i.e. the same string can be passed to speech or directly be shown.
The downside: It is not possible anymore to place translatable quotation marks around the text in speech(). I do not think that that is grave; there is an image of the speaking person next to the text.

Are there things I have overlooked? Otherwise, I consider this the cleanest solution and will implement it.

GunChleoc (gunchleoc) wrote :

Removing the quotation marks certainly will resolve the problem. If nobody objects, I'd be fine with it.

GunChleoc (gunchleoc) on 2014-10-29
Changed in widelands:
status: In Progress → Fix Committed
milestone: none → build19-rc1
status: Fix Committed → Confirmed
GunChleoc (gunchleoc) on 2014-11-16
Changed in widelands:
assignee: wl-zocker (wl-zocker) → GunChleoc (gunchleoc)
status: Confirmed → In Progress
GunChleoc (gunchleoc) wrote :

I think this is low priority right now, and a Lua coder can take this on.

Changed in widelands:
assignee: GunChleoc (gunchleoc) → nobody
milestone: build19-rc1 → none
status: In Progress → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers