Skip to main content

ed_journals/modules/logs/content/log_event_content/
loadout_event.rs

1//! Fired when there are updates to the player's ship modules.
2
3use serde::{Deserialize, Serialize};
4
5use crate::modules::ship::{ShipModule, ShipSlot, ShipType};
6
7/// Fired when there are updates to the player's ship modules.
8#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
9#[serde(rename_all = "PascalCase")]
10pub struct LoadoutEvent {
11    /// The current active ship.
12    pub ship: ShipType,
13
14    /// The current active ship id.
15    #[serde(rename = "ShipID")]
16    pub ship_id: u32,
17
18    /// The name of the current active ship.
19    pub ship_name: String,
20
21    /// The name of the current call-sign.
22    pub ship_ident: String,
23
24    /// List of current modules.
25    pub modules: Vec<LoadoutEventModule>,
26}
27
28/// An active loadout module.
29#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
30#[serde(rename_all = "PascalCase")]
31pub struct LoadoutEventModule {
32    /// The slot the module is assigned to.
33    pub slot: ShipSlot,
34
35    /// The assigned module.
36    pub item: ShipModule,
37
38    /// Whether the module is currently active.
39    pub on: bool,
40
41    /// The power priority.
42    pub priority: u8,
43
44    /// The current health for the module.
45    pub health: f32,
46
47    // TODO check when this value is used
48    pub value: Option<u32>,
49    pub ammo_in_clip: Option<u32>,
50}