]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/dialog.c
get rid of some dead code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / dialog.c
index 8202fbbb67e4c358989d96c20bae9eb2dd002cec..800a12681e4eb3d8b95ba4c0206baf1691cf5f3a 100644 (file)
@@ -59,6 +59,7 @@ CLASS(Dialog) EXTENDS(InputContainer)
        ATTRIB(Dialog, zoomedOutTitleBar, float, 0)
 
        ATTRIB(Dialog, backgroundImage, string, string_null)
+       ATTRIB(Dialog, borderLines, float, 1)
        ATTRIB(Dialog, closeButtonImage, string, string_null)
 
        ATTRIB(Dialog, frame, entity, NULL)
@@ -77,7 +78,6 @@ void Dialog_fill(entity me)
 
 void Dialog_addItemSimple(entity me, float row, float col, float rowspan, float colspan, entity e, vector v)
 {
-       //print(vtos(me.itemSpacing), " ", vtos(me.itemSize), "\n");
        vector o, s;
        o = me.itemOrigin + eX * ( col          * me.itemSpacing_x) + eY * ( row          * me.itemSpacing_y);
        s = me.itemSize   + eX * ((colspan - 1) * me.itemSpacing_x) + eY * ((rowspan - 1) * me.itemSpacing_y);
@@ -128,7 +128,7 @@ void Dialog_configureDialog(entity me)
        float absWidth, absHeight;
 
        me.frame = spawnBorderImage();
-       me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.titleHeight);
+       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;
        me.frame.alpha = me.alpha;
@@ -138,9 +138,9 @@ void Dialog_configureDialog(entity me)
                me.titleHeight = 0; // no title bar
 
        absWidth = me.intendedWidth * conwidth;
-       absHeight = me.titleHeight + me.marginTop + me.rows * me.rowHeight + (me.rows - 1) * me.rowSpacing + me.marginBottom;
+       absHeight = me.borderLines * me.titleHeight + me.marginTop + me.rows * me.rowHeight + (me.rows - 1) * me.rowSpacing + me.marginBottom;
        me.itemOrigin  = eX * (me.marginLeft / absWidth)
-                      + eY * ((me.titleHeight + me.marginTop) / absHeight);
+                      + eY * ((me.borderLines * me.titleHeight + me.marginTop) / absHeight);
        me.itemSize    = eX * ((1 - (me.marginLeft + me.marginRight + me.columnSpacing * (me.columns - 1)) / absWidth) / me.columns)
                       + eY * (me.rowHeight / absHeight);
        me.itemSpacing = me.itemSize
@@ -155,7 +155,7 @@ void Dialog_configureDialog(entity me)
        if(me.closable)
        {
                closebutton = me.closeButton = spawnButton();
-               closebutton.configureButton(closebutton, "Close", 0, me.closeButtonImage);
+               closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
                closebutton.onClick = Dialog_Close; closebutton.onClickEntity = me;
                closebutton.srcMulti = 0;
                me.addItem(me, closebutton, '0 0 0', '1 1 0', 1); // put it as LAST