Skip to main content

LuaGuiElementAddParams

Struct LuaGuiElementAddParams 

Source
pub struct LuaGuiElementAddParams {
Show 87 fields pub anchor: Option<GuiAnchor>, pub caption: Option<String>, pub elem_tooltip: Option<ElemID>, pub enabled: Option<bool>, pub game_controller_interaction: Option<String>, pub ignored_by_interaction: Option<bool>, pub index: Option<u32>, pub locked: Option<bool>, pub name: Option<String>, pub raise_hover_events: Option<bool>, pub style: Option<String>, pub tags: Option<Tags>, pub tooltip: Option<String>, pub type: GuiElementType, pub visible: Option<bool>, pub auto_toggle: Option<bool>, pub mouse_button_filter: Option<MouseButtonFlags>, pub toggled: Option<bool>, pub position: Option<MapPosition>, pub surface_index: Option<u32>, pub zoom: Option<f64>, pub state: Option<bool>, pub achievement: Option<String>, pub asteroid_chunk: Option<String>, pub decorative: Option<String>, pub elem_filters: Option<Vec<PrototypeFilterEntry>>, pub elem_type: Option<ElemType>, pub entity: Option<String>, pub entity_with_quality: Option<PrototypeWithQuality>, pub equipment: Option<String>, pub equipment_with_quality: Option<PrototypeWithQuality>, pub fluid: Option<String>, pub item: Option<String>, pub item_group: Option<String>, pub item_with_quality: Option<PrototypeWithQuality>, pub recipe: Option<String>, pub recipe_with_quality: Option<PrototypeWithQuality>, pub signal: Option<SignalID>, pub space_location: Option<String>, pub technology: Option<String>, pub tile: Option<String>, pub items: Option<Vec<String>>, pub selected_index: Option<u32>, pub direction: Option<GuiDirection>, pub empty_slot_info: Option<EmptySlotInfo>, pub handle_cursor_split: Option<bool>, pub handle_cursor_transfer: Option<bool>, pub handle_open_item: Option<bool>, pub handle_open_mod_item: Option<bool>, pub handle_send_stack_to_trash: Option<bool>, pub handle_send_stacks_to_trash: Option<bool>, pub slots_per_row: Option<u8>, pub chart_player_index: Option<u32>, pub force: Option<String>, pub value: Option<f64>, pub horizontal_scroll_policy: Option<ScrollPolicy>, pub vertical_scroll_policy: Option<ScrollPolicy>, pub discrete_values: Option<bool>, pub maximum_value: Option<f64>, pub minimum_value: Option<f64>, pub value_step: Option<f64>, pub resize_to_sprite: Option<bool>, pub sprite: Option<SpritePath>, pub clicked_sprite: Option<SpritePath>, pub hovered_sprite: Option<SpritePath>, pub number: Option<f64>, pub quality: Option<String>, pub show_percent_for_small_numbers: Option<bool>, pub allow_none_state: Option<bool>, pub left_label_caption: Option<String>, pub left_label_tooltip: Option<String>, pub right_label_caption: Option<String>, pub right_label_tooltip: Option<String>, pub switch_state: Option<SwitchState>, pub badge_text: Option<String>, pub column_count: Option<u32>, pub draw_horizontal_line_after_headers: Option<bool>, pub draw_horizontal_lines: Option<bool>, pub draw_vertical_lines: Option<bool>, pub vertical_centering: Option<bool>, pub icon_selector: Option<bool>, pub text: Option<String>, pub allow_decimal: Option<bool>, pub allow_negative: Option<bool>, pub is_password: Option<bool>, pub lose_focus_on_confirm: Option<bool>, pub numeric: Option<bool>,
}
Expand description

Add a new child element to this GuiElement.

Fields§

§anchor: Option<GuiAnchor>

Where to position the child element when in the relative element.

§caption: Option<String>

Text displayed on the child element. For frames, this is their title. For other elements, like buttons or labels, this is the content. Whilst this attribute may be used on all elements, it doesn’t make sense for tables and flows as they won’t display it.

§elem_tooltip: Option<ElemID>

Elem tooltip of the child element. Will be displayed above tooltip.

§enabled: Option<bool>

Whether the child element is enabled. Defaults to true.

§game_controller_interaction: Option<String>

How the element should interact with game controllers. Defaults to defines.game_controller_interaction.normal.

§ignored_by_interaction: Option<bool>

Whether the child element is ignored by interaction. Defaults to false.

§index: Option<u32>

Location in its parent that the child element should slot into. By default, the child will be appended onto the end.

§locked: Option<bool>

Whether the child element is locked. Defaults to false.

§name: Option<String>

Name of the child element. It must be unique within the parent element.

§raise_hover_events: Option<bool>

Whether this element will raise on_gui_hover and on_gui_leave. Defaults to false.

§style: Option<String>

The name of the style prototype to apply to the new element.

§tags: Option<Tags>

Tags associated with the child element.

§tooltip: Option<String>

Tooltip of the child element.

§type: GuiElementType

The kind of element to add, which potentially has its own attributes as listed below.

§visible: Option<bool>

Whether the child element is visible. Defaults to true.

§auto_toggle: Option<bool>

Whether the button will automatically toggle when clicked. Defaults to false.

§mouse_button_filter: Option<MouseButtonFlags>

Which mouse buttons the button responds to. Defaults to "left-and-right".

§toggled: Option<bool>

The initial toggled state of the button. Defaults to false.

§position: Option<MapPosition>

The position the camera centers on.

