#include "pages.qh"
-
-METHOD(GuidePage, describe, string(GuidePage this))
-{
- TC(GuidePage, this);
- return this.m_description;
-}
-METHOD(GuidePage, display, void(GuidePage this, void(string name, string icon) returns))
-{
- TC(GuidePage, this);
- string icon_str;
- if (this.m_title == _("Introduction"))
- icon_str = "gametype_dm";
- else if (this.m_title == _("Movement"))
- icon_str = "gametype_inv";
- else
- icon_str = string_null;
- returns(this.m_title, icon_str);
-}
CLASS(GuidePage, Object);
ATTRIB(GuidePage, m_id, int, 0);
- ATTRIB(GuidePage, m_title, string, "");
+ ATTRIB(GuidePage, m_name, string, "");
+ ATTRIB(GuidePage, m_icon, string);
ATTRIB(GuidePage, m_description, string, "");
- METHOD(GuidePage, describe, string(GuidePage));
- METHOD(GuidePage, display, void(GuidePage this, void(string name, string icon) returns));
+ METHOD(GuidePage, describe, string(GuidePage this))
+ {
+ TC(GuidePage, this);
+ return this.m_description;
+ }
+ METHOD(GuidePage, display, void(GuidePage this, void(string name, string icon) returns))
+ {
+ TC(GuidePage, this);
+ returns(this.m_name, this.m_icon ? this.m_icon : string_null);
+ }
- CONSTRUCTOR(GuidePage, string _title) {
+ CONSTRUCTOR(GuidePage, string _name, string _icon) {
CONSTRUCT(GuidePage);
- this.m_title = _title;
+ this.m_name = _name;
+ this.m_icon = _icon;
}
ENDCLASS(GuidePage)
REGISTRY(GuidePages, 16)
-#define REGISTER_GUIDE_PAGE(id, title) \
- REGISTER(GuidePages, GUIDE_PAGE, id, m_id, NEW(GuidePage, title))
+#define REGISTER_GUIDE_PAGE(id, name, icon) \
+ REGISTER(GuidePages, GUIDE_PAGE, id, m_id, NEW(GuidePage, name, icon))
REGISTER_REGISTRY(GuidePages)
-REGISTER_GUIDE_PAGE(0, _("Introduction")) {
+REGISTER_GUIDE_PAGE(0, _("Introduction"), "gametype_dm")
+{
this.m_description = _("Welcome to Xonotic, the free and fast arena shooter!\n\n"
"Keep in mind all values and descriptions in this guide are based on the default game settings, so it may differ from the experience when playing on some modified servers");
}
-REGISTER_GUIDE_PAGE(1, _("Movement")) {
+
+REGISTER_GUIDE_PAGE(1, _("Movement"), "gametype_inv")
+{
this.m_description = _("In Xonotic to move quickly you will have to airstrafe and bunnyhop"); // TODO
}