]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small serverlist's code cleanup
authorterencehill <piuntn@gmail.com>
Sun, 21 Nov 2021 22:16:42 +0000 (23:16 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 21 Nov 2021 22:16:42 +0000 (23:16 +0100)
qcsrc/menu/xonotic/dialog_multiplayer_join.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/serverlist.qh

index a65a4945b0276996635f5f1c8a98f0291d29b684..01e4381e85196b43d3d3fd79d3af7cb35eacd362 100644 (file)
@@ -18,8 +18,7 @@ entity makeXonoticServerListTab()
 
 void XonoticServerListTab_refresh(entity this, entity slist)
 {
-    bool clear = false;
-    slist.refreshServerList(slist, clear ? REFRESHSERVERLIST_RESET : REFRESHSERVERLIST_ASK);
+       slist.refreshServerList(slist, REFRESHSERVERLIST_ASK);
 }
 
 void XonoticServerListTab_fill(entity me)
index 71119adf121be93f98d50f1df273be17f3415c12..c990c921208b4d2dc4908958f0f9234517b00540 100644 (file)
@@ -6,6 +6,12 @@
 #include "dialog_multiplayer_join_serverinfo.qh"
 #include <common/mapinfo.qh>
 
+#define IsFavorite(srv) IsServerInList(cvar_string("net_slist_favorites"), srv)
+#define IsPromoted(srv) IsServerInList(_Nex_ExtResponseSystem_PromotedServers, srv)
+#define IsRecommended(srv) IsServerInList(_Nex_ExtResponseSystem_RecommendedServers, srv)
+
+float m_gethostcachecategory(float entry) { return CategoryOverride(CategoryForEntry(entry)); }
+
 void SL_ProcessCategoryOverrides(.string override_field_string, .float override_field)
 {
        for (int i = 0; i < category_ent_count; ++i)
@@ -1107,8 +1113,8 @@ bool XonoticServerList_keyDown(entity me, int scan, bool ascii, bool shift)
        {
                if(me.nItems != 0)
                {
-                       float thisPos = me.getItemStart(me, me.selectedItem); 
-                       float thisHeight = me.getItemHeight(me, me.selectedItem); 
+                       float thisPos = me.getItemStart(me, me.selectedItem);
+                       float thisHeight = me.getItemHeight(me, me.selectedItem);
                        vector org = boxToGlobal(eY * (thisPos - me.scrollPos), me.origin, me.size);
                        vector sz = boxToGlobalSize(eY * thisHeight + eX * (1 - me.controlWidth), me.size);
                        m_play_click_sound(MENU_SOUND_OPEN);
index db74045986d7eb8b78bc06326639656a74addc4f..150e220715c21a4b776178947056543df0559527 100644 (file)
@@ -125,14 +125,11 @@ const float REFRESHSERVERLIST_RESET = 3;     // ..., also clear the list first
 
 // function declarations
 float IsServerInList(string list, string srv);
-#define IsFavorite(srv) IsServerInList(cvar_string("net_slist_favorites"), srv)
-#define IsPromoted(srv) IsServerInList(_Nex_ExtResponseSystem_PromotedServers, srv)
-#define IsRecommended(srv) IsServerInList(_Nex_ExtResponseSystem_RecommendedServers, srv)
 
 entity RetrieveCategoryEnt(float catnum);
 
 float CategoryOverride(float cat);
-float m_gethostcachecategory(float entry) { return CategoryOverride(CategoryForEntry(entry)); }
+float m_gethostcachecategory(float entry);
 
 
 // fields for category entities