When you inherit from a dialog class and then inherit from the "controls" subclass of the parent dialog, any control classes inherited won't show up when createDialog is used.
They will correctly show up in the config viewer however.
When you inherit from a dialog class and then inherit from the "controls" subclass of the parent dialog, any control classes inherited won't show up when createDialog is used.
They will correctly show up in the config viewer however.
Create a new addon and add the example below to config.cpp.
Example_Dialog1 contains a working dialog with a listbox and two buttons. In Example_Dialog2 I expect the dialog to be the exact same, except the background box is white instead of black. However when tested using createDialog you can see this is not the result.
Also worth checking the config viewer to see that the inherited control subclasses are listed correctly.
class RscButtonMenuCancel;
class RscButtonMenuOK;
class RscListbox;
class RscText;
class Example_RscBaseDialog
{
idd = -1; movingEnable = true; onLoad = "\ [] spawn {\ while {dialog} do {\ if !(alive player) then {\ closeDialog 0;\ };\ };\ };\ ";
};
class Example_Dialog1: Example_RscBaseDialog
{
class controls { class BackgroundBox: RscText { x = safezoneX+safezoneW*0.4; y = safezoneY+safezoneH*0.325; w = 0.2*safezoneW; h = 0.165*safezoneH; colorBackground[] = {0,0,0,0.7}; }; class Listbox: RscListbox { idc = 101; x = safezoneX+safezoneW*0.405; y = safezoneY+safezoneH*0.33; w = 0.19*safezoneW; h = 0.155*safezoneH; colorBackground[] = {0,0,0,0.5}; }; class ButtonCancel: RscButtonMenuCancel { action = "closeDialog 0;"; x = safezoneX+safezoneW*0.44; y = safezoneY+safezoneH*0.495; w = 0.05*safezoneW; h = 0.025*safezoneH; }; class ButtonOK: RscButtonMenuOK { x = safezoneX+safezoneW*0.51; y = safezoneY+safezoneH*0.495; w = 0.05*safezoneW; h = 0.025*safezoneH; }; };
};
class Example_Dialog2: Example_Dialog1
{
class controls: controls { class BackgroundBox: BackgroundBox { colorBackground[] = {1,1,1,0.7}; }; };
};
Original thread on the issue:
http://forums.bistudio.com/showthread.php?186086-createDialog-and-class-inheritance