§surface_index: Option<u32>

The surface that the camera will render. Defaults to the player’s current surface.

§zoom: Option<f64>

The initial camera zoom. Defaults to 0.75.

§state: Option<bool>

The initial checked-state of the checkbox.

§achievement: Option<String>

If type is "achievement" - the default value for the button.

§asteroid_chunk: Option<String>

If type is "asteroid-chunk" - the default value for the button.

§decorative: Option<String>

If type is "decorative" - the default value for the button.

§elem_filters: Option<Vec<PrototypeFilterEntry>>

Filters describing what to show in the selection window. The applicable filter depends on the elem_type.

§elem_type: Option<ElemType>

The type of the button.

§entity: Option<String>

If type is "entity" - the default value for the button.

§entity_with_quality: Option<PrototypeWithQuality>

If type is "entity-with-quality" - the default value for the button.

§equipment: Option<String>

If type is "equipment" - the default value for the button.

§equipment_with_quality: Option<PrototypeWithQuality>

If type is "equipment-with-quality" - the default value for the button.

§fluid: Option<String>

If type is "fluid" - the default value for the button.

§item: Option<String>

If type is "item" - the default value for the button.

§item_group: Option<String>

If type is "item-group" - the default value for the button.

§item_with_quality: Option<PrototypeWithQuality>

If type is "item-with-quality" - the default value for the button.

§recipe: Option<String>

If type is "recipe" - the default value for the button.

§recipe_with_quality: Option<PrototypeWithQuality>

If type is "recipe-with-quality" - the default value for the button.

§signal: Option<SignalID>

If type is "signal" - the default value for the button.

§space_location: Option<String>

If type is "space-location" - the default value for the button.

§technology: Option<String>

If type is "technology" - the default value for the button.

§tile: Option<String>

If type is "tile" - the default value for the button.

§items: Option<Vec<String>>

The initial items in the dropdown.

§selected_index: Option<u32>

The index of the initially selected item. Defaults to 0.

§direction: Option<GuiDirection>

The initial direction of the flow’s layout. Defaults to "horizontal".

§empty_slot_info: Option<EmptySlotInfo>§handle_cursor_split: Option<bool>§handle_cursor_transfer: Option<bool>§handle_open_item: Option<bool>§handle_open_mod_item: Option<bool>§handle_send_stack_to_trash: Option<bool>§handle_send_stacks_to_trash: Option<bool>§slots_per_row: Option<u8>§chart_player_index: Option<u32>

The player index the map should use. Defaults to the current player.

§force: Option<String>

The force this minimap should use. Defaults to the player’s current force.

§value: Option<f64>

The initial value of the progressbar, in the range [0, 1]. Defaults to 0.

§horizontal_scroll_policy: Option<ScrollPolicy>

Policy of the horizontal scroll bar. Defaults to "auto".

§vertical_scroll_policy: Option<ScrollPolicy>

Policy of the vertical scroll bar. Defaults to "auto".

§discrete_values: Option<bool>

Defaults to true.

§maximum_value: Option<f64>

The maximum value for the slider. Defaults to 30.

§minimum_value: Option<f64>

The minimum value for the slider. Defaults to 0.

§value_step: Option<f64>

The minimum value the slider can move. Defaults to 1.

§resize_to_sprite: Option<bool>

Whether the widget should resize according to the sprite in it. Defaults to true.

§sprite: Option<SpritePath>

Path to the image to display.

§clicked_sprite: Option<SpritePath>

Path to the image to display on the button when it is clicked.

§hovered_sprite: Option<SpritePath>

Path to the image to display on the button when it is hovered.

§number: Option<f64>

The number shown on the button.

§quality: Option<String>

The name of the quality shown on the button.

§show_percent_for_small_numbers: Option<bool>

Formats small numbers as percentages. Defaults to false.

§allow_none_state: Option<bool>

Whether the switch can be set to a middle state. Defaults to false.

§left_label_caption: Option<String>§left_label_tooltip: Option<String>§right_label_caption: Option<String>§right_label_tooltip: Option<String>§switch_state: Option<SwitchState>

If set to “none”, allow_none_state must be true. Defaults to "left".

§badge_text: Option<String>

The text to display after the normal tab text (designed to work with numbers).

§column_count: Option<u32>

Number of columns. This can’t be changed after the table is created.

§draw_horizontal_line_after_headers: Option<bool>

Whether the table should draw a single horizontal grid line after the headers. Defaults to false.

§draw_horizontal_lines: Option<bool>

Whether the table should draw horizontal grid lines. Defaults to false.

§draw_vertical_lines: Option<bool>

Whether the table should draw vertical grid lines. Defaults to false.

§vertical_centering: Option<bool>

Whether the content of the table should be vertically centered. Defaults to true.

§icon_selector: Option<bool>

Whether to add the rich text icon selector to the text box. This attribute can’t be changed after creating the widget. Defaults to false.

§text: Option<String>

The initial text contained in the text-box.

§allow_decimal: Option<bool>

Defaults to false.

§allow_negative: Option<bool>

Defaults to false.

§is_password: Option<bool>

Defaults to false.

§lose_focus_on_confirm: Option<bool>

Defaults to false.

§numeric: Option<bool>

Defaults to false.

Trait Implementations§

Source§

impl Clone for LuaGuiElementAddParams

Source§

fn clone(&self) -> LuaGuiElementAddParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LuaGuiElementAddParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LuaGuiElementAddParams

Source§

fn default() -> LuaGuiElementAddParams

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.