diff --git a/docs/blocks/type.md b/docs/blocks/type.md index 8f685fd..db68035 100644 --- a/docs/blocks/type.md +++ b/docs/blocks/type.md @@ -1,7 +1,7 @@ # Item type - This data block encodes for the type of the item that's being encoded. - This will support crafteds in the future, but for now it only supports non crafted types. -- If you input a crafted value, literally nothing will happen. +- If you input a crafted value, literally nothing will happen, I think. - Field name: `item_type` - Field type: `String` - Field potential values: `"Gear"`, `"Tome"`, `"Charm"` diff --git a/src/jsonstruct.rs b/src/jsonstruct.rs index b1fb565..8bfb249 100644 --- a/src/jsonstruct.rs +++ b/src/jsonstruct.rs @@ -1,13 +1,33 @@ use crate::errorfr::Errorfr; -use idmangler_lib::types::{ItemType, TransformVersion}; +use idmangler_lib::types::{ItemType, TransformVersion, ConsumableType, GearType}; use serde::Deserialize; use std::fs; // structs for the json parsing #[derive(Deserialize)] -pub struct Powder { - pub r#type: char, - pub amount: Option, +pub struct Jsonconfig { + pub debug: Option, // not a thing to be encoded, this just toggles debug prints. Also settable using --debug + // Item Types (Gear, Tome, Charm, Crafted Gear, Crafted Consum) + pub item_type: ItemTypeDeser, + // Crafted type for Crafted item types ( + pub crafted_type: Option, + // name of item + pub name: Option, + // shiny data + pub shiny: Option, + pub ids: Option>, + pub powders: Option>, + pub rerolls: Option, +} +#[derive(Deserialize)] +pub enum CraftedType { + Gear(GearType), + Consu(ConsumableType) +} +#[derive(Deserialize)] +pub struct Shinystruct { + pub id: u8, + pub key: String, } #[derive(Deserialize)] pub struct Identificationer { @@ -16,21 +36,11 @@ pub struct Identificationer { pub roll: Option, } #[derive(Deserialize)] -pub struct Jsonconfig { - pub debug: Option, - pub item_type: ItemTypeDeser, - pub name: Option, - pub shiny: Option, - pub ids: Option>, - pub powders: Option>, - pub rerolls: Option, +pub struct Powder { + pub r#type: char, + pub amount: Option, } -#[derive(Deserialize)] -pub struct Shinystruct { - pub id: u8, - pub key: String, -} #[derive(Deserialize)] pub struct Shinyjson { pub key: String,