X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fitem%2Fdialog.c;h=383578781544e96b900cca383fc702c377945de8;hb=bf20397b0c62c9de0335ef9d70d60842fde9d0b2;hp=800a12681e4eb3d8b95ba4c0206baf1691cf5f3a;hpb=5a682c6eb030594b9cc2cf652dd5ab98475095db;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/item/dialog.c b/qcsrc/menu/item/dialog.c index 800a12681..383578781 100644 --- a/qcsrc/menu/item/dialog.c +++ b/qcsrc/menu/item/dialog.c @@ -4,7 +4,7 @@ // - closable is 0 // - rootDialog is 0 // - title is "" -// - marginTop is +// - marginTop is // - intendedHeight ends up to be the tab's actual height, or at least close // - titleFontSize is 0 // - marginTop cancels out as much of titleHeight as needed (that is, it should be actualMarginTop - titleHeight) @@ -58,6 +58,8 @@ CLASS(Dialog) EXTENDS(InputContainer) ATTRIB(Dialog, zoomedOutTitleBarPosition, float, 0) ATTRIB(Dialog, zoomedOutTitleBar, float, 0) + ATTRIB(Dialog, requiresConnection, float, 0) // set to TRUE if the dialog requires a connection to be opened + ATTRIB(Dialog, backgroundImage, string, string_null) ATTRIB(Dialog, borderLines, float, 1) ATTRIB(Dialog, closeButtonImage, string, string_null) @@ -124,7 +126,6 @@ void Dialog_TDempty(entity me, float colspan) void Dialog_configureDialog(entity me) { - entity closebutton; float absWidth, absHeight; me.frame = spawnBorderImage(); @@ -134,7 +135,7 @@ void Dialog_configureDialog(entity me) me.frame.alpha = me.alpha; me.addItem(me, me.frame, '0 0 0', '1 1 0', 1); - if not(me.titleFontSize) + if (!me.titleFontSize) me.titleHeight = 0; // no title bar absWidth = me.intendedWidth * conwidth; @@ -152,16 +153,15 @@ void Dialog_configureDialog(entity me) me.fill(me); - if(me.closable) + if(me.closable && me.borderLines > 0) { - closebutton = me.closeButton = spawnButton(); + entity closebutton; + closebutton = me.closeButton = me.frame.closeButton = spawnButton(); 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 } - - me.frame.closeButton = closebutton; } void Dialog_close(entity me)