mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix char selection not showing tools
This commit is contained in:
parent
6fd3339b75
commit
6fe5c5724c
@ -28,7 +28,7 @@ impl CharacterBehavior for Data {
|
||||
fn behavior(&self, data: &JoinData) -> StateUpdate {
|
||||
let mut update = StateUpdate::from(data);
|
||||
|
||||
handle_move(data, &mut update, 0.2);
|
||||
handle_move(data, &mut update, 0.3);
|
||||
handle_jump(data, &mut update);
|
||||
|
||||
if self.prepare_timer < self.prepare_duration
|
||||
|
@ -117,7 +117,7 @@ impl PlayState for CharSelectionState {
|
||||
global_state.window.renderer_mut(),
|
||||
self.client.borrow().get_tick(),
|
||||
humanoid_body.clone(),
|
||||
loadout,
|
||||
loadout.as_ref(),
|
||||
);
|
||||
|
||||
// Draw the UI to the screen.
|
||||
|
@ -333,9 +333,31 @@ impl CharSelectionUi {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_loadout(&mut self) -> Option<&comp::Loadout> {
|
||||
pub fn get_loadout(&mut self) -> Option<comp::Loadout> {
|
||||
match &mut self.mode {
|
||||
Mode::Select(_) => None,
|
||||
Mode::Select(characterdata) => {
|
||||
let loadout = comp::Loadout {
|
||||
active_item: characterdata
|
||||
.as_ref()
|
||||
.and_then(|d| d.tool.as_ref())
|
||||
.map(|tool| comp::ItemConfig {
|
||||
item: (*load_expect::<comp::Item>(&tool)).clone(),
|
||||
ability1: None,
|
||||
ability2: None,
|
||||
ability3: None,
|
||||
block_ability: None,
|
||||
dodge_ability: None,
|
||||
}),
|
||||
second_item: None,
|
||||
shoulder: None,
|
||||
chest: None,
|
||||
belt: None,
|
||||
hand: None,
|
||||
pants: None,
|
||||
foot: None,
|
||||
};
|
||||
Some(loadout)
|
||||
},
|
||||
Mode::Create { loadout, tool, .. } => {
|
||||
loadout.active_item = tool.map(|tool| comp::ItemConfig {
|
||||
item: (*load_expect::<comp::Item>(tool)).clone(),
|
||||
@ -345,7 +367,7 @@ impl CharSelectionUi {
|
||||
block_ability: None,
|
||||
dodge_ability: None,
|
||||
});
|
||||
Some(loadout)
|
||||
Some(loadout.clone())
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user