diff --git a/cspell.json b/cspell.json index c56bbe8..ec86b48 100644 --- a/cspell.json +++ b/cspell.json @@ -1,130 +1 @@ -{ - "version": "0.2", - "language": "en", - "flagWords": [], - "words": [ - "Astroloy", - "Autolathe", - "bapal", - "bapz", - "bapzal", - "batchmode", - "batchmodes", - "bdns", - "bdnsal", - "bdse", - "bdseal", - "beqal", - "beqz", - "beqzal", - "bgeal", - "bgez", - "bgezal", - "bgtal", - "bgtz", - "bgtzal", - "bindgen", - "bleal", - "blez", - "blezal", - "bltal", - "bltz", - "bltzal", - "bnaal", - "bnan", - "bnaz", - "bnazal", - "bneal", - "bnez", - "bnezal", - "brap", - "brapz", - "brdns", - "brdse", - "breq", - "breqz", - "brge", - "brgez", - "brgt", - "brgtz", - "brle", - "brlez", - "brlt", - "brltz", - "brna", - "brnan", - "brnaz", - "brne", - "brnez", - "Circuitboard", - "codegen", - "conv", - "cstyle", - "endpos", - "getd", - "Hardsuit", - "hashables", - "inext", - "inextp", - "infile", - "itertools", - "jetpack", - "kbshortcutmenu", - "Keybind", - "lbns", - "logicable", - "logictype", - "logictypes", - "lzma", - "Mineables", - "mscorlib", - "MSEED", - "ninf", - "nomatch", - "oprs", - "overcolumn", - "Overlength", - "pedia", - "peekable", - "prec", - "preproc", - "putd", - "QUICKFIX", - "reagentmode", - "reagentmodes", - "repr", - "retval", - "rocketstation", - "sapz", - "sattellite", - "sdns", - "sdse", - "searchbox", - "searchbtn", - "seqz", - "serde", - "settingsmenu", - "sgez", - "sgtz", - "slez", - "slotlogic", - "slotlogicable", - "slotlogictype", - "slotlogictypes", - "slottype", - "sltz", - "snan", - "snanz", - "snaz", - "snez", - "splitn", - "Stationeers", - "stationpedia", - "stdweb", - "thiserror", - "tokentype", - "trunc", - "Tsify", - "whos" - ] -} +{"language":"en","flagWords":[],"version":"0.2","words":["Astroloy","Autolathe","bapal","bapz","bapzal","batchmode","batchmodes","bdns","bdnsal","bdse","bdseal","beqal","beqz","beqzal","bgeal","bgez","bgezal","bgtal","bgtz","bgtzal","bindgen","bleal","blez","blezal","bltal","bltz","bltzal","bnaal","bnan","bnaz","bnazal","bneal","bnez","bnezal","brap","brapz","brdns","brdse","breq","breqz","brge","brgez","brgt","brgtz","brle","brlez","brlt","brltz","brna","brnan","brnaz","brne","brnez","Circuitboard","codegen","conv","cstyle","endpos","getd","Hardsuit","hashables","inext","inextp","infile","itertools","jetpack","kbshortcutmenu","Keybind","lbns","logicable","logictype","logictypes","lzma","Mineables","mscorlib","MSEED","ninf","nomatch","oprs","overcolumn","Overlength","pedia","peekable","prec","preproc","putd","QUICKFIX","reagentmode","reagentmodes","repr","retval","rocketstation","sapz","sattellite","sdns","sdse","searchbox","searchbtn","seqz","serde","settingsmenu","sgez","sgtz","slez","slotlogic","slotlogicable","slotlogictype","slotlogictypes","slottype","sltz","snan","snanz","snaz","snez","splitn","Stationeers","stationpedia","stdweb","thiserror","tokentype","trunc","Tsify","whos","Depressurising","Pressurising","logicslottypes","lparen","rparen","hstack","dylib"]} diff --git a/ic10emu/Cargo.toml b/ic10emu/Cargo.toml index 4ce57c2..c73f2e2 100644 --- a/ic10emu/Cargo.toml +++ b/ic10emu/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] -crate-type = ["lib"] +crate-type = ["lib", "cdylib"] [dependencies] diff --git a/ic10emu/src/lib.rs b/ic10emu/src/lib.rs index e11e6ef..cc26a39 100644 --- a/ic10emu/src/lib.rs +++ b/ic10emu/src/lib.rs @@ -164,6 +164,8 @@ pub struct Device { pub name: Option, pub name_hash: Option, pub fields: HashMap, + pub prefab_name: Option, + pub prefab_hash: Option, pub slots: Vec, pub reagents: HashMap>, pub ic: Option, @@ -253,6 +255,8 @@ impl Device { id, name: None, name_hash: None, + prefab_name: None, + prefab_hash: None, fields: HashMap::new(), slots: Vec::new(), reagents: HashMap::new(), @@ -273,6 +277,7 @@ impl Device { value: 0.0, }, ); + device.prefab_name = Some("StructureCircuitHousing".to_owned()); device.fields.insert( LogicType::Error, LogicField { @@ -280,6 +285,7 @@ impl Device { value: 0.0, }, ); + device.prefab_hash = Some(-128473777); device.fields.insert( LogicType::PrefabHash, LogicField { diff --git a/ic10emu_wasm/src/lib.rs b/ic10emu_wasm/src/lib.rs index c984eac..716252e 100644 --- a/ic10emu_wasm/src/lib.rs +++ b/ic10emu_wasm/src/lib.rs @@ -43,6 +43,16 @@ impl DeviceRef { self.device.borrow().name_hash } + #[wasm_bindgen(getter, js_name = "prefabName")] + pub fn prefab_name(&self) -> Option { + self.device.borrow().prefab_name.clone() + } + + #[wasm_bindgen(getter, js_name = "prefabHash")] + pub fn prefab_hash(&self) -> Option { + self.device.borrow().prefab_hash + } + #[wasm_bindgen(getter, skip_typescript)] pub fn fields(&self) -> JsValue { serde_wasm_bindgen::to_value(&self.device.borrow().fields).unwrap() diff --git a/ic10emu_wasm/src/types.ts b/ic10emu_wasm/src/types.ts index 8230ba8..6bb32a8 100644 --- a/ic10emu_wasm/src/types.ts +++ b/ic10emu_wasm/src/types.ts @@ -26,11 +26,11 @@ type Defines = Map; type Pins = (number | undefined)[] export interface DeviceRef { - readonly fields: Fields | undefined; - readonly slots: Slot[] | undefined; - readonly reagents: Reagents | undefined; - readonly connections: Connection[] | undefined; - readonly aliases: Aliases | undefined; - readonly defines: Defines | undefined; - readonly pins: Pins; + readonly fields: Fields; + readonly slots: Slot[]; + readonly reagents: Reagents; + readonly connections: Connection[]; + readonly aliases?: Aliases | undefined; + readonly defines?: Defines | undefined; + readonly pins?: Pins; } diff --git a/www/cspell.json b/www/cspell.json index 196686c..7c986dc 100644 --- a/www/cspell.json +++ b/www/cspell.json @@ -1,120 +1 @@ -{ - "words": [ - "Astroloy", - "Autolathe", - "bapal", - "bapz", - "bapzal", - "batchmode", - "batchmodes", - "bdns", - "bdnsal", - "bdse", - "bdseal", - "beqal", - "beqz", - "beqzal", - "bgeal", - "bgez", - "bgezal", - "bgtal", - "bgtz", - "bgtzal", - "bleal", - "blez", - "blezal", - "bltal", - "bltz", - "bltzal", - "bnaal", - "bnan", - "bnaz", - "bnazal", - "bneal", - "bnez", - "bnezal", - "brap", - "brapz", - "brdns", - "brdse", - "breq", - "breqz", - "brge", - "brgez", - "brgt", - "brgtz", - "brle", - "brlez", - "brlt", - "brltz", - "brna", - "brnan", - "brnaz", - "brne", - "brnez", - "Circuitboard", - "codegen", - "Depressurising", - "endpos", - "getd", - "Hardsuit", - "hardwrap", - "hashables", - "infile", - "jetpack", - "Keybind", - "lbns", - "logicable", - "logicslottypes", - "logictype", - "logictypes", - "lparen", - "Mineables", - "modelist", - "ninf", - "noconflict", - "offcanvas", - "overcolumn", - "Overlength", - "pedia", - "pinf", - "popperjs", - "preproc", - "Pressurising", - "putd", - "QUICKFIX", - "reagentmode", - "reagentmodes", - "rocketstation", - "rparen", - "sapz", - "sattellite", - "sdns", - "sdse", - "seqz", - "serde", - "sgez", - "sgtz", - "slez", - "slotlogic", - "slotlogicable", - "slotlogictype", - "slotlogictypes", - "slottype", - "sltz", - "snan", - "snanz", - "snaz", - "snez", - "splitn", - "Stationeers", - "stationpedia", - "themelist", - "tokentype", - "trunc", - "whos" - ], - "version": "0.2", - "language": "en", - "flagWords": [] -} +{"flagWords":[],"words":["Astroloy","Autolathe","bapal","bapz","bapzal","batchmode","batchmodes","bdns","bdnsal","bdse","bdseal","beqal","beqz","beqzal","bgeal","bgez","bgezal","bgtal","bgtz","bgtzal","bleal","blez","blezal","bltal","bltz","bltzal","bnaal","bnan","bnaz","bnazal","bneal","bnez","bnezal","brap","brapz","brdns","brdse","breq","breqz","brge","brgez","brgt","brgtz","brle","brlez","brlt","brltz","brna","brnan","brnaz","brne","brnez","Circuitboard","codegen","Depressurising","endpos","getd","Hardsuit","hardwrap","hashables","hstack","infile","jetpack","Keybind","lbns","logicable","logicslottypes","logictype","logictypes","lparen","Mineables","modelist","ninf","noconflict","offcanvas","overcolumn","Overlength","pedia","pinf","popperjs","preproc","Pressurising","putd","QUICKFIX","reagentmode","reagentmodes","rocketstation","rparen","sapz","sattellite","sdns","sdse","seqz","serde","sgez","sgtz","slez","slotlogic","slotlogicable","slotlogictype","slotlogictypes","slottype","sltz","snan","snanz","snaz","snez","splitn","Stationeers","stationpedia","themelist","tokentype","trunc","whos","regen"],"language":"en","version":"0.2"} diff --git a/www/src/index.html b/www/src/index.html index ecb1c07..10a9162 100644 --- a/www/src/index.html +++ b/www/src/index.html @@ -199,7 +199,7 @@
Editor Cursor Style
-
+
Instruction Pointer
@@ -218,12 +218,34 @@
Editor Cursor Style
-
- + +
+ +
+
+
+
-
+
+
+

+ +

+
+
+
+ +
+
+
+