Skip to main content

IEditorExportPlatformExtension

Trait IEditorExportPlatformExtension 

pub trait IEditorExportPlatformExtension: GodotClass<Base = EditorExportPlatformExtension> + You_forgot_the_attribute__godot_api {
Show 39 methods // Required methods fn get_preset_features( &self, preset: Option<Gd<EditorExportPreset>>, ) -> PackedArray<GString>; fn get_os_name(&self) -> GString; fn get_name(&self) -> GString; fn get_logo(&self) -> Option<Gd<Texture2D>>; fn has_valid_export_configuration( &self, preset: Option<Gd<EditorExportPreset>>, debug: bool, ) -> bool; fn has_valid_project_configuration( &self, preset: Option<Gd<EditorExportPreset>>, ) -> bool; fn get_binary_extensions( &self, preset: Option<Gd<EditorExportPreset>>, ) -> PackedArray<GString>; fn export_project( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, flags: DebugFlags, ) -> Error; fn get_platform_features(&self) -> PackedArray<GString>; // Provided methods fn init(base: Base<Self::Base>) -> Self { ... } fn on_notification(&mut self, what: ObjectNotification) { ... } fn on_get(&self, property: StringName) -> Option<Variant> { ... } fn on_set(&mut self, property: StringName, value: Variant) -> bool { ... } fn on_validate_property(&self, property: &mut PropertyInfo) { ... } fn on_get_property_list(&mut self) -> Vec<PropertyInfo> { ... } fn on_property_get_revert(&self, property: StringName) -> Option<Variant> { ... } fn to_string(&self) -> GString { ... } fn is_executable(&self, path: GString) -> bool { ... } fn get_export_options(&self) -> Array<AnyDictionary> { ... } fn should_update_export_options(&mut self) -> bool { ... } fn get_export_option_visibility( &self, preset: Option<Gd<EditorExportPreset>>, option: GString, ) -> bool { ... } fn get_export_option_warning( &self, preset: Option<Gd<EditorExportPreset>>, option: StringName, ) -> GString { ... } fn poll_export(&mut self) -> bool { ... } fn get_options_count(&self) -> i32 { ... } fn get_options_tooltip(&self) -> GString { ... } fn get_option_icon(&self, device: i32) -> Option<Gd<Texture2D>> { ... } fn get_option_label(&self, device: i32) -> GString { ... } fn get_option_tooltip(&self, device: i32) -> GString { ... } fn get_device_architecture(&self, device: i32) -> GString { ... } fn cleanup(&mut self) { ... } fn run( &mut self, preset: Option<Gd<EditorExportPreset>>, device: i32, debug_flags: DebugFlags, ) -> Error { ... } fn get_run_icon(&self) -> Option<Gd<Texture2D>> { ... } fn can_export( &self, preset: Option<Gd<EditorExportPreset>>, debug: bool, ) -> bool { ... } fn export_pack( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, flags: DebugFlags, ) -> Error { ... } fn export_zip( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, flags: DebugFlags, ) -> Error { ... } fn export_pack_patch( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, patches: PackedArray<GString>, flags: DebugFlags, ) -> Error { ... } fn export_zip_patch( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, patches: PackedArray<GString>, flags: DebugFlags, ) -> Error { ... } fn get_debug_protocol(&self) -> GString { ... } fn initialize(&mut self) { ... }
}
Expand description

§Interface trait for class EditorExportPlatformExtension.

Functions in this trait represent constructors (init) or virtual method callbacks invoked by the engine.

Base interfaces: IEditorExportPlatform > IRefCounted > IObject.
(Strike-through means some intermediate Godot classes are marked final, and can thus not be inherited by GDExtension.)

See also Godot docs for EditorExportPlatformExtension methods.

Required Methods§

fn get_preset_features( &self, preset: Option<Gd<EditorExportPreset>>, ) -> PackedArray<GString>

Returns array of platform specific features for the specified preset.

fn get_os_name(&self) -> GString

Returns target OS name.

fn get_name(&self) -> GString

Returns export platform name.

