mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'imbris/fix-drag' into 'master'
Re-fix dragging and fix compilation of the server with the worldgen feature off Closes #588 See merge request veloren/veloren!1550
This commit is contained in:
@ -362,7 +362,10 @@ impl Server {
|
|||||||
let connection_handler = ConnectionHandler::new(network);
|
let connection_handler = ConnectionHandler::new(network);
|
||||||
|
|
||||||
// Initiate real-time world simulation
|
// Initiate real-time world simulation
|
||||||
|
#[cfg(feature = "worldgen")]
|
||||||
rtsim::init(&mut state, &world);
|
rtsim::init(&mut state, &world);
|
||||||
|
#[cfg(not(feature = "worldgen"))]
|
||||||
|
rtsim::init(&mut state);
|
||||||
|
|
||||||
let this = Self {
|
let this = Self {
|
||||||
state,
|
state,
|
||||||
@ -503,6 +506,7 @@ impl Server {
|
|||||||
dt,
|
dt,
|
||||||
|dispatcher_builder| {
|
|dispatcher_builder| {
|
||||||
sys::add_server_systems(dispatcher_builder);
|
sys::add_server_systems(dispatcher_builder);
|
||||||
|
#[cfg(feature = "worldgen")]
|
||||||
rtsim::add_server_systems(dispatcher_builder);
|
rtsim::add_server_systems(dispatcher_builder);
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
|
@ -82,8 +82,11 @@ pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) {
|
|||||||
dispatch_builder.add(tick::Sys, TICK_SYS, &[LOAD_CHUNK_SYS, UNLOAD_CHUNK_SYS]);
|
dispatch_builder.add(tick::Sys, TICK_SYS, &[LOAD_CHUNK_SYS, UNLOAD_CHUNK_SYS]);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(state: &mut State, world: &world::World) {
|
pub fn init(state: &mut State, #[cfg(feature = "worldgen")] world: &world::World) {
|
||||||
|
#[cfg(feature = "worldgen")]
|
||||||
let mut rtsim = RtSim::new(world.sim().get_size());
|
let mut rtsim = RtSim::new(world.sim().get_size());
|
||||||
|
#[cfg(not(feature = "worldgen"))]
|
||||||
|
let mut rtsim = RtSim::new(Vec2::new(40, 40));
|
||||||
|
|
||||||
for _ in 0..2500 {
|
for _ in 0..2500 {
|
||||||
let pos = rtsim
|
let pos = rtsim
|
||||||
|
@ -2628,6 +2628,9 @@ impl Hud {
|
|||||||
WinEvent::Moved(_) => {
|
WinEvent::Moved(_) => {
|
||||||
// Prevent the cursor from being grabbed while the window is being moved as this
|
// Prevent the cursor from being grabbed while the window is being moved as this
|
||||||
// causes the window to move erratically
|
// causes the window to move erratically
|
||||||
|
// TODO: this creates an issue where if you move the window then you need to
|
||||||
|
// close a menu to re-grab the mouse (and if one isn't already
|
||||||
|
// open you need to open and close a menu)
|
||||||
self.show.want_grab = false;
|
self.show.want_grab = false;
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
|
@ -941,6 +941,10 @@ impl Window {
|
|||||||
self.scale_factor = scale_factor;
|
self.scale_factor = scale_factor;
|
||||||
self.events.push(Event::ScaleFactorChanged(scale_factor));
|
self.events.push(Event::ScaleFactorChanged(scale_factor));
|
||||||
},
|
},
|
||||||
|
WindowEvent::Moved(winit::dpi::PhysicalPosition { x, y }) => {
|
||||||
|
self.events
|
||||||
|
.push(Event::Moved(Vec2::new(x as u32, y as u32)));
|
||||||
|
},
|
||||||
WindowEvent::ReceivedCharacter(c) => self.events.push(Event::Char(c)),
|
WindowEvent::ReceivedCharacter(c) => self.events.push(Event::Char(c)),
|
||||||
WindowEvent::MouseInput { button, state, .. } => {
|
WindowEvent::MouseInput { button, state, .. } => {
|
||||||
if let (true, Some(game_inputs)) =
|
if let (true, Some(game_inputs)) =
|
||||||
|
Reference in New Issue
Block a user