Page MenuHomeFeedback Tracker

[Bug] ctrlText returns the config value even if ctrlSetText is used
Reviewed, NormalPublic

Description

I have a control (CT_Button) with ST_PICTURE that uses a procedural texture like this:
text = "#(argb,8,8,3)color(1,1,1,1)";

I wanted to change its color, but since there's no ctrlTextColor command T153507 (I need the color for future calculations), I decided to overwrite the image with a new procedural texture using ctrlSetText.

The problem is, the command ctrlText seems to return the text in config no matter what I do (ctrlSetText appears to change the color instead of text)

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Scripting
Steps To Reproduce
  1. Create a display config with some control (ST_PICTURE):
class RscButton;
class MyDisplay {
	idd = 121212;  
	movingEnable = false;
	enableSimulation = true;
	controlsBackground[] = {};
	objects[] = {};
	class controls {
		class SomeCtrl: RscButton
		{
			idc = 1200;
			type = 1;
			style = 48;
			text = "#(argb,8,8,3)color(1,1,1,1)";
			x = safeZoneX + 0.5*safeZoneW - 0.1;
			y = safeZoneY + 0.5*safeZoneH - 0.1;
			w = 0.2;
			h = 0.2;
			colorText[] = {1,1,1,1};
			colorBackground[] = {1,1,1,1};
			colorFocused[] = {1,1,1,1};
			colorBackgroundActive[] = {1,1,1,1};
			offsetX = 0;
			offsetY = 0;
			colorDisabled[] = {0.3,0.3,0.3,0};
			colorBackgroundDisabled[] = {0.7,0.7,0.7,0};
			offsetPressedX = 0.002;
			offsetPressedY = 0.002;
			colorShadow[] = {0,0,0,0};
			shadow = 0;
			colorBorder[] = {0,0,0,1};
			borderSize = 0;
			soundEnter[] = {"",0.1,1};
			soundPush[] = {"",0.1,1};
			soundClick[] = {"",0.1,1};
			soundEscape[] = {"",0.1,1};
			font = "PuristaMedium";
			sizeEx = 0.04;
		};
	};
};
  1. Run this command in debug console:
[] spawn {
_d = findDisplay 46 createDisplay "MyDisplay";
_c = _d displayCtrl 1200;

sleep 2;

_c ctrlSetText "#(argb,8,8,3)color(1,0,0,1)";

hint ctrlText _c;
}

It still returns "#(argb,8,8,3)color(1,1,1,1)" as the text. However, you can clearly see that the control has turned red. So ctrlSetText has changed the color, not text.

Event Timeline

Leopard20 created this task.Tue, Sep 1, 6:24 AM
Leopard20 updated the task description. (Show Details)Tue, Sep 1, 6:46 AM
Leopard20 edited Steps To Reproduce. (Show Details)
Leopard20 updated the task description. (Show Details)Tue, Sep 1, 6:55 AM
h- added a subscriber: h-.Tue, Sep 1, 11:24 AM
BIS_fnc_KK changed the task status from New to Reviewed.

picture button is special case, so yes this is a bug