From 1ffa77166a1e9e480180de967da14208eca4ab42 Mon Sep 17 00:00:00 2001 From: don-tnowe <67479453+don-tnowe@users.noreply.github.com> Date: Thu, 22 Sep 2022 19:18:09 +0300 Subject: [PATCH] Implement resource cell editing --- .../resources_speadsheet_view/editor_view.gd | 6 +- .../editor_view.tscn | 5 +- .../typed_cells/cell_editor.gd | 3 +- .../typed_cells/cell_editor_color.gd | 2 +- .../typed_cells/cell_editor_resource.gd | 52 +++++++++++++++ .../typed_cells/resource.tscn | 60 ++++++++++++++++++ example/icons/1.tres | 8 +++ example/icons/2.tres | 8 +++ example/icons/3.tres | 8 +++ example/icons/4.tres | 8 +++ example/icons/5.tres | 8 +++ example/icons/6.tres | 8 +++ example/icons/all_icons.png | Bin 0 -> 2072 bytes example/icons/all_icons.png.import | 35 ++++++++++ example/my_custom_resource.gd | 8 ++- example/new scene.tscn | 34 ++++++++++ example/upgrades/elemental.tres | 5 +- example/upgrades/health.tres | 5 +- example/upgrades/up_aoe.tres | 5 +- example/upgrades/up_magic.tres | 4 +- example/upgrades/up_strength.tres | 4 +- example/upgrades/weapon_axe.tres | 4 +- example/upgrades/weapon_blizzard.tres | 4 +- example/upgrades/weapon_chaos_blast.tres | 6 +- example/upgrades/weapon_dagger.tres | 4 +- example/upgrades/weapon_giga_sword.tres | 6 +- example/upgrades/weapon_lightning.tres | 4 +- example/upgrades/weapon_spear.tres | 4 +- 28 files changed, 281 insertions(+), 27 deletions(-) create mode 100644 addons/resources_speadsheet_view/typed_cells/cell_editor_resource.gd create mode 100644 addons/resources_speadsheet_view/typed_cells/resource.tscn create mode 100644 example/icons/1.tres create mode 100644 example/icons/2.tres create mode 100644 example/icons/3.tres create mode 100644 example/icons/4.tres create mode 100644 example/icons/5.tres create mode 100644 example/icons/6.tres create mode 100644 example/icons/all_icons.png create mode 100644 example/icons/all_icons.png.import create mode 100644 example/new scene.tscn diff --git a/addons/resources_speadsheet_view/editor_view.gd b/addons/resources_speadsheet_view/editor_view.gd index ebf0ae3..e4b94e4 100644 --- a/addons/resources_speadsheet_view/editor_view.gd +++ b/addons/resources_speadsheet_view/editor_view.gd @@ -180,7 +180,7 @@ func _update_row(row_index : int): var next_color := Color.white for i in columns.size(): if root_node.get_child_count() <= (row_index + 1) * columns.size() + i: - current_node = column_editors[i].create_cell() + current_node = column_editors[i].create_cell(self) current_node.connect("gui_input", self, "_on_cell_gui_input", [current_node]) root_node.add_child(current_node) @@ -400,10 +400,6 @@ func _on_cell_gui_input(event : InputEvent, cell : Control): select_cell(cell) - if event is InputEventMouseMotion: - if Input.is_mouse_button_pressed(BUTTON_LEFT): - select_cell(cell) - func _gui_input(event : InputEvent): if event is InputEventMouseButton: diff --git a/addons/resources_speadsheet_view/editor_view.tscn b/addons/resources_speadsheet_view/editor_view.tscn index 82da8e6..e2c01ce 100644 --- a/addons/resources_speadsheet_view/editor_view.tscn +++ b/addons/resources_speadsheet_view/editor_view.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/resources_speadsheet_view/editor_view.gd" type="Script" id=1] [ext_resource path="res://addons/resources_speadsheet_view/typed_cells/cell_editor_string.gd" type="Script" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://addons/resources_speadsheet_view/table_header.tscn" type="PackedScene" id=6] [ext_resource path="res://addons/resources_speadsheet_view/typed_editors/dock_color.tscn" type="PackedScene" id=7] [ext_resource path="res://addons/resources_speadsheet_view/typed_editors/dock_number.tscn" type="PackedScene" id=8] +[ext_resource path="res://addons/resources_speadsheet_view/typed_cells/cell_editor_resource.gd" type="Script" id=9] [sub_resource type="Image" id=3] data = { @@ -45,7 +46,7 @@ __meta__ = { "_edit_lock_": true } table_header_scene = ExtResource( 6 ) -cell_editor_classes = [ ExtResource( 3 ), ExtResource( 5 ), ExtResource( 2 ) ] +cell_editor_classes = [ ExtResource( 3 ), ExtResource( 5 ), ExtResource( 9 ), ExtResource( 2 ) ] path_folder_path = NodePath("HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer/Path") path_recent_paths = NodePath("HeaderContentSplit/VBoxContainer/HBoxContainer/RecentPaths") path_table_root = NodePath("HeaderContentSplit/MarginContainer/FooterContentSplit/Panel/Scroll/MarginContainer/TableGrid") diff --git a/addons/resources_speadsheet_view/typed_cells/cell_editor.gd b/addons/resources_speadsheet_view/typed_cells/cell_editor.gd index 24513ed..94317c6 100644 --- a/addons/resources_speadsheet_view/typed_cells/cell_editor.gd +++ b/addons/resources_speadsheet_view/typed_cells/cell_editor.gd @@ -9,7 +9,8 @@ func can_edit_value(value, type, property_hint) -> bool: return true # Override to change how the cell is created; preload a scene or create nodes from code. -func create_cell() -> Control: +# Caller is an instance of `editor_view.tscn`. +func create_cell(caller : Control) -> Control: return load(CELL_SCENE_DIR + "basic.tscn").instance() # Override to change behaviour when the cell is clicked to be selected. diff --git a/addons/resources_speadsheet_view/typed_cells/cell_editor_color.gd b/addons/resources_speadsheet_view/typed_cells/cell_editor_color.gd index 4184ee7..4214294 100644 --- a/addons/resources_speadsheet_view/typed_cells/cell_editor_color.gd +++ b/addons/resources_speadsheet_view/typed_cells/cell_editor_color.gd @@ -3,7 +3,7 @@ extends CellEditor var _cached_color := Color.white -func create_cell() -> Control: +func create_cell(caller : Control) -> Control: var node = load(CELL_SCENE_DIR + "basic.tscn").instance() var color = ColorRect.new() node.align = Label.ALIGN_RIGHT diff --git a/addons/resources_speadsheet_view/typed_cells/cell_editor_resource.gd b/addons/resources_speadsheet_view/typed_cells/cell_editor_resource.gd new file mode 100644 index 0000000..0a69cc5 --- /dev/null +++ b/addons/resources_speadsheet_view/typed_cells/cell_editor_resource.gd @@ -0,0 +1,52 @@ +extends CellEditor + +var previewer : EditorResourcePreview + + +func can_edit_value(value, type, property_hint) -> bool: + return type == TYPE_OBJECT + + +func create_cell(caller : Control) -> Control: + if previewer == null: + previewer = caller.editor_plugin.get_editor_interface().get_resource_previewer() + + var node = load(CELL_SCENE_DIR + "resource.tscn").instance() + return node + + +func set_value(node : Control, value): + if value == null: + node.get_node("Box/Tex").visible = false + node.get_node("Box/Label").text = "[empty]" + node.editor_description = "" + + if !value is Resource: return + + node.editor_description = value.resource_path + node.get_node("Box/Label").text = value.resource_name + "[" + value.resource_path.get_file() + "]" + if value is Texture: + node.get_node("Box/Tex").visible = true + node.get_node("Box/Tex").texture = value + + else: + node.get_node("Box/Tex").visible = false + previewer.queue_resource_preview(value.resource_path, self, "_on_preview_loaded", node) + + +func get_value(node : Control): + if node.editor_description == "": return null + return load(node.editor_description) + + +func set_color(node : Control, color : Color): + node.get_node("Back").modulate = color * 0.6 if node.editor_description == "" else color + + +func get_text_length(node : Control): + return -1 + + +func _on_preview_loaded(path : String, preview : Texture, thumbnail_preview : Texture, node): + node.get_node("Box/Tex").visible = true + node.get_node("Box/Tex").texture = preview diff --git a/addons/resources_speadsheet_view/typed_cells/resource.tscn b/addons/resources_speadsheet_view/typed_cells/resource.tscn new file mode 100644 index 0000000..38f0a4c --- /dev/null +++ b/addons/resources_speadsheet_view/typed_cells/resource.tscn @@ -0,0 +1,60 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://icon.png" type="Texture" id=1] + +[sub_resource type="DynamicFont" id=1] +size = 8 + +[node name="Label" type="MarginContainer"] +margin_right = 58.0 +margin_bottom = 14.0 +size_flags_vertical = 9 +__meta__ = { +"_edit_lock_": true +} + +[node name="Back" type="LineEdit" parent="."] +show_behind_parent = true +margin_right = 85.0 +margin_bottom = 32.0 +focus_mode = 0 +mouse_filter = 2 +custom_fonts/font = SubResource( 1 ) +editable = false +expand_to_text_length = true +context_menu_enabled = false +virtual_keyboard_enabled = false +caret_blink = true +caret_blink_speed = 0.5 +__meta__ = { +"_edit_lock_": true +} + +[node name="Selected" type="ColorRect" parent="."] +visible = false +margin_right = 85.0 +margin_bottom = 32.0 +mouse_filter = 2 +color = Color( 1, 1, 1, 0.247059 ) + +[node name="Box" type="HBoxContainer" parent="."] +margin_right = 85.0 +margin_bottom = 32.0 + +[node name="Tex" type="TextureRect" parent="Box"] +margin_right = 32.0 +margin_bottom = 32.0 +rect_min_size = Vector2( 32, 32 ) +texture = ExtResource( 1 ) +expand = true +stretch_mode = 6 + +[node name="Label" type="Label" parent="Box"] +margin_left = 36.0 +margin_top = 9.0 +margin_right = 85.0 +margin_bottom = 23.0 +size_flags_horizontal = 3 +text = "res.tres" +align = 1 +valign = 1 diff --git a/example/icons/1.tres b/example/icons/1.tres new file mode 100644 index 0000000..822d10c --- /dev/null +++ b/example/icons/1.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://example/icons/all_icons.png" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 64, 0, 64, 64 ) diff --git a/example/icons/2.tres b/example/icons/2.tres new file mode 100644 index 0000000..c2fb21c --- /dev/null +++ b/example/icons/2.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://example/icons/all_icons.png" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 64, 64 ) diff --git a/example/icons/3.tres b/example/icons/3.tres new file mode 100644 index 0000000..d40c073 --- /dev/null +++ b/example/icons/3.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://example/icons/all_icons.png" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 128, 0, 64, 64 ) diff --git a/example/icons/4.tres b/example/icons/4.tres new file mode 100644 index 0000000..fc4bdb3 --- /dev/null +++ b/example/icons/4.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://example/icons/all_icons.png" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 192, 0, 64, 64 ) diff --git a/example/icons/5.tres b/example/icons/5.tres new file mode 100644 index 0000000..63b1e60 --- /dev/null +++ b/example/icons/5.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://example/icons/all_icons.png" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 0, 64, 64, 64 ) diff --git a/example/icons/6.tres b/example/icons/6.tres new file mode 100644 index 0000000..23e1a9e --- /dev/null +++ b/example/icons/6.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://example/icons/all_icons.png" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 64, 64, 64, 64 ) diff --git a/example/icons/all_icons.png b/example/icons/all_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..71e7fe2957664a76bc18fa95df3af8664b8686a6 GIT binary patch literal 2072 zcmds&_fym97RJ8`B(e!v5Tz?6NGAcZfPkxzLI@FJE`ks`NHqo!*p(_#lwJ~H*@#FF zOA&UJ7K)&>r7EGhm!=5r1*NP=lLfM2yg%JP;r{T>IiF{qcb=Iu=bbl&O0h=36kq@V zAZ$nkdjJ3lTM!^7A}sXB&JITuZf}hPYG0mO7J_I1)(#5*PqN_q-Vh-}skRPQ0)ar- zI(ClT5*BcTJ>{|hc;93|7ScDNBw9ECeA{_+K+;-dCIB4EupwX_B0W|o`|m88idpdo z1cK#E$=8k0k+FR}R*HZ*~TLah(Jo1}(+SDGGuX2HSX6g1Wgc>+Lr{ zQJiH>9e8l&aMT!>WZ__;Z11Ol-;pseq#HfB&R156<+TD((FSQ-|3Kf(b*T`(vTBXm zcep)56evMDFUeij(gc51DcravNng+FFKG;7>NBUBf4<_4dX> zx)eeK=FuhU(K^V_99@3vV-)jHZ23qq$JB9j_=CGHK+OzXHq>vo`lA0eBS(UUVNU5~ z`)cv}rH_3>-sMCmD_<$RnYnruL21B~d(!xLUYBh`V`|??BE~5tndKRw!DY+LnhhBR zRwoa6;jD=>wCCEx1zHqu0@f1m13jUGjGPC{w0ANS?2g0}U zVW34v0>zUC+&C={xvl!{73h#B*-W~(R$`P_iq09uxBVmOBIv9C8nL>{%@n)>@W(sUY5%TXWSjVwvuX4uxx$!TJnA{85 zr5-HgZR4P)xR1BNQ)KHr!SFG{9yv4Grs~XOS$`^@y|Hp)d}VXf=0bR}8ymwGT1$Rb z*Voz#e9_#WAFGakhV(mK{`gA)|4E@ zNomcpekII(G`HPP&AD$#a3Q>y?? zT!hOGz)E}EQ0v?d`X+_EtRhn7?L}%2Eq-j^GBmL?)#qOCf{dCalx0ceYthq{5{z3+ z!ekqEbKWJUkd&28sgCk?8uSRpA|>aibw1UO(895xPRP3xk2LgnVFk0~8nVQk$VnR4 zi+;$5G8BblJq9bP$V;x^u$M1>plzbF5mP2%X68R+l>}>)vW`DMkzBbu9QsHjTQ>+* zNh`;pN$L`+SE1gnTY;h9V|Te2dRYgFde-HT(3s*}%CMQkNMAGHB1cEh*%}8v zOrFTeTtxlX)X+suYtL|Fd^*tg02s4rvR+xaBv%qDm{}}!eym#7pb7L;!>7X&c$CS7 zjI60m<41{WP4J?*tv$&1l4m79xFmbXfqU3%;N34&ff9?CNqR%x?xx~`Z0)L)otrb= zaMooZ>M=e`w>#5&;;%~WP>(OW_7|)nZnVod@mX@tFy-L%Hach<7MS(eSK_AsToco? z<k{$luJN!x>a5WRM0@u^2OZ4A&*&eE!{A4qp6padJE zd=c)u?J?=0L*XiV$|=GW=LoscZ^4hI5xlSqm$Y-YA978w)vKdwMd-CRr} zf+6Nt7dwL6m@glS`34Soy_=4P%LOwJQ#SO<+p7g)HMyk{sbg|~*B*kGHcHi3MS5tq zakMxD`sPTr=9F=ZhL39nx(lIy#eIY^Vj?+(zoCfc)SbH&p;(W&yDbTS8~g5-nRyz# zh_2d@v|{4+tL0!1nCJfDy2_So1gdP?zypY{8ud!6y*IAZ0w1ZCe{g-Ifi=|?rHFPi z7?71`91%VQ6m6`Qjhd3Nk4c7v_JVnC#9#eK^Ap>Jw`!+DThm;IxQ2*0c;)$SuxW^% zie06cGikNBjv0{F;eaVu_4*pVUNV8klp(!^v~Mz_zi=J2+H>xbH^HhKcTM6wgEud( z;Xu$U+osMY>SnTEv!4i~;}q9SaZ{FkLdPnD=ch~)QN=Qx1`c?U5;lWtSudAwzJCP8 z#V2ej%vGs=vW_U|ilIjcQV(My!xMYo7=A()99qs_`jVaHavc6PLRaSb@)bSiSk3>g nTq-2AMf(5W5Z2BtEEE9tu5)S5_NOa_zcpZEMIqGUyzcx1Xv(BC literal 0 HcmV?d00001 diff --git a/example/icons/all_icons.png.import b/example/icons/all_icons.png.import new file mode 100644 index 0000000..3742958 --- /dev/null +++ b/example/icons/all_icons.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/all_icons.png-81c01fb40e0103e1eb894edd007b8876.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://example/icons/all_icons.png" +dest_files=[ "res://.import/all_icons.png-81c01fb40e0103e1eb894edd007b8876.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/example/my_custom_resource.gd b/example/my_custom_resource.gd index e90ba74..68e1691 100644 --- a/example/my_custom_resource.gd +++ b/example/my_custom_resource.gd @@ -5,16 +5,18 @@ extends Resource export var color1 := Color.white export var max_duplicates := 0 export var tags := "tag_1 tag_2 tag_3" +export var icon : Texture +export var custom_scene : PackedScene export var color2 := Color.white -export(String) var tag_delimeter = " " +export var tag_delimeter := " " export var base_weight := 10.0 export var is_notable := false export(String, MULTILINE) var multiplier_per_tag := "" export(String, MULTILINE) var multiplier_if_tag_present := "" export(String, MULTILINE) var multiplier_if_tag_not_present := "" export(String, MULTILINE) var max_tags_present := "" -export(String) var list_item_delimeter = " " -export(String) var list_row_delimeter = ";" +export var list_item_delimeter := " " +export var list_row_delimeter := ";" var is_cached := false var tag_array := [] diff --git a/example/new scene.tscn b/example/new scene.tscn new file mode 100644 index 0000000..becf33a --- /dev/null +++ b/example/new scene.tscn @@ -0,0 +1,34 @@ +[gd_scene format=2] + +[node name="Node2D" type="Node2D"] + +[node name="ColorRect" type="ColorRect" parent="."] +margin_left = 51.0 +margin_top = 54.0 +margin_right = 374.0 +margin_bottom = 371.0 +rect_rotation = -15.0 +color = Color( 0, 1, 0.0156863, 1 ) + +[node name="ColorRect2" type="ColorRect" parent="."] +margin_left = 484.0 +margin_top = 66.0 +margin_right = 807.0 +margin_bottom = 383.0 +rect_rotation = 15.0 +color = Color( 0, 0.905882, 1, 1 ) + +[node name="ColorRect3" type="ColorRect" parent="."] +margin_left = -39.0 +margin_top = 324.0 +margin_right = 284.0 +margin_bottom = 641.0 +rect_rotation = -30.0 +color = Color( 0, 0.0156863, 1, 1 ) + +[node name="ColorRect4" type="ColorRect" parent="."] +margin_left = 271.0 +margin_top = 219.0 +margin_right = 594.0 +margin_bottom = 536.0 +color = Color( 0.686275, 0, 1, 1 ) diff --git a/example/upgrades/elemental.tres b/example/upgrades/elemental.tres index b59b6bb..0f3d659 100644 --- a/example/upgrades/elemental.tres +++ b/example/upgrades/elemental.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/6.tres" type="Texture" id=2] [resource] resource_name = "Upgrade: Elemental Damage" @@ -8,7 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = "elemental" -requires_one_of_tags = "" +icon = ExtResource( 2 ) color2 = Color( 0.964706, 0.298039, 0.298039, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/health.tres b/example/upgrades/health.tres index 17dedd3..0935eaf 100644 --- a/example/upgrades/health.tres +++ b/example/upgrades/health.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/2.tres" type="Texture" id=2] [resource] resource_name = "Upgrade: Health" @@ -8,7 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = "health melee" -requires_one_of_tags = "" +icon = ExtResource( 2 ) color2 = Color( 0.129412, 1, 0.243137, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/up_aoe.tres b/example/upgrades/up_aoe.tres index ddbc513..f3610c8 100644 --- a/example/upgrades/up_aoe.tres +++ b/example/upgrades/up_aoe.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/6.tres" type="Texture" id=2] [resource] resource_name = "Upgrade: Area of Effect" @@ -8,7 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 1, 1 ) max_duplicates = 4 tags = "aoe" -requires_one_of_tags = "" +icon = ExtResource( 2 ) color2 = Color( 0.964706, 0.298039, 0.298039, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/up_magic.tres b/example/upgrades/up_magic.tres index 2adeaa1..bb9cb14 100644 --- a/example/upgrades/up_magic.tres +++ b/example/upgrades/up_magic.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/5.tres" type="Texture" id=2] [resource] resource_name = "Upgrade: Magic" @@ -8,6 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = "magic" +icon = ExtResource( 2 ) color2 = Color( 0.189457, 0.452246, 0.902344, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/up_strength.tres b/example/upgrades/up_strength.tres index b8a9985..3844f57 100644 --- a/example/upgrades/up_strength.tres +++ b/example/upgrades/up_strength.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/1.tres" type="Texture" id=2] [resource] resource_name = "Upgrade: Strength" @@ -8,6 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = "strength" +icon = ExtResource( 2 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/weapon_axe.tres b/example/upgrades/weapon_axe.tres index 2bf5146..d98b643 100644 --- a/example/upgrades/weapon_axe.tres +++ b/example/upgrades/weapon_axe.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/3.tres" type="Texture" id=2] [resource] resource_name = "Weapon: Axe" @@ -8,6 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 0.2, 1 ) max_duplicates = 1 tags = "weapon strength aoe melee" +icon = ExtResource( 2 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/weapon_blizzard.tres b/example/upgrades/weapon_blizzard.tres index d4ccb74..998c9fa 100644 --- a/example/upgrades/weapon_blizzard.tres +++ b/example/upgrades/weapon_blizzard.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/4.tres" type="Texture" id=2] [resource] resource_name = "Weapon: Blizzard" @@ -8,6 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 0.2, 1 ) max_duplicates = 1 tags = "weapon magic aoe elemental" +icon = ExtResource( 2 ) color2 = Color( 0.189457, 0.452246, 0.902344, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/weapon_chaos_blast.tres b/example/upgrades/weapon_chaos_blast.tres index 026b124..de674d9 100644 --- a/example/upgrades/weapon_chaos_blast.tres +++ b/example/upgrades/weapon_chaos_blast.tres @@ -1,6 +1,8 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=4 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/4.tres" type="Texture" id=2] +[ext_resource path="res://example/new scene.tscn" type="PackedScene" id=3] [resource] resource_name = "Weapon: Chaos Blast" @@ -8,6 +10,8 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 0.2, 1 ) max_duplicates = 1 tags = "weapon magic legendary chaosblast aoe" +icon = ExtResource( 2 ) +custom_scene = ExtResource( 3 ) color2 = Color( 0.40631, 0.190945, 0.832031, 1 ) tag_delimeter = " " base_weight = 1.0 diff --git a/example/upgrades/weapon_dagger.tres b/example/upgrades/weapon_dagger.tres index 430861f..5bfef57 100644 --- a/example/upgrades/weapon_dagger.tres +++ b/example/upgrades/weapon_dagger.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/3.tres" type="Texture" id=2] [resource] resource_name = "Weapon: Daggers" @@ -8,6 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 0.2, 1 ) max_duplicates = 1 tags = "weapon strength dagger projectile" +icon = ExtResource( 2 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/weapon_giga_sword.tres b/example/upgrades/weapon_giga_sword.tres index 46b5994..e2ad47c 100644 --- a/example/upgrades/weapon_giga_sword.tres +++ b/example/upgrades/weapon_giga_sword.tres @@ -1,6 +1,8 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=4 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/3.tres" type="Texture" id=2] +[ext_resource path="res://example/new scene.tscn" type="PackedScene" id=3] [resource] resource_name = "Weapon: Giga Sword" @@ -8,6 +10,8 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 0.2, 1 ) max_duplicates = 1 tags = "weapon strength legendary gigasword melee" +icon = ExtResource( 2 ) +custom_scene = ExtResource( 3 ) color2 = Color( 0.988235, 0.93848, 0.192157, 1 ) tag_delimeter = " " base_weight = 1.0 diff --git a/example/upgrades/weapon_lightning.tres b/example/upgrades/weapon_lightning.tres index 43aa4f4..8ade7fb 100644 --- a/example/upgrades/weapon_lightning.tres +++ b/example/upgrades/weapon_lightning.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/4.tres" type="Texture" id=2] [resource] resource_name = "Weapon: Lightning" @@ -8,6 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 0.2, 1 ) max_duplicates = 1 tags = "weapon magic lightning elemental" +icon = ExtResource( 2 ) color2 = Color( 0.189457, 0.452246, 0.902344, 1 ) tag_delimeter = " " base_weight = 10.0 diff --git a/example/upgrades/weapon_spear.tres b/example/upgrades/weapon_spear.tres index b87b755..78795ee 100644 --- a/example/upgrades/weapon_spear.tres +++ b/example/upgrades/weapon_spear.tres @@ -1,6 +1,7 @@ -[gd_resource type="Resource" load_steps=2 format=2] +[gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://example/my_custom_resource.gd" type="Script" id=1] +[ext_resource path="res://example/icons/3.tres" type="Texture" id=2] [resource] resource_name = "Weapon: Spear" @@ -8,6 +9,7 @@ script = ExtResource( 1 ) color1 = Color( 1, 1, 0.2, 1 ) max_duplicates = 1 tags = "weapon strength spear melee" +icon = ExtResource( 2 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) tag_delimeter = " " base_weight = 10.0