From 5a159e2d4c1deba683f8975101a803d5a525aa57 Mon Sep 17 00:00:00 2001 From: TimePath Date: Mon, 17 Aug 2015 17:51:47 +1000 Subject: [PATCH] Improve wrapping --- qcsrc/menu/xonotic/dialog_media_guide_description.qc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/qcsrc/menu/xonotic/dialog_media_guide_description.qc b/qcsrc/menu/xonotic/dialog_media_guide_description.qc index 33462e5263..6b1e596cd7 100644 --- a/qcsrc/menu/xonotic/dialog_media_guide_description.qc +++ b/qcsrc/menu/xonotic/dialog_media_guide_description.qc @@ -33,10 +33,13 @@ CLASS(XonoticGuideDescription, XonoticListBox) string currentWrapped = this.descriptionWrapped; if (currentWrapped) strunzone(currentWrapped); string wrapped = ""; - for (getWrappedLine_remaining = desc; getWrappedLine_remaining; ) { - // FIXME: calculate this - string s = getWrappedLine(1.275, this.realFontSize, draw_TextWidth_WithColors); - wrapped = sprintf("%s\n%s", wrapped, s); + for (int i = 0, n = tokenizebyseparator(desc, "\n"); i < n; ++i) { + string line = ""; + for (getWrappedLine_remaining = argv(i); getWrappedLine_remaining; ) { + string s = getWrappedLine(1, this.realFontSize, draw_TextWidth_WithColors); + line = sprintf("%s\n%s", line, s); + } + wrapped = strcat(wrapped, line); } this.descriptionWrapped = strzone(wrapped); -- 2.39.2