mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Clean comments, fix mistake, change dep source now that compatible version is available on crates.io
This commit is contained in:
parent
5e8d74e00e
commit
7dfb24d4a5
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -2779,7 +2779,8 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "old_school_gfx_glutin_ext"
|
name = "old_school_gfx_glutin_ext"
|
||||||
version = "0.23.0"
|
version = "0.23.0"
|
||||||
source = "git+https://github.com/Imberflur/old-school-gfx-glutin-ext.git#e128e187a81d1fa15409db38bc93e6677fc09288"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a7cf32ddfed46b511150abb23d3193d38ec71ffafa561e6c2d82ad06eb51072e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gfx_core",
|
"gfx_core",
|
||||||
"gfx_device_gl",
|
"gfx_device_gl",
|
||||||
|
@ -25,7 +25,7 @@ anim = { package = "veloren-voxygen-anim", path = "src/anim", default-features =
|
|||||||
# Graphics
|
# Graphics
|
||||||
gfx = "0.18.2"
|
gfx = "0.18.2"
|
||||||
gfx_device_gl = { version = "0.16.2", optional = true }
|
gfx_device_gl = { version = "0.16.2", optional = true }
|
||||||
old_school_gfx_glutin_ext = { git = "https://github.com/Imberflur/old-school-gfx-glutin-ext.git" }
|
old_school_gfx_glutin_ext = "0.23"
|
||||||
glutin = "0.23.0"
|
glutin = "0.23.0"
|
||||||
winit = { version = "0.21.0", features = ["serde"] }
|
winit = { version = "0.21.0", features = ["serde"] }
|
||||||
conrod_core = { git = "https://gitlab.com/veloren/conrod.git" }
|
conrod_core = { git = "https://gitlab.com/veloren/conrod.git" }
|
||||||
|
@ -63,6 +63,7 @@ impl GlobalState {
|
|||||||
pub fn maintain(&mut self, dt: f32) { self.audio.maintain(dt); }
|
pub fn maintain(&mut self, dt: f32) { self.audio.maintain(dt); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: appears to be currently unused by playstates
|
||||||
pub enum Direction {
|
pub enum Direction {
|
||||||
Forwards,
|
Forwards,
|
||||||
Backwards,
|
Backwards,
|
||||||
@ -86,7 +87,6 @@ pub enum PlayStateResult {
|
|||||||
/// A trait representing a playable game state. This may be a menu, a game
|
/// A trait representing a playable game state. This may be a menu, a game
|
||||||
/// session, the title screen, etc.
|
/// session, the title screen, etc.
|
||||||
pub trait PlayState {
|
pub trait PlayState {
|
||||||
/// Get a descriptive name for this state type.
|
|
||||||
/// Called when entering this play state from another
|
/// Called when entering this play state from another
|
||||||
fn enter(&mut self, global_state: &mut GlobalState, direction: Direction);
|
fn enter(&mut self, global_state: &mut GlobalState, direction: Direction);
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ use veloren_voxygen::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use common::{
|
use common::{
|
||||||
assets::{load_watched, watch},
|
assets::{load, load_expect, load_watched, watch},
|
||||||
clock::Clock,
|
clock::Clock,
|
||||||
};
|
};
|
||||||
use std::panic;
|
use std::panic;
|
||||||
|
@ -73,7 +73,7 @@ pub fn run(mut global_state: GlobalState, event_loop: EventLoop) {
|
|||||||
global_state.on_play_state_changed();
|
global_state.on_play_state_changed();
|
||||||
});
|
});
|
||||||
states.last_mut().map(|new_state| {
|
states.last_mut().map(|new_state| {
|
||||||
new_state.enter(&mut global_state, Direction::Forwards);
|
new_state.enter(&mut global_state, Direction::Backwards);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
PlayStateResult::Push(mut new_state) => {
|
PlayStateResult::Push(mut new_state) => {
|
||||||
@ -115,17 +115,7 @@ pub fn run(mut global_state: GlobalState, event_loop: EventLoop) {
|
|||||||
.swap_buffers()
|
.swap_buffers()
|
||||||
.expect("Failed to swap window buffers!");
|
.expect("Failed to swap window buffers!");
|
||||||
}
|
}
|
||||||
//global_state.window.request_redraw();
|
|
||||||
},
|
},
|
||||||
/*winit::event::Event::WindowEvent {
|
|
||||||
event: WindowEvent::RedrawRequested,
|
|
||||||
..
|
|
||||||
} => {
|
|
||||||
// render here
|
|
||||||
}
|
|
||||||
..
|
|
||||||
*control_flow = ControlFlow::Exit;
|
|
||||||
}*/
|
|
||||||
winit::event::Event::WindowEvent { event, .. } => global_state
|
winit::event::Event::WindowEvent { event, .. } => global_state
|
||||||
.window
|
.window
|
||||||
.handle_window_event(event, &mut global_state.settings),
|
.handle_window_event(event, &mut global_state.settings),
|
||||||
|
@ -705,7 +705,6 @@ impl PlayState for SessionState {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: dont
|
|
||||||
// Look for changes in the localization files
|
// Look for changes in the localization files
|
||||||
if global_state.localization_watcher.reloaded() {
|
if global_state.localization_watcher.reloaded() {
|
||||||
hud_events.push(HudEvent::ChangeLanguage(self.voxygen_i18n.metadata.clone()));
|
hud_events.push(HudEvent::ChangeLanguage(self.voxygen_i18n.metadata.clone()));
|
||||||
|
Loading…
Reference in New Issue
Block a user