omp/runtime.rs
1pub use omp_gdk::{Runtime, __terminate_event_chain};
2/// Registers the gamemode object and it's events
3#[macro_export]
4macro_rules! register {
5 ($name:expr) => {{
6 let obj = std::rc::Rc::new(std::cell::RefCell::new($name));
7 omp::runtime::Runtime.with(|runtime| {
8 runtime.borrow_mut().push(obj.clone());
9 });
10 obj
11 }};
12}
13
14#[macro_export]
15macro_rules! terminate_event {
16 ($name:expr) => {
17 omp::runtime::__terminate_event_chain.with_borrow_mut(|terminate| {
18 *terminate = true;
19 });
20 return $name
21 };
22}