diff --git a/Cargo.lock b/Cargo.lock index 91a4acc..5851aba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -368,6 +368,27 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "color-print" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" +dependencies = [ + "color-print-proc-macro", +] + +[[package]] +name = "color-print-proc-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" +dependencies = [ + "nom", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "com" version = "0.6.0" @@ -1029,6 +1050,12 @@ dependencies = [ "paste", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "mlua" version = "0.9.4" @@ -1117,6 +1144,16 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-traits" version = "0.2.17" @@ -1703,6 +1740,7 @@ name = "strafe-client" version = "0.9.0" dependencies = [ "bytemuck", + "color-print", "configparser", "ddsfile", "glam", diff --git a/Cargo.toml b/Cargo.toml index 3a32b41..0dc0d8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] bytemuck = { version = "1.13.1", features = ["derive"] } +color-print = "0.3.5" configparser = "3.0.2" ddsfile = "0.5.1" glam = "0.24.1" diff --git a/src/luau.rs b/src/luau.rs index e61faa1..b208667 100644 --- a/src/luau.rs +++ b/src/luau.rs @@ -1,5 +1,6 @@ use mlua::{Lua as Luau, Result, Table}; use glam::{Vec2, Vec3, Vec4, Quat}; +use color_print::cprintln; const STRAFE_VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -216,7 +217,7 @@ impl Luavm for StrafeluaGlobals { pub fn error_wrapper(execute_result: Result<()>) { match execute_result { Ok(t) => t, - Err(e) => println!("[StrafeLua ERROR]: {}", e), + Err(e) => cprintln!("[StrafeLua ERROR]: {}", e), } } diff --git a/src/main.rs b/src/main.rs index e1efe7f..7dfae3f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -119,7 +119,6 @@ pub fn default_models()->model::IndexedModelInstances{ fn main(){ let strafelua_vm = luau::new_state(true).expect("Failed to load strafe lua"); - // luau/tests/Vector.lua luau::error_wrapper(strafelua_vm.load(r#" --Purposely throw an error Squidward()