Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_media_guide.qc File Reference
#include "dialog_media_guide.qh"
#include "button.qh"
#include "inputbox.qh"
#include "textlabel.qh"
#include <menu/xonotic/guide/entries.qh>
Include dependency graph for dialog_media_guide.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TOPIC(src, name, icon)

Functions

entity makeXonoticGuideTab ()
void XonoticGuideTab_entryChangeNotify (entity, entity me)
void XonoticGuideTab_fill (entity me)
void XonoticGuideTab_topicChangeNotify (entity, entity me)

Macro Definition Documentation

◆ TOPIC

#define TOPIC ( src,
name,
icon )
Value:
if (idx++ == i) \
{ \
static entity e; \
if (!e) \
e = src; \
found = e; \
break; \
}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback

Referenced by TopicSource::getEntry(), TopicSource::reload(), and XonoticGuideTab_topicChangeNotify().

Function Documentation

◆ makeXonoticGuideTab()

entity makeXonoticGuideTab ( )

Definition at line 8 of file dialog_media_guide.qc.

9{
10 entity me;
11 me = NEW(XonoticGuideTab);
12 me.configureDialog(me);
13 return me;
14}
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

Referenced by XonoticMediaDialog_fill().

◆ XonoticGuideTab_entryChangeNotify()

void XonoticGuideTab_entryChangeNotify ( entity ,
entity me )

Definition at line 72 of file dialog_media_guide.qc.

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 void func_null()

References entity(), and func_null().

Referenced by XonoticGuideTab_fill().

◆ XonoticGuideTab_fill()

void XonoticGuideTab_fill ( entity me)

Definition at line 15 of file dialog_media_guide.qc.

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}
void XonoticGuideTab_entryChangeNotify(entity, entity me)
void XonoticGuideTab_topicChangeNotify(entity, entity me)
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
string string_null
Definition nil.qh:9
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticInputBox_T(bool doEditColorCodes, string theCvar, string theTooltip)
Definition inputbox.qc:3

References entity(), EntryList_StringFilterBox_Change(), EntryList_StringFilterBox_keyDown(), makeXonoticInputBox_T(), makeXonoticTextLabel(), string_null, XonoticGuideTab_entryChangeNotify(), and XonoticGuideTab_topicChangeNotify().

◆ XonoticGuideTab_topicChangeNotify()

void XonoticGuideTab_topicChangeNotify ( entity ,
entity me )

Definition at line 49 of file dialog_media_guide.qc.

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}
#define TOPIC(src, name, icon)
#define TOPICS(X)
Definition guide.qh:8
#define NULL
Definition post.qh:14

References entity(), EntryList_StringFilterBox_Change(), NULL, TOPIC, and TOPICS.

Referenced by XonoticGuideTab_fill().