Jump to content
Sign in to follow this  
Spudgunner

Dialog control problem: colorShadow

Recommended Posts

I have been following An Introduction to Dialogs at Ofpec but I ran into a problem with the colorShadow control. Each time the code runs, a error box appears saying there is No Entry for ButtonControl.colorShadow.

colorShadow[] = {0.8,0.8,0.8,1}; // dark grey

Any idea what's causing the error?

I use this code in a trigger's activation field box:

_ok = createDialog "sampleDialog";
waitUntil { !dialog };

The full description.ext (or hpp) file is here:

#define CT_BUTTON 1

class sampleDialog {
idd = -1;
movingEnable = false;
controlsBackground[] = {};
controls[] = {"ButtonControl","HintButton"};
objects[] = {};
class ButtonControl {
	idc = -1;
	type = CT_BUTTON;
	style = 2;
	moving = false;
	x = 0.45;
	y = 0.9;
	h = 0.05;
	w = 0.1;
	font = "Zeppelin32";
	sizeEx = 0.025;
	action = "closeDialog 0; hint ""Close pushed"";"
	text = "Close";
	default = false;
	colorText[] = {1,0,0,1}; // white
	colorFocused[] = {0,1,0,1}; // green
	[b]colorShadow[] = {0.8,0.8,0.8,1}; // PROBLEM HERE![/b]
	colorBorder[] = {0.5,0.5,0.5,1}; // grey
	colorBackground[] = {0,1,1,1};
	colorBackgroundActive[] = {0,1,0,1}; // green
	colorDisabled[] = {1,0,0,1};
	colorBackgroundDisabled[] = {0.5,0.5,0.5,1}; // grey
	borderSize = 0.015;
	offsetX = 0.005;
	offsetY = 0.005;
	offsetPressedX = 0.002;
	offsetPressedY = 0.002;
	soundEnter[] = {"",0,1}; // no sound
	soundPush[] = {"",0,1}; // no sound
	soundClick[] = {"",0,1}; // no sound
	soundEscape[] = {"",0,1}; // no sound
};
class HintButton : ButtonControl { // using inhertance
	x = 0.6;
	text = "Hint";
	action = "hint ""Hint from second button! "";";
};
};

Share this post


Link to post
Share on other sites

Tested the code you posted in a sample mission.

Works as expected, without any error.

Did you solve the problem ?

Share this post


Link to post
Share on other sites
Tested the code you posted in a sample mission.

Works as expected, without any error.

Did you solve the problem ?

Not yet, but it's curious that I get an error and not you. I have the problem even if I remove that part of the code.

Share this post


Link to post
Share on other sites

That you get the error, if you remove the code, is normal.

This control attribute is mandatory. You must specify it!

Other attributes may be optional, but not colorShadow.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×