Returns the platform logo displayed in the export dialog. The logo should be 32×32 pixels, adjusted for the current editor scale (see get_editor_scale).

fn has_valid_export_configuration( &self, preset: Option<Gd<EditorExportPreset>>, debug: bool, ) -> bool

Returns true if export configuration is valid.

fn has_valid_project_configuration( &self, preset: Option<Gd<EditorExportPreset>>, ) -> bool

Returns true if project configuration is valid.

fn get_binary_extensions( &self, preset: Option<Gd<EditorExportPreset>>, ) -> PackedArray<GString>

Returns array of supported binary extensions for the full project export.

fn export_project( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, flags: DebugFlags, ) -> Error

Creates a full project at path for the specified preset.

This method is called when “Export” button is pressed in the export dialog.

This method implementation can call save_pack or save_zip to use default PCK/ZIP export process, or calls export_project_files and implement custom callback for processing each exported file.

fn get_platform_features(&self) -> PackedArray<GString>

Returns array of platform specific features.

Provided Methods§

fn init(base: Base<Self::Base>) -> Self

Godot constructor, accepting an injected base object.

base refers to the base instance of the class, which can either be stored in a Base<T> field or discarded. This method returns a fully-constructed instance, which will then be moved into a Gd<T> pointer.

If the class has a #[class(init)] attribute, this method will be auto-generated and must not be overridden.

fn on_notification(&mut self, what: ObjectNotification)

Called when the object receives a Godot notification.

The type of notification can be identified through what. The enum is designed to hold all possible NOTIFICATION_* constants that the current class can handle. However, this is not validated in Godot, so an enum variant Unknown exists to represent integers out of known constants (mistakes or future additions).

This method is named _notification in Godot, but on_notification in Rust. To send notifications, use the Object::notify method.

See also in Godot docs:

fn on_get(&self, property: StringName) -> Option<Variant>

Called whenever get() is called or Godot gets the value of a property.

Should return the given property’s value as Some(value), or None if the property should be handled normally.

See also in Godot docs:

fn on_set(&mut self, property: StringName, value: Variant) -> bool

Called whenever Godot set() is called or Godot sets the value of a property.

Should set property to the given value and return true, or return false to indicate the property should be handled normally.

See also in Godot docs:

fn on_validate_property(&self, property: &mut PropertyInfo)

Called whenever Godot retrieves value of property. Allows to customize existing properties. Every property info goes through this method, except properties added with on_get_property_list().

Exposed property here is a shared mutable reference obtained (and returned to) from Godot.

See also in the Godot docs:

fn on_get_property_list(&mut self) -> Vec<PropertyInfo>

Available on since_api=4.3 only.

Called whenever Godot get_property_list() is called, the returned vector here is appended to the existing list of properties.

This should mainly be used for advanced purposes, such as dynamically updating the property list in the editor.

See also in Godot docs:

fn on_property_get_revert(&self, property: StringName) -> Option<Variant>

Called by Godot to tell if a property has a custom revert or not.

Return None for no custom revert, and return Some(value) to specify the custom revert.

This is a combination of Godot’s Object::_property_get_revert and Object::_property_can_revert. This means that this function will usually be called twice by Godot to find the revert.

Note that this should be a pure function. That is, it should always return the same value for a property as long as self remains unchanged. Otherwise, this may lead to unexpected (safe) behavior.

fn to_string(&self) -> GString

String representation of the Godot instance.

Override this method to define how the instance is represented as a string. Used by impl Display for Gd<T>, as well as str() and print() in GDScript.

fn is_executable(&self, path: GString) -> bool

Returns true if specified file is a valid executable (native executable or script) for the target platform.

fn get_export_options(&self) -> Array<AnyDictionary>

Returns a property list, as an Array of dictionaries. Each Dictionary must at least contain the name: StringName and type: Variant.Type entries.

