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
pub fn active_quickbars(&self) -> LuaAny
pub fn camera_alt_info(&self) -> LuaAny
pub fn camera_player(&self) -> LuaAny
pub fn camera_player_cursor_direction(&self) -> LuaAny
pub fn camera_player_cursor_position(&self) -> MapPosition
pub fn camera_position(&self) -> MapPosition
pub fn camera_surface_index(&self) -> u32
pub fn camera_zoom(&self) -> LuaAny
pub fn gui_tooltip_interval(&self) -> LuaAny
pub fn hide_cursor(&self) -> LuaAny
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &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.
pub fn smart_belt_building(&self) -> LuaAny
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