From f2f2582d546327be9e0254dea8370a9bb6b749f7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 12 May 2020 13:45:06 +0200 Subject: display if a fight had CM activated --- src/main.rs | 3 +++ src/output/formats.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index bf4c472..74fcf7f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,6 +139,8 @@ pub struct LogResult { players: Vec, /// The outcome of the fight. outcome: FightOutcome, + /// Whether the fight had the Challenge Mote turned on. + is_cm: bool, } /// A player. @@ -495,6 +497,7 @@ fn extract_info(entry: &DirEntry, log: &Log) -> LogResult { boss_name, players, outcome: get_fight_outcome(log), + is_cm: log.is_cm(), } } diff --git a/src/output/formats.rs b/src/output/formats.rs index 599e804..203502a 100644 --- a/src/output/formats.rs +++ b/src/output/formats.rs @@ -36,13 +36,14 @@ impl Format for HumanReadable { }; writeln!( result, - "{}: {} - {}: {} {}", + "{}: {} - {}: {}{} {}", "Date".green(), item.time .with_timezone(&Local) .format("%Y-%m-%d %H:%M:%S %a"), "Boss".green(), item.boss_name, + if item.is_cm { " CM" } else { "" }, outcome, ) .unwrap(); -- cgit v1.2.3