Skip to content

Commit

Permalink
Merge pull request #13 from ethangreen-dev/disable-console-by-arg
Browse files Browse the repository at this point in the history
Add `--disable-console` argument
  • Loading branch information
ethangreen-dev authored Apr 22, 2024
2 parents bc02759 + 49fab29 commit a1ac407
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/lovely-win/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::env;
use std::panic;
use std::ffi::c_void;

Expand Down Expand Up @@ -45,7 +46,10 @@ unsafe extern "system" fn DllMain(_: HINSTANCE, reason: u32, _: *const c_void) -
);
}));

let _ = AllocConsole();
let args = env::args().collect::<Vec<_>>();
if !args.contains(&"--disable-console".to_string()) {
let _ = AllocConsole();
}

// Initialize the lovely runtime.
let rt = Lovely::init(&|a, b, c, d| LuaLoadbuffer_Detour.call(a, b, c, d));
Expand Down

0 comments on commit a1ac407

Please sign in to comment.