From 7fec7f8d3e0552a5e4761d9d0f511c018415d42d Mon Sep 17 00:00:00 2001 From: otta8634 Date: Tue, 31 Dec 2024 01:17:26 +0800 Subject: [PATCH] Flesh out Guide topic code Also properly commented out DebugSource. --- qcsrc/menu/xonotic/guide/guide.qc | 2 ++ qcsrc/menu/xonotic/guide/guide.qh | 3 +++ qcsrc/menu/xonotic/guide/pages.qc | 10 +++++++++- qcsrc/menu/xonotic/guide/pages.qh | 9 +++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/qcsrc/menu/xonotic/guide/guide.qc b/qcsrc/menu/xonotic/guide/guide.qc index 5723211f8..7c60b1a2b 100644 --- a/qcsrc/menu/xonotic/guide/guide.qc +++ b/qcsrc/menu/xonotic/guide/guide.qc @@ -25,6 +25,7 @@ METHOD(TopicSource, reload, int(TopicSource this, string filter)) return n; } +/* entity DebugSource_find_debug() { entity head = NULL, tail = NULL; @@ -70,6 +71,7 @@ METHOD(DebugSource, reload, int(DebugSource this, string filter)) } return idx; } +*/ METHOD(MapSource, getEntry, entity(MapSource this, int i, void(string, string) returns)) { diff --git a/qcsrc/menu/xonotic/guide/guide.qh b/qcsrc/menu/xonotic/guide/guide.qh index 88ad489f9..2a34aaaf2 100644 --- a/qcsrc/menu/xonotic/guide/guide.qh +++ b/qcsrc/menu/xonotic/guide/guide.qh @@ -18,18 +18,21 @@ X(NEW(TurretSource), _("Turrets"), "gametype_as") \ X(NEW(MutatorSource), _("Mutators"), "gametype_nb") \ X(NEW(MapSource), _("Maps"), "gametype_ctf") \ + /*if (gamestatus & GAME_DEVELOPER) X(NEW(DebugSource), _("Debug"), "gametype_ons")*/ \ /**/ CLASS(TopicSource, DataSource) METHOD(TopicSource, getEntry, entity(TopicSource this, int i, void(string, string) returns)); METHOD(TopicSource, reload, int(TopicSource this, string filter)); ENDCLASS(TopicSource) +/* CLASS(DebugSource, DataSource) .entity nextdebug; string DebugSource_activeFilter = ""; METHOD(DebugSource, getEntry, entity(DebugSource this, int i, void(string, string) returns)); METHOD(DebugSource, reload, int(DebugSource this, string filter)); ENDCLASS(DebugSource) +*/ .bool m_hidden; diff --git a/qcsrc/menu/xonotic/guide/pages.qc b/qcsrc/menu/xonotic/guide/pages.qc index 1b15398b5..b6b9af2ad 100644 --- a/qcsrc/menu/xonotic/guide/pages.qc +++ b/qcsrc/menu/xonotic/guide/pages.qc @@ -2,9 +2,17 @@ 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)) { - returns(this.m_title, "nopreview_map"); + 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 = "nopreview_map"; + returns(this.m_title, icon_str); } diff --git a/qcsrc/menu/xonotic/guide/pages.qh b/qcsrc/menu/xonotic/guide/pages.qh index b11cb9fb8..5f29b530b 100644 --- a/qcsrc/menu/xonotic/guide/pages.qh +++ b/qcsrc/menu/xonotic/guide/pages.qh @@ -12,7 +12,6 @@ CLASS(GuidePage, Object); CONSTRUCT(GuidePage); this.m_title = _title; } - ENDCLASS(GuidePage) REGISTRY(GuidePages, 16) @@ -20,4 +19,10 @@ REGISTRY(GuidePages, 16) REGISTER(GuidePages, GUIDE_PAGE, id, m_id, NEW(GuidePage, title)) REGISTER_REGISTRY(GuidePages) -REGISTER_GUIDE_PAGE(0, _("Intro")) { this.m_description = _("Welcome to Xonotic"); } +REGISTER_GUIDE_PAGE(0, _("Introduction")) { + 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")) { + this.m_description = _("In Xonotic to move quickly you will have to airstrafe and bunnyhop"); // TODO +} -- 2.39.5