Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_media_guide.qc
Go to the documentation of this file.
2
3#include "button.qh"
4#include "inputbox.qh"
5#include "textlabel.qh"
7
9{
11 me.configureDialog(me);
12 return me;
13}
15{
16 entity e;
17
18 float col = 0;
19 float width = 1.5;
20 me.gotoRC(me, 0.5, col); me.setFirstColumn(me, me.currentColumn);
21 me.TD(me, me.rows - 0.5, width, e = me.topicList);
23 e.onChangeEntity = me;
24
25 col += width;
26 width = 1.75;
27 me.gotoRC(me, 0.5, col); me.setFirstColumn(me, me.currentColumn);
28 me.TD(me, me.rows - 1.5, width, e = me.entryList);
30 e.onChangeEntity = me;
31 me.gotoRC(me, me.rows - 1, col);
32 me.entryList.stringFilterBox = makeXonoticInputBox_T(false, string_null,
33 _("Click here or CTRL+F to provide a keyword to narrow down the list; CTRL+DEL to clear; ENTER when done."));
34 me.TD(me, 1, 0.3, makeXonoticTextLabel(0, _("Filter:")));
35 me.TD(me, 1, width - 0.3, e = me.entryList.stringFilterBox);
38 e.onChangeEntity = me.entryList;
39
40 col += width;
41 width = 2.75;
42 me.gotoRC(me, 0.5, col); me.setFirstColumn(me, me.currentColumn);
43 me.TD(me, me.rows - 0.5, width, me.descriptionPane);
44
45 me.topicChangeNotify(me.topicList, me);
46}
47
49{
50 entity entries = me.entryList;
51 const int i = me.topicList.selectedItem;
52 int idx = 0;
53 entity found = NULL;
54 #define TOPIC(src, name, icon) \
55 if (idx++ == i) \
56 { \
57 static entity e; \
58 if (!e) \
59 e = src; \
60 found = e; \
61 break; \
62 }
63 do { TOPICS(TOPIC); }
64 while (0);
65 #undef TOPIC
66 entries.source = found;
67 entries.selectedItem = -1; // signal that the source has changed
68 entries.stringFilterBox.setText(entries.stringFilterBox, "");
69 EntryList_StringFilterBox_Change(entries.stringFilterBox, entries); // this calls entries.refilter, which calls entries.setSelected, which calls entryChangeNotify
70}
72{
73 entity entries = me.entryList;
74 if (entries.nItems <= 0)
75 return;
76 entity e = entries.source.getEntry(entries.source, entries.selectedItem, func_null);
77 me.descriptionPane.setDescription(me.descriptionPane, e.describe(e));
78}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void XonoticGuideTab_fill(entity me)
void XonoticGuideTab_entryChangeNotify(entity, entity me)
#define TOPIC(src, name, icon)
void XonoticGuideTab_topicChangeNotify(entity, entity me)
entity makeXonoticGuideTab()
void EntryList_StringFilterBox_Change(entity box, entity me)
Definition entries.qc:156
float EntryList_StringFilterBox_keyDown(entity me, float scan, float ascii, float shift)
Definition entries.qc:106
#define TOPICS(X)
Definition guide.qh:8
var void func_null()
string string_null
Definition nil.qh:9
#define NEW(cname,...)
Definition oo.qh:117
#define NULL
Definition post.qh:14
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticInputBox_T(bool doEditColorCodes, string theCvar, string theTooltip)
Definition inputbox.qc:3