Skip to content

DraggedContent ​

Inherits: MarginContainer

Unified visual component for dragging both items AND abilities Pure display - NO LOGIC Replaces both DraggedItem and DraggedAbility

Variables ​

ContentTypecurrent_content_typeContentType.NONE
DisplayModecurrent_modeDisplayMode.NORMAL
Variantdisplayed_contentnull
intdisplayed_quantity1
Colornormal_modulateColor.WHITE
Colorenchanting_modulateColor(0.8, 1.0, 0.8, 0.9)
Colorerror_modulateColor(1.0, 0.6, 0.6, 0.9)

Methods ​

voidshow_dragged_item( item: ItemInstance, quantity: int = 1 )
voidshow_dragged_ability( ability: AbilityInstance )
voidshow_enchanting( scroll: ItemInstance )
voidhide_drag()
voidflash_error()
boolis_showing()
ContentTypeget_content_type()
DisplayModeget_display_mode()
Variantget_displayed_content()
boolis_dragging_item()
boolis_dragging_ability()

Enumerations ​

enum ContentType ​

========== ENUMS ==========

  • NONE = 0
  • ITEM = 1
  • ABILITY = 2

enum DisplayMode ​

The options of display mode: normal, enchanting.

  • NORMAL = 0

Variable descriptions ​

ContentType current_content_type = ContentType.NONE ​

========== STATE ==========

DisplayMode current_mode = DisplayMode.NORMAL ​

How the dragged picture is shown (normal, enchanting or an error).

Variant displayed_content = null ​

ItemInstance or AbilityInstance

int displayed_quantity = 1 ​

The quantity shown on the dragged item.

Color normal_modulate = Color.WHITE ​

========== VISUAL FEEDBACK ==========

Color enchanting_modulate = Color(0.8, 1.0, 0.8, 0.9) ​

The tint of the picture while an enchant scroll is dragged.

Color error_modulate = Color(1.0, 0.6, 0.6, 0.9) ​

The tint of the picture when the drop is not allowed.

Method descriptions ​

void show_dragged_item( item: ItemInstance, quantity: int = 1 ) ​

Show item being dragged

void show_dragged_ability( ability: AbilityInstance ) ​

Show ability being dragged

void show_enchanting( scroll: ItemInstance ) ​

Show enchanting mode (items only)

void hide_drag() ​

Hide drag display

void flash_error() ​

Flash error feedback

bool is_showing() ​

Is something dragged and shown?

ContentType get_content_type() ​

What is dragged: an item or an ability.

DisplayMode get_display_mode() ​

How the dragged picture is shown.

Variant get_displayed_content() ​

The item or ability that is dragged.

bool is_dragging_item() ​

Is an item dragged?

bool is_dragging_ability() ​

Is an ability dragged?