DraggedContent ​
Inherits: MarginContainer
Unified visual component for dragging both items AND abilities Pure display - NO LOGIC Replaces both DraggedItem and DraggedAbility
Variables ​
ContentType | current_content_type | ContentType.NONE |
DisplayMode | current_mode | DisplayMode.NORMAL |
Variant | displayed_content | null |
int | displayed_quantity | 1 |
Color | normal_modulate | Color.WHITE |
Color | enchanting_modulate | Color(0.8, 1.0, 0.8, 0.9) |
Color | error_modulate | Color(1.0, 0.6, 0.6, 0.9) |
Methods ​
void | show_dragged_item( item: ItemInstance, quantity: int = 1 ) |
void | show_dragged_ability( ability: AbilityInstance ) |
void | show_enchanting( scroll: ItemInstance ) |
void | hide_drag() |
void | flash_error() |
bool | is_showing() |
ContentType | get_content_type() |
DisplayMode | get_display_mode() |
Variant | get_displayed_content() |
bool | is_dragging_item() |
bool | is_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?