Files
ojrc/rc_services_room/src/operations/all_customisations_info.rs
T

64 lines
2.7 KiB
Rust
Raw Normal View History

use polariton_server::operations::SimpleFunc;
2025-03-08 17:16:02 -05:00
use polariton::{operation::{Arr, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::customisation_info::CustomisationData;
const SKINS_KEY: u8 = 228;
const SPAWNS_KEY: u8 = 229;
const DEATHS_KEY: u8 = 230;
const OWNED_SKINS_KEY: u8 = 231;
const OWNED_SPAWNS_KEY: u8 = 232;
const OWNED_DEATHS_KEY: u8 = 233;
const OWNED_EMOTES_KEY: u8 = 76;
pub(super) fn all_customisations_provider() -> SimpleFunc<216, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(SKINS_KEY, Typed::Arr(Arr {
2025-03-08 17:16:02 -05:00
ty: TypePrefix::HashMap, // hashtable
items: vec![
CustomisationData {
2025-03-01 16:22:57 -05:00
id: "RC_MothershipSkin_Neptune_01".to_string(),
localised_name: "Neptune 01".to_string(),
skin_scene_name: "RC_MothershipSkin_Neptune_01".to_string(),
simulation_prefab: "TODO_sim_prefab".to_string(),
preview_image_name: "TODO_preview_img".to_string(),
is_default: true,
}.as_transmissible(),
],
}));
params.insert(SPAWNS_KEY, Typed::Arr(Arr {
2025-03-08 17:16:02 -05:00
ty: TypePrefix::HashMap, // hashtable
items: vec![
CustomisationData {
id: "spawn0".to_string(),
localised_name: "Default".to_string(),
skin_scene_name: "TODO_skin".to_string(),
simulation_prefab: "TODO_sim_prefab".to_string(),
preview_image_name: "TODO_preview_img".to_string(),
is_default: true,
}.as_transmissible(),
],
}));
params.insert(DEATHS_KEY, Typed::Arr(Arr {
2025-03-08 17:16:02 -05:00
ty: TypePrefix::HashMap, // hashtable
items: vec![
CustomisationData {
id: "death0".to_string(),
localised_name: "Default".to_string(),
skin_scene_name: "TODO_skin".to_string(),
simulation_prefab: "TODO_sim_prefab".to_string(),
preview_image_name: "TODO_preview_img".to_string(),
is_default: true,
}.as_transmissible(),
],
}));
params.insert(OWNED_SKINS_KEY, Typed::StrArr(vec![].into()));
params.insert(OWNED_SPAWNS_KEY, Typed::StrArr(vec![].into()));
params.insert(OWNED_DEATHS_KEY, Typed::StrArr(vec![].into()));
params.insert(OWNED_EMOTES_KEY, Typed::StrArr(vec![].into()));
Ok(params.into())
})
}