]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/dialog.qc
Merge CLASS and EXTENDS, #define NEW(cname) (spawn##cname())
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / dialog.qc
index 1723f27cb8e5335691741ca3df38a883f3798e74..e68a0931d13882e0b7c2d51cb8c230eda7e159fb 100644 (file)
@@ -14,7 +14,7 @@
 // a subclass may help with using this as a tab
 
 #ifdef INTERFACE
-CLASS(Dialog) EXTENDS(InputContainer)
+CLASS(DialogInputContainer)
        METHOD(Dialog, configureDialog, void(entity)) // no runtime configuration, all parameters are given in the code!
        METHOD(Dialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        METHOD(Dialog, keyDown, float(entity, float, float, float))
@@ -128,7 +128,7 @@ void Dialog_configureDialog(entity me)
 {
        float absWidth, absHeight;
 
-       me.frame = spawnBorderImage();
+       me.frame = NEW(BorderImage);
        me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.borderLines * me.titleHeight);
        me.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition;
        me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar;
@@ -156,7 +156,7 @@ void Dialog_configureDialog(entity me)
        if(me.closable && me.borderLines > 0)
        {
                entity closebutton;
-               closebutton = me.closeButton = me.frame.closeButton = spawnButton();
+               closebutton = me.closeButton = me.frame.closeButton = NEW(Button);
                closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
                closebutton.onClick = Dialog_Close; closebutton.onClickEntity = me;
                closebutton.srcMulti = 0;