3 void XonoticGuideTab_fill(entity this)
5 entity topics = this.topicList;
6 topics.onChange = XonoticGuideTab_topicChangeNotify;
7 topics.onChangeEntity = this;
8 entity entries = this.entryList;
9 entries.onChange = XonoticGuideTab_entryChangeNotify;
10 entries.onChangeEntity = this;
11 entity filter = entries.stringFilterBox = makeXonoticInputBox(false, string_null);
12 filter.keyDown = MapList_StringFilterBox_keyDown;
13 filter.onChange = MapList_StringFilterBox_Change;
14 filter.onChangeEntity = entries;
15 entries.controlledTextbox = filter;
16 entity description = this.descriptionPane;
20 this.gotoRC(this, 0, col);
21 this.TD(this, 1, width, makeXonoticHeaderLabel(_("Topic")));
23 this.TD(this, this.rows - 1, width, topics);
25 col += width, width = 2;
26 this.gotoRC(this, 0, col); this.setFirstColumn(this, this.currentColumn);
27 this.TD(this, 1, width, makeXonoticHeaderLabel(_("Entry")));
29 this.TD(this, this.rows - 1 - 1, width, entries);
30 this.gotoRC(this, this.rows - 1, col);
31 this.TD(this, 1, 0.3, makeXonoticTextLabel(0, _("Filter:")));
32 this.TD(this, 1, width - 0.3, filter);
34 col += width, width = 2.5;
35 this.gotoRC(this, 0, col); this.setFirstColumn(this, this.currentColumn);
36 this.TD(this, 1, width, makeXonoticHeaderLabel(_("Description")));
38 this.TD(this, this.rows - 1, width, description);
40 this.topicChangeNotify(topics, this);
43 void XonoticGuideTab_topicChangeNotify(entity, entity this)
45 entity topics = this.topicList;
46 entity entries = this.entryList;
47 int i = topics.selectedItem;
50 #define TOPIC(src, name, icon) if (idx++ == i) { static entity e; if (!e) e = src; found = e; break; }
51 do { TOPICS(TOPIC); } while (0);
53 entries.source = found;
54 entries.refilter(entries);
55 entries.setSelected(entries, 0);
58 void XonoticGuideTab_entryChangeNotify(entity, entity this)
60 entity desc = this.descriptionPane;
61 entity entries = this.entryList;
62 entity e = entries.source.getEntry(entries.source, entries.selectedItem, func_null);
63 string s = e.describe(e);
64 if (cvar("developer")) { s = sprintf("entity %i\n%s", e, s); }
65 desc.setDescription(desc, s);