From ece53430a171d7b5cc3cfd2da52c51f5912d3f7a Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sun, 15 Sep 2019 10:28:10 -0700 Subject: [PATCH] point out the A and B in the a/b test menu --- game/src/abtest/mod.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/game/src/abtest/mod.rs b/game/src/abtest/mod.rs index 86be800c12..e0b6c91c08 100644 --- a/game/src/abtest/mod.rs +++ b/game/src/abtest/mod.rs @@ -24,6 +24,7 @@ pub struct ABTestMode { diff_all: Option, common: CommonState, test_name: String, + flipped: bool, } impl ABTestMode { @@ -69,6 +70,7 @@ impl ABTestMode { diff_all: None, common: CommonState::new(), test_name: test_name.to_string(), + flipped: false, } } } @@ -76,7 +78,15 @@ impl ABTestMode { impl State for ABTestMode { fn event(&mut self, ctx: &mut EventCtx, ui: &mut UI) -> Transition { let mut txt = Text::prompt("A/B Test Mode"); - txt.add(Line(&ui.primary.map.get_edits().edits_name)); + if self.flipped { + txt.add(Line("B").fg(Color::CYAN)); + } else { + txt.add(Line("A").fg(Color::RED)); + } + txt.append(Line(format!( + " - {}", + ui.primary.map.get_edits().edits_name + ))); if let Some(ref diff) = self.diff_trip { txt.add(Line(format!("Showing diff for {}", diff.trip))); } else if let Some(ref diff) = self.diff_all { @@ -112,6 +122,7 @@ impl State for ABTestMode { &mut self.primary_agent_tools, &mut self.secondary_agent_tools, ); + self.flipped = !self.flipped; } if self.menu.action("scoreboard") {