r3988 - in trunk/data/qcsrc: client common server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Jul 31 01:52:54 EDT 2008
Author: div0
Date: 2008-07-31 01:52:54 -0400 (Thu, 31 Jul 2008)
New Revision: 3988
Modified:
trunk/data/qcsrc/client/sbar.qc
trunk/data/qcsrc/common/constants.qh
trunk/data/qcsrc/server/scores_rules.qc
Log:
add real ranks for LMS (with st, nd, rd, th)
Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc 2008-07-31 05:41:55 UTC (rev 3987)
+++ trunk/data/qcsrc/client/sbar.qc 2008-07-31 05:52:54 UTC (rev 3988)
@@ -532,8 +532,23 @@
else
sbar_field_rgb = '1 1 1';
if(!tmp)
- if(f & SFL_HIDE_ZERO)
+ if(f & (SFL_HIDE_ZERO | SFL_RANK))
return "";
+ if(f & SFL_RANK)
+ {
+ str = ftos(floor(tmp + 0.5));
+ num = strlen(str);
+ if((num >= 2) && (substring(str, num - 2, 1) == "1"))
+ return strcat(str, "th");
+ else if(substring(str, num - 1, 1) == "1")
+ return strcat(str, "st");
+ else if(substring(str, num - 1, 1) == "2")
+ return strcat(str, "nd");
+ else if(substring(str, num - 1, 1) == "3")
+ return strcat(str, "rd");
+ else
+ return strcat(str, "th");
+ }
return ftos(tmp);
}
//return "error";
Modified: trunk/data/qcsrc/common/constants.qh
===================================================================
--- trunk/data/qcsrc/common/constants.qh 2008-07-31 05:41:55 UTC (rev 3987)
+++ trunk/data/qcsrc/common/constants.qh 2008-07-31 05:52:54 UTC (rev 3988)
@@ -211,6 +211,11 @@
#define SFL_ALLOW_HIDE 16
/**
+ * Display as a rank (with st, nd, rd, th suffix)
+ */
+#define SFL_RANK 32
+
+/**
* Scoring priority (NOTE: PRIMARY is used for fraglimit)
*/
#define SFL_SORT_PRIO_SECONDARY 4
Modified: trunk/data/qcsrc/server/scores_rules.qc
===================================================================
--- trunk/data/qcsrc/server/scores_rules.qc 2008-07-31 05:41:55 UTC (rev 3987)
+++ trunk/data/qcsrc/server/scores_rules.qc 2008-07-31 05:52:54 UTC (rev 3988)
@@ -87,7 +87,7 @@
{
ScoreRules_basics(0, 0);
ScoreInfo_SetLabel_PlayerScore(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
- ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_HIDE_ZERO | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
+ ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
}
// Key hunt stuff
More information about the nexuiz-commits
mailing list