-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
7,688 additions
and
4,119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// @generated by cargo bevy-api-gen generate, modify the templates not this file | ||
#![allow(clippy::all)] | ||
#![allow(unused, deprecated, dead_code)] | ||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
use super::bevy_ecs::*; | ||
use super::bevy_reflect::*; | ||
extern crate self as bevy_script_api; | ||
use bevy_script_api::{ | ||
lua::RegisterForeignLuaType, ReflectedValue, common::bevy::GetWorld, | ||
}; | ||
#[derive(bevy_mod_scripting_lua_derive::LuaProxy)] | ||
#[proxy(derive(), remote = "bevy::a11y::Focus", functions[])] | ||
struct Focus(ReflectedValue); | ||
#[derive(Default)] | ||
pub(crate) struct Globals; | ||
impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals { | ||
fn add_instances< | ||
'lua, | ||
T: bevy_mod_scripting_lua::tealr::mlu::InstanceCollector<'lua>, | ||
>(self, instances: &mut T) -> bevy_mod_scripting_lua::tealr::mlu::mlua::Result<()> { | ||
Ok(()) | ||
} | ||
} | ||
pub struct BevyA11YAPIProvider; | ||
impl bevy_mod_scripting_core::hosts::APIProvider for BevyA11YAPIProvider { | ||
type APITarget = std::sync::Mutex<bevy_mod_scripting_lua::tealr::mlu::mlua::Lua>; | ||
type ScriptContext = std::sync::Mutex<bevy_mod_scripting_lua::tealr::mlu::mlua::Lua>; | ||
type DocTarget = bevy_mod_scripting_lua::docs::LuaDocFragment; | ||
fn attach_api( | ||
&mut self, | ||
ctx: &mut Self::APITarget, | ||
) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { | ||
let ctx = ctx.get_mut().expect("Unable to acquire lock on Lua context"); | ||
bevy_mod_scripting_lua::tealr::mlu::set_global_env(Globals, ctx) | ||
.map_err(|e| bevy_mod_scripting_core::error::ScriptError::Other( | ||
e.to_string(), | ||
)) | ||
} | ||
fn get_doc_fragment(&self) -> Option<Self::DocTarget> { | ||
Some( | ||
bevy_mod_scripting_lua::docs::LuaDocFragment::new( | ||
"BevyA11YAPI", | ||
|tw| { | ||
tw.document_global_instance::<Globals>() | ||
.expect("Something went wrong documenting globals") | ||
.process_type::<LuaFocus>() | ||
}, | ||
), | ||
) | ||
} | ||
fn setup_script( | ||
&mut self, | ||
script_data: &bevy_mod_scripting_core::hosts::ScriptData, | ||
ctx: &mut Self::ScriptContext, | ||
) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { | ||
Ok(()) | ||
} | ||
fn setup_script_runtime( | ||
&mut self, | ||
world_ptr: bevy_mod_scripting_core::world::WorldPointer, | ||
_script_data: &bevy_mod_scripting_core::hosts::ScriptData, | ||
ctx: &mut Self::ScriptContext, | ||
) -> Result<(), bevy_mod_scripting_core::error::ScriptError> { | ||
Ok(()) | ||
} | ||
fn register_with_app(&self, app: &mut bevy::app::App) { | ||
app.register_foreign_lua_type::<bevy::a11y::Focus>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.