shenanigans
This commit is contained in:
parent
9459b6adb9
commit
a29295d878
2 changed files with 28 additions and 18 deletions
|
@ -1,7 +1,7 @@
|
||||||
# Item type
|
# Item type
|
||||||
- This data block encodes for the type of the item that's being encoded.
|
- 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.
|
- 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 name: `item_type`
|
||||||
- Field type: `String`
|
- Field type: `String`
|
||||||
- Field potential values: `"Gear"`, `"Tome"`, `"Charm"`
|
- Field potential values: `"Gear"`, `"Tome"`, `"Charm"`
|
||||||
|
|
|
@ -1,13 +1,33 @@
|
||||||
use crate::errorfr::Errorfr;
|
use crate::errorfr::Errorfr;
|
||||||
use idmangler_lib::types::{ItemType, TransformVersion};
|
use idmangler_lib::types::{ItemType, TransformVersion, ConsumableType, GearType};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
// structs for the json parsing
|
// structs for the json parsing
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Powder {
|
pub struct Jsonconfig {
|
||||||
pub r#type: char,
|
pub debug: Option<bool>, // not a thing to be encoded, this just toggles debug prints. Also settable using --debug
|
||||||
pub amount: Option<u8>,
|
// Item Types (Gear, Tome, Charm, Crafted Gear, Crafted Consum)
|
||||||
|
pub item_type: ItemTypeDeser,
|
||||||
|
// Crafted type for Crafted item types (
|
||||||
|
pub crafted_type: Option<String>,
|
||||||
|
// name of item
|
||||||
|
pub name: Option<String>,
|
||||||
|
// shiny data
|
||||||
|
pub shiny: Option<Shinyjson>,
|
||||||
|
pub ids: Option<Vec<Identificationer>>,
|
||||||
|
pub powders: Option<Vec<Powder>>,
|
||||||
|
pub rerolls: Option<u8>,
|
||||||
|
}
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
pub enum CraftedType {
|
||||||
|
Gear(GearType),
|
||||||
|
Consu(ConsumableType)
|
||||||
|
}
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
pub struct Shinystruct {
|
||||||
|
pub id: u8,
|
||||||
|
pub key: String,
|
||||||
}
|
}
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Identificationer {
|
pub struct Identificationer {
|
||||||
|
@ -16,21 +36,11 @@ pub struct Identificationer {
|
||||||
pub roll: Option<u8>,
|
pub roll: Option<u8>,
|
||||||
}
|
}
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Jsonconfig {
|
pub struct Powder {
|
||||||
pub debug: Option<bool>,
|
pub r#type: char,
|
||||||
pub item_type: ItemTypeDeser,
|
pub amount: Option<u8>,
|
||||||
pub name: Option<String>,
|
|
||||||
pub shiny: Option<Shinyjson>,
|
|
||||||
pub ids: Option<Vec<Identificationer>>,
|
|
||||||
pub powders: Option<Vec<Powder>>,
|
|
||||||
pub rerolls: Option<u8>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
pub struct Shinystruct {
|
|
||||||
pub id: u8,
|
|
||||||
pub key: String,
|
|
||||||
}
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Shinyjson {
|
pub struct Shinyjson {
|
||||||
pub key: String,
|
pub key: String,
|
||||||
|
|
Loading…
Reference in a new issue