From bd6b1df6410957bd4cea36435a44492e14aea9d1 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Sat, 25 May 2019 14:53:44 +0200 Subject: [PATCH] Use type MouseButton instead of glutin::MouseButton Former-commit-id: 7fc8b2f3f42ed45455feaa4a36e225a981b768ac --- voxygen/src/main.rs | 1 + voxygen/src/window.rs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index f48ea71175..f81f17c803 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -1,4 +1,5 @@ #![feature(drain_filter)] +#![feature(type_alias_enum_variants)] #![recursion_limit = "2048"] #[macro_use] diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 75d33916d2..f0dd30aafb 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -3,10 +3,12 @@ use crate::{ settings::Settings, ui, Error, }; -use glutin::{ElementState, MouseButton}; use std::collections::HashMap; use vek::*; +pub type MouseButton = glutin::MouseButton; +pub type ElementState = glutin::ElementState; + pub struct Window { events_loop: glutin::EventsLoop, renderer: Renderer, @@ -126,7 +128,7 @@ impl Window { } glutin::WindowEvent::ReceivedCharacter(c) => events.push(Event::Char(c)), glutin::WindowEvent::MouseInput { button, state, .. } - if cursor_grabbed && state == ElementState::Pressed => + if cursor_grabbed && state == glutin::ElementState::Pressed => { events.push(Event::Click(button, state)) }