Skip to content

Commit

Permalink
Add {debuff_list_p} placeholder for those, who whant to see only perc…
Browse files Browse the repository at this point in the history
…ents in debuff_list without exact times #270

Removed enrage % from {debuff_list} #267
Add {debuff_list} and {debuff_list_p} placeholders to the footer for those, who want to see all debuffs below dps stats.
Replace full debuff name with short debuff name in paste string if override file exists in meter db.
  • Loading branch information
Gl0 committed Dec 13, 2016
1 parent e9bc5f3 commit 299a989
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
26 changes: 21 additions & 5 deletions DamageMeter.Core/CopyPaste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,14 @@ public static Tuple<string,string> Copy(StatsSummary statsSummary, Skills skills
: 0) + LP.PerSecond);
dpsString.Replace("{enrage}", FormatHelpers.Instance.FormatPercent(enrageperc));
dpsString.Replace("{debuff_list}", String.Join(" | ",
bossDebuff.Where(x => x.Value.Duration(firstTick, lastTick) > 0).ToList().Select(
x => x.Key.Name + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick, lastTick) / (lastTick - firstTick)) +
bossDebuff.Where(x => x.Key.Id != 8888888 && x.Value.Duration(firstTick, lastTick) > 0).ToList().Select(
x => x.Key.ShortName + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick, lastTick) / (lastTick - firstTick)) +
" (" + TimeSpan.FromTicks(x.Value.Duration(firstTick, lastTick)).ToString(@"mm\:ss") + ") ")
));
dpsString.Replace("{debuff_list_p}", String.Join(" | ",
bossDebuff.Where(x => x.Key.Id != 8888888 && x.Value.Duration(firstTick, lastTick) > 0).ToList().Select(
x => x.Key.ShortName + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick, lastTick) / (lastTick - firstTick)))
));

var placeholders = new List<KeyValuePair<PlayerDamageDealt, Dictionary<string, string>>>();
foreach (var playerStats in playerInfosOrdered)
Expand Down Expand Up @@ -199,9 +203,13 @@ public static Tuple<string,string> Copy(StatsSummary statsSummary, Skills skills
playerHolder["{hits_received}"] = FormatHelpers.Instance.FormatValue(skills.HitsReceived(playerStats.Source.User, entityInfo.Entity, timedEncounter));
playerHolder["{debuff_list}"] = String.Join(" | ",
bossDebuff.Where(x=>x.Key.Id!=8888888 && x.Value.InitialPlayerClass==playerStats.Source.Class && x.Value.Duration(firstTick,lastTick)>0).ToList().Select(
x=>x.Key.Name + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick,lastTick) / (lastTick - firstTick)) +
x=>x.Key.ShortName + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick,lastTick) / (lastTick - firstTick)) +
" ("+ TimeSpan.FromTicks(x.Value.Duration(firstTick, lastTick)).ToString(@"mm\:ss")+") ")
);
playerHolder["{debuff_list_p}"] = String.Join(" | ",
bossDebuff.Where(x => x.Key.Id != 8888888 && x.Value.InitialPlayerClass == playerStats.Source.Class && x.Value.Duration(firstTick, lastTick) > 0).ToList().Select(
x => x.Key.ShortName + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick, lastTick) / (lastTick - firstTick)))
);
}
var placeholderLength = placeholders.SelectMany(x => x.Value).GroupBy(x=>x.Key).ToDictionary(x=>x.Key,x=>x.Max(z=> graphics.MeasureString(z.Value, Font, default(PointF), StringFormat.GenericTypographic).Width));
var dpsmono = new StringBuilder(dpsString.ToString());
Expand All @@ -225,8 +233,16 @@ public static Tuple<string,string> Copy(StatsSummary statsSummary, Skills skills
});
dpsmono = dpsString;
}
dpsString.Append(footer);
dpsmono.Append(footer);
var footerstr=footer.Replace("{debuff_list}", String.Join(" | ",
bossDebuff.Where(x => x.Key.Id != 8888888 && x.Value.Duration(firstTick, lastTick) > 0).ToList().Select(
x => x.Key.ShortName + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick, lastTick) / (lastTick - firstTick)) +
" (" + TimeSpan.FromTicks(x.Value.Duration(firstTick, lastTick)).ToString(@"mm\:ss") + ") ")
)).Replace("{debuff_list_p}", String.Join(" | ",
bossDebuff.Where(x => x.Key.Id != 8888888 && x.Value.Duration(firstTick, lastTick) > 0).ToList().Select(
x => x.Key.ShortName + " " + FormatHelpers.Instance.FormatPercent((double)x.Value.Duration(firstTick, lastTick) / (lastTick - firstTick)))
));
dpsString.Append(footerstr);
dpsmono.Append(footerstr);
var paste = dpsString.ToString();
var monoPaste = dpsmono.ToString();
while (paste.Contains(" \\")) paste = paste.Replace(" \\", "\\");
Expand Down
2 changes: 1 addition & 1 deletion Lang/Resources/ru/events-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<abnormality ingame="false" trigger="Added" target="Self">
<abnormalities>
<abnormality>950068</abnormality>
<abnormality>950165</abnormality>
<abnormality>950179</abnormality>
</abnormalities>
<actions>
<notify>
Expand Down
2 changes: 1 addition & 1 deletion TeraCommon

0 comments on commit 299a989

Please sign in to comment.