Additionally, the following keys are supported:

  • hint: PropertyHint

  • hint_string: String

  • usage: PropertyUsageFlags

  • class_name: StringName

  • default_value: Variant, default value of the property.

  • update_visibility: bool, if set to true, get_export_option_visibility is called for each property when this property is changed.

  • required: bool, if set to true, this property warnings are critical, and should be resolved to make export possible. This value is a hint for the has_valid_export_configuration implementation, and not used by the engine directly.

See also on_get_property_list.

fn should_update_export_options(&mut self) -> bool

Returns true if export options list is changed and presets should be updated.

fn get_export_option_visibility( &self, preset: Option<Gd<EditorExportPreset>>, option: GString, ) -> bool

Validates option and returns visibility for the specified preset. Default implementation return true for all options.

fn get_export_option_warning( &self, preset: Option<Gd<EditorExportPreset>>, option: StringName, ) -> GString

Validates option and returns warning message for the specified preset. Default implementation return empty string for all options.

fn poll_export(&mut self) -> bool

Returns true if one-click deploy options are changed and editor interface should be updated.

fn get_options_count(&self) -> i32

Returns the number of devices (or other options) available in the one-click deploy menu.

fn get_options_tooltip(&self) -> GString

Returns tooltip of the one-click deploy menu button.

fn get_option_icon(&self, device: i32) -> Option<Gd<Texture2D>>

Returns the item icon for the specified device in the one-click deploy menu. The icon should be 16×16 pixels, adjusted for the current editor scale (see get_editor_scale).

fn get_option_label(&self, device: i32) -> GString

Returns one-click deploy menu item label for the specified device.

fn get_option_tooltip(&self, device: i32) -> GString

Returns one-click deploy menu item tooltip for the specified device.

fn get_device_architecture(&self, device: i32) -> GString

Returns device architecture for one-click deploy.

fn cleanup(&mut self)

Called by the editor before platform is unregistered.

fn run( &mut self, preset: Option<Gd<EditorExportPreset>>, device: i32, debug_flags: DebugFlags, ) -> Error

This method is called when device one-click deploy menu option is selected.

Implementation should export project to a temporary location, upload and run it on the specific device, or perform another action associated with the menu item.

fn get_run_icon(&self) -> Option<Gd<Texture2D>>

Returns the icon of the one-click deploy menu button. The icon should be 16×16 pixels, adjusted for the current editor scale (see get_editor_scale).

fn can_export( &self, preset: Option<Gd<EditorExportPreset>>, debug: bool, ) -> bool

Returns true if the specified preset is valid and can be exported. Use set_config_error and set_config_missing_templates to set error details.

Usual implementations call has_valid_export_configuration and has_valid_project_configuration to determine if exporting is possible.

fn export_pack( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, flags: DebugFlags, ) -> Error

Creates a PCK archive at path for the specified preset.

This method is called when “Export PCK/ZIP” button is pressed in the export dialog, with “Export as Patch” disabled, and PCK is selected as a file type.

fn export_zip( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, flags: DebugFlags, ) -> Error

Create a ZIP archive at path for the specified preset.

This method is called when “Export PCK/ZIP” button is pressed in the export dialog, with “Export as Patch” disabled, and ZIP is selected as a file type.

fn export_pack_patch( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, patches: PackedArray<GString>, flags: DebugFlags, ) -> Error

Creates a patch PCK archive at path for the specified preset, containing only the files that have changed since the last patch.

This method is called when “Export PCK/ZIP” button is pressed in the export dialog, with “Export as Patch” enabled, and PCK is selected as a file type.

Note: The patches provided in patches have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.

fn export_zip_patch( &mut self, preset: Option<Gd<EditorExportPreset>>, debug: bool, path: GString, patches: PackedArray<GString>, flags: DebugFlags, ) -> Error

Create a ZIP archive at path for the specified preset, containing only the files that have changed since the last patch.

This method is called when “Export PCK/ZIP” button is pressed in the export dialog, with “Export as Patch” enabled, and ZIP is selected as a file type.

Note: The patches provided in patches have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.

fn get_debug_protocol(&self) -> GString

Returns protocol used for remote debugging. Default implementation return tcp://.

fn initialize(&mut self)

Initializes the plugin. Called by the editor when platform is registered.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§