X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fitem%2Fdialog.qc;h=77037ace61132e48fc3bf57e87f24fc7e249756a;hb=ff442844108257ce535eae6dc08eaf659ff5efd7;hp=62c74406ed92860cc95a07ad06aae11489d91cae;hpb=845401fd312c66c059aaee1772ac5d79555ab4fc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/item/dialog.qc b/qcsrc/menu/item/dialog.qc index 62c74406e..77037ace6 100644 --- a/qcsrc/menu/item/dialog.qc +++ b/qcsrc/menu/item/dialog.qc @@ -13,8 +13,10 @@ // // a subclass may help with using this as a tab -#ifdef INTERFACE -CLASS(Dialog) EXTENDS(InputContainer) +#ifndef ITEM_DIALOG_H +#define ITEM_DIALOG_H +#include "inputcontainer.qc" +CLASS(Dialog, InputContainer) 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,12 +130,15 @@ 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.borderLines * me.titleHeight); - me.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition; - me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar; - me.frame.alpha = me.alpha; - me.addItem(me, me.frame, '0 0 0', '1 1 0', 1); + if(me.isTabRoot) + { + 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; + me.frame.alpha = me.alpha; + me.addItem(me, me.frame, '0 0 0', '1 1 0', 1); + } if (!me.titleFontSize) me.titleHeight = 0; // no title bar @@ -153,10 +158,10 @@ void Dialog_configureDialog(entity me) me.fill(me); - if(me.closable && me.borderLines > 0) + if(me.isTabRoot && 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; @@ -182,6 +187,7 @@ float Dialog_keyDown(entity me, float key, float ascii, float shift) { if(key == K_ESCAPE) { + m_play_click_sound(MENU_SOUND_CLOSE); me.close(me); return 1; }