first Prototype
This commit is contained in:
parent
e11825c698
commit
35ce267482
481 changed files with 17315 additions and 1 deletions
77
addons/ui_extensions/dropdown/Arrow.svg
Normal file
77
addons/ui_extensions/dropdown/Arrow.svg
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="16px"
|
||||
height="16px"
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
id="SVGRoot"
|
||||
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
|
||||
sodipodi:docname="Arrow.svg">
|
||||
<defs
|
||||
id="defs820" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="32.188791"
|
||||
inkscape:cx="9.2976091"
|
||||
inkscape:cy="8.614865"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1016"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:pagecheckerboard="true"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true">
|
||||
<sodipodi:guide
|
||||
position="7.9841459,21.249633"
|
||||
orientation="1,0"
|
||||
id="guide816"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
position="11.121884,8.4501466"
|
||||
orientation="0,1"
|
||||
id="guide818"
|
||||
inkscape:locked="false" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata823">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 10.978523,10.548312 4.844615,-4.8514122 c 6.1e-5,-6.26e-5 1.25e-4,-9.38e-5 1.85e-4,-1.563e-4 0.05215,-0.052254 0.08986,-0.1132844 0.114034,-0.1782836 0.06622,-0.1776575 0.02838,-0.385458 -0.114219,-0.5283221 L 13.534576,2.6984099 C 13.39191,2.5555771 13.18446,2.517784 13.007015,2.5840936 c -0.06488,0.024206 -0.125853,0.061968 -0.178067,0.1141601 0,6.25e-5 -6.4e-5,9.37e-5 -1.26e-4,1.562e-4 L 7.9841459,7.5498534 3.1394697,2.6984411 3.1393137,2.6982849 C 3.0871316,2.646093 3.0261849,2.6083312 2.9613078,2.5841249 2.7838324,2.517784 2.5763825,2.5556083 2.4337159,2.6984411 L 0.14512383,4.9902006 c -0.1426666,0.1428639 -0.18040745,0.3506321 -0.11418944,0.5282908 0.0242039,0.064967 0.0619137,0.1260588 0.11403348,0.1782835 6.24e-5,3.11e-5 9.359e-5,9.35e-5 1.5596e-4,1.56e-4 L 4.9898314,10.548312 c 0.9003938,0.912135 1.9117225,1.857651 2.9943457,2.99849 1.8283342,-1.807231 2.0385509,-2.014714 2.9943459,-2.99849 z"
|
||||
id="path5"
|
||||
style="fill:#ffffff;fill-opacity:0.95754718;stroke-width:0.03121235"
|
||||
sodipodi:nodetypes="ccccccccccccccscccccc" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
37
addons/ui_extensions/dropdown/Arrow.svg.import
Normal file
37
addons/ui_extensions/dropdown/Arrow.svg.import
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bb76dl3aocsjo"
|
||||
path="res://.godot/imported/Arrow.svg-e4a7a75ac3bf7e30d5e37f222d3ad4c0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/ui_extensions/dropdown/Arrow.svg"
|
||||
dest_files=["res://.godot/imported/Arrow.svg-e4a7a75ac3bf7e30d5e37f222d3ad4c0.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
63
addons/ui_extensions/dropdown/Cancel.svg
Normal file
63
addons/ui_extensions/dropdown/Cancel.svg
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="16px"
|
||||
height="16px"
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
id="SVGRoot"
|
||||
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
|
||||
sodipodi:docname="Cancel.svg">
|
||||
<defs
|
||||
id="defs820" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="45.254834"
|
||||
inkscape:cx="4.2126349"
|
||||
inkscape:cy="7.5511398"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1016"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:pagecheckerboard="true" />
|
||||
<metadata
|
||||
id="metadata823">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 15.893561,12.896603 c -6.1e-5,-6.2e-5 -1.24e-4,-1.24e-4 -1.86e-4,-1.56e-4 L 11.04876,8.045035 15.893375,3.1936229 c 6.2e-5,-6.26e-5 1.25e-4,-9.38e-5 1.86e-4,-1.563e-4 0.05215,-0.052254 0.08986,-0.1132844 0.114034,-0.1782836 0.06622,-0.1776575 0.02838,-0.385458 -0.11422,-0.5283221 L 13.604813,0.19513298 c -0.142666,-0.14283283 -0.350116,-0.1806259 -0.527561,-0.11431625 -0.06488,0.02420628 -0.125853,0.06196816 -0.178067,0.11416007 0,6.248e-5 -6.3e-5,9.369e-5 -1.25e-4,1.5618e-4 L 8.0543834,5.0465765 3.2097072,0.1951642 c -6.24e-5,-6.246e-5 -9.36e-5,-9.371e-5 -1.56e-4,-1.5616e-4 C 3.1573691,0.14281612 3.0964224,0.10505428 3.0315453,0.08084797 2.8540699,0.01450708 2.64662,0.05233138 2.5039534,0.1951642 L 0.21536133,2.4869237 c -0.1426666,0.1428639 -0.18040745,0.3506321 -0.11418944,0.5282908 0.0242039,0.064967 0.0619137,0.1260588 0.11403348,0.1782835 6.24e-5,3.11e-5 9.359e-5,9.35e-5 1.5596e-4,1.56e-4 L 5.0600689,8.045035 0.21536133,12.896479 c -3.119e-5,6.2e-5 -9.356e-5,9.3e-5 -1.2478e-4,1.55e-4 -0.0521198,0.05225 -0.0898294,0.113285 -0.11406466,0.178252 -0.0662492,0.177661 -0.02847716,0.385459 0.11418944,0.528323 l 2.28859207,2.291727 c 0.1426981,0.142864 0.3501477,0.180658 0.5275919,0.114348 0.064876,-0.02423 0.125854,-0.062 0.1780377,-0.11419 3.11e-5,-6.3e-5 9.35e-5,-9.4e-5 1.559e-4,-1.57e-4 l 4.8446757,-4.851412 4.8446764,4.851411 c 6.3e-5,3.3e-5 1.25e-4,9.5e-5 1.88e-4,1.26e-4 0.05222,0.05222 0.113127,0.08999 0.178003,0.114222 0.177445,0.06631 0.384958,0.02852 0.527561,-0.114348 l 2.288563,-2.291758 c 0.142667,-0.142864 0.180438,-0.350664 0.11422,-0.528322 -0.02434,-0.06497 -0.06191,-0.125998 -0.114065,-0.178253 z"
|
||||
id="path5"
|
||||
style="stroke-width:0.03121235;fill:#ffffff;fill-opacity:0.95754719" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
37
addons/ui_extensions/dropdown/Cancel.svg.import
Normal file
37
addons/ui_extensions/dropdown/Cancel.svg.import
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://btxlurvr45t4y"
|
||||
path="res://.godot/imported/Cancel.svg-fbdf3881698da8995a36f6dcd62b6529.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/ui_extensions/dropdown/Cancel.svg"
|
||||
dest_files=["res://.godot/imported/Cancel.svg-fbdf3881698da8995a36f6dcd62b6529.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
175
addons/ui_extensions/dropdown/Dropdown.gd
Normal file
175
addons/ui_extensions/dropdown/Dropdown.gd
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
# UI Extension Filter Dropdown : MIT License
|
||||
# @author Vladimir Petrenko
|
||||
@tool
|
||||
extends VBoxContainer
|
||||
class_name Dropdown
|
||||
|
||||
signal selection_changed(item: DropdownItem)
|
||||
|
||||
var _disabled: bool = false
|
||||
var _selected = -1
|
||||
var _group = ButtonGroup.new()
|
||||
var _items: Array[DropdownItem] = []
|
||||
|
||||
@export var ignore_case: bool = true
|
||||
@export var popup_maxheight_count: int = 5
|
||||
@onready var _icon: TextureRect = $HBox/Icon
|
||||
@onready var _selector: Button = $HBox/Selector
|
||||
@onready var _clear: Button= $HBox/Clear
|
||||
@onready var _popup_panel: PopupPanel= $PopupPanel
|
||||
@onready var _filter: LineEdit= $PopupPanel/VBoxPanel/Filter
|
||||
@onready var _popup_panel_vbox: VBoxContainer= $PopupPanel/VBoxPanel/Scroll/ScrollVBox/VBox
|
||||
|
||||
func set_disabled(value: bool) -> void:
|
||||
_disabled = value
|
||||
_selector.disabled = _disabled
|
||||
_clear.disabled = _disabled
|
||||
|
||||
func is_disabled() -> bool:
|
||||
return _disabled
|
||||
|
||||
func items() -> Array:
|
||||
return _items
|
||||
|
||||
func add_item_as_string(value: String, tooltip: String = "") -> void:
|
||||
add_item(DropdownItem.new(value, value, tooltip))
|
||||
|
||||
func add_item(item: DropdownItem) -> void:
|
||||
_items.append(item)
|
||||
|
||||
func clear() -> void:
|
||||
for item in _items:
|
||||
item.free()
|
||||
_items = []
|
||||
|
||||
func erase_item_by_string(value: String) -> void:
|
||||
erase_item(DropdownItem.new(value, value))
|
||||
|
||||
func erase_item(item: DropdownItem) -> void:
|
||||
_items.erase(item)
|
||||
item.free()
|
||||
|
||||
func set_selected_item(item: DropdownItem) -> void:
|
||||
_on_selection_changed(_items.find(item))
|
||||
|
||||
func set_selected_index(index: int) -> void:
|
||||
_on_selection_changed(index)
|
||||
|
||||
func set_selected_by_value(value) -> void:
|
||||
for item in _items:
|
||||
if item.value == value:
|
||||
set_selected_item(item)
|
||||
return
|
||||
|
||||
func get_selected_index() -> int:
|
||||
return _selected
|
||||
|
||||
func get_selected_item():
|
||||
if _selected >=0:
|
||||
return _items[_selected]
|
||||
return null
|
||||
|
||||
func get_selected_value():
|
||||
if _selected >=0:
|
||||
return _items[_selected].value
|
||||
return null
|
||||
|
||||
func _ready() -> void:
|
||||
_group.resource_local_to_scene = false
|
||||
_update_view()
|
||||
_init_connections()
|
||||
|
||||
func _update_view() -> void:
|
||||
_update_view_icon()
|
||||
_update_view_button()
|
||||
|
||||
func _update_view_icon() -> void:
|
||||
if _selected >= 0 and _items[_selected].icon != null:
|
||||
_icon.show()
|
||||
else:
|
||||
_icon.hide()
|
||||
|
||||
func _update_view_button() -> void:
|
||||
_clear.visible = _selected >= 0
|
||||
|
||||
func _init_connections() -> void:
|
||||
_selector.pressed.connect(_update_popup_view)
|
||||
_clear.pressed.connect(_clear_pressed)
|
||||
_filter.text_changed.connect(_filter_changed)
|
||||
|
||||
func _update_popup_view() -> void:
|
||||
if _disabled:
|
||||
return
|
||||
_update_items_view()
|
||||
var rect = get_global_rect()
|
||||
var position = Vector2(rect.position.x, rect.position.y + rect.size.y + 2)
|
||||
if Engine.is_editor_hint():
|
||||
position = get_viewport().canvas_transform * global_position + Vector2(get_viewport().position)
|
||||
position.y += size.y
|
||||
_popup_panel.position = position
|
||||
_popup_panel.popup()
|
||||
|
||||
func _update_items_view() -> void:
|
||||
for child in _popup_panel_vbox.get_children():
|
||||
_popup_panel_vbox.remove_child(child)
|
||||
child.queue_free()
|
||||
for index in range(_items.size()):
|
||||
if _filter.text.length() <= 0:
|
||||
_popup_panel_vbox.add_child(_init_check_box(index))
|
||||
else:
|
||||
var filter_text = _filter.text
|
||||
var item_text = _items[index].text
|
||||
if ignore_case:
|
||||
filter_text = filter_text.to_upper()
|
||||
item_text = item_text.to_upper()
|
||||
if filter_text in item_text:
|
||||
_popup_panel_vbox.add_child(_init_check_box(index))
|
||||
var rect = get_global_rect()
|
||||
var size = Vector2(rect.size.x, _popup_calc_height())
|
||||
_popup_panel.set_size(size)
|
||||
|
||||
func _popup_calc_height() -> int:
|
||||
var child_count = _popup_panel_vbox.get_child_count()
|
||||
if child_count > 0:
|
||||
var single_height: int = _popup_panel_vbox.get_child(0).size.y + 5
|
||||
if child_count >= popup_maxheight_count:
|
||||
return (popup_maxheight_count + 1) * single_height
|
||||
else:
|
||||
if Engine.is_editor_hint():
|
||||
return (child_count + 1) * single_height + single_height / 2
|
||||
else:
|
||||
return (child_count + 1) * single_height
|
||||
return 0
|
||||
|
||||
func _init_check_box(index: int) -> CheckBox:
|
||||
var check_box = CheckBox.new()
|
||||
check_box.set_button_group(_group)
|
||||
check_box.text = _items[index].text
|
||||
check_box.tooltip_text = _items[index].tooltip
|
||||
if _items[index].icon != null:
|
||||
check_box.expand_icon = true
|
||||
check_box.icon = _items[index].icon
|
||||
if index == _selected:
|
||||
check_box.set_pressed(true)
|
||||
check_box.pressed.connect(_on_selection_changed.bind(index))
|
||||
return check_box
|
||||
|
||||
func _on_selection_changed(index: int) -> void:
|
||||
if index < 0:
|
||||
_selected = -1
|
||||
_selector.text = ""
|
||||
else:
|
||||
_selected = index
|
||||
_selector.text = _items[_selected].text
|
||||
_selector.tooltip_text = _items[_selected].tooltip
|
||||
if _items[_selected].icon != null:
|
||||
_icon.texture = _items[_selected].icon
|
||||
emit_signal("selection_changed", _items[_selected])
|
||||
_popup_panel.hide()
|
||||
_update_view()
|
||||
|
||||
func _clear_pressed() -> void:
|
||||
set_selected_index(-1)
|
||||
|
||||
func _filter_changed(_text: String) -> void:
|
||||
_update_items_view()
|
||||
1
addons/ui_extensions/dropdown/Dropdown.gd.uid
Normal file
1
addons/ui_extensions/dropdown/Dropdown.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://h1140f0rhrye
|
||||
63
addons/ui_extensions/dropdown/Dropdown.tscn
Normal file
63
addons/ui_extensions/dropdown/Dropdown.tscn
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://ov647hx6yjxa"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/ui_extensions/dropdown/Dropdown.gd" id="1_ah183"]
|
||||
[ext_resource type="Texture2D" uid="uid://btxlurvr45t4y" path="res://addons/ui_extensions/dropdown/Cancel.svg" id="1_l2sby"]
|
||||
[ext_resource type="Texture2D" uid="uid://bb76dl3aocsjo" path="res://addons/ui_extensions/dropdown/Arrow.svg" id="2_ims8p"]
|
||||
|
||||
[node name="DropdownContent" type="VBoxContainer"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("1_ah183")
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="HBox"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Selector" type="Button" parent="HBox"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
icon = ExtResource("2_ims8p")
|
||||
alignment = 0
|
||||
icon_alignment = 2
|
||||
|
||||
[node name="Clear" type="Button" parent="HBox"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
icon = ExtResource("1_l2sby")
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="PopupPanel" type="PopupPanel" parent="."]
|
||||
|
||||
[node name="VBoxPanel" type="VBoxContainer" parent="PopupPanel"]
|
||||
offset_left = 4.0
|
||||
offset_top = 4.0
|
||||
offset_right = 96.0
|
||||
offset_bottom = 96.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Filter" type="LineEdit" parent="PopupPanel/VBoxPanel"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Scroll" type="ScrollContainer" parent="PopupPanel/VBoxPanel"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ScrollVBox" type="VBoxContainer" parent="PopupPanel/VBoxPanel/Scroll"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="PopupPanel/VBoxPanel/Scroll/ScrollVBox"]
|
||||
layout_mode = 2
|
||||
15
addons/ui_extensions/dropdown/DropdownItem.gd
Normal file
15
addons/ui_extensions/dropdown/DropdownItem.gd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# UI Extension Filter Dropdown Item : MIT License
|
||||
# @author Vladimir Petrenko
|
||||
extends Object
|
||||
class_name DropdownItem
|
||||
|
||||
var value
|
||||
var text: String
|
||||
var tooltip: String
|
||||
var icon: Texture2D
|
||||
|
||||
func _init(ivalue, itext: String, itooltip: String = "", iicon: Texture2D = null) -> void:
|
||||
self.value = ivalue
|
||||
self.text = itext
|
||||
self.tooltip = itooltip
|
||||
self.icon = iicon
|
||||
1
addons/ui_extensions/dropdown/DropdownItem.gd.uid
Normal file
1
addons/ui_extensions/dropdown/DropdownItem.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dvq1rgfxhpb4p
|
||||
Loading…
Add table
Add a link
Reference in a new issue