pub struct LuaSimulation;Expand description
Functions for use during simulations. This object cannot be saved, and cannot be used outside of a simulation.
The simulation object instance can be obtained from LuaGameScript::simulation.
Implementations§
Source§impl LuaSimulation
impl LuaSimulation
Sourcepub fn set_active_quickbars(&self, value: u8)
pub fn set_active_quickbars(&self, value: u8)
Set the active_quickbars attribute (Lua: self.active_quickbars = value).
Sourcepub fn set_camera_alt_info(&self, value: bool)
pub fn set_camera_alt_info(&self, value: bool)
Set the camera_alt_info attribute (Lua: self.camera_alt_info = value).
Sourcepub fn set_camera_player(&self, value: PlayerIdentification)
pub fn set_camera_player(&self, value: PlayerIdentification)
Set the camera_player attribute (Lua: self.camera_player = value).
Sourcepub fn set_camera_player_cursor_direction(&self, value: &'static str)
pub fn set_camera_player_cursor_direction(&self, value: &'static str)
Set the camera_player_cursor_direction attribute (Lua: self.camera_player_cursor_direction = value).
pub fn camera_player_cursor_position(&self) -> MapPosition
Sourcepub fn set_camera_player_cursor_position(&self, value: MapPosition)
pub fn set_camera_player_cursor_position(&self, value: MapPosition)
Set the camera_player_cursor_position attribute (Lua: self.camera_player_cursor_position = value).
pub fn camera_position(&self) -> MapPosition
Sourcepub fn set_camera_position(&self, value: MapPosition)
pub fn set_camera_position(&self, value: MapPosition)
Set the camera_position attribute (Lua: self.camera_position = value).
pub fn camera_surface_index(&self) -> u32
Sourcepub fn set_camera_surface_index(&self, value: u32)
pub fn set_camera_surface_index(&self, value: u32)
Set the camera_surface_index attribute (Lua: self.camera_surface_index = value).
Sourcepub fn set_camera_zoom(&self, value: f64)
pub fn set_camera_zoom(&self, value: f64)
Set the camera_zoom attribute (Lua: self.camera_zoom = value).
Sourcepub fn set_gui_tooltip_interval(&self, value: f64)
pub fn set_gui_tooltip_interval(&self, value: f64)
Set the gui_tooltip_interval attribute (Lua: self.gui_tooltip_interval = value).
Sourcepub fn set_hide_cursor(&self, value: bool)
pub fn set_hide_cursor(&self, value: bool)
Set the hide_cursor attribute (Lua: self.hide_cursor = value).
Sourcepub fn object_name(&self) -> &'static str
pub fn object_name(&self) -> &'static str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Sourcepub fn set_smart_belt_building(&self, value: bool)
pub fn set_smart_belt_building(&self, value: bool)
Set the smart_belt_building attribute (Lua: self.smart_belt_building = value).
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
Sourcepub fn activate_rail_planner(
&self,
params: LuaSimulationActivateRailPlannerParams,
)
pub fn activate_rail_planner( &self, params: LuaSimulationActivateRailPlannerParams, )
Activate the rail planner at the given position.
Sourcepub fn control_down(&self, params: LuaSimulationControlDownParams)
pub fn control_down(&self, params: LuaSimulationControlDownParams)
Send a control press event at the current cursor position.
Sourcepub fn control_press(&self, params: LuaSimulationControlPressParams)
pub fn control_press(&self, params: LuaSimulationControlPressParams)
Send a control down and up event at the current cursor position. This is equivalent to calling LuaSimulation::control_down, then LuaSimulation::control_up.
Sourcepub fn control_up(&self, params: LuaSimulationControlUpParams)
pub fn control_up(&self, params: LuaSimulationControlUpParams)
Send a control release event at the current cursor position.
pub fn create_test_player( &self, params: LuaSimulationCreateTestPlayerParams, ) -> LuaPlayer
Sourcepub fn deactivate_rail_planner(&self)
pub fn deactivate_rail_planner(&self)
Deactivate the rail planner.
pub fn get_slot_position( &self, params: LuaSimulationGetSlotPositionParams, ) -> Option<MapPosition>
pub fn get_widget_position( &self, params: LuaSimulationGetWidgetPositionParams, ) -> Option<MapPosition>
Sourcepub fn mouse_click(&self)
pub fn mouse_click(&self)
Send a left mouse button click event at its current position. This is equivalent to calling LuaSimulation::mouse_down, then LuaSimulation::mouse_up.
Sourcepub fn mouse_down(&self)
pub fn mouse_down(&self)
Send a left mouse button-down event at its current position.
Sourcepub fn move_cursor(&self, params: LuaSimulationMoveCursorParams) -> bool
pub fn move_cursor(&self, params: LuaSimulationMoveCursorParams) -> bool
Move the cursor towards the given position at the given speed.
Sourcepub fn scroll_clipboard_backwards(&self)
pub fn scroll_clipboard_backwards(&self)
Scroll the clipboard backwards by one entry.
Sourcepub fn scroll_clipboard_forwards(&self)
pub fn scroll_clipboard_forwards(&self)
Scroll the clipboard forwards by one entry.
Sourcepub fn write(&self, params: LuaSimulationWriteParams)
pub fn write(&self, params: LuaSimulationWriteParams)
Write text as if it was typed by a player. Overwrites existing text by selecting it first.
Trait Implementations§
Source§impl Clone for LuaSimulation
impl Clone for LuaSimulation
Source§fn clone(&self) -> LuaSimulation
fn clone(&self) -> LuaSimulation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more