Change a bunch of settings defaults, fix sprite looting key

This commit is contained in:
Treeco 2020-05-23 15:11:42 +01:00
parent b849f654c5
commit ec2ed4da2c
4 changed files with 16 additions and 9 deletions

View File

@ -1192,7 +1192,7 @@ impl<'a> Widget for SettingsWindow<'a> {
if let Some(new_val) = ImageSlider::discrete(
display_zoom,
1,
800,
300,
self.imgs.slider_indicator,
self.imgs.slider,
)

View File

@ -271,11 +271,6 @@ impl PlayState for SessionState {
}
} else {
self.inputs.secondary.set_state(state);
// Check for select_block that is highlighted
if let Some(select_pos) = self.scene.select_pos() {
client.collect_block(select_pos);
}
}
},
@ -391,6 +386,12 @@ impl PlayState for SessionState {
Event::InputUpdate(GameInput::Interact, state) => {
let mut client = self.client.borrow_mut();
// Collect terrain sprites
if let Some(select_pos) = self.scene.select_pos() {
client.collect_block(select_pos);
}
// Collect lootable entities
let player_pos = client
.state()
.read_storage::<comp::Pos>()

View File

@ -135,7 +135,7 @@ impl ControlSettings {
GameInput::ToggleIngameUi => KeyMouse::Key(VirtualKeyCode::F6),
GameInput::Roll => MIDDLE_CLICK_KEY,
GameInput::Respawn => KeyMouse::Key(VirtualKeyCode::Space),
GameInput::Interact => KeyMouse::Mouse(MouseButton::Right),
GameInput::Interact => KeyMouse::Key(VirtualKeyCode::E),
GameInput::ToggleWield => KeyMouse::Key(VirtualKeyCode::T),
//GameInput::Charge => KeyMouse::Key(VirtualKeyCode::Key1),
GameInput::FreeLook => KeyMouse::Key(VirtualKeyCode::L),
@ -568,7 +568,7 @@ impl Default for GraphicsSettings {
fn default() -> Self {
Self {
view_distance: 10,
sprite_render_distance: 250,
sprite_render_distance: 150,
figure_lod_render_distance: 250,
max_fps: 60,
fov: 50,

View File

@ -620,6 +620,12 @@ impl Window {
},
glutin::DeviceEvent::MouseWheel { delta, .. } if cursor_grabbed && *focused => {
events.push(Event::Zoom({
// Since scrolling apparently acts different depending on platform
#[cfg(target_os = "windows")]
const PLATFORM_FACTOR: f32 = -4.0;
#[cfg(not(target_os = "windows"))]
const PLATFORM_FACTOR: f32 = 1.0;
let y = match delta {
glutin::MouseScrollDelta::LineDelta(_x, y) => y,
// TODO: Check to see if there is a better way to find the "line
@ -629,7 +635,7 @@ impl Window {
// across operating systems.
glutin::MouseScrollDelta::PixelDelta(pos) => (pos.y / 16.0) as f32,
};
y * (zoom_sensitivity as f32 / 100.0) * zoom_inversion
y * (zoom_sensitivity as f32 / 100.0) * zoom_inversion * PLATFORM_FACTOR
}))
},
_ => {},