mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add 1st and 2nd item of inventory in hotbar
This commit is contained in:
parent
bc7f0731fc
commit
df7793549c
@ -16,7 +16,18 @@ pub struct CharacterProfile {
|
||||
impl Default for CharacterProfile {
|
||||
fn default() -> Self {
|
||||
CharacterProfile {
|
||||
hotbar_slots: [None; 10],
|
||||
hotbar_slots: [
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
Some(hud::HotbarSlotContents::Inventory(0)),
|
||||
Some(hud::HotbarSlotContents::Inventory(1)),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -183,13 +194,35 @@ mod tests {
|
||||
fn test_get_slots_with_empty_profile() {
|
||||
let mut profile = Profile::default();
|
||||
let slots = profile.get_hotbar_slots("TestServer", 12345);
|
||||
assert_eq!(slots, [None; 10])
|
||||
assert_eq!(slots, [
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
Some(hud::HotbarSlotContents::Inventory(0)),
|
||||
Some(hud::HotbarSlotContents::Inventory(1)),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
])
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_set_slots_with_empty_profile() {
|
||||
let mut profile = Profile::default();
|
||||
let slots = [None; 10];
|
||||
let slots = [
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
Some(hud::HotbarSlotContents::Inventory(0)),
|
||||
Some(hud::HotbarSlotContents::Inventory(1)),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
];
|
||||
profile.set_hotbar_slots("TestServer", 12345, slots);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user