You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
536 B

use libpso::packet::login::{ShipList, ShipListEntry};
use libpso::utf8_to_utf16_array;
use networking::interserver::Ship;
pub const SHIP_MENU_ID: u32 = 1;
pub fn ship_list(ships: &[Ship]) -> ShipList {
let ships = ships.iter()
.enumerate()
.map(|(i, ship)| {
ShipListEntry {
menu: SHIP_MENU_ID,
item: i as u32,
flags: 0,
name: utf8_to_utf16_array!(ship.name, 0x11)
}
})
.collect();
ShipList::new(ships)
}