private static void InternalAddTrashProperties(Mobile viewer, ExtendedOPL list) { if (!CMOptions.ModuleEnabled || !CMOptions.UseTrashedProps || viewer == null || viewer.Deleted || list == null || !(viewer is PlayerMobile)) { return; } TrashProfile p = EnsureProfile(viewer); int todayTotal = p.GetTokenTotal(DateTime.UtcNow); int total = p.GetTokenTotal(); list.Add( "<basefont color=#{0:X6}>Total Tokens Earned: {1}", Color.SkyBlue.ToArgb(), total <= 0 ? "0" : total.ToString("#,#")); if (CMOptions.DailyLimit > 0) { const int blocks = 10; double cur = (Math.Max(0, Math.Min(CMOptions.DailyLimit, (double)todayTotal)) / CMOptions.DailyLimit) * 100.0; int left = (int)Math.Floor(cur / blocks); int right = blocks - left; list.Add("<basefont color=#{0:X6}>Tokens Earned Today:", Color.SkyBlue.ToArgb()); list.Add( "[<basefont color=#{0:X6}>{1}<basefont color=#{2:X6}>{3}<basefont color=#{4:X6}>] {5}/{6}", Color.LimeGreen.ToArgb(), new String('=', left), Color.OrangeRed.ToArgb(), new String('=', right), Color.SkyBlue.ToArgb(), todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"), CMOptions.DailyLimit.ToString("#,#")); } else { list.Add("Tokens Earned Today: {0}", todayTotal <= 0 ? "0" : todayTotal.ToString("#,#")); } list.Add("<basefont color=#ffffff>"); }
private static int InternalProfileSortToday(TrashProfile a, TrashProfile b) { if (a == b) { return(0); } if (a == null) { return(1); } if (b == null) { return(-1); } if (a.Deleted && b.Deleted) { return(0); } if (a.Deleted) { return(1); } if (b.Deleted) { return(-1); } var when = DateTime.UtcNow; var aTotal = a.GetTokenTotal(when); var bTotal = b.GetTokenTotal(when); if (aTotal > bTotal) { return(-1); } if (aTotal < bTotal) { return(1); } return(0); }
private static int InternalProfileSort(TrashProfile a, TrashProfile b) { if (a == b) { return(0); } if (a == null) { return(1); } if (b == null) { return(-1); } if (a.Deleted && b.Deleted) { return(0); } if (a.Deleted) { return(1); } if (b.Deleted) { return(-1); } int aTotal = a.GetTokenTotal(); int bTotal = b.GetTokenTotal(); if (aTotal > bTotal) { return(-1); } if (aTotal < bTotal) { return(1); } return(0); }
private static int InternalProfileSort(TrashProfile a, TrashProfile b) { if (a == b) { return 0; } if (a == null) { return 1; } if (b == null) { return -1; } if (a.Deleted && b.Deleted) { return 0; } if (a.Deleted) { return 1; } if (b.Deleted) { return -1; } int aTotal = a.GetTokenTotal(); int bTotal = b.GetTokenTotal(); if (aTotal > bTotal) { return -1; } if (aTotal < bTotal) { return 1; } return 0; }
private static int InternalProfileSortToday(TrashProfile a, TrashProfile b) { if (a == b) { return 0; } if (a == null) { return 1; } if (b == null) { return -1; } if (a.Deleted && b.Deleted) { return 0; } if (a.Deleted) { return 1; } if (b.Deleted) { return -1; } DateTime when = DateTime.UtcNow; int aTotal = a.GetTokenTotal(when); int bTotal = b.GetTokenTotal(when); if (aTotal > bTotal) { return -1; } if (aTotal < bTotal) { return 1; } return 0; }