mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-27 16:36:02 +03:00
fix the sim score plugin
This commit is contained in:
parent
0cbc2e5d7e
commit
3c710c2e8a
@ -105,8 +105,10 @@ impl GUI<RenderingHints> for UI {
|
||||
if let Some(p) = self.get_active_plugin() {
|
||||
p.draw(g, &mut ctx);
|
||||
} else {
|
||||
// If no other mode was active, give the ambient plugins in ViewMode a chance.
|
||||
// If no other mode was active, give the ambient plugins in ViewMode and SimMode a
|
||||
// chance.
|
||||
self.primary_plugins.view_mode().draw(g, &mut ctx);
|
||||
self.plugins.sim_mode().draw(g, &mut ctx);
|
||||
}
|
||||
|
||||
self.canvas.draw_text(g, hints.osd, BOTTOM_LEFT);
|
||||
@ -216,6 +218,10 @@ impl PluginsPerUI {
|
||||
fn edit_mode(&self) -> &EditMode {
|
||||
self.list[0].downcast_ref::<EditMode>().unwrap()
|
||||
}
|
||||
|
||||
fn sim_mode(&self) -> &Box<Plugin> {
|
||||
&self.list[1]
|
||||
}
|
||||
}
|
||||
|
||||
impl UI {
|
||||
|
@ -40,7 +40,7 @@ impl LogScroller {
|
||||
pub fn event(&mut self, input: &mut UserInput) -> bool {
|
||||
let ev = input.use_event_directly().clone();
|
||||
|
||||
if let Some(Button::Keyboard(Key::Escape)) = ev.press_args() {
|
||||
if let Some(Button::Keyboard(Key::Return)) = ev.press_args() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ pub const LINE_HEIGHT: f64 = 22.0;
|
||||
// TODO Totally made up. Should query the font or something.
|
||||
const MAX_CHAR_WIDTH: f64 = 25.0;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Debug, Clone)]
|
||||
struct TextSpan {
|
||||
text: String,
|
||||
fg_color: Color,
|
||||
@ -35,7 +35,7 @@ impl TextSpan {
|
||||
}
|
||||
|
||||
// TODO parse style from markup tags
|
||||
#[derive(Clone)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Text {
|
||||
lines: Vec<Vec<TextSpan>>,
|
||||
bg_color: Color,
|
||||
|
Loading…
Reference in New Issue
Block a user