]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an OK exit button to the guide dialog
authorotta8634 <k9wolf@pm.me>
Sat, 15 Feb 2025 11:18:28 +0000 (19:18 +0800)
committerotta8634 <k9wolf@pm.me>
Sat, 15 Feb 2025 11:18:28 +0000 (19:18 +0800)
This makes it much easier to exit, rather than having to press Esc or the tiny x.
This is also done in the mutators and other dialogs.

qcsrc/menu/xonotic/dialog_singleplayer_guide.qc

index abd9d3abf82ada740aced7dfc76045283b763729..0d4cae15674744f8eec4390df777808e17968748 100644 (file)
@@ -12,7 +12,7 @@ void XonoticGuideDialog_fill(entity me)
        me.gotoRC(me, 0, col);
                me.TD(me, 1, width, makeXonoticHeaderLabel(_("Topic")));
        me.TR(me);
-               me.TD(me, me.rows - 1, width, e = me.topicList);
+               me.TD(me, me.rows - 2, width, e = me.topicList);
                        e.onChange = XonoticGuideDialog_topicChangeNotify;
                        e.onChangeEntity = me;
 
@@ -20,10 +20,10 @@ void XonoticGuideDialog_fill(entity me)
        me.gotoRC(me, 0, col); me.setFirstColumn(me, me.currentColumn);
                me.TD(me, 1, width, makeXonoticHeaderLabel(_("Entry")));
        me.TR(me);
-               me.TD(me, me.rows - 1 - 1, width, e = me.entryList);
+               me.TD(me, me.rows - 3, width, e = me.entryList);
                        e.onChange = XonoticGuideDialog_entryChangeNotify;
                        e.onChangeEntity = me;
-       me.gotoRC(me, me.rows - 1, col);
+       me.gotoRC(me, me.rows - 2, col);
                me.entryList.stringFilterBox = makeXonoticInputBox_T(false, string_null,
                        _("Click here or Ctrl-F to provide a keyword to narrow down the map list. Ctrl-Delete to clear; Enter when done."));
                me.TD(me, 1, 0.3, makeXonoticTextLabel(0, _("Filter:")));
@@ -36,7 +36,12 @@ void XonoticGuideDialog_fill(entity me)
        me.gotoRC(me, 0, col); me.setFirstColumn(me, me.currentColumn);
                me.TD(me, 1, width, makeXonoticHeaderLabel(_("Description")));
        me.TR(me);
-               me.TD(me, me.rows - 1, width, me.descriptionPane);
+               me.TD(me, me.rows - 2, width, me.descriptionPane);
+
+       me.gotoRC(me, me.rows - 1, 0);
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
+                       e.onClick = Dialog_Close;
+                       e.onClickEntity = me;
 
        me.topicChangeNotify(me.topicList, me);
 }