From 4bcd58f563d0122d9a2d69b79b749e77c26a5803 Mon Sep 17 00:00:00 2001 From: Bjorn Date: Sun, 5 May 2024 21:50:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20localised=20to=20locali?= =?UTF-8?q?zed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/journal_event_content/backpack_event.rs | 2 +- .../models/journal_event_content/buy_suit_event.rs | 2 +- .../journal_event_content/codex_entry_event.rs | 8 ++++---- .../create_suit_loadout_event.rs | 4 ++-- .../models/journal_event_content/dock_srv_event.rs | 2 +- .../fss_signal_discovered_event.rs | 2 +- .../journal_event_content/launch_srv_event.rs | 2 +- .../models/journal_event_content/loadout_event.rs | 9 ++++++--- .../models/journal_event_content/location_event.rs | 4 ++-- .../models/journal_event_content/missions_event.rs | 6 ++++-- .../journal_event_content/module_store_event.rs | 2 +- .../shared/civilization/faction.rs | 2 +- .../journal_event_content/ship_targeted_event.rs | 14 +++++++------- .../journal_event_content/stored_modules_event.rs | 2 +- .../journal_event_content/stored_ships_event.rs | 4 ++-- .../journal_event_content/suit_loadout_event.rs | 4 ++-- .../supercruise_destination_drop_event.rs | 2 +- .../switch_suit_loadout_event.rs | 4 ++-- .../models/journal_event_content/uss_drop_event.rs | 2 +- 19 files changed, 41 insertions(+), 36 deletions(-) diff --git a/ed-journals/src/models/journal_event_content/backpack_event.rs b/ed-journals/src/models/journal_event_content/backpack_event.rs index e601a9db..2364ef52 100644 --- a/ed-journals/src/models/journal_event_content/backpack_event.rs +++ b/ed-journals/src/models/journal_event_content/backpack_event.rs @@ -18,7 +18,7 @@ pub struct BackpackEventObject { pub name: Item, #[serde(rename = "Name_Localised")] - pub name_localised: String, + pub name_localized: String, #[serde(rename = "OwnerID")] pub owner_id: u64, diff --git a/ed-journals/src/models/journal_event_content/buy_suit_event.rs b/ed-journals/src/models/journal_event_content/buy_suit_event.rs index f42e2035..cd3fea05 100644 --- a/ed-journals/src/models/journal_event_content/buy_suit_event.rs +++ b/ed-journals/src/models/journal_event_content/buy_suit_event.rs @@ -9,7 +9,7 @@ pub struct BuySuitEvent { pub name: Suit, #[serde(rename = "Name_Localised")] - pub name_localised: String, + pub name_localized: String, pub price: u64, #[serde(rename = "SuitID")] diff --git a/ed-journals/src/models/journal_event_content/codex_entry_event.rs b/ed-journals/src/models/journal_event_content/codex_entry_event.rs index bcab6601..f7bdfaab 100644 --- a/ed-journals/src/models/journal_event_content/codex_entry_event.rs +++ b/ed-journals/src/models/journal_event_content/codex_entry_event.rs @@ -11,19 +11,19 @@ pub struct CodexEntryEvent { pub name: CodexEntry, #[serde(rename = "Name_Localised")] - pub name_localised: String, + pub name_localized: String, pub category: CodexEntryEventCategory, #[serde(rename = "Category_Localised")] - pub category_localised: String, + pub category_localized: String, pub sub_category: CodexEntryEventSubcategory, #[serde(rename = "SubCategory_Localised")] - pub sub_category_localised: String, + pub sub_category_localized: String, pub region: Region, #[serde(rename = "Region_Localised")] - pub region_localised: String, + pub region_localized: String, pub system: String, pub system_address: u64, diff --git a/ed-journals/src/models/journal_event_content/create_suit_loadout_event.rs b/ed-journals/src/models/journal_event_content/create_suit_loadout_event.rs index a25b1f57..1524e42c 100644 --- a/ed-journals/src/models/journal_event_content/create_suit_loadout_event.rs +++ b/ed-journals/src/models/journal_event_content/create_suit_loadout_event.rs @@ -10,7 +10,7 @@ pub struct CreateSuitLoadoutEvent { pub suit_name: Suit, #[serde(rename = "SuitName_Localised")] - pub suit_name_localised: String, + pub suit_name_localized: String, pub suit_mods: Vec, #[serde(rename = "LoadoutID")] @@ -38,7 +38,7 @@ pub struct CreateSuitLoadoutEventModule { pub module_name: String, #[serde(rename = "ModuleName_Localised")] - pub module_name_localised: String, + pub module_name_localized: String, pub class: u8, pub weapon_mods: Vec, } diff --git a/ed-journals/src/models/journal_event_content/dock_srv_event.rs b/ed-journals/src/models/journal_event_content/dock_srv_event.rs index d7ef83c9..88804276 100644 --- a/ed-journals/src/models/journal_event_content/dock_srv_event.rs +++ b/ed-journals/src/models/journal_event_content/dock_srv_event.rs @@ -8,7 +8,7 @@ pub struct DockSRVEvent { pub srv_type: SRVType, #[serde(rename = "SRVType_Localised")] - pub srv_type_localised: String, + pub srv_type_localized: String, #[serde(rename = "ID")] pub id: u8, diff --git a/ed-journals/src/models/journal_event_content/fss_signal_discovered_event.rs b/ed-journals/src/models/journal_event_content/fss_signal_discovered_event.rs index 410af45b..ab18b34a 100644 --- a/ed-journals/src/models/journal_event_content/fss_signal_discovered_event.rs +++ b/ed-journals/src/models/journal_event_content/fss_signal_discovered_event.rs @@ -7,7 +7,7 @@ pub struct FSSSignalDiscoveredEvent { pub signal_name: String, #[serde(rename = "SignalName_Localised")] - pub signal_name_localised: Option, + pub signal_name_localized: Option, #[serde(default)] pub is_station: bool, diff --git a/ed-journals/src/models/journal_event_content/launch_srv_event.rs b/ed-journals/src/models/journal_event_content/launch_srv_event.rs index 1d10d218..23a967eb 100644 --- a/ed-journals/src/models/journal_event_content/launch_srv_event.rs +++ b/ed-journals/src/models/journal_event_content/launch_srv_event.rs @@ -9,7 +9,7 @@ pub struct LaunchSRVEvent { pub srv_type: SRVType, #[serde(rename = "SRVType_Localised")] - pub srv_type_localised: String, + pub srv_type_localized: String, // TODO check if this can be replaced with an enum pub loadout: String, diff --git a/ed-journals/src/models/journal_event_content/loadout_event.rs b/ed-journals/src/models/journal_event_content/loadout_event.rs index e034f7d1..bcdc1d2f 100644 --- a/ed-journals/src/models/journal_event_content/loadout_event.rs +++ b/ed-journals/src/models/journal_event_content/loadout_event.rs @@ -1,9 +1,12 @@ use serde::Deserialize; +use crate::journal_event_content::shared::ship::ship_module::ShipModule; +use crate::journal_event_content::shared::ship::ship_slot::ShipSlot; +use crate::journal_event_content::shared::ship::ship_type::ShipType; #[derive(Debug, Deserialize, Clone, PartialEq)] #[serde(rename_all = "PascalCase")] pub struct LoadoutEvent { - pub ship: String, + pub ship: ShipType, #[serde(rename = "ShipID")] pub ship_id: u32, @@ -15,8 +18,8 @@ pub struct LoadoutEvent { #[derive(Debug, Deserialize, Clone, PartialEq)] #[serde(rename_all = "PascalCase")] pub struct LoadoutModule { - pub slot: String, - pub item: String, + pub slot: ShipSlot, + pub item: ShipModule, pub on: bool, pub priority: u8, pub health: f32, diff --git a/ed-journals/src/models/journal_event_content/location_event.rs b/ed-journals/src/models/journal_event_content/location_event.rs index 82ad0883..385f201f 100644 --- a/ed-journals/src/models/journal_event_content/location_event.rs +++ b/ed-journals/src/models/journal_event_content/location_event.rs @@ -31,7 +31,7 @@ pub struct LocationEventStationEconomy { pub name: String, #[serde(rename = "Name_Localised")] - pub name_localised: String, + pub name_localized: String, pub proportion: f32, } @@ -46,7 +46,7 @@ pub struct LocationEventFaction { pub happiness: String, #[serde(rename = "Happiness_Localised")] - pub happiness_localised: String, + pub happiness_localized: String, pub my_reputation: f32, #[serde(default)] diff --git a/ed-journals/src/models/journal_event_content/missions_event.rs b/ed-journals/src/models/journal_event_content/missions_event.rs index b10cf120..cd311238 100644 --- a/ed-journals/src/models/journal_event_content/missions_event.rs +++ b/ed-journals/src/models/journal_event_content/missions_event.rs @@ -1,4 +1,5 @@ use serde::Deserialize; +use crate::journal_event_content::shared::station::mission_type::MissionType; #[derive(Debug, Deserialize, Clone, PartialEq)] #[serde(rename_all = "PascalCase")] @@ -13,7 +14,7 @@ pub struct MissionsEvent { pub struct MissionEventEntry { #[serde(rename = "MissionID")] pub mission_id: u32, - pub name: String, + pub name: MissionType, pub passenger_mission: bool, pub expires: u32, } @@ -22,6 +23,7 @@ pub struct MissionEventEntry { mod tests { use crate::models::journal_event_content::missions_event::{MissionEventEntry, MissionsEvent}; use serde_json::json; + use crate::journal_event_content::shared::station::mission_type::MissionType; #[test] fn mission_event_is_parsed_correctly() { @@ -42,7 +44,7 @@ mod tests { let expected = MissionsEvent { active: vec![MissionEventEntry { mission_id: 65380900, - name: "Mission_Courier_name".to_string(), + name: MissionType::DataCourier, passenger_mission: false, expires: 82751, }], diff --git a/ed-journals/src/models/journal_event_content/module_store_event.rs b/ed-journals/src/models/journal_event_content/module_store_event.rs index 32b1ad12..2bb4b743 100644 --- a/ed-journals/src/models/journal_event_content/module_store_event.rs +++ b/ed-journals/src/models/journal_event_content/module_store_event.rs @@ -13,7 +13,7 @@ pub struct ModuleStoreEvent { pub stored_item: ShipModule, #[serde(rename = "StoredItem_Localised")] - pub stored_item_localised: String, + pub stored_item_localized: String, pub ship: ShipType, #[serde(rename = "ShipID")] diff --git a/ed-journals/src/models/journal_event_content/shared/civilization/faction.rs b/ed-journals/src/models/journal_event_content/shared/civilization/faction.rs index 91405496..ae777b2e 100644 --- a/ed-journals/src/models/journal_event_content/shared/civilization/faction.rs +++ b/ed-journals/src/models/journal_event_content/shared/civilization/faction.rs @@ -18,7 +18,7 @@ pub struct Faction { pub happiness: FactionHappiness, #[serde(rename = "Happiness_Localised")] - pub happiness_localised: Option, + pub happiness_localized: Option, pub my_reputation: f32, #[serde(default)] diff --git a/ed-journals/src/models/journal_event_content/ship_targeted_event.rs b/ed-journals/src/models/journal_event_content/ship_targeted_event.rs index 3b8d932a..368cbd01 100644 --- a/ed-journals/src/models/journal_event_content/ship_targeted_event.rs +++ b/ed-journals/src/models/journal_event_content/ship_targeted_event.rs @@ -27,7 +27,7 @@ pub struct ShipTargetedEventScanStageLocked { pub ship: ShipType, #[serde(rename = "Ship_Localised")] - pub ship_localised: Option, + pub ship_localized: Option, } #[derive(Debug, Deserialize, Clone, PartialEq)] @@ -36,11 +36,11 @@ pub struct ShipTargetedEventScanStageOne { pub ship: ShipType, #[serde(rename = "Ship_Localised")] - pub ship_localised: String, + pub ship_localized: String, pub pilot_name: String, #[serde(rename = "PilotName_Localised")] - pub pilot_name_localised: String, + pub pilot_name_localized: String, pub pilot_rank: String, } @@ -51,13 +51,13 @@ pub struct ShipTargetedEventScanStageTwo { pub ship: ShipType, #[serde(rename = "Ship_Localised")] - pub ship_localised: String, + pub ship_localized: String, // TODO replace this with an enum pub pilot_name: String, #[serde(rename = "PilotName_Localised")] - pub pilot_name_localised: String, + pub pilot_name_localized: String, pub pilot_rank: String, pub shield_health: f32, @@ -70,11 +70,11 @@ pub struct ShipTargetedEventScanStageThree { pub ship: ShipType, #[serde(rename = "Ship_Localised")] - pub ship_localised: String, + pub ship_localized: String, pub pilot_name: String, #[serde(rename = "PilotName_Localised")] - pub pilot_name_localised: String, + pub pilot_name_localized: String, pub pilot_rank: String, pub shield_health: f32, diff --git a/ed-journals/src/models/journal_event_content/stored_modules_event.rs b/ed-journals/src/models/journal_event_content/stored_modules_event.rs index 0c10e188..3f4d9cc9 100644 --- a/ed-journals/src/models/journal_event_content/stored_modules_event.rs +++ b/ed-journals/src/models/journal_event_content/stored_modules_event.rs @@ -17,7 +17,7 @@ pub struct StoredModulesEventItem { pub name: String, #[serde(rename = "Name_Localised")] - pub name_localised: String, + pub name_localized: String, pub storage_slot: u16, #[serde(default)] diff --git a/ed-journals/src/models/journal_event_content/stored_ships_event.rs b/ed-journals/src/models/journal_event_content/stored_ships_event.rs index 3d54fa5b..66857d65 100644 --- a/ed-journals/src/models/journal_event_content/stored_ships_event.rs +++ b/ed-journals/src/models/journal_event_content/stored_ships_event.rs @@ -22,7 +22,7 @@ pub struct StoredShipEventLocalShip { pub ship_type: ShipType, #[serde(rename = "ShipType_Localised")] - pub ship_type_localised: Option, + pub ship_type_localized: Option, pub name: Option, pub value: u64, pub hot: bool, @@ -36,7 +36,7 @@ pub struct StoredShipEventRemoteShip { pub ship_type: ShipType, #[serde(rename = "ShipType_Localised")] - pub ship_type_localised: Option, + pub ship_type_localized: Option, pub name: String, #[serde(default)] diff --git a/ed-journals/src/models/journal_event_content/suit_loadout_event.rs b/ed-journals/src/models/journal_event_content/suit_loadout_event.rs index 6e2f7522..c436bfd5 100644 --- a/ed-journals/src/models/journal_event_content/suit_loadout_event.rs +++ b/ed-journals/src/models/journal_event_content/suit_loadout_event.rs @@ -10,7 +10,7 @@ pub struct SuitLoadoutEvent { pub suit_name: String, #[serde(rename = "SuitName_Localised")] - pub suit_name_localised: String, + pub suit_name_localized: String, pub suit_mods: Vec, #[serde(rename = "LoadoutID")] @@ -37,7 +37,7 @@ pub struct SuitLoadoutModule { pub module_name: String, #[serde(rename = "ModuleName_Localised")] - pub module_name_localised: String, + pub module_name_localized: String, pub class: u8, pub weapon_mods: Vec, } diff --git a/ed-journals/src/models/journal_event_content/supercruise_destination_drop_event.rs b/ed-journals/src/models/journal_event_content/supercruise_destination_drop_event.rs index 55b70a9e..b354185c 100644 --- a/ed-journals/src/models/journal_event_content/supercruise_destination_drop_event.rs +++ b/ed-journals/src/models/journal_event_content/supercruise_destination_drop_event.rs @@ -8,6 +8,6 @@ pub struct SupercruiseDestinationDropEvent { // TODO this appears to be empty if the destination is a fleet carrier #[serde(rename = "Type_Localised")] - pub type_localised: Option, + pub type_localized: Option, pub threat: u8, } diff --git a/ed-journals/src/models/journal_event_content/switch_suit_loadout_event.rs b/ed-journals/src/models/journal_event_content/switch_suit_loadout_event.rs index 8ed460f5..34cfc8dd 100644 --- a/ed-journals/src/models/journal_event_content/switch_suit_loadout_event.rs +++ b/ed-journals/src/models/journal_event_content/switch_suit_loadout_event.rs @@ -10,7 +10,7 @@ pub struct SwitchSuitLoadoutEvent { pub suit_name: String, #[serde(rename = "SuitName_Localised")] - pub suit_name_localised: String, + pub suit_name_localized: String, pub suit_mods: Vec, #[serde(rename = "LoadoutID")] @@ -38,7 +38,7 @@ pub struct SwitchSuitLoadoutEventModule { pub module_name: String, #[serde(rename = "ModuleName_Localised")] - pub module_name_localised: String, + pub module_name_localized: String, pub class: u8, pub weapon_mods: Vec, } diff --git a/ed-journals/src/models/journal_event_content/uss_drop_event.rs b/ed-journals/src/models/journal_event_content/uss_drop_event.rs index 3ce0006f..1c385254 100644 --- a/ed-journals/src/models/journal_event_content/uss_drop_event.rs +++ b/ed-journals/src/models/journal_event_content/uss_drop_event.rs @@ -7,7 +7,7 @@ pub struct USSDropEvent { pub uss_type: String, #[serde(rename = "USSType_Localised")] - pub uss_type_localised: String, + pub uss_type_localized: String, #[serde(rename = "USSThreat")] pub uss_threat: u8,