M sdbclient/assets/scripts/ui_play.lua => sdbclient/assets/scripts/ui_play.lua +0 -2
@@ 9,6 9,4 @@
function on_start()
print_to_console("hello from lua")
print("hello from lua")
-
- print(world)
end
M sdbclient/src/lua/mod.rs => sdbclient/src/lua/mod.rs +1 -1
@@ 18,8 18,8 @@ pub struct LuaPlugin;
impl Plugin for LuaPlugin {
fn build(&self, app: &mut App) {
app.add_startup_system(load_scripts)
- .add_script_handler_stage::<LuaScriptHost<()>, _, 0, 30>(CoreStage::PostUpdate)
.add_script_host::<LuaScriptHost<()>, _>(CoreStage::PostUpdate)
+ .add_script_handler_stage::<LuaScriptHost<()>, _, 0, 0>(CoreStage::PostUpdate)
.add_api_provider::<LuaScriptHost<()>>(Box::new(LuaAPIProvider))
.add_api_provider::<LuaScriptHost<()>>(Box::new(LuaBevyAPIProvider));
}
M => +1 -14
@@ 10,7 10,6 @@ use bevy::{
prelude::*,
ui::{JustifyContent, Size, Style, Val},
};
use bevy_mod_scripting::prelude::*;
use crate::constants::TEXT_COLOR;
@@ 20,19 19,7 @@ use super::{MenuButtonAction, NORMAL_BUTTON};
#[derive(Component)]
pub struct OnPlayScreen;
pub fn play_setup(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut lua_writer: PriorityEventWriter<LuaEvent<()>>,
) {
let event = LuaEvent {
hook_name: "on_start".to_string(),
args: (),
recipients: Recipients::All,
};
lua_writer.send(event, 0);
pub fn play_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let font = asset_server.load("fonts/FiraMono-Regular.ttf");
let button_style = Style {