HudMessage cutoff feature and auto word wrap

Moderator: GZDoom Developers

User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: HudMessage cutoff feature and auto word wrap

Post by Xaser »

randi wrote:I think this was a communication error due to English as a second language. It did wrap words; the only reason it didn't in that screenshot was because there were no space characters for line breaks, so it had to break at character boundaries instead.
Oh! Well, that's perfect, then. :D

Kudos to all involved.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: HudMessage cutoff feature and auto word wrap

Post by Gez »

I was looking at the code trying to figure out if wrapwidth is a boolean meaning to wrap on the width; or an integer giving a width at which to wrap, and I don't understand how this works at all. It seems not to be actually referenced in code anywhere. It's assigned, and it's serialized, but I don't see any "SomeFunctionWhichUseWrapWidthAsParameter(WrapWidth)" call or "if (WrapWidth)". :?

I mean, except the obvious:

Code: Select all

					if (WrapWidth != 0)
					{
						msg->SetWrapWidth(WrapWidth);
					}

Code: Select all

	void SetWrapWidth(int wrap)
	{
		WrapWidth = wrap;
		ResetText(SourceText);
	}
But that doesn't help since nothing else happens with it afterwards. It's not referenced in ResetText, for example; which instead uses HUDWidth and/or ClipWidth and/or SCREENWIDTH.

Searching for all references specifically to DHUDMessage::WrapWidth gives only these results:

Code: Select all

	WrapWidth = 0;
	arc << WrapWidth;
	ClipX = ClipY = ClipWidth = ClipHeight = WrapWidth = 0;
	WrapWidth = wrap;
	int ClipX, ClipY, ClipWidth, ClipHeight, WrapWidth;	// in HUD coords
assignation, serialization, assignation, assignation, definition. Never actual use.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: HudMessage cutoff feature and auto word wrap

Post by randi »

My bad. It's supposed to be the width it wraps text to. (Normally it wraps it to the width of the screen.) My only excuse is, as I said, I had to do quite a bit of work to the patch.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”