Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed property typos, KeyCode typo. #857

Merged
merged 2 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/bevy_input/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub enum KeyCode {
NumpadAdd,
Apostrophe,
Apps,
Asterix,
Asterisk,
Plus,
At,
Ax,
Expand Down
7 changes: 4 additions & 3 deletions crates/bevy_property/src/type_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{any::TypeId, fmt};
pub struct PropertyTypeRegistry {
registrations: HashMap<String, PropertyTypeRegistration>,
short_names: HashMap<String, String>,
ambigous_names: HashSet<String>,
ambiguous_names: HashSet<String>,
}

impl PropertyTypeRegistry {
Expand All @@ -20,10 +20,11 @@ impl PropertyTypeRegistry {

fn add_registration(&mut self, registration: PropertyTypeRegistration) {
let short_name = registration.short_name.to_string();
if self.short_names.contains_key(&short_name) || self.ambigous_names.contains(&short_name) {
if self.short_names.contains_key(&short_name) || self.ambiguous_names.contains(&short_name)
{
// name is ambiguous. fall back to long names for all ambiguous types
self.short_names.remove(&short_name);
self.ambigous_names.insert(short_name);
self.ambiguous_names.insert(short_name);
} else {
self.short_names
.insert(short_name, registration.name.to_string());
Expand Down
9 changes: 5 additions & 4 deletions crates/bevy_type_registry/src/type_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct ComponentRegistry {
pub registrations: HashMap<TypeId, ComponentRegistration>,
pub short_names: HashMap<String, TypeId>,
pub full_names: HashMap<String, TypeId>,
pub ambigous_names: HashSet<String>,
pub ambiguous_names: HashSet<String>,
}

impl ComponentRegistry {
Expand All @@ -35,10 +35,11 @@ impl ComponentRegistry {
let short_name = registration.short_name.to_string();
self.full_names
.insert(registration.long_name.to_string(), registration.ty);
if self.short_names.contains_key(&short_name) || self.ambigous_names.contains(&short_name) {
if self.short_names.contains_key(&short_name) || self.ambiguous_names.contains(&short_name)
{
// name is ambiguous. fall back to long names for all ambiguous types
self.short_names.remove(&short_name);
self.ambigous_names.insert(short_name);
self.ambiguous_names.insert(short_name);
} else {
self.short_names.insert(short_name, registration.ty);
}
Expand All @@ -65,7 +66,7 @@ impl ComponentRegistry {
let mut registration = self.get_with_short_name(type_name);
if registration.is_none() {
registration = self.get_with_full_name(type_name);
if registration.is_none() && self.ambigous_names.contains(type_name) {
if registration.is_none() && self.ambiguous_names.contains(type_name) {
panic!("Type name is ambiguous: {}", type_name);
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_wgpu/src/wgpu_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct WgpuRenderer {
pub queue: wgpu::Queue,
pub window_resized_event_reader: EventReader<WindowResized>,
pub window_created_event_reader: EventReader<WindowCreated>,
pub intialized: bool,
pub initialized: bool,
}

impl WgpuRenderer {
Expand Down Expand Up @@ -59,7 +59,7 @@ impl WgpuRenderer {
queue,
window_resized_event_reader: Default::default(),
window_created_event_reader: Default::default(),
intialized: false,
initialized: false,
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_winit/src/converters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub fn convert_virtual_key_code(virtual_key_code: winit::event::VirtualKeyCode)
winit::event::VirtualKeyCode::NumpadAdd => KeyCode::NumpadAdd,
winit::event::VirtualKeyCode::Apostrophe => KeyCode::Apostrophe,
winit::event::VirtualKeyCode::Apps => KeyCode::Apps,
winit::event::VirtualKeyCode::Asterisk => KeyCode::Asterix,
winit::event::VirtualKeyCode::Asterisk => KeyCode::Asterisk,
winit::event::VirtualKeyCode::Plus => KeyCode::Plus,
winit::event::VirtualKeyCode::At => KeyCode::At,
winit::event::VirtualKeyCode::Ax => KeyCode::Ax,
Expand Down