pub struct LuaPin;Expand description
A pin owned by a player.
Implementations§
Source§impl LuaPin
impl LuaPin
Sourcepub fn alert_positions(&self) -> Vec<MapPosition>
pub fn alert_positions(&self) -> Vec<MapPosition>
The alert positions if this pin is configured to show alert data.
Sourcepub fn set_alert_positions(&self, value: Vec<MapPosition>)
pub fn set_alert_positions(&self, value: Vec<MapPosition>)
Set the alert_positions attribute (Lua: self.alert_positions = value).
The alert positions if this pin is configured to show alert data.
Sourcepub fn alert_type(&self) -> &'static str
pub fn alert_type(&self) -> &'static str
The type of alert this pin is for (if configured to be about alerts).
Sourcepub fn set_alert_type(&self, value: &'static str)
pub fn set_alert_type(&self, value: &'static str)
Set the alert_type attribute (Lua: self.alert_type = value).
The type of alert this pin is for (if configured to be about alerts).
pub fn always_visible(&self) -> bool
Sourcepub fn set_always_visible(&self, value: bool)
pub fn set_always_visible(&self, value: bool)
Set the always_visible attribute (Lua: self.always_visible = value).
Sourcepub fn chart_tag(&self) -> LuaCustomChartTag
pub fn chart_tag(&self) -> LuaCustomChartTag
The custom chart tag - if this pin specificaly binds to a chart tag.
The chart tag must be on the same force as the owning player.
Sourcepub fn set_chart_tag(&self, value: LuaCustomChartTag)
pub fn set_chart_tag(&self, value: LuaCustomChartTag)
Set the chart_tag attribute (Lua: self.chart_tag = value).
The custom chart tag - if this pin specificaly binds to a chart tag.
The chart tag must be on the same force as the owning player.
Sourcepub fn index(&self) -> u32
pub fn index(&self) -> u32
The index of this pin (unique to this player).
Note that this index has no corelation to the position of the pin within LuaPlayer::get_pins
Sourcepub fn label(&self) -> &'static str
pub fn label(&self) -> &'static str
The label for this pin - if any. This will be an empty string if there is no label set.
Sourcepub fn set_label(&self, value: &'static str)
pub fn set_label(&self, value: &'static str)
Set the label attribute (Lua: self.label = value).
The label for this pin - if any. This will be an empty string if there is no label set.
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_player(&self, value: LuaPlayer)
pub fn set_player(&self, value: LuaPlayer)
Set the player attribute (Lua: self.player = value).
The player that this pin is bound to.
Sourcepub fn position(&self) -> MapPosition
pub fn position(&self) -> MapPosition
The position if this pin specifically binds to a surface and position.
If writing, and this pin was not bound to a specific surface and position, the default surface of nauvis is used.
Sourcepub fn set_position(&self, value: MapPosition)
pub fn set_position(&self, value: MapPosition)
Set the position attribute (Lua: self.position = value).
The position if this pin specifically binds to a surface and position.
If writing, and this pin was not bound to a specific surface and position, the default surface of nauvis is used.
Sourcepub fn preview_distance(&self) -> u16
pub fn preview_distance(&self) -> u16
The radius (in tiles) that is shown in the tooltip for this pin.
Sourcepub fn set_preview_distance(&self, value: u16)
pub fn set_preview_distance(&self, value: u16)
Set the preview_distance attribute (Lua: self.preview_distance = value).
The radius (in tiles) that is shown in the tooltip for this pin.
Sourcepub fn surface_index(&self) -> u32
pub fn surface_index(&self) -> u32
The surface index if this pin specifically binds to a surface and position.
If writing, and this pin was not bound to a specific surface and position, the default position of (0,0) is used.
Sourcepub fn set_surface_index(&self, value: u32)
pub fn set_surface_index(&self, value: u32)
Set the surface_index attribute (Lua: self.surface_index = value).
The surface index if this pin specifically binds to a surface and position.
If writing, and this pin was not bound to a specific surface and position, the default position of (0,0) is used.
Sourcepub fn set_targets(&self, value: Vec<LuaEntity>)
pub fn set_targets(&self, value: Vec<LuaEntity>)
Set the targets attribute (Lua: self.targets = value).
The targets of this pin - if any.
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 get_pin_center(&self) -> Option<MapPosition>
pub fn get_pin_center(&self) -> Option<MapPosition>
The center of this pin if it can be computed.