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{
10 entity me;
11 me = NEW(XonoticGuideTab);
12 me.configureDialog(me);
13 return me;
14}
16{
17 entity e;
18
19 float col = 0;
20 float width = 1.5;
21 me.gotoRC(me, 0.5, col); me.setFirstColumn(me, me.currentColumn);
22 me.TD(me, me.rows - 0.5, width, e = me.topicList);
24 e.onChangeEntity = me;
25
26 col += width;
27 width = 1.75;
28 me.gotoRC(me, 0.5, col); me.setFirstColumn(me, me.currentColumn);
29 me.TD(me, me.rows - 1.5, width, e = me.entryList);
31 e.onChangeEntity = me;
32 me.gotoRC(me, me.rows - 1, col);
33 me.entryList.stringFilterBox = makeXonoticInputBox_T(false, string_null,
34 _("Click here or CTRL+F to provide a keyword to narrow down the list; CTRL+DEL to clear; ENTER when done."));
35 me.TD(me, 1, 0.3, makeXonoticTextLabel(0, _("Filter:")));
36 me.TD(me, 1, width - 0.3, e = me.entryList.stringFilterBox);
39 e.onChangeEntity = me.entryList;
40
41 col += width;
42 width = 2.75;
43 me.gotoRC(me, 0.5, col); me.setFirstColumn(me, me.currentColumn);
44 me.TD(me, me.rows - 0.5, width, me.descriptionPane);
45
46 me.topicChangeNotify(me.topicList, me);
47}
48
50{
51 entity entries = me.entryList;
52 const int i = me.topicList.selectedItem;
53 int idx = 0;
54 entity found = NULL;
55 #define TOPIC(src, name, icon) \
56 if (idx++ == i) \
57 { \
58 static entity e; \
59 if (!e) \
60 e = src; \
61 found = e; \
62 break; \
63 }
64 do { TOPICS(TOPIC); }
65 while (0);
66 #undef TOPIC
67 entries.source = found;
68 entries.selectedItem = -1; // signal that the source has changed
69 entries.stringFilterBox.setText(entries.stringFilterBox, "");
70 EntryList_StringFilterBox_Change(entries.stringFilterBox, entries); // this calls entries.refilter, which calls entries.setSelected, which calls entryChangeNotify
71}
73{
74 entity entries = me.entryList;
75 if (entries.nItems <= 0)
76 return;
77 entity e = entries.source.getEntry(entries.source, entries.selectedItem, func_null);
78 me.descriptionPane.setDescription(me.descriptionPane, e.describe(e));
79}
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