From 0244c4323b60fce6e9f9e13bd0d21d9bf37b20a5 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Sun, 16 Feb 2025 18:11:22 +0800 Subject: [PATCH] Remove MapSource and DebugSource leftover guide code These were unused, commented out in case we wanted to add them back. --- qcsrc/menu/xonotic/guide/guide.qc | 78 ------------------------------- qcsrc/menu/xonotic/guide/guide.qh | 20 -------- 2 files changed, 98 deletions(-) diff --git a/qcsrc/menu/xonotic/guide/guide.qc b/qcsrc/menu/xonotic/guide/guide.qc index 7431d1d378..e6f938f3e0 100644 --- a/qcsrc/menu/xonotic/guide/guide.qc +++ b/qcsrc/menu/xonotic/guide/guide.qc @@ -24,81 +24,3 @@ METHOD(TopicSource, reload, int(TopicSource this, string filter)) #undef TOPIC return n; } - -/* -entity DebugSource_find_debug() -{ - entity head = NULL, tail = NULL; - for (entity it = NULL; (it = nextent(it)); ) { - if (!it.instanceOfObject) continue; - if (it.instanceOfGameItem) continue; - if (it.instanceOfAnimHost) continue; - if (it.instanceOfDataSource) continue; - if (it.classname == "Object") continue; - if (it.classname == "vtbl") continue; - if (!tail) - tail = head = it; - else - { - tail.nextdebug = it; - tail = it; - } - } - return head; -} -METHOD(DebugSource, getEntry, entity(DebugSource this, int i, void(string, string) returns)) -{ - int idx = 0; - entity e; - for (e = DebugSource_find_debug(); e; e = e.nextdebug) - { - if (strstrofs(sprintf("entity %i", e), DebugSource_activeFilter, 0) < 0) continue; - if (idx++ == i) break; - } - if (returns) - e.display(e, returns); - return e; -} -METHOD(DebugSource, reload, int(DebugSource this, string filter)) -{ - DebugSource_activeFilter = filter; - int idx = 0; - entity e; - for (e = DebugSource_find_debug(); e; e = e.nextdebug) - { - if (strstrofs(sprintf("entity %i", e), DebugSource_activeFilter, 0) < 0) continue; - idx++; - } - return idx; -} -*/ - -#if 0 -METHOD(MapSource, getEntry, entity(MapSource this, int i, void(string, string) returns)) -{ - if (!MapInfo_Get_ByID(i)) - return DataSource_false; - string path = strcat("/maps/", MapInfo_Map_bspname); - string img = draw_PictureSize(path) ? path : "nopreview_map"; - if (returns) - returns(MapInfo_Map_titlestring, img); - MapInfo_ClearTemps(); - return DataSource_true; -} -METHOD(MapSource, indexOf, int(MapSource this, string s)) -{ - MapInfo_FindName(s); - return MapInfo_FindName_firstResult; -} -METHOD(MapSource, reload, int(MapSource this, string s)) -{ - _MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, 0, 0); - if (s) - MapInfo_FilterString(s); - return MapInfo_count; -} -METHOD(MapSource, destroy, void(MapSource this)) -{ - MapInfo_Shutdown(); -} -#endif diff --git a/qcsrc/menu/xonotic/guide/guide.qh b/qcsrc/menu/xonotic/guide/guide.qh index 9bbc2681ea..fa8260ff06 100644 --- a/qcsrc/menu/xonotic/guide/guide.qh +++ b/qcsrc/menu/xonotic/guide/guide.qh @@ -18,23 +18,12 @@ X(NEW(VehicleSource), _("Vehicles"), "gametype_rc") \ 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; .bool instanceOfAmmo; .bool instanceOfHealth; @@ -133,12 +122,3 @@ REGISTRY_SOURCE(TurretSource, Turrets, Turrets) #include REGISTRY_SOURCE(MutatorSource, Mutators, Mutators) // The descriptions for these are in common/mutators/mutator/*.qc (not the cl_* or sv_* files) - -#if 0 -CLASS(MapSource, DataSource) - METHOD(MapSource, getEntry, entity(MapSource this, int i, void(string, string) returns)); - METHOD(MapSource, indexOf, int(MapSource this, string s)); - METHOD(MapSource, reload, int(MapSource this, string s)); - METHOD(MapSource, destroy, void(MapSource)); -ENDCLASS(MapSource) -#endif -- 2.39.5