Compare commits
No commits in common. "552f7d57741a5e62f76e7083c0fc99a7c21e23f1" and "240ddc7e8436ea7eaed40f3ed13d7cdf61f76e29" have entirely different histories.
552f7d5774
...
240ddc7e84
@ -689,7 +689,6 @@ fn pso_packet_data_enum<'a>(name: syn::Ident, repr_type: syn::Ident, variants: i
|
|||||||
.clone()
|
.clone()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, variant)| {
|
.map(|(i, variant)| {
|
||||||
let variant = &variant.ident;
|
|
||||||
quote! {
|
quote! {
|
||||||
#i => #name::#variant,
|
#i => #name::#variant,
|
||||||
}
|
}
|
||||||
@ -699,7 +698,6 @@ fn pso_packet_data_enum<'a>(name: syn::Ident, repr_type: syn::Ident, variants: i
|
|||||||
let variant_to_value = variants
|
let variant_to_value = variants
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, variant)| {
|
.map(|(i, variant)| {
|
||||||
let variant = &variant.ident;
|
|
||||||
quote! {
|
quote! {
|
||||||
#name::#variant => #repr_type::to_le_bytes(#i as #repr_type).to_vec(),
|
#name::#variant => #repr_type::to_le_bytes(#i as #repr_type).to_vec(),
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,8 @@ use serde::{Serialize, Deserialize};
|
|||||||
|
|
||||||
|
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(PSOPacketData, Default, Debug, Copy, Clone, Hash, PartialEq, Eq, strum::Display, strum::EnumString, Serialize, Deserialize)]
|
#[derive(PSOPacketData, Debug, Copy, Clone, Hash, PartialEq, Eq, strum::Display, strum::EnumString, Serialize, Deserialize)]
|
||||||
pub enum CharacterClass {
|
pub enum CharacterClass {
|
||||||
#[default]
|
|
||||||
HUmar,
|
HUmar,
|
||||||
HUnewearl,
|
HUnewearl,
|
||||||
HUcast,
|
HUcast,
|
||||||
@ -22,6 +21,12 @@ pub enum CharacterClass {
|
|||||||
FOnewearl,
|
FOnewearl,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for CharacterClass {
|
||||||
|
fn default() -> CharacterClass {
|
||||||
|
CharacterClass::HUmar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: TryFrom
|
// TODO: TryFrom
|
||||||
impl std::convert::From<u8> for CharacterClass {
|
impl std::convert::From<u8> for CharacterClass {
|
||||||
fn from(f: u8) -> CharacterClass {
|
fn from(f: u8) -> CharacterClass {
|
||||||
@ -91,9 +96,8 @@ impl CharacterClass {
|
|||||||
|
|
||||||
|
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(PSOPacketData, Default, Debug, Copy, Clone, Hash, PartialEq, Eq, strum::Display, strum::EnumString, Serialize, Deserialize)]
|
#[derive(PSOPacketData, Debug, Copy, Clone, Hash, PartialEq, Eq, strum::Display, strum::EnumString, Serialize, Deserialize)]
|
||||||
pub enum SectionID {
|
pub enum SectionID {
|
||||||
#[default]
|
|
||||||
Viridia,
|
Viridia,
|
||||||
Greenill,
|
Greenill,
|
||||||
Skyly,
|
Skyly,
|
||||||
@ -106,6 +110,12 @@ pub enum SectionID {
|
|||||||
Whitill,
|
Whitill,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for SectionID {
|
||||||
|
fn default() -> SectionID {
|
||||||
|
SectionID::Viridia
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: TryFrom
|
// TODO: TryFrom
|
||||||
impl From<u8> for SectionID {
|
impl From<u8> for SectionID {
|
||||||
fn from(id: u8) -> SectionID {
|
fn from(id: u8) -> SectionID {
|
||||||
|
@ -489,7 +489,7 @@ impl ShipList {
|
|||||||
pub fn new(ships: Vec<ShipListEntry>) -> ShipList {
|
pub fn new(ships: Vec<ShipListEntry>) -> ShipList {
|
||||||
ShipList {
|
ShipList {
|
||||||
baseship: ShipListEntry {
|
baseship: ShipListEntry {
|
||||||
menu: ships.first().map(|s| s.menu).unwrap_or(0),
|
menu: ships.get(0).map(|s| s.menu).unwrap_or(0),
|
||||||
item: 0,
|
item: 0,
|
||||||
flags: 0,
|
flags: 0,
|
||||||
name: utf8_to_utf16_array("Ship"),
|
name: utf8_to_utf16_array("Ship"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user