Page MenuHomeFeedback Tracker

ctrlSetStructuredText updates provided Structured Text instance
Assigned, NormalPublic

Description

Using ctrlSetStructuredText on with structured text *edits* this structured text object.
For example on a RscStructuredText control:

private _text = "abcd";
private _parsedText = parseText _text;
_myControl ctrlSetStructuredText _parsedText;    // will change _parsedText value
_myControl ctrlSetStructuredText parseText _text // circumvents the issue

Thanks to @Dscha for finding it out.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10
Category
Ingame UI
Steps To Reproduce

Start the provided mission:
first two waves of UI controls will show normal behaviour, whereas last two will show the issue.

Event Timeline

Dscha added a comment.Mar 21 2020, 5:13 PM

Additional Info:
This happens to custom prefabs of RscStructuredText classes (doesn't matter if the defined is in a Mission (description.ext) or inside a .pbo (config.cpp))

class my_RscStructuredText: RscStructuredText
{
	idc = -1;
	class Attributes
	{
		align = "center";
		color = "#00FFFF";
		colorLink = "#D09B43";
		font = "RobotoCondensed";
		size = 0.04;
		shadow = 0;
	};
};
LouMontana updated the task description. (Show Details)Mar 21 2020, 5:16 PM
Dscha added a comment.Mar 21 2020, 5:23 PM

proper mission:

dedmen added a subscriber: dedmen.Mar 21 2020, 5:27 PM

ctrlSetStructuredText probably modifies parsedText param by ref.

dedmen changed the task status from New to Acknowledged.Mar 24 2020, 3:29 PM
dedmen claimed this task.Mar 24 2020, 8:19 PM
dedmen changed the task status from Acknowledged to Assigned.