└── addons
└── datatable_godot
├── LICENSE
├── README.md
├── class
├── class_collection.gd
├── class_datatable.gd
└── class_struct.gd
├── common
├── backup.gd
├── class_generator.gd
├── commonV2.gd
├── compatibility.gd
├── customClassDB.gd
├── exporter.gd
├── importer.gd
├── interface.gd
├── plugin.gd
├── resource.gd
├── schema.gd
├── signals.gd
└── updater.gd
├── dat6D05.tmp
├── dat7FB2.tmp
├── datatable.gd
├── datatable.tscn
├── escape_shortcut.tres
├── icons
├── AABB.png
├── AABB.png.import
├── Add.svg
├── Add.svg.import
├── Basis.png
├── Basis.png.import
├── Close.svg
├── Close.svg.import
├── Color.svg
├── Color.svg.import
├── HTTPRequest.png
├── HTTPRequest.png.import
├── Help.svg
├── Help.svg.import
├── Load.png
├── Load.png.import
├── Plane.png
├── Plane.png.import
├── Projection.png
├── Projection.png.import
├── Quaternion.png
├── Quaternion.png.import
├── Rect2.png
├── Rect2.png.import
├── Reload.png
├── Reload.png.import
├── Remove.svg
├── Remove.svg.import
├── Ressource.png
├── Ressource.png.import
├── Save.png
├── Save.png.import
├── Search.png
├── Search.png.import
├── StatusError.png
├── StatusError.png.import
├── StatusSuccess.png
├── StatusSuccess.png.import
├── StatusWarning.png
├── StatusWarning.png.import
├── String.svg
├── String.svg.import
├── Transform2D.png
├── Transform2D.png.import
├── Transform3D.png
├── Transform3D.png.import
├── Vector2.svg
├── Vector2.svg.import
├── Vector3.svg
├── Vector3.svg.import
├── Vector4.svg
├── Vector4.svg.import
├── array_value.png
├── array_value.png.import
├── bool.png
├── bool.png.import
├── datatable.svg
├── datatable.svg.import
├── dictionary.png
├── dictionary.png.import
├── float.svg
├── float.svg.import
├── int.svg
├── int.svg.import
├── invalid_type.png
├── invalid_type.png.import
├── label.png
├── label.png.import
├── single_value.png
├── single_value.png.import
├── single_value.png~
├── tab_icon.svg
├── tab_icon.svg.import
├── table-entry_white.svg
└── table-entry_white.svg.import
├── plugin.cfg
└── ui
├── bg
├── bg_autoupdate.gd
├── bg_manageType.gd
└── bg_newTable.gd
├── box
└── arr_item_box.gd
├── buttons
├── help
│ ├── about.gd
│ ├── b_closeHelp.gd
│ └── changelog.gd
├── main
│ ├── b_help.gd
│ ├── b_manageTableType.gd
│ ├── b_newTable.gd
│ ├── b_newTableType.gd
│ ├── mb_manageCollection.gd
│ └── txt_version_status.gd
├── manageCollection
│ └── b_closeWindow.gd
├── manageType
│ ├── b_addType.gd
│ ├── b_add_param.gd
│ ├── b_closeWindow.gd
│ ├── b_deleteType.gd
│ ├── b_delete_param.gd
│ └── type_title.gd
└── newTable
│ ├── b_closeWindow.gd
│ ├── b_createTable.gd
│ ├── b_deleteTable.gd
│ ├── b_resource_import.gd
│ ├── b_tableItemDelete.gd
│ ├── export_but.gd
│ ├── import_but.gd
│ ├── in_tableItemName.gd
│ └── txt_table_name.gd
├── datatable_ui.gd
├── inputs
├── help
│ └── title.gd
├── manage_type
│ ├── in_comment_param.gd
│ ├── in_newTypeName.gd
│ └── in_new_param_name.gd
└── new_table
│ ├── OB_tableType.gd
│ ├── b_addItemTable.gd
│ ├── in_itemTableName.gd
│ ├── in_tableTitle.gd
│ └── param_block.gd
├── link handler project mainscreen.gd
├── nodes
├── OB_Enum.gd
├── generatedClassPreview
│ ├── generatedClassPreview.gd
│ └── generatedClassPreview.tscn
├── importer
│ └── customResource
│ │ ├── customResource.gd
│ │ ├── customResource.tscn
│ │ ├── customResourceVarListItem.gd
│ │ └── customResourceVarListItem.tscn
└── schema
│ ├── aabb_schema.tscn
│ ├── array_schema.tscn
│ ├── basis_schema.tscn
│ ├── bool_schema.tscn
│ ├── color_schema.tscn
│ ├── dict_item_schema.tscn
│ ├── dict_schema.tscn
│ ├── dict_win_schema.tscn
│ ├── float_schema.tscn
│ ├── int_schema.tscn
│ ├── invalid_schema.tscn
│ ├── plane_schema.tscn
│ ├── proj_schema.tscn
│ ├── quat_schema.tscn
│ ├── rect_schema.tscn
│ ├── ress_schema.tscn
│ ├── string_schema.tscn
│ ├── t_2_schema.tscn
│ ├── t_3_schema.tscn
│ ├── vector_2_schema.tscn
│ ├── vector_3_schema.tscn
│ └── vector_4_schema.tscn
└── schema
└── new_table
├── VBC_itemTableDataList.gd
├── aabb_schema.gd
├── array_schema.gd
├── basis_schema.gd
├── bool_schema.gd
├── color_schema.gd
├── dict_item_schema.gd
├── dict_schema.gd
├── dict_win_schema.gd
├── float_schema.gd
├── int_schema.gd
├── invalid_schema.gd
├── plane_schema.gd
├── proj_schema.gd
├── quaternionSchema.gd
├── rect_schema.gd
├── ress_schema.gd
├── schema_table.gd
├── string_schema.gd
├── t2_schema.gd
├── t3_schema.gd
├── tableItemSchema.gd
├── vector2_schema.gd
├── vector3_schema.gd
└── vector4_schema.gd
/addons/datatable_godot/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024-present Ward727
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/addons/datatable_godot/README.md:
--------------------------------------------------------------------------------
1 | # 💾Godot DataTable Plugin
2 |
3 | A plugin that give you the ability to create a datatable directly inside the editor.
4 |
5 | ### 
6 |
7 | If you have any suggestions (features, types, etc.), find a bug, or want to say something about it, [open an issue!](https://github.com/Ward727a/godot_datatable_plugin/issues) 🙂
8 |
9 | [Download it on the Godot Asset store](https://godotengine.org/asset-library/asset/2986) or [on GitHub!](https://github.com/Ward727a/godot_datatable_plugin/releases/latest)
10 |
11 | ## ✨Features
12 |
13 | - Nearly all types are supported! (int, string, Rect2, Vector4, Projection, etc.)
14 |
15 | - A nice UI, directly integrated within the editor!
16 |
17 | - A class that gives you the ability to get, set, or remove an element inside a table.
18 |
19 | - An auto-update system. (But you can choose to not use the update system if you want!)
20 | **Original Creator: [Nathanhoad for Godot Input Helper](https://github.com/nathanhoad/godot_input_helper/tree/main) under MIT License**
21 |
22 | - The ability to create an element that is an array inside a table with other elements.
23 |
24 | - Complete class documentation with examples and details.
25 |
26 | - All data is saved inside a [PackedDataContainer](https://docs.godotengine.org/en/stable/classes/class_packeddatacontainer.html) that allows you to serielize them with ease!
27 |
28 | - Collection system - A feature that allow you to create multiple datatable files for one project.
29 |
30 | - Setting a default value for each parameter of a structure.
31 |
32 | - Generate a base class from your structure.
33 |
34 | ## 👨💻Upcoming Features
35 |
36 | - The ability to link other tables and table items inside another table.
37 |
38 | - An example project.
39 |
40 | - [And more!](https://github.com/users/Ward727a/projects/2)
41 |
42 | - Want something and don't see it here? [Make an issue!](https://github.com/Ward727a/godot_datatable_plugin/issues)🙂
43 |
44 | ## ❔FAQ
45 |
46 | #### Can I use C# with this plugin?
47 |
48 | The C# is not actually supported, I will work on it if there is a needed, but for now I want to finish the plugin features before maybe doing it. If needed, please [open an issue](https://github.com/Ward727a/godot_datatable_plugin/issues)
49 |
50 | #### I created my table, and added elements in it, how can I access it?
51 |
52 | You can access it by using the `Collection` class!
53 |
54 | ## ©License
55 |
56 | This plugin is licensed under the MIT License, see [License](https://github.com/Ward727a/godot_datatable_plugin/blob/master/LICENSE) for more info.
57 |
--------------------------------------------------------------------------------
/addons/datatable_godot/class/class_struct.gd:
--------------------------------------------------------------------------------
1 | extends Object
2 | ## This class is for the DataTable Plugin pre-generated structure class code.
3 | ## [br]I discourage you to delete it, but do as you want!
4 | ##
5 | ## @experimental
6 | class_name Structure
7 |
8 | func _get_dict(_structure: Dictionary):
9 |
10 | var _data: Dictionary = {}
11 |
12 | for i in get_property_list():
13 | if(i['name'].begins_with("_")):
14 |
15 | var _name: String = i['name'].substr(1, i['name'].length() - 1)
16 | var _var_name: String
17 |
18 | if _structure['params'].has(_name):
19 | if i['type'] == TYPE_OBJECT:
20 | if get(i['name']) == null:
21 | _data[_name] = "res://"
22 | else:
23 | if get(i['name']).get_class() == "Resource":
24 | _data[_name] = get(i['name']).get_path()
25 |
26 | continue
27 | _data[_name] = get(i['name'])
28 | return _data
--------------------------------------------------------------------------------
/addons/datatable_godot/common/commonV2.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | class_name _dt_common
3 | ## Class created by DataTable Plugin
4 | ## This class is used for common functions that are used in multiple parts of the plugin, like [method get_version], [method add_root], etc
5 |
6 | # Color for text
7 |
8 | const txt_color = {
9 | SUCCESS = "lightgreen",
10 | WARNING = "ffde66",
11 | ERROR = "ff768b",
12 | VECX = "fab293",
13 | VECY = "93fab2",
14 | VECZ = "b293fa",
15 | VECW = "93dbfa"
16 | }
17 |
18 | const color = {
19 | SUCCESS = Color(.45, .95, .5),
20 | WARNING = Color(1, .87, .4),
21 | ERROR = Color(1, .47, .42),
22 | DEFAULT = Color(.87, .87, .87)
23 | }
24 |
25 | # Type for plugin
26 |
27 | const TYPE_INVALID = -1 # This type is used mainly for the dictionary editor for now (V2.3.0)
28 | const TYPE_STRING = 0
29 | const TYPE_INT = 1
30 | const TYPE_FLOAT = 2
31 | const TYPE_COLOR = 3
32 | const TYPE_VECTOR2 = 4
33 | const TYPE_VECTOR3 = 5
34 | const TYPE_VECTOR4 = 6
35 | const TYPE_BOOL = 7
36 | const TYPE_RESS = 8 # Ressource
37 | const TYPE_QUAT = 9 # Quaternion
38 | const TYPE_RECT = 10
39 | const TYPE_PLANE = 11
40 | const TYPE_T2 = 12 # Transform2D
41 | const TYPE_T3 = 13 # Transform3D
42 | const TYPE_AABB = 14
43 | const TYPE_BASIS = 15
44 | const TYPE_PROJ = 16
45 | const TYPE_DICT = 17
46 | const TYPE_DICT_ITEM = 18 # This is for a dictionary item, not a dictionary itself (mainly used for the editor)
47 | const TYPE_MAX = 19
48 |
49 | const SIZE_SINGLE = 0
50 | const SIZE_ARRAY = 1
51 | const SIZE_MAX = 2
52 |
53 | const INVALID_ICON = "res://addons/datatable_godot/icons/invalid_type.png"
54 | const INT_ICON = "res://addons/datatable_godot/icons/int.svg"
55 | const FLOAT_ICON = "res://addons/datatable_godot/icons/float.svg"
56 | const STR_ICON = "res://addons/datatable_godot/icons/String.svg"
57 | const COLOR_ICON = "res://addons/datatable_godot/icons/Color.svg"
58 | const V2_ICON = "res://addons/datatable_godot/icons/Vector2.svg"
59 | const V3_ICON = "res://addons/datatable_godot/icons/Vector3.svg"
60 | const V4_ICON = "res://addons/datatable_godot/icons/Vector4.svg"
61 | const BOOL_ICON = "res://addons/datatable_godot/icons/bool.png"
62 | const RESS_ICON = "res://addons/datatable_godot/icons/Ressource.png"
63 | const QUAT_ICON = "res://addons/datatable_godot/icons/Quaternion.png"
64 | const RECT_ICON = "res://addons/datatable_godot/icons/Rect2.png"
65 | const PLANE_ICON = "res://addons/datatable_godot/icons/Plane.png"
66 | const T2_ICON = "res://addons/datatable_godot/icons/Transform2D.png"
67 | const T3_ICON = "res://addons/datatable_godot/icons/Transform3D.png"
68 | const AABB_ICON = "res://addons/datatable_godot/icons/AABB.png"
69 | const BASIS_ICON = "res://addons/datatable_godot/icons/Basis.png"
70 | const PROJ_ICON = "res://addons/datatable_godot/icons/Projection.png"
71 | const DICT_ICON = "res://addons/datatable_godot/icons/dictionary.png"
72 |
73 | const ARR_ICON = "res://addons/datatable_godot/icons/array_value.png"
74 | const SINGLE_ICON = "res://addons/datatable_godot/icons/single_value.png"
75 |
76 | # backend func
77 |
78 | func ASSERT_ERROR(message: String):
79 | assert(false, message)
80 |
81 | func add_root(Child: Node):
82 |
83 | if Child == null || !Child:
84 | ASSERT_ERROR("Can't add child to EditorInterface: child null or invalid")
85 | return
86 |
87 | EditorInterface.get_base_control().add_child(Child)
88 |
89 | func SUCCESS(message: String):
90 | print_rich(str("[color=",txt_color.SUCCESS,"][DataTable] ", message))
91 |
92 | func WARNING(message: String):
93 | push_warning(str("[DataTable] ", message))
94 |
95 | func ERROR(message: String):
96 | push_error(str("[DataTable] ", message))
97 |
98 | func DEBUG(message: String):
99 | if _dt_plugin.get_instance().get_dev_debug() == "true":
100 | print_rich(str("[DataTable - Debug] ", message))
101 |
102 |
--------------------------------------------------------------------------------
/addons/datatable_godot/common/customClassDB.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends _dt_common
3 | class_name _dt_classDB
4 |
5 | # Created this because the default ClassDB doesn't detect custom created classes
6 |
7 | static func class_exist(className: String) -> bool:
8 |
9 | var arr = ProjectSettings.get_global_class_list().filter(
10 | func(data: Dictionary):
11 | return data['class'] == className
12 | )
13 |
14 | if arr.size() != 0:
15 | return true
16 |
17 | push_error(str("Class '",className,"' doesn't exist!"))
18 | return false
19 |
20 | static func get_class_data(className: String) -> Dictionary:
21 |
22 | if !class_exist(className):
23 | return {}
24 |
25 | var arr = ProjectSettings.get_global_class_list().filter(
26 | func(data: Dictionary):
27 | return data['class'] == className
28 | )
29 |
30 | if arr.size() != 1:
31 | push_error(str("Found Multiple?? class with name '",className,"'!"))
32 | return {}
33 |
34 | return arr[0]
35 |
36 | static func class_instantiate(className: String) -> Resource:
37 |
38 | if !class_exist(className):
39 | return null
40 |
41 | var classData = get_class_data(className)
42 |
43 | if classData == {}:
44 | return null
45 |
46 | if !classData.has('path'):
47 | push_error(str("Can't found key 'path' in class '",className,"'!"))
48 | return null
49 |
50 | if !classData.has('language'):
51 | push_error(str("Can't found key 'language' in class '",className,"'!"))
52 | return null
53 |
54 | if classData['language'] != 'GDScript':
55 | push_error(str("The class '",className,"' isn't a GDScript class!"))
56 | return null
57 |
58 | var script: GDScript = load(classData['path'])
59 |
60 | return script
61 |
62 | static func get_direct_child(className: String) -> Array:
63 |
64 |
65 | var arr = []
66 |
67 | for i in ProjectSettings.get_global_class_list():
68 | if i['base'] == className:
69 | arr.append(str(i['class']))
70 |
71 |
72 | return arr
--------------------------------------------------------------------------------
/addons/datatable_godot/common/exporter.gd:
--------------------------------------------------------------------------------
1 | extends _dt_common
2 | class_name _dt_exporter
3 | ## Class that manages exporting the CSV, JSON, and resources inside the datatable.
4 |
5 | # ########################### #
6 | # ###### CSV Functions ###### #
7 | # ########################### #
8 | static func _csv_convert_header(structure: Dictionary) -> Dictionary:
9 |
10 | var header: String = ""
11 | var headers: Array = []
12 |
13 | for param in structure['params']:
14 | header += param + ","
15 | headers.append(param)
16 |
17 | # remove last comma
18 | header = header.left(-1)
19 |
20 | return {"arr":headers, "str":header} # return both array and string
21 |
22 | static func _csv_convert_lines(header: Array, data: Dictionary) -> String:
23 |
24 | var lines: String = ""
25 |
26 | for line in data['rows']:
27 |
28 | for key in header:
29 |
30 | if !data['rows'][line]['columns'].has(key):
31 | lines += ","
32 | continue
33 |
34 | var value = data['rows'][line]['columns'][key]['value']
35 |
36 | value = str(value).replace('"', '""')
37 |
38 | if value.contains(","):
39 | value = "\"" + value + "\""
40 |
41 | value += ","
42 |
43 | lines += value
44 |
45 | # remove last comma
46 | lines = lines.left(-1)
47 |
48 | lines += "\n"
49 |
50 | return lines
51 |
52 | static func _csv_export(data: Dictionary, structure: Dictionary) -> String:
53 |
54 | var csv: String = ""
55 |
56 | var header = _csv_convert_header(structure)
57 |
58 | csv += header['str']
59 | csv += "\n"
60 | csv += _csv_convert_lines(header['arr'], data)
61 |
62 | return csv
63 |
64 |
65 | # ################################ #
66 | # ###### Resource Functions ###### #
67 | # ################################ #
68 |
69 |
--------------------------------------------------------------------------------
/addons/datatable_godot/common/interface.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends _dt_common
3 | class_name _dt_interface
4 |
5 | ## Class that manages the interface system of the plugin
6 |
7 | const check_update_text: String = "[img]res://addons/datatable_godot/icons/Reload.png[/img] Checking for update... "
8 | const up_to_date_text: String = "[img]res://addons/datatable_godot/icons/StatusSuccess.png[/img] [color=lightgreen]Version up-to-date! "
9 | const update_available_text: String = "[img]res://addons/datatable_godot/icons/StatusError.png[/img] [color=#ff768b]An update is available! "
10 | const cant_check_text: String = "[img]res://addons/datatable_godot/icons/StatusWarning.png[/img] [color=ffde66]Couldn't check for update! "
11 |
12 | const check_update_tip: String = "The plugin is check for an update..."
13 | const up_to_date_tip: String = "You good to go, you got the last version available!"
14 | const update_available_tip: String = "A new update is available, please update it!"
15 | const cant_check_tip: String = "The plugin couldn't check if an update was available due to an unknown error. Check it manually please!"
16 |
17 | var _main: Control
18 |
19 |
20 | static var _INSTANCE: _dt_interface
21 |
22 | static func delete():
23 | _INSTANCE = null
24 |
25 |
26 | static func get_instance() -> _dt_interface:
27 |
28 | if !_INSTANCE || _dt_plugin.get_instance().get_dev_reset_instance() == "true":
29 | _INSTANCE = _dt_interface.new()
30 |
31 | _INSTANCE.load_var()
32 | return _INSTANCE
33 |
34 | # Init
35 |
36 | func load_var():
37 | # can be used to init variable if needed
38 | pass
39 |
40 | # Backend
41 |
42 | func set_main(value: Control):
43 | _main = value
44 |
45 | func get_main() -> Control:
46 |
47 | if !_main:
48 | ASSERT_ERROR("Can't get main interface because it's null, it need to be initiated by the main plugin script")
49 | return null
50 |
51 | return _main
52 |
53 | func show_main():
54 | get_main().toggleMain()
55 |
56 | func show_type():
57 | get_main().toggleManageType()
58 |
59 | func show_table():
60 | get_main().toggleNewTable()
61 |
--------------------------------------------------------------------------------
/addons/datatable_godot/common/plugin.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends _dt_common
3 | class_name _dt_plugin
4 |
5 | ## Class that manages all the config, and plugin related information for the plugin
6 |
7 | const LOCAL_PATH: String = "res://addons/datatable_godot/"
8 | const LOCAL_CONFIG_PATH: String = "res://addons/datatable_godot/plugin.cfg"
9 |
10 | var _config: ConfigFile
11 |
12 |
13 | signal plugin_off
14 | signal plugin_on
15 |
16 | static var _INSTANCE: _dt_plugin
17 |
18 | static func delete():
19 | _INSTANCE = null
20 |
21 | static func get_instance() -> _dt_plugin:
22 |
23 | if !_INSTANCE:
24 | _INSTANCE = _dt_plugin.new()
25 |
26 | _INSTANCE.load_var()
27 | return _INSTANCE
28 |
29 | # Init
30 |
31 | func load_var():
32 | _config = ConfigFile.new()
33 | _config.load(LOCAL_CONFIG_PATH)
34 |
35 | # Config
36 |
37 | func get_version() -> String:
38 | return _config.get_value("plugin", "version")
39 |
40 | func get_name() -> String:
41 | return _config.get_value("plugin", "name")
42 |
43 | func get_dev_debug() -> String:
44 | return _config.get_value("dev", "debug", "false")
45 |
46 | func get_dev_stop_update() -> String:
47 | return _config.get_value("dev", "stop_update", "false")
48 |
49 | func get_dev_stop_backup() -> String:
50 | return _config.get_value("dev", "stop_backup", "false")
51 |
52 | func get_dev_stop_convert() -> String:
53 | return _config.get_value("dev", "stop_convert", "false")
54 |
55 | func get_dev_reset_instance() -> String:
56 | return _config.get_value("dev", "reset_instance", "false")
57 |
58 | func get_dev_force_convert() -> String:
59 | return _config.get_value("dev", "force_convert", "false")
60 |
61 | func get_dev_convert_watchdog_limit() -> String:
62 | return _config.get_value("dev", "convert_watchdog_limit", "10000")
63 |
64 | func get_file_version() -> String:
65 | return _config.get_value("file", "version")
66 |
67 | func get_file_ext() -> String:
68 | return _config.get_value("file", "ext", ".tableCollection.res")
69 |
70 | func get_backup_path() -> String:
71 | return _config.get_value("backup", "folder", "res://datatable_backup/")
72 |
73 | func get_backup_max() -> String:
74 | return _config.get_value("backup", "max", "3")
75 |
76 | func get_backup_suffix() -> String:
77 | return _config.get_value("backup", "suffix", "_backup")
78 |
79 | func get_update_temp_file() -> String:
80 | return _config.get_value("update", "temp_file", "user://temp_update_datatable.zip")
81 |
82 | func get_update_safeguard() -> String:
83 | return _config.get_value("update", "safeguard", "res://safeguard/safeguard.gd")
84 |
85 | # Convert a version number to an actually comparable number
86 | # OC: Nathanhoad (https://github.com/nathanhoad/godot_input_helper/tree/main) under MIT License (see above)
87 | func version_to_number(version: String) -> int:
88 |
89 | var bits = version.split(".")
90 | return bits[0].to_int() * 1000000 + bits[1].to_int() * 1000 + bits[2].to_int()
91 |
--------------------------------------------------------------------------------
/addons/datatable_godot/common/signals.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Node
3 |
4 | signal toggle_plugin_on
5 | signal toggle_plugin_off
6 |
7 | signal toggle_main_ask
8 | signal toggle_main_response
9 |
10 | signal toggle_newTable_ask
11 | signal toggle_newTable_response
12 | signal toggle_manageTable_ask
13 | signal toggle_manageTable_response
14 |
15 | signal toggle_newType_ask
16 | signal toggle_newType_response
17 | signal toggle_manageType_ask
18 | signal toggle_manageType_response
19 |
20 | signal toggle_help_ask
21 | signal toggle_help_response
22 |
23 | signal add_type_ask(type: Dictionary)
24 | signal add_type_response(success: bool)
25 | signal get_type_ask(key: int)
26 | signal get_type_response(data: Dictionary, key: int)
27 |
28 | signal script_key_ask(script_name: String)
29 | signal script_key_response(key: int, script_name: String)
30 |
31 | signal get_data_ask(key: int)
32 | signal get_data_response(data: Dictionary, key: int)
33 |
34 | signal popup_alert_ask(title: String, description: String)
35 |
36 | signal ask_reload_data
37 |
38 | signal presave_data
39 |
--------------------------------------------------------------------------------
/addons/datatable_godot/datatable.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends EditorPlugin
3 |
4 | var datatableDock: Node
5 |
6 | @onready var common: Node
7 |
8 | const tab_icon = preload("res://addons/datatable_godot/icons/tab_icon.svg")
9 | const tab_path = "res://addons/datatable_godot/datatable.tscn"
10 |
11 | func _enter_tree():
12 | # Initialization of the plugin goes here.
13 | datatableDock = preload(tab_path).instantiate()
14 |
15 | _add_data_table_dock()
16 | datatableDock.hide()
17 |
18 | common = datatableDock.get_node('signals')
19 |
20 | _dt_interface.get_instance().set_main(datatableDock)
21 |
22 | print("[DataTable] => Plugin is enabled!")
23 |
24 | _dt_plugin.get_instance().plugin_on.emit()
25 |
26 | func _exit_tree():
27 | _dt_plugin.get_instance().plugin_off.emit()
28 |
29 | # Clean-up of the plugin goes here.
30 | _remove_data_table_dock()
31 |
32 | print("[DataTable] => Plugin is disabled!")
33 |
34 | _dt_plugin.get_instance().delete()
35 | _dt_interface.get_instance().delete()
36 | _dt_resource.get_instance().delete()
37 | _dt_backup.get_instance().delete()
38 | _dt_updater.get_instance().delete()
39 | _dt_schema.get_instance().delete()
40 | _dt_class_generator.get_instance().delete()
41 | pass
42 |
43 | func _has_main_screen():
44 | return true
45 |
46 | func _get_plugin_name():
47 | return "Datatable"
48 |
49 | func _get_plugin_icon():
50 | return tab_icon
51 |
52 | func _make_visible(visible):
53 | if is_instance_valid(datatableDock):
54 | datatableDock.visible = visible
55 | if visible:
56 | datatableDock.check_for_datatable_change()
57 |
58 | func _add_data_table_dock():
59 | get_editor_interface().get_editor_main_screen().add_child(datatableDock)
60 |
61 | func _remove_data_table_dock():
62 | datatableDock.queue_free()
63 |
--------------------------------------------------------------------------------
/addons/datatable_godot/escape_shortcut.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="Shortcut" load_steps=2 format=3 uid="uid://canf3frmvnvfd"]
2 |
3 | [sub_resource type="InputEventKey" id="InputEventKey_6vnfp"]
4 | keycode = 4194305
5 |
6 | [resource]
7 | events = [SubResource("InputEventKey_6vnfp")]
8 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/AABB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/AABB.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/AABB.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dhrostg6qnf3u"
6 | path="res://.godot/imported/AABB.png-5cb56a6003e670e488146002255c048d.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/AABB.png"
14 | dest_files=["res://.godot/imported/AABB.png-5cb56a6003e670e488146002255c048d.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Add.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Add.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://d4af0scr4f3ea"
6 | path="res://.godot/imported/Add.svg-66653a52988d1e15af27c8fdbfd5fe94.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Add.svg"
14 | dest_files=["res://.godot/imported/Add.svg-66653a52988d1e15af27c8fdbfd5fe94.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Basis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Basis.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Basis.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cw7yrghswx3pg"
6 | path="res://.godot/imported/Basis.png-fbb5d8c4a9bb516e769c056d5919b07f.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Basis.png"
14 | dest_files=["res://.godot/imported/Basis.png-fbb5d8c4a9bb516e769c056d5919b07f.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Close.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Close.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://kpudoq60xvhi"
6 | path="res://.godot/imported/Close.svg-3cbb64b2485d3df1864c1bfbf4c45cd6.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Close.svg"
14 | dest_files=["res://.godot/imported/Close.svg-3cbb64b2485d3df1864c1bfbf4c45cd6.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Color.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Color.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cw3pqcha6hash"
6 | path="res://.godot/imported/Color.svg-a6898735af4ef8be1575e69769f02674.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Color.svg"
14 | dest_files=["res://.godot/imported/Color.svg-a6898735af4ef8be1575e69769f02674.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/HTTPRequest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/HTTPRequest.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/HTTPRequest.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://xg222ueyxka0"
6 | path="res://.godot/imported/HTTPRequest.png-edc100fca90751221c4e3bd46ab2af23.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/HTTPRequest.png"
14 | dest_files=["res://.godot/imported/HTTPRequest.png-edc100fca90751221c4e3bd46ab2af23.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Help.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Help.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bwwxi1ostoe7b"
6 | path="res://.godot/imported/Help.svg-c2d8314bb9bd5a872634a5921ab9ca7b.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Help.svg"
14 | dest_files=["res://.godot/imported/Help.svg-c2d8314bb9bd5a872634a5921ab9ca7b.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Load.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Load.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Load.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dwb1kfrq35nuy"
6 | path="res://.godot/imported/Load.png-95f104b4df73ef332167d025289f99e3.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Load.png"
14 | dest_files=["res://.godot/imported/Load.png-95f104b4df73ef332167d025289f99e3.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Plane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Plane.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Plane.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b1sf25ugxyjr2"
6 | path="res://.godot/imported/Plane.png-717c5366e4872e1969cafea654396166.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Plane.png"
14 | dest_files=["res://.godot/imported/Plane.png-717c5366e4872e1969cafea654396166.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Projection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Projection.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Projection.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://7810wjrwyh4k"
6 | path="res://.godot/imported/Projection.png-1b772692fdac97fbeedf571034931540.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Projection.png"
14 | dest_files=["res://.godot/imported/Projection.png-1b772692fdac97fbeedf571034931540.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Quaternion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Quaternion.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Quaternion.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dwa4hgxufiht2"
6 | path="res://.godot/imported/Quaternion.png-a4a848830a5974be2b81514694271e5e.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Quaternion.png"
14 | dest_files=["res://.godot/imported/Quaternion.png-a4a848830a5974be2b81514694271e5e.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Rect2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Rect2.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Rect2.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://deeletsgtujsc"
6 | path="res://.godot/imported/Rect2.png-c5c84713f6ef9c2a1c3210729304bcca.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Rect2.png"
14 | dest_files=["res://.godot/imported/Rect2.png-c5c84713f6ef9c2a1c3210729304bcca.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Reload.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Reload.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://1rxby4gxu1wl"
6 | path="res://.godot/imported/Reload.png-eb601c0d8eaeda7e2fcdab37fddf410e.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Reload.png"
14 | dest_files=["res://.godot/imported/Reload.png-eb601c0d8eaeda7e2fcdab37fddf410e.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Remove.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Remove.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://blh822uvyrgg1"
6 | path="res://.godot/imported/Remove.svg-e961e0bbf221f85f7c445bc03f405acc.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Remove.svg"
14 | dest_files=["res://.godot/imported/Remove.svg-e961e0bbf221f85f7c445bc03f405acc.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Ressource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Ressource.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Ressource.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cudqdqhvvyvvd"
6 | path="res://.godot/imported/Ressource.png-14d5788c0da00a0f03abbfde1e035165.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Ressource.png"
14 | dest_files=["res://.godot/imported/Ressource.png-14d5788c0da00a0f03abbfde1e035165.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Save.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Save.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bck1i8evwspny"
6 | path="res://.godot/imported/Save.png-0fcf1b63d06b16477db42bfdc41b182a.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Save.png"
14 | dest_files=["res://.godot/imported/Save.png-0fcf1b63d06b16477db42bfdc41b182a.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Search.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Search.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://danpa70ygoi1q"
6 | path="res://.godot/imported/Search.png-b8f8673447b60f3a7a13b6df240db789.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Search.png"
14 | dest_files=["res://.godot/imported/Search.png-b8f8673447b60f3a7a13b6df240db789.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/StatusError.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/StatusError.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/StatusError.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bn6pft8haygk0"
6 | path="res://.godot/imported/StatusError.png-8d15e4101ac652907ccc62fe736c3626.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/StatusError.png"
14 | dest_files=["res://.godot/imported/StatusError.png-8d15e4101ac652907ccc62fe736c3626.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/StatusSuccess.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/StatusSuccess.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/StatusSuccess.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bffehmyw0j8vx"
6 | path="res://.godot/imported/StatusSuccess.png-b885d67f2de73b674d8b5c18751cfb8a.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/StatusSuccess.png"
14 | dest_files=["res://.godot/imported/StatusSuccess.png-b885d67f2de73b674d8b5c18751cfb8a.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/StatusWarning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/StatusWarning.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/StatusWarning.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bhsyx16j1ocmy"
6 | path="res://.godot/imported/StatusWarning.png-4b4e8c0f54a4167dba92ca9faa4c678d.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/StatusWarning.png"
14 | dest_files=["res://.godot/imported/StatusWarning.png-4b4e8c0f54a4167dba92ca9faa4c678d.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/String.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/String.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bh4utwbo8c1th"
6 | path="res://.godot/imported/String.svg-84a4683b9f4ff1c9863e76610294bbad.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/String.svg"
14 | dest_files=["res://.godot/imported/String.svg-84a4683b9f4ff1c9863e76610294bbad.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Transform2D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Transform2D.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Transform2D.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b78syqljkqgw0"
6 | path="res://.godot/imported/Transform2D.png-bcbd4b70096e3829ecd87cd12698329e.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Transform2D.png"
14 | dest_files=["res://.godot/imported/Transform2D.png-bcbd4b70096e3829ecd87cd12698329e.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Transform3D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/Transform3D.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Transform3D.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://l42684mvyre3"
6 | path="res://.godot/imported/Transform3D.png-dd046d4a84f616d9f8dce37eedf401cc.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Transform3D.png"
14 | dest_files=["res://.godot/imported/Transform3D.png-dd046d4a84f616d9f8dce37eedf401cc.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Vector2.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Vector2.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cep60026oa02c"
6 | path="res://.godot/imported/Vector2.svg-309e8b38fca13514e4a071c6aedc79f0.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Vector2.svg"
14 | dest_files=["res://.godot/imported/Vector2.svg-309e8b38fca13514e4a071c6aedc79f0.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Vector3.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Vector3.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cjj2fecod00cv"
6 | path="res://.godot/imported/Vector3.svg-91f65c333935c15d71cc91305a246b9f.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Vector3.svg"
14 | dest_files=["res://.godot/imported/Vector3.svg-91f65c333935c15d71cc91305a246b9f.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Vector4.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/Vector4.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dpah1oqjdvr7u"
6 | path="res://.godot/imported/Vector4.svg-cccb172bdc6828805a26ef89e45609e0.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/Vector4.svg"
14 | dest_files=["res://.godot/imported/Vector4.svg-cccb172bdc6828805a26ef89e45609e0.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/array_value.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/array_value.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/array_value.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b2tja7u6nyfd8"
6 | path="res://.godot/imported/array_value.png-10ec9393316e5fac81fb3f775f87b7f1.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/array_value.png"
14 | dest_files=["res://.godot/imported/array_value.png-10ec9393316e5fac81fb3f775f87b7f1.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/bool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/bool.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/bool.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://boigovej7l3ld"
6 | path="res://.godot/imported/bool.png-0292f247a6a16be866b1cd535abf51d5.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/bool.png"
14 | dest_files=["res://.godot/imported/bool.png-0292f247a6a16be866b1cd535abf51d5.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/datatable.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
66 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/datatable.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://udrj76ipju00"
6 | path="res://.godot/imported/datatable.svg-e4bb7fdb403c6f1eaf5ee8e702a64f29.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/datatable.svg"
14 | dest_files=["res://.godot/imported/datatable.svg-e4bb7fdb403c6f1eaf5ee8e702a64f29.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/dictionary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/dictionary.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/dictionary.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dy5aq6thx5vmw"
6 | path="res://.godot/imported/dictionary.png-677a26612733d955b2188720d61896a2.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/dictionary.png"
14 | dest_files=["res://.godot/imported/dictionary.png-677a26612733d955b2188720d61896a2.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/float.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/float.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://hmlxro3byyk4"
6 | path="res://.godot/imported/float.svg-c4c1226eaae44cb23e0c729267e76fa4.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/float.svg"
14 | dest_files=["res://.godot/imported/float.svg-c4c1226eaae44cb23e0c729267e76fa4.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/int.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/int.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bpl61j5iclrvd"
6 | path="res://.godot/imported/int.svg-24de6b00dd0d454b02b7d61c8f55ed38.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/int.svg"
14 | dest_files=["res://.godot/imported/int.svg-24de6b00dd0d454b02b7d61c8f55ed38.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/invalid_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/invalid_type.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/invalid_type.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://clbwbwuypjrfb"
6 | path="res://.godot/imported/invalid_type.png-c7eb6c2215fc7366deeca8e4940f8545.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/invalid_type.png"
14 | dest_files=["res://.godot/imported/invalid_type.png-c7eb6c2215fc7366deeca8e4940f8545.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/label.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/label.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/label.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://fvcqg1n8g1ru"
6 | path="res://.godot/imported/label.png-4898491586bba141b618da1f1eb22ea1.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/label.png"
14 | dest_files=["res://.godot/imported/label.png-4898491586bba141b618da1f1eb22ea1.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/single_value.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/single_value.png
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/single_value.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cw3yfy2wnj7sr"
6 | path="res://.godot/imported/single_value.png-12994c4766144ef6387b02c5209d42f2.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/single_value.png"
14 | dest_files=["res://.godot/imported/single_value.png-12994c4766144ef6387b02c5209d42f2.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/single_value.png~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ward727a/godot_datatable_plugin/fb40d5a28b25d218b306b233caaaa730733839af/addons/datatable_godot/icons/single_value.png~
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/tab_icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/tab_icon.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://begwwmk5xo51b"
6 | path="res://.godot/imported/tab_icon.svg-8194700a25ffc5b96ad3fcb7c636a790.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/tab_icon.svg"
14 | dest_files=["res://.godot/imported/tab_icon.svg-8194700a25ffc5b96ad3fcb7c636a790.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/table-entry_white.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/datatable_godot/icons/table-entry_white.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bwbhaey706wfm"
6 | path="res://.godot/imported/table-entry_white.svg-c72d8535f5bffb6ebec6ab18347ff01d.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/datatable_godot/icons/table-entry_white.svg"
14 | dest_files=["res://.godot/imported/table-entry_white.svg-c72d8535f5bffb6ebec6ab18347ff01d.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 | svg/scale=1.0
36 | editor/scale_with_editor_scale=false
37 | editor/convert_colors_with_editor_theme=false
38 |
--------------------------------------------------------------------------------
/addons/datatable_godot/plugin.cfg:
--------------------------------------------------------------------------------
1 | [plugin]
2 | name="DataTable"
3 | description="A simple datatable system to use in godot"
4 | author="Ward"
5 | version="2.2.0"
6 | script="datatable.gd"
7 |
8 | [update]
9 | temp_file="user://temp_update_datatable.zip"
10 | safeguard="res://safeguard/safeguard.gd"
11 |
12 | [backup]
13 | folder="res://datatable_backup/"
14 | max="3"
15 | suffix="_backup"
16 |
17 | [file]
18 | ext=".tableCollection.res"
19 | version="1.1.0"
20 |
21 | [dev]
22 | debug="true"
23 | stop_update="false"
24 | stop_backup="false"
25 | stop_convert="false"
26 | reset_instance="false"
27 | force_convert="false"
28 | convert_watchdog_limit="10000"
29 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/bg/bg_autoupdate.gd:
--------------------------------------------------------------------------------
1 | # Original creator of this code part is nathanhoad, I only edited it a little to make it work with mine!
2 | # Github link to his plugin: https://github.com/nathanhoad/godot_input_helper/tree/main
3 | # Thanks to nathanhoad!
4 | #
5 | # Nathanhoad License:
6 | # MIT License
7 | # Copyright (c) 2022-present Nathan Hoad
8 | #
9 | # Permission is hereby granted, free of charge, to any person obtaining a copy
10 | # of this software and associated documentation files (the "Software"), to deal
11 | # in the Software without restriction, including without limitation the rights
12 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | # copies of the Software, and to permit persons to whom the Software is
14 | # furnished to do so, subject to the following conditions:
15 | #
16 | # The above copyright notice and this permission notice shall be included in all
17 | # copies or substantial portions of the Software.
18 | #
19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | # SOFTWARE.
26 |
27 | @tool
28 | extends Panel
29 |
30 | signal failed()
31 |
32 | signal updated(new_version: String)
33 |
34 | @onready var title: Label = $MarginContainer/MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer2/Label
35 | @onready var downloadButton: Button = $MarginContainer/MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer3/MarginContainer/b_downloadUpdate
36 | @onready var close: Button = $MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/right_top/Button
37 | @onready var http_request: HTTPRequest = $"../../HTTPRequest"
38 |
39 | @onready var success_txt: RichTextLabel = $MarginContainer/MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/success_txt
40 | @onready var error_txt: RichTextLabel = $MarginContainer/MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/error_txt
41 |
42 | var next_version: String = "":
43 | set(new_value):
44 | next_version = new_value
45 | title.text = str("The version ",new_value," is available for download!")
46 | get:
47 | return next_version
48 |
49 | func _ready():
50 | downloadButton.pressed.connect(_on_download_button_pressed)
51 | close.pressed.connect(_close_window)
52 |
53 | func _close_window():
54 | self.visible = false
55 |
56 | func _on_download_button_pressed() -> void:
57 |
58 | _dt_updater.get_instance().failed.connect(_on_failed_update)
59 | _dt_updater.get_instance().updated.connect(_on_success_update)
60 |
61 | if _dt_updater.get_instance()._on_download_button_pressed():
62 | error_txt.visible = true
63 | return
64 |
65 | downloadButton.disabled = true
66 | downloadButton.text = "Downloading the update..."
67 |
68 | func _on_failed_update():
69 |
70 | error_txt.visible = true
71 | downloadButton.text = "Error when trying to update!"
72 |
73 | func _on_success_update(next_v:String):
74 |
75 | success_txt.visible = true
76 | downloadButton.text = str("Update: ",next_v," done with success!")
77 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/box/arr_item_box.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends VBoxContainer
3 |
4 | # @onready var COMMON: Node = $"../../../../../../../../../../../../signals"
5 |
6 | var data = {}
7 |
8 | var used_schema: Resource = null
9 | @onready var item_schema: HBoxContainer = get_child(0)
10 |
11 | func add_item(value: Variant):
12 |
13 | var item_name = data.size()
14 |
15 | if data.has(item_name):
16 | return
17 |
18 | if used_schema == null:
19 | return
20 |
21 | var item = item_schema.duplicate()
22 | add_child(item)
23 | var duplicate = used_schema.instantiate()
24 | item.add_child(duplicate)
25 | item.move_child(duplicate, 0)
26 | duplicate.set_value(value)
27 |
28 | var b_delete = item.get_child(1)
29 |
30 | b_delete.pressed.connect(remove_item.bind(item_name))
31 |
32 | duplicate.set_h_size_flags(SIZE_EXPAND_FILL)
33 |
34 | data[item_name] = {'value':value, 'node': duplicate, "item": item}
35 |
36 | duplicate.set_disabled(true)
37 |
38 | # Hide text node
39 | duplicate.text.visible = false
40 |
41 | duplicate.visible = true
42 | item.visible = true
43 |
44 | func remove_item(item_name: int):
45 |
46 | if !data.has(item_name):
47 | printerr("Data doesn't have ",item_name)
48 | return
49 |
50 | var node: Node = data[item_name]['item']
51 |
52 | data.erase(item_name)
53 |
54 | node.queue_free()
55 |
56 | # COMMON.presave_data.emit()
57 |
58 |
59 | func get_items_value()->Array:
60 |
61 | var arr: Array = []
62 |
63 | for i in data:
64 | if data[i].has('value'):
65 | arr.append(data[i]['value'])
66 |
67 |
68 | return arr
69 |
70 | func reset_items():
71 |
72 | for i in data.size():
73 | data[i]['item'].queue_free()
74 | data = {}
75 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/help/about.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 |
5 | @onready var about:ScrollContainer = $"../../../HBoxContainer/left_menu_box/MarginContainer/about"
6 | @onready var changelog:ScrollContainer = $"../../../HBoxContainer/left_menu_box/MarginContainer/changelog"
7 |
8 | func _pressed():
9 | about.visible = true
10 | changelog.visible = false
11 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/help/b_closeHelp.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | common.toggle_main_ask.emit()
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/help/changelog.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 |
5 | @onready var about:ScrollContainer = $"../../../HBoxContainer/left_menu_box/MarginContainer/about"
6 | @onready var changelog:ScrollContainer = $"../../../HBoxContainer/left_menu_box/MarginContainer/changelog"
7 |
8 | func _pressed():
9 | about.visible = false
10 | changelog.visible = true
11 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/main/b_help.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | common.toggle_help_ask.emit()
9 |
10 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/main/b_manageTableType.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | _dt_interface.get_instance().show_type()
9 |
10 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/main/b_newTable.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | _dt_interface.get_instance().show_table()
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/main/b_newTableType.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | common.toggle_newType_ask.emit()
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/main/mb_manageCollection.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends MenuButton
3 |
4 | @onready var common = %signals
5 |
6 | var _popup_menu: PopupMenu
7 |
8 | var _load_file_dialog: FileDialog
9 | var _new_file_dialog: FileDialog
10 |
11 | enum _MenuOption{
12 | LOAD_COLLECTION,
13 | NEW_COLLECTION
14 | }
15 |
16 | const _collection_required_key = ["table", "type"]
17 |
18 | const _collection_file_filters: PackedStringArray = ["*.tableCollection.res ; Collection", "*.res ; Old collection"]
19 | const _file_min_size: Vector2 = Vector2(450, 350)
20 | const _file_initial_pos: Window.WindowInitialPosition = Window.WINDOW_INITIAL_POSITION_CENTER_MAIN_WINDOW_SCREEN
21 |
22 | # Called when the node enters the scene tree for the first time.
23 | func _ready():
24 | _popup_menu = get_popup()
25 |
26 | _popup_menu.id_pressed.connect(_item_pressed)
27 |
28 | pass
29 |
30 | func _item_pressed(id: int):
31 |
32 | match (id):
33 | _MenuOption.LOAD_COLLECTION: # Show load file popup
34 |
35 | _load_file_dialog = FileDialog.new()
36 | _load_file_dialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
37 |
38 | _load_file_dialog.filters = _collection_file_filters
39 | _load_file_dialog.initial_position = _file_initial_pos
40 | _load_file_dialog.min_size = _file_min_size
41 |
42 | _load_file_dialog.visible = true
43 |
44 | EditorInterface.get_base_control().add_child(_load_file_dialog)
45 |
46 | _load_file_dialog.file_selected.connect(_on_load_collection)
47 | _load_file_dialog.close_requested.connect(_on_close_load)
48 |
49 | pass
50 | _MenuOption.NEW_COLLECTION: # Show create file popup
51 |
52 | _new_file_dialog = FileDialog.new()
53 | _new_file_dialog.file_mode = FileDialog.FILE_MODE_SAVE_FILE
54 |
55 | _new_file_dialog.add_filter("*.tableCollection.res", "Collection")
56 | _new_file_dialog.initial_position = _file_initial_pos
57 | _new_file_dialog.min_size = _file_min_size
58 |
59 | _new_file_dialog.visible = true
60 |
61 | EditorInterface.get_base_control().add_child(_new_file_dialog)
62 |
63 | _new_file_dialog.file_selected.connect(_on_new_collection)
64 | _new_file_dialog.close_requested.connect(_on_close_new)
65 |
66 | pass
67 |
68 | func _on_load_collection(collection_path: String):
69 | print_rich("[color=",_dt_common.txt_color.WARNING,"][DataTable] Loading collection at path: ", collection_path)
70 |
71 | _dt_resource.get_instance().load_file(collection_path)
72 | _dt_resource.get_instance().res_reload.emit()
73 |
74 | var collection_name = _dt_resource.get_instance().get_name()
75 | collection_path = _dt_resource.get_instance().get_path()
76 |
77 | print_rich("[color=",_dt_common.txt_color.SUCCESS,"][DataTable] Loaded collection '",collection_name,"' with success!")
78 |
79 | %label_collection.set_text(str("Opened collection: ", collection_name))
80 | %label_collection.set_tooltip_text(str("path: ",collection_path))
81 |
82 | _dt_backup.get_instance().make(collection_path)
83 |
84 | _dt_backup.get_instance().link(%backup_timer, collection_path)
85 |
86 | $"../b_newTable".disabled = false
87 | $"../b_manageTableType".disabled = false
88 |
89 | _load_file_dialog.queue_free()
90 |
91 | func _on_new_collection(collection_path: String):
92 | print_rich("[color=",_dt_common.txt_color.WARNING,"][DataTable] Creating new collection at path: ", collection_path)
93 |
94 | _dt_resource.get_instance().new_file(collection_path)
95 | _dt_resource.get_instance().res_reload.emit()
96 |
97 | var collection_name = _dt_resource.get_instance().get_name()
98 | collection_path = _dt_resource.get_instance().get_path()
99 |
100 | print_rich("[color=",_dt_common.txt_color.SUCCESS,"][DataTable] Created collection '",collection_name,"' with success!")
101 |
102 | %label_collection.set_text(str("Opened collection: ", collection_name))
103 | %label_collection.set_tooltip_text(str("path: ",collection_path))
104 |
105 | _dt_backup.get_instance().make(collection_path)
106 |
107 | _dt_backup.get_instance().link(%backup_timer, collection_path)
108 |
109 | _new_file_dialog.queue_free()
110 |
111 | func _on_close_load():
112 | _load_file_dialog.queue_free()
113 |
114 | func _on_close_new():
115 | _new_file_dialog.queue_free()
116 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/main/txt_version_status.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends RichTextLabel
3 |
4 | func _gui_input(event):
5 | if event is InputEventMouseButton:
6 | if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
7 | _dt_updater.get_instance().check_update(self)
8 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/manageCollection/b_closeWindow.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | common.toggle_main_ask.emit()
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/manageType/b_addType.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | @onready var bg_manageType: Panel = $"../../../../.."
5 | @onready var in_type_name: LineEdit = $"../in_newTypeName"
6 |
7 | func _ready():
8 | bg_manageType.add_type_response.connect(_is_added)
9 |
10 | func _pressed():
11 | bg_manageType.add_type_ask.emit(in_type_name.get_text())
12 |
13 | func _is_added(success: bool):
14 |
15 | if success:
16 | in_type_name.set_text("")
17 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/manageType/b_add_param.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | @onready var bg_manageType: Panel = $"../../../../../../.."
5 |
6 | @onready var in_new_param_name: LineEdit = $"../in_new_param_name"
7 | @onready var ob_param_type: OptionButton = $"../OB_paramType"
8 | @onready var ob_param_size: OptionButton = $"../OB_paramSize"
9 |
10 | func _ready():
11 | bg_manageType.add_param_response.connect(_add_response)
12 |
13 | func _pressed():
14 |
15 | var paramType: int = ob_param_type.get_selected_id()
16 | var paramSize: int = ob_param_size.get_selected_id()
17 | var paramName: String = in_new_param_name.get_text()
18 |
19 | if paramName.is_empty():
20 | return
21 |
22 | bg_manageType.add_param_ask.emit(paramName, paramType, paramSize)
23 |
24 | func _add_response(success: bool):
25 |
26 | if success:
27 | in_new_param_name.set_text("")
28 |
29 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/manageType/b_closeWindow.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | _dt_interface.get_instance().show_main()
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/manageType/b_deleteType.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 |
5 | @onready var bg: Panel = $"../../../../../../../../.."
6 |
7 | func _pressed():
8 | bg.remove_type.emit(get_parent())
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/manageType/b_delete_param.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | @onready var bg_manageType: Panel = $"../../../../../../../../../../../.."
5 |
6 |
7 | func _pressed():
8 | bg_manageType.remove_param_ask.emit(get_meta('param_name'))
9 |
10 | get_parent().queue_free()
11 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/manageType/type_title.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends RichTextLabel
3 |
4 | @onready var bg: Panel = $"../../../../../../../../.."
5 |
6 | func _gui_input(event):
7 | if event is InputEventMouseButton:
8 | if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
9 | var object_node: HBoxContainer = get_parent()
10 |
11 | bg.select_type.emit(object_node)
12 | if event.button_index == MOUSE_BUTTON_RIGHT and event.pressed:
13 | var object_node: HBoxContainer = get_parent()
14 | bg.generate_class.emit(object_node)
15 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/b_closeWindow.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | ## import common node to access signals
5 | @onready var common: Node = %signals
6 |
7 | func _pressed():
8 | _dt_interface.get_instance().show_main()
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/b_createTable.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | @onready var bg_newTable: Panel = $"../../../../.."
5 | @onready var in_tableTitle: LineEdit = $"../in_tableTitle"
6 |
7 | func _ready():
8 | bg_newTable.create_table_response.connect(_reset_input)
9 |
10 | func _pressed():
11 | if disabled:
12 | return
13 | bg_newTable.create_table.emit(in_tableTitle.get_text())
14 |
15 | func _reset_input(success: bool):
16 | if success:
17 | in_tableTitle.set_text("")
18 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/b_deleteTable.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | @onready var bg_newTable: Panel = $"../../../../../../.."
5 |
6 | func _pressed():
7 | bg_newTable.delete_table.emit(get_parent())
8 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/b_resource_import.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | signal dropped_file_on(path: String)
5 |
6 | func _can_drop_data(position, data):
7 |
8 | return typeof(data) == TYPE_DICTIONARY and data.has("files")
9 |
10 | func _drop_data(position, data):
11 |
12 | dropped_file_on.emit(data['files'][0])
13 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/b_tableItemDelete.gd:
--------------------------------------------------------------------------------
1 | extends Button
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/export_but.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends MenuButton
3 |
4 | signal csv_export(path: String)
5 |
6 | signal cr_export(path: String)
7 |
8 | # Called when the node enters the scene tree for the first time.
9 | func _ready():
10 |
11 | # link id_pressed signal to _on_pressed_id function
12 | get_popup().id_pressed.connect(_on_item_pressed)
13 |
14 | pass
15 |
16 | func set_disabled(disabled: bool):
17 | self.disabled = disabled
18 |
19 | func _on_item_pressed(item_id: int):
20 | print("Item pressed")
21 |
22 | match(item_id):
23 | 0:
24 | _on_item_csv_pressed()
25 | 1:
26 | _on_item_CR_pressed()
27 | _:
28 | print("Unknown item pressed")
29 |
30 | func _on_item_csv_pressed():
31 | print("CSV pressed")
32 |
33 | var _dialog = FileDialog.new()
34 |
35 | _dialog.file_mode = FileDialog.FILE_MODE_SAVE_FILE
36 | _dialog.min_size = Vector2(600, 400)
37 | _dialog.filters = ["*.csv ; CSV file"]
38 |
39 | _dialog.file_selected.connect(_on_csv_selected)
40 |
41 | get_parent().add_child(_dialog)
42 |
43 | _dialog.popup_centered()
44 |
45 | func _on_item_CR_pressed():
46 | print("CR pressed")
47 |
48 | var _dialog = FileDialog.new()
49 |
50 | _dialog.file_mode = FileDialog.FILE_MODE_SAVE_FILE
51 | _dialog.min_size = Vector2(600, 400)
52 | _dialog.filters = ["*.tres ; Resource file", "*.res ; Binary resource file"]
53 |
54 | _dialog.file_selected.connect(_on_cr_selected)
55 |
56 | get_parent().add_child(_dialog)
57 |
58 | _dialog.popup_centered()
59 |
60 |
61 | func _on_csv_selected(path):
62 | print("CSV selected")
63 |
64 | csv_export.emit(path)
65 |
66 | func _on_cr_selected(path):
67 | print("CR selected")
68 |
69 |
70 |
71 | cr_export.emit(path)
72 |
73 |
74 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/import_but.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends MenuButton
3 |
4 | signal csv_selected(content: String)
5 |
6 | signal cr_selected(res: Resource, type_selected_name: String)
7 |
8 | # Called when the node enters the scene tree for the first time.
9 | func _ready():
10 |
11 | # link id_pressed signal to _on_pressed_id function
12 | get_popup().id_pressed.connect(_on_item_pressed)
13 |
14 | pass
15 |
16 | func set_disabled(disabled: bool):
17 | self.disabled = disabled
18 |
19 | func _on_item_pressed(item_id: int):
20 | print("Item pressed")
21 |
22 | match(item_id):
23 | 0:
24 | _on_item_csv_pressed()
25 | 1:
26 | _on_item_CR_pressed()
27 | _:
28 | print("Unknown item pressed")
29 |
30 | func _on_item_csv_pressed():
31 | print("CSV pressed")
32 |
33 | var _dialog = FileDialog.new()
34 |
35 | _dialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
36 | _dialog.min_size = Vector2(600, 400)
37 | _dialog.filters = ["*.csv ; CSV file"]
38 |
39 | _dialog.file_selected.connect(_on_csv_selected)
40 |
41 | get_parent().add_child(_dialog)
42 |
43 | _dialog.popup_centered()
44 |
45 | func _on_item_CR_pressed():
46 | print("CR pressed")
47 |
48 | var _dialog = FileDialog.new()
49 |
50 | _dialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
51 | _dialog.min_size = Vector2(600, 400)
52 | _dialog.filters = ["*.tres ; Resource file", "*.res ; Binary resource file"]
53 | var resource_types = _dt_classDB.get_direct_child("Resource")
54 |
55 | print(resource_types)
56 |
57 | var option_box = HBoxContainer.new()
58 |
59 |
60 | var option_label = Label.new()
61 | option_label.text = "Resource type: "
62 |
63 | var option_button = OptionButton.new()
64 | option_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
65 |
66 | var options = []
67 |
68 | for i in resource_types:
69 | options.append(i)
70 |
71 | options.sort()
72 |
73 | for i in options:
74 | option_button.add_item(i)
75 |
76 | option_box.add_child(option_label)
77 | option_box.add_child(option_button)
78 |
79 | _dialog.get_vbox().add_child(option_box) # add type selection to file dialog
80 |
81 | _dialog.file_selected.connect(_on_cr_selected.bind(option_button))
82 |
83 | get_parent().add_child(_dialog)
84 |
85 | _dialog.popup_centered()
86 |
87 |
88 | func _on_csv_selected(path):
89 | print("CSV selected")
90 |
91 | var file = FileAccess.open(path, FileAccess.READ)
92 |
93 | if !file:
94 | print("Error opening file")
95 | return
96 |
97 | var content = file.get_as_text()
98 | print(content)
99 | file.close()
100 |
101 | csv_selected.emit(content)
102 |
103 | func _on_cr_selected(path, option_button):
104 | print("CR selected")
105 |
106 | var res = ResourceLoader.load(path)
107 |
108 | if !res:
109 | print("Error loading resource")
110 | return
111 |
112 | cr_selected.emit(res, option_button.get_item_text(option_button.selected))
113 |
114 |
115 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/in_tableItemName.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends RichTextLabel
3 |
4 | @onready var bg_newTable: Panel = $"../../../../../../../../../.."
5 |
6 | var common
7 | var table_name
8 | signal pressed()
9 |
10 | func _gui_input(event):
11 | if event is InputEventMouseButton:
12 | if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
13 | pressed.emit()
14 | if event.button_index == MOUSE_BUTTON_RIGHT and event.pressed:
15 | copy_template_code()
16 |
17 | func copy_template_code():
18 |
19 | var label: Label = Label.new()
20 | var timer: Timer = Timer.new()
21 |
22 | timer.one_shot = true
23 | timer.wait_time = 3.
24 |
25 | label.set_text("Template copied!")
26 |
27 | label.position = bg_newTable.get_local_mouse_position()
28 |
29 | label.position.y += 10
30 | label.position.x += 10
31 |
32 | timer.timeout.connect(_hide_text.bind(label, timer))
33 | bg_newTable.add_child(label)
34 | bg_newTable.add_child(timer)
35 | timer.start()
36 |
37 |
38 |
39 | var template = str(
40 | "\n",
41 | "const collection_path: String = \"",_dt_resource.get_instance().get_path(),"\"\n",
42 | "var collec: Collection = Collection.new(collection_path)\n",
43 | "\n",
44 | "const table_name: String = \"",table_name,"\"\n",
45 | "var table: Datatable = collec.get_table(table_name)\n",
46 | "\n",
47 | "const item_name: String = \"",get_text(),"\"\n",
48 | "var item: Dictionary = table.get_item(item_name)\n",
49 | "\n",
50 | "# Here you can start to get your value inside the 'item' var\n",
51 | "#print(item) # This print all the value inside the item\n"
52 | )
53 |
54 | DisplayServer.clipboard_set(template)
55 |
56 | func _hide_text(label: Label, timer: Timer):
57 | label.queue_free()
58 | timer.queue_free()
59 |
60 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/buttons/newTable/txt_table_name.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends RichTextLabel
3 |
4 | @onready var bg_newTable: Panel = $"../../../../../../.."
5 |
6 | var common
7 |
8 | func _gui_input(event):
9 | if event is InputEventMouseButton:
10 | if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
11 | bg_newTable.select_table.emit(get_parent())
12 | if event.button_index == MOUSE_BUTTON_RIGHT and event.pressed:
13 | copy_template_code()
14 |
15 | func copy_template_code():
16 |
17 | var label: Label = Label.new()
18 | var timer: Timer = Timer.new()
19 |
20 | timer.one_shot = true
21 | timer.wait_time = 3.
22 |
23 | label.set_text("Template copied!")
24 |
25 | label.position = bg_newTable.get_local_mouse_position()
26 |
27 | label.position.y += 10
28 | label.position.x += 10
29 |
30 | timer.timeout.connect(_hide_text.bind(label, timer))
31 | bg_newTable.add_child(label)
32 | bg_newTable.add_child(timer)
33 | timer.start()
34 |
35 | var template = str(
36 | "\n",
37 | "const collection_path: String = \"",_dt_resource.get_instance().get_path(),"\"\n",
38 | "var collec: Collection = Collection.new(collection_path)\n",
39 | "\n",
40 | "const table_name: String = \"",get_text(),"\"\n",
41 | "var table: Datatable = collec.get_table(table_name)\n",
42 | "\n",
43 | "# Here you can start to get your item with the 'table' var\n"
44 | )
45 |
46 | DisplayServer.clipboard_set(template)
47 |
48 | func _hide_text(label: Label, timer: Timer):
49 | label.queue_free()
50 | timer.queue_free()
51 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/datatable_ui.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Control
3 |
4 | ## import common
5 | @onready var common:Node = %signals
6 |
7 | ## Popup components - Alert
8 | @onready var pop_alert_main: Popup = $alert
9 | @onready var pop_alert_title: Label = $alert/Panel/MarginContainer/Panel/MarginContainer/VBoxContainer/alert_title
10 | @onready var pop_alert_description: RichTextLabel = $alert/Panel/MarginContainer/Panel/MarginContainer/VBoxContainer/Panel/MarginContainer/alert_text
11 |
12 | ## UI Components - Background
13 | @onready var bg_main: VBoxContainer = $MarginContainer/bg_main
14 | @onready var bg_newTable: Panel = $MarginContainer/bg_newTable
15 | @onready var bg_manageType: Panel = $MarginContainer/bg_manageType
16 | @onready var bg_autoupdate: Panel = $MarginContainer/bg_autoupdate
17 |
18 | @onready var version_statut: RichTextLabel = $MarginContainer/bg_main/Panel/VBoxContainer/HBoxContainer/HBoxContainer3/version_status
19 |
20 | ###############
21 | ## Functions ##
22 | ###############
23 |
24 | func _ready():
25 |
26 | ## We check if a new update is available or not
27 | _dt_updater.get_instance().check_update(version_statut)
28 | _dt_updater.get_instance().update_available.connect(_show_update_window)
29 |
30 | ## By security we reset the visible state of the main window to true
31 | toggleMain()
32 |
33 | common.popup_alert_ask.connect(_signal_show_alert_popup)
34 |
35 | func _disable_all_UI():
36 | bg_main.visible = false
37 | bg_newTable.visible = false
38 | bg_manageType.visible = false
39 |
40 | #####################
41 | ## Signal Callable ##
42 | #####################
43 |
44 | func toggleMain():
45 | _disable_all_UI()
46 | bg_main.visible = true
47 |
48 | common.toggle_main_response.emit()
49 |
50 | func toggleNewTable():
51 | _disable_all_UI()
52 | bg_newTable.visible = true
53 |
54 | common.toggle_newTable_response.emit()
55 |
56 | func toggleManageType():
57 | _disable_all_UI()
58 | bg_manageType.visible = true
59 |
60 | common.toggle_manageType_response.emit()
61 |
62 | func _signal_show_alert_popup(title: String, description: String):
63 | pop_alert_title.text = title
64 | pop_alert_description.text = description
65 | pop_alert_main.show()
66 |
67 | func check_for_datatable_change():
68 |
69 | _dt_resource.get_instance().res_reload.emit()
70 |
71 | func _show_update_window(next_v: String):
72 | bg_autoupdate.next_version = next_v
73 | bg_autoupdate.visible = true
74 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/help/title.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Label
3 |
4 | @onready var common: Node = %signals
5 |
6 | # Called when the node enters the scene tree for the first time.
7 | func _ready():
8 | set_text(str("Datatable Documentation - Version ", common.plugin_version))
9 | pass
10 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/manage_type/in_comment_param.gd:
--------------------------------------------------------------------------------
1 | extends LineEdit
2 |
3 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/manage_type/in_newTypeName.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends LineEdit
3 |
4 | @onready var bg_manageType: Panel = $"../../../../.."
5 | @onready var b_addType: Button = $"../b_addType"
6 |
7 | func _ready():
8 |
9 | text_changed.connect(_text_change)
10 | text_submitted.connect(_signal_submit)
11 | bg_manageType.check_type_name_response.connect(_check_name)
12 | bg_manageType.recheck_type_name.connect(_recheck_validity)
13 |
14 |
15 | func _text_change(new_value: String):
16 | bg_manageType.check_type_name_ask.emit(new_value)
17 |
18 | func _check_name(valid: bool):
19 | if valid:
20 | add_theme_color_override("font_color", Color(1,1,1,1))
21 | b_addType.disabled = false
22 | else:
23 | add_theme_color_override("font_color", Color(0.8, 0.2, 0.2, 1))
24 | b_addType.disabled = true
25 |
26 | func _recheck_validity():
27 | bg_manageType.check_type_name_ask.emit(get_text())
28 |
29 | func _signal_submit(_text_value: String):
30 | b_addType._pressed()
31 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/manage_type/in_new_param_name.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends LineEdit
3 |
4 | @onready var bg_manageType: Panel = $"../../../../../../.."
5 | @onready var b_add_param: Button = $"../b_add_param"
6 |
7 | # Called when the node enters the scene tree for the first time.
8 | func _ready():
9 | text_changed.connect(_signal_text_edited)
10 | text_submitted.connect(_signal_submit)
11 | bg_manageType.edit_param_name_response.connect(_signal_text_valid)
12 | bg_manageType.recheck_param_name.connect(_recheck_valid)
13 | pass
14 |
15 | func _signal_text_edited(new_value: String):
16 | bg_manageType.edit_param_name_ask.emit(new_value)
17 |
18 | func _signal_text_valid(valid: bool):
19 | if valid:
20 | add_theme_color_override("font_color", Color(1,1,1,1))
21 | b_add_param.disabled = false
22 | else:
23 | add_theme_color_override("font_color", Color(0.8, 0.2, 0.2, 1))
24 | b_add_param.disabled = true
25 |
26 | func _recheck_valid():
27 | bg_manageType.edit_param_name_ask.emit(get_text())
28 |
29 | func _signal_submit(_text_value: String):
30 | b_add_param._pressed()
31 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/new_table/OB_tableType.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends OptionButton
3 |
4 | @onready var bg_newTable: Panel = $"../../../../../../../.."
5 |
6 | func _ready():
7 | bg_newTable.reload_table_type_options_ask.connect(_reload_option_ask)
8 | item_selected.connect(_signal_item_selected)
9 | pass
10 |
11 |
12 |
13 |
14 | func _reload_option_ask(new_options: Dictionary):
15 |
16 | var old_selected_id: int = get_selected_id()
17 | var old_selected_text: String = get_item_text(old_selected_id) if old_selected_id != -1 else ""
18 |
19 |
20 | if old_selected_id == -1:
21 | old_selected_id = 0
22 |
23 | clear()
24 |
25 | for i:String in new_options:
26 | add_item(i)
27 | set_item_metadata((item_count-1), new_options[i])
28 |
29 | if item_count != 0:
30 | select(old_selected_id)
31 | if old_selected_text != get_item_text(old_selected_id):
32 | select(0)
33 |
34 | func _signal_item_selected(id: int):
35 | bg_newTable.change_table_type.emit(id)
36 | set_tooltip_text(get_item_metadata(id)['name'])
37 |
38 | func set_to_type(type_name: String):
39 | for i in item_count:
40 | if i == item_count:
41 | return false
42 |
43 | if get_item_metadata(i)['name'] == type_name:
44 | select(i)
45 | set_tooltip_text(type_name)
46 | return true
47 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/new_table/b_addItemTable.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 |
4 | @onready var bg_newTable: Panel = $"../../../../../.."
5 | @onready var item_name: LineEdit = $"../in_itemTableName"
6 |
7 | func _pressed():
8 | if disabled:
9 | return
10 | bg_newTable.create_item.emit(item_name.get_text())
11 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/new_table/in_itemTableName.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends LineEdit
3 |
4 | @onready var common: Node = %signals
5 | @onready var bg_newTable: Panel = $"../../../../../.."
6 | @onready var b_addItem: Button = $"../b_addItemTable"
7 |
8 | # Called when the node enters the scene tree for the first time.
9 | func _ready():
10 |
11 | text_changed.connect(_signal_text_change)
12 | text_submitted.connect(_signal_submit)
13 | bg_newTable.create_item_response.connect(_signal_add_item_response)
14 | bg_newTable.delete_item_response.connect(_signal_remove_item_response)
15 | bg_newTable.reload_item_list.connect(_signal_reload)
16 |
17 | pass
18 |
19 | func _signal_text_change(new_value: String):
20 | if bg_newTable.scan_item_name(new_value):
21 | add_theme_color_override("font_color", Color(1,1,1,1))
22 | if !b_addItem.get_meta('force_disabled'):
23 | b_addItem.disabled = false
24 | else:
25 | add_theme_color_override("font_color", Color(0.8, 0.2, 0.2, 1))
26 | if !b_addItem.get_meta('force_disabled'):
27 | b_addItem.disabled = true
28 |
29 | func _signal_add_item_response(success: bool):
30 | if success:
31 | set_text("")
32 |
33 | func _signal_remove_item_response(success: bool):
34 | if success:
35 | _signal_text_change(get_text())
36 |
37 | func _signal_submit(_text_value: String):
38 | b_addItem._pressed()
39 |
40 | func _signal_reload():
41 | _signal_text_change(get_text())
42 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/new_table/in_tableTitle.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends LineEdit
3 |
4 | @onready var common: Node = %signals
5 | @onready var bg_newTable: Panel = $"../../../../.."
6 | @onready var b_createTable: Button = $"../b_createTable"
7 |
8 | # Called when the node enters the scene tree for the first time.
9 | func _ready():
10 |
11 | text_changed.connect(_signal_text_change)
12 | text_submitted.connect(_signal_submit)
13 | bg_newTable.add_table_response.connect(_signal_add_table_response)
14 |
15 | pass
16 |
17 | func _signal_text_change(new_value: String):
18 | if bg_newTable.scan_table_name(new_value):
19 | add_theme_color_override("font_color", Color(1,1,1,1))
20 | else:
21 | add_theme_color_override("font_color", Color(0.8, 0.2, 0.2, 1))
22 |
23 | func _signal_add_table_response():
24 | set_text("")
25 |
26 | func _signal_submit(_text_value: String):
27 | b_createTable._pressed()
28 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/inputs/new_table/param_block.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Panel
3 |
4 | @onready var bg_newTable: Panel = $"../../../.."
5 | @onready var table_name_txt: Label = $MarginContainer/VBoxContainer/table_name_box/box_value
6 | @onready var table_size_txt: Label = $MarginContainer/VBoxContainer/table_number_box/box_value
7 | @onready var table_type_ob: OptionButton = $MarginContainer/VBoxContainer/table_type_box/OB_tableType
8 |
9 |
10 | func reload(new_data: Dictionary):
11 |
12 | visible = true
13 |
14 | table_name_txt.set_text(new_data['name'])
15 | table_size_txt.set_text(str(new_data['size']))
16 |
17 | if new_data['size'] != 0:
18 | table_type_ob.disabled = true
19 | else:
20 | table_type_ob.disabled = false
21 |
22 | return table_type_ob.set_to_type(str(new_data['structure']))
23 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/link handler project mainscreen.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends RichTextLabel
3 |
4 | func _ready():
5 | meta_clicked.connect(_on_meta_clicked)
6 |
7 | func _on_meta_clicked(meta):
8 | OS.shell_open(str(meta))
9 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/OB_Enum.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends OptionButton
3 |
4 | # This script is still in WIP
5 |
6 | var enum_ = []
7 |
8 | func _reload():
9 |
10 | clear()
11 |
12 | for item in enum_:
13 | var enum_name = item['name']
14 | var enum_id = item['id']
15 | var enum_icon = item['icon']
16 |
17 | add_item(enum_name, enum_id)
18 | set_item_icon(enum_id, enum_icon)
19 |
20 | func add_enum(enum_name: String, enum_icon: Texture2D = null):
21 |
22 | enum_.append({"name": enum_name, "id": enum_.size(), "icon": enum_icon})
23 |
24 | func clear_enum():
25 |
26 | enum_.clear()
27 |
28 | func set_enum(enum_id: int, enum_name: String, enum_icon: Texture2D = null):
29 |
30 | enum_[enum_id] = {"name": enum_name, "id": enum_id, "icon": enum_icon}
31 |
32 | func get_enum(id: int):
33 |
34 | return enum_[id]
35 |
36 | func get_all_enum():
37 |
38 | return enum_
39 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/generatedClassPreview/generatedClassPreview.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends ConfirmationDialog
3 |
4 | var codeNode: CodeEdit
5 | var file_dialog: FileDialog
6 |
7 | var className: String = "":
8 | set(new_value):
9 | className = new_value
10 | set_title(str("Generated Class Preview: ", className))
11 |
12 | var content: String = "":
13 | set(new_value):
14 | content = new_value
15 | codeNode.set_text(content)
16 |
17 | func _ready():
18 | codeNode = get_child(0).get_child(0)
19 |
20 | codeNode.set_language('GDScript')
21 |
22 | get_ok_button().pressed.connect(_on_save_file_asked)
23 |
24 | func _on_save_file_asked():
25 |
26 | file_dialog = FileDialog.new()
27 |
28 | file_dialog.add_filter("*.gd", "GDScript")
29 |
30 | file_dialog.file_mode = FileDialog.FILE_MODE_SAVE_FILE
31 |
32 | file_dialog.file_selected.connect(_on_save_file)
33 | file_dialog.canceled.connect(_on_cancel_save)
34 |
35 | file_dialog.initial_position = Window.WINDOW_INITIAL_POSITION_CENTER_PRIMARY_SCREEN
36 | file_dialog.size = Vector2(300, 400)
37 |
38 | EditorInterface.get_base_control().add_child(file_dialog)
39 |
40 | file_dialog.visible = true
41 |
42 | return
43 |
44 | func _on_save_file(path: String):
45 |
46 | var script_file: GDScript = GDScript.new()
47 |
48 | script_file.set_source_code(content)
49 |
50 | ResourceSaver.save(script_file, path)
51 |
52 | EditorInterface.get_file_system_dock().navigate_to_path(path)
53 |
54 | func _on_cancel_save():
55 | file_dialog.visible = false
56 | file_dialog.queue_free()
57 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/generatedClassPreview/generatedClassPreview.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://bcwbl0fh5xxmv"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/nodes/generatedClassPreview/generatedClassPreview.gd" id="1_pkx34"]
4 |
5 | [sub_resource type="EditorSyntaxHighlighter" id="EditorSyntaxHighlighter_lexb6"]
6 |
7 | [node name="GeneratedClassPreview" type="ConfirmationDialog"]
8 | title = "Generated Class Preview: "
9 | initial_position = 2
10 | size = Vector2i(750, 400)
11 | visible = true
12 | exclusive = false
13 | ok_button_text = "Save in file..."
14 | script = ExtResource("1_pkx34")
15 |
16 | [node name="VBoxContainer" type="VBoxContainer" parent="."]
17 | offset_left = 4.0
18 | offset_top = 4.0
19 | offset_right = 746.0
20 | offset_bottom = 358.0
21 | size_flags_horizontal = 3
22 | size_flags_vertical = 3
23 |
24 | [node name="CodeEdit" type="CodeEdit" parent="VBoxContainer"]
25 | layout_mode = 2
26 | size_flags_vertical = 3
27 | editable = false
28 | syntax_highlighter = SubResource("EditorSyntaxHighlighter_lexb6")
29 | language = "GDScript"
30 |
31 | [node name="Label" type="Label" parent="VBoxContainer"]
32 | layout_mode = 2
33 | text = "Please note that this feature is still in development, If you encouter a bug, report it on GitHub!"
34 | horizontal_alignment = 1
35 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/importer/customResource/customResource.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Window
3 |
4 | signal vars_selected(vars: Array)
5 |
6 | signal vars_deselect(except_name: String)
7 | signal vars_block(except_name: String)
8 | signal vars_unblock()
9 |
10 | # Variable that stores the var inside the given resource
11 | var var_list_data = []
12 | var var_fix_data = []
13 |
14 |
15 | # Search box
16 | @onready var le_search: LineEdit = %le_search
17 | @onready var bt_search: Button = %bt_search
18 |
19 | # List of vars
20 | @onready var var_list: VBoxContainer = %var_list
21 | var var_list_model: Resource
22 |
23 | # label amount selected
24 | @onready var label_selected: Label = %lbl_amount
25 |
26 | # confirm button
27 | @onready var bt_select: Button = %bt_select
28 |
29 | var total_amount = 0:
30 | set(new_amount):
31 | total_amount = new_amount
32 | label_selected.text = "Amount selected: " + str(selected_amount) + "/" + str(total_amount)
33 |
34 | var selected_amount = 0:
35 | set(new_amount):
36 | selected_amount = new_amount
37 | label_selected.text = "Amount selected: " + str(selected_amount) + "/" + str(total_amount)
38 |
39 | func _ready():
40 | var_list_model = preload("res://addons/datatable_godot/ui/nodes/importer/customResource/customResourceVarListItem.tscn")
41 |
42 | # Connect the signals
43 | bt_search.pressed.connect(_on_bt_search_pressed)
44 | bt_select.pressed.connect(_on_bt_select_pressed)
45 |
46 | # Connect the close signal
47 | close_requested.connect(_on_close)
48 |
49 | func _add_item(var_name: String, var_type: int, valid: bool = true, add_to_var: bool = true):
50 | var item = var_list_model.instantiate()
51 |
52 | item.var_name = var_name
53 | item.var_type = str(var_type)
54 | item.var_valid = valid
55 | print("var_name: ", var_name, " - var_type: ", var_type, " - valid: ", valid)
56 |
57 | item.var_import_changed.connect(_on_item_selected)
58 | vars_deselect.connect(item._on_deselect)
59 | vars_block.connect(item._on_block)
60 | vars_unblock.connect(item._on_unblock)
61 |
62 | var_list.add_child(item)
63 | var_list_data.append(item)
64 | if add_to_var:
65 | var_fix_data.append({"name": var_name, "type": var_type, "valid": valid})
66 | total_amount += 1
67 | print("_add_item: ", var_name, " - ", var_type)
68 | print("\n\tvar_list_data: ", var_list_data)
69 |
70 | func clear_items_ui():
71 | for i in var_list.get_children():
72 | i.queue_free()
73 |
74 | func clear_items_data():
75 | var_list_data.clear()
76 | total_amount = 0
77 |
78 | func _get_vars(search_text: String) -> Array:
79 | var vars = []
80 |
81 | # Get the vars
82 | for i in var_fix_data:
83 | var var_name = i.name
84 | var var_type = i.type
85 | var var_valid = i.valid
86 |
87 | # Check if the var name contains the search text
88 | if search_text == "" or var_name.find(search_text) != -1:
89 | vars.append({"name": var_name, "type": var_type, "valid": var_valid})
90 |
91 | return vars
92 |
93 | func _on_bt_search_pressed():
94 | # Clear the list
95 | clear_items_ui()
96 |
97 | # Get the search text
98 | var search_text = le_search.text
99 |
100 | # Get the vars
101 | var vars = _get_vars(search_text)
102 |
103 | clear_items_data()
104 | # Add the vars to the list
105 | for v in vars:
106 | _add_item(v.name, v.type, v.valid, false)
107 |
108 | func _on_bt_select_pressed():
109 |
110 | # Get the selected vars
111 | var selected_vars = []
112 |
113 | for i in var_list_data:
114 | if i.var_import:
115 | selected_vars.append({"name": i.var_name, "type": i.var_type, "valid": i.var_valid})
116 |
117 | # Emit the signal
118 | vars_selected.emit(selected_vars)
119 |
120 | print("close window")
121 |
122 | func _on_close():
123 | # Emit the signal
124 | vars_selected.emit([])
125 |
126 | print("close window")
127 |
128 | queue_free()
129 |
130 | func _on_item_selected(var_name: String, var_import: bool, var_type: String):
131 | print("var_name: ", var_name, " - var_import: ", var_import)
132 |
133 | # Update the selected amount
134 | if var_import:
135 | selected_amount += 1
136 | else:
137 | selected_amount -= 1
138 | if selected_amount < 0:
139 | selected_amount = 0
140 |
141 | # Check if the selected item is a dict
142 | if var_type.to_int() == TYPE_DICTIONARY:
143 | if !var_import:
144 | vars_unblock.emit()
145 | return
146 | vars_deselect.emit(var_name)
147 | vars_block.emit(var_name)
148 | selected_amount = 1
149 | return
150 |
151 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/importer/customResource/customResource.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://ct2pf7jdxotho"]
2 |
3 | [ext_resource type="Texture2D" uid="uid://danpa70ygoi1q" path="res://addons/datatable_godot/icons/Search.png" id="1_mxuvw"]
4 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/nodes/importer/customResource/customResource.gd" id="1_pgpw0"]
5 |
6 | [node name="CustomResource" type="Window"]
7 | title = "Import X.trs [ResourceClass]"
8 | initial_position = 2
9 | size = Vector2i(600, 400)
10 | visible = false
11 | transient = true
12 | exclusive = true
13 | script = ExtResource("1_pgpw0")
14 |
15 | [node name="MarginContainer" type="MarginContainer" parent="."]
16 | anchors_preset = 15
17 | anchor_right = 1.0
18 | anchor_bottom = 1.0
19 | grow_horizontal = 2
20 | grow_vertical = 2
21 | size_flags_horizontal = 3
22 | size_flags_vertical = 3
23 | theme_override_constants/margin_left = 2
24 | theme_override_constants/margin_top = 2
25 | theme_override_constants/margin_right = 2
26 | theme_override_constants/margin_bottom = 2
27 |
28 | [node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer"]
29 | layout_mode = 2
30 |
31 | [node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer2"]
32 | layout_mode = 2
33 | size_flags_vertical = 3
34 |
35 | [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer2/HBoxContainer"]
36 | layout_mode = 2
37 | size_flags_horizontal = 3
38 |
39 | [node name="box_search" type="HBoxContainer" parent="MarginContainer/VBoxContainer2/HBoxContainer/VBoxContainer"]
40 | layout_mode = 2
41 |
42 | [node name="le_search" type="LineEdit" parent="MarginContainer/VBoxContainer2/HBoxContainer/VBoxContainer/box_search"]
43 | unique_name_in_owner = true
44 | layout_mode = 2
45 | size_flags_horizontal = 3
46 | placeholder_text = "Search..."
47 |
48 | [node name="bt_search" type="Button" parent="MarginContainer/VBoxContainer2/HBoxContainer/VBoxContainer/box_search"]
49 | unique_name_in_owner = true
50 | layout_mode = 2
51 | theme_override_colors/font_color = Color(0, 0, 0, 0)
52 | theme_override_colors/font_pressed_color = Color(0, 0, 0, 0)
53 | theme_override_colors/font_hover_color = Color(0, 0, 0, 0)
54 | theme_override_colors/font_focus_color = Color(0, 0, 0, 0)
55 | theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 0)
56 | theme_override_colors/font_disabled_color = Color(0, 0, 0, 0)
57 | theme_override_colors/font_outline_color = Color(0, 0, 0, 0)
58 | text = " X "
59 | icon = ExtResource("1_mxuvw")
60 | icon_alignment = 1
61 |
62 | [node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer2/HBoxContainer/VBoxContainer"]
63 | layout_mode = 2
64 | size_flags_vertical = 3
65 |
66 | [node name="var_list" type="VBoxContainer" parent="MarginContainer/VBoxContainer2/HBoxContainer/VBoxContainer/ScrollContainer"]
67 | unique_name_in_owner = true
68 | layout_mode = 2
69 | size_flags_horizontal = 3
70 | size_flags_vertical = 3
71 |
72 | [node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer2"]
73 | layout_mode = 2
74 |
75 | [node name="Label" type="Label" parent="MarginContainer/VBoxContainer2/HBoxContainer2"]
76 | custom_minimum_size = Vector2(0, 48)
77 | layout_mode = 2
78 | size_flags_horizontal = 3
79 | text = "Be aware that you can only import 1 dictionary: If you select a dictionary any other selected var will be unselected!"
80 | autowrap_mode = 2
81 |
82 | [node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer2"]
83 | layout_mode = 2
84 |
85 | [node name="lbl_amount" type="Label" parent="MarginContainer/VBoxContainer2/HBoxContainer3"]
86 | unique_name_in_owner = true
87 | layout_mode = 2
88 | size_flags_horizontal = 3
89 | text = "Amount selected: 0/10"
90 |
91 | [node name="bt_select" type="Button" parent="MarginContainer/VBoxContainer2/HBoxContainer3"]
92 | unique_name_in_owner = true
93 | layout_mode = 2
94 | text = "Confirm selection"
95 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/importer/customResource/customResourceVarListItem.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | signal var_import_changed(var_name: String, var_import: bool, var_type: String)
5 |
6 | @onready var _varName: Label = %varName
7 | @onready var _varType: Label = %varType
8 | @onready var _varImport: CheckBox = %varImport
9 |
10 | var var_name = "":
11 | set(new_value):
12 | var_name = new_value
13 | %varName.set_text(new_value)
14 |
15 | var var_type = "":
16 | set(new_value):
17 | var_type = new_value
18 | %varType.set_text(type_string(new_value.to_int()).capitalize())
19 |
20 | var var_valid: bool = true:
21 | set(new_value):
22 | var_valid = new_value
23 | if new_value:
24 | %varName.remove_theme_color_override("font_color")
25 | %varName.tooltip_text = ""
26 | else:
27 | print("Invalid var name: ", var_name)
28 | %varName.add_theme_color_override("font_color", Color(1, .47, .42))
29 | %varName.tooltip_text = "This name is not present in the used structure. If you import it, it will be added to the structure."
30 |
31 | var var_import = false
32 |
33 | func _ready():
34 | _varImport.pressed.connect(_on_varImport_pressed)
35 |
36 | func _on_varImport_pressed():
37 | var_import = _varImport.button_pressed
38 | var_import_changed.emit(var_name, var_import, var_type)
39 |
40 | func _on_deselect(except_name: String):
41 | if except_name != var_name:
42 | _varImport.button_pressed = false
43 | var_import = false
44 | var_import_changed.emit(var_name, var_import, var_type)
45 |
46 | func _on_block(except_name: String):
47 | if except_name != var_name:
48 | _varImport.disabled = true
49 |
50 | func _on_unblock():
51 | _varImport.disabled = false
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/importer/customResource/customResourceVarListItem.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dwwhhoq1e0gkl"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/nodes/importer/customResource/customResourceVarListItem.gd" id="1_x08tm"]
4 |
5 | [node name="CustomResourceVarListItem" type="HBoxContainer"]
6 | anchors_preset = 15
7 | anchor_right = 1.0
8 | anchor_bottom = 1.0
9 | grow_horizontal = 2
10 | grow_vertical = 2
11 | size_flags_horizontal = 3
12 | script = ExtResource("1_x08tm")
13 |
14 | [node name="varName" type="Label" parent="."]
15 | unique_name_in_owner = true
16 | layout_mode = 2
17 | size_flags_horizontal = 3
18 | mouse_filter = 0
19 |
20 | [node name="varType" type="Label" parent="."]
21 | unique_name_in_owner = true
22 | layout_mode = 2
23 | size_flags_horizontal = 3
24 |
25 | [node name="varImport" type="CheckBox" parent="."]
26 | unique_name_in_owner = true
27 | layout_mode = 2
28 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/array_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=5 format=3 uid="uid://6kgq5h8y7gcu"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/array_schema.gd" id="1_hlcei"]
4 | [ext_resource type="Texture2D" uid="uid://d4af0scr4f3ea" path="res://addons/datatable_godot/icons/Add.svg" id="2_43556"]
5 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/box/arr_item_box.gd" id="3_gepj5"]
6 | [ext_resource type="Texture2D" uid="uid://blh822uvyrgg1" path="res://addons/datatable_godot/icons/Remove.svg" id="4_gqklv"]
7 |
8 | [node name="array_schema" type="VBoxContainer"]
9 | size_flags_horizontal = 3
10 | script = ExtResource("1_hlcei")
11 | metadata/array = true
12 |
13 | [node name="HBoxContainer" type="HBoxContainer" parent="."]
14 | layout_mode = 2
15 |
16 | [node name="RichTextLabel" type="RichTextLabel" parent="HBoxContainer"]
17 | custom_minimum_size = Vector2(163, 0)
18 | layout_mode = 2
19 | size_flags_horizontal = 3
20 | size_flags_stretch_ratio = 0.4
21 | tooltip_text = "test"
22 | bbcode_enabled = true
23 | text = "[img]res://addons/datatable_godot/icons/array_value.png[/img]Array"
24 | fit_content = true
25 | scroll_active = false
26 |
27 | [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer"]
28 | layout_mode = 2
29 | size_flags_horizontal = 3
30 |
31 | [node name="paramValue" type="HBoxContainer" parent="HBoxContainer/HBoxContainer"]
32 | clip_contents = true
33 | layout_mode = 2
34 | size_flags_horizontal = 3
35 |
36 | [node name="b_add_arr_item" type="Button" parent="HBoxContainer/HBoxContainer"]
37 | custom_minimum_size = Vector2(35, 0)
38 | layout_mode = 2
39 | theme_override_colors/font_color = Color(0, 0, 0, 0)
40 | theme_override_colors/font_pressed_color = Color(0, 0, 0, 0)
41 | theme_override_colors/font_hover_color = Color(0, 0, 0, 0)
42 | theme_override_colors/font_focus_color = Color(0, 0, 0, 0)
43 | theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 0)
44 | theme_override_colors/font_disabled_color = Color(0, 0, 0, 0)
45 | theme_override_colors/font_outline_color = Color(0, 0, 0, 0)
46 | text = " X "
47 | icon = ExtResource("2_43556")
48 | icon_alignment = 1
49 |
50 | [node name="MarginContainer" type="MarginContainer" parent="."]
51 | clip_contents = true
52 | layout_mode = 2
53 | size_flags_vertical = 0
54 |
55 | [node name="HBoxContainer2" type="HBoxContainer" parent="."]
56 | layout_mode = 2
57 | size_flags_vertical = 3
58 |
59 | [node name="MarginContainer" type="MarginContainer" parent="HBoxContainer2"]
60 | layout_mode = 2
61 | size_flags_horizontal = 3
62 | size_flags_vertical = 0
63 | size_flags_stretch_ratio = 0.4
64 |
65 | [node name="arr_items_list" type="VBoxContainer" parent="HBoxContainer2"]
66 | layout_mode = 2
67 | size_flags_horizontal = 3
68 | size_flags_vertical = 3
69 | script = ExtResource("3_gepj5")
70 |
71 | [node name="arr_item_schema" type="HBoxContainer" parent="HBoxContainer2/arr_items_list"]
72 | visible = false
73 | layout_mode = 2
74 | size_flags_vertical = 3
75 |
76 | [node name="b_delete_arr_item" type="Button" parent="HBoxContainer2/arr_items_list/arr_item_schema"]
77 | layout_mode = 2
78 | theme_override_colors/font_color = Color(0, 0, 0, 0)
79 | theme_override_colors/font_pressed_color = Color(0, 0, 0, 0)
80 | theme_override_colors/font_hover_color = Color(0, 0, 0, 0)
81 | theme_override_colors/font_focus_color = Color(0, 0, 0, 0)
82 | theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 0)
83 | theme_override_colors/font_disabled_color = Color(0, 0, 0, 0)
84 | theme_override_colors/font_outline_color = Color(0, 0, 0, 0)
85 | text = " X "
86 | icon = ExtResource("4_gqklv")
87 | icon_alignment = 1
88 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/bool_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://b77hnhhpu8av8"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/bool_schema.gd" id="1_0n7jv"]
4 |
5 | [node name="bool_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_0n7jv")
8 |
9 | [node name="RichTextLabel" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Bool type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/bool.png[/img] String Name"
16 | fit_content = true
17 |
18 | [node name="paramValue" type="CheckBox" parent="."]
19 | layout_mode = 2
20 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/color_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://2ybv0wpdcdeb"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/color_schema.gd" id="1_mqcqk"]
4 |
5 | [node name="color_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_mqcqk")
8 |
9 | [node name="ParamName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Color type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/Color.svg[/img] Color Name"
16 | fit_content = true
17 |
18 | [node name="ParamValue" type="ColorPickerButton" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/dict_item_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://k8qthmlvngki"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/dict_item_schema.gd" id="1_3k1re"]
4 | [ext_resource type="Texture2D" uid="uid://blh822uvyrgg1" path="res://addons/datatable_godot/icons/Remove.svg" id="1_q6252"]
5 |
6 | [node name="dict_item_schema" type="HBoxContainer"]
7 | anchors_preset = 15
8 | anchor_right = 1.0
9 | anchor_bottom = 1.0
10 | grow_horizontal = 2
11 | grow_vertical = 2
12 | size_flags_horizontal = 3
13 | size_flags_vertical = 3
14 | script = ExtResource("1_3k1re")
15 |
16 | [node name="ItemName" type="RichTextLabel" parent="."]
17 | unique_name_in_owner = true
18 | custom_minimum_size = Vector2(100, 0)
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 | bbcode_enabled = true
22 |
23 | [node name="ItemValue" type="VBoxContainer" parent="."]
24 | unique_name_in_owner = true
25 | layout_mode = 2
26 | size_flags_horizontal = 3
27 |
28 | [node name="ItemDelete" type="Button" parent="."]
29 | unique_name_in_owner = true
30 | layout_mode = 2
31 | theme_override_colors/font_color = Color(0, 0, 0, 0)
32 | theme_override_colors/font_pressed_color = Color(0, 0, 0, 0)
33 | theme_override_colors/font_hover_color = Color(0, 0, 0, 0)
34 | theme_override_colors/font_focus_color = Color(0, 0, 0, 0)
35 | theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 0)
36 | theme_override_colors/font_disabled_color = Color(0, 0, 0, 0)
37 | theme_override_colors/font_outline_color = Color(0, 0, 0, 0)
38 | text = " X "
39 | icon = ExtResource("1_q6252")
40 | icon_alignment = 1
41 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/dict_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://drtgy44d6xwuj"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/dict_schema.gd" id="1_7rpdw"]
4 |
5 | [node name="DictSchema" type="HBoxContainer"]
6 | visible = false
7 | anchors_preset = 15
8 | anchor_right = 1.0
9 | anchor_bottom = 1.0
10 | grow_horizontal = 2
11 | grow_vertical = 2
12 | script = ExtResource("1_7rpdw")
13 |
14 | [node name="ParamName" type="RichTextLabel" parent="."]
15 | unique_name_in_owner = true
16 | layout_mode = 2
17 | size_flags_horizontal = 3
18 | size_flags_stretch_ratio = 0.4
19 | bbcode_enabled = true
20 | text = "[img]res://addons/datatable_godot/icons/dictionary.png[/img] Dictionnary name"
21 | fit_content = true
22 | autowrap_mode = 0
23 |
24 | [node name="ParamInteract" type="Button" parent="."]
25 | unique_name_in_owner = true
26 | layout_mode = 2
27 | size_flags_horizontal = 3
28 | text = "Open editor"
29 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/dict_win_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=3 uid="uid://5ac7ttyyv5p5"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/dict_win_schema.gd" id="1_g8ls3"]
4 | [ext_resource type="Texture2D" uid="uid://bh4utwbo8c1th" path="res://addons/datatable_godot/icons/String.svg" id="2_2nl64"]
5 | [ext_resource type="Texture2D" uid="uid://d4af0scr4f3ea" path="res://addons/datatable_godot/icons/Add.svg" id="3_sbbmy"]
6 |
7 | [node name="DictSchema" type="HBoxContainer"]
8 | anchors_preset = 15
9 | anchor_right = 1.0
10 | anchor_bottom = 1.0
11 | grow_horizontal = 2
12 | grow_vertical = 2
13 | script = ExtResource("1_g8ls3")
14 |
15 | [node name="ParamName" type="RichTextLabel" parent="."]
16 | unique_name_in_owner = true
17 | visible = false
18 | layout_mode = 2
19 | bbcode_enabled = true
20 |
21 | [node name="ParamValue" type="VBoxContainer" parent="."]
22 | unique_name_in_owner = true
23 | layout_mode = 2
24 | size_flags_horizontal = 3
25 |
26 | [node name="rootValue" type="HBoxContainer" parent="ParamValue"]
27 | layout_mode = 2
28 |
29 | [node name="rootName" type="LineEdit" parent="ParamValue/rootValue"]
30 | unique_name_in_owner = true
31 | custom_minimum_size = Vector2(100, 0)
32 | layout_mode = 2
33 | size_flags_horizontal = 3
34 |
35 | [node name="rootType" type="OptionButton" parent="ParamValue/rootValue"]
36 | unique_name_in_owner = true
37 | layout_mode = 2
38 | size_flags_horizontal = 3
39 | item_count = 1
40 | selected = 0
41 | popup/item_0/text = "String"
42 | popup/item_0/icon = ExtResource("2_2nl64")
43 | popup/item_0/id = 0
44 |
45 | [node name="rootAdd" type="Button" parent="ParamValue/rootValue"]
46 | unique_name_in_owner = true
47 | layout_mode = 2
48 | theme_override_colors/font_color = Color(0, 0, 0, 0)
49 | theme_override_colors/font_pressed_color = Color(0, 0, 0, 0)
50 | theme_override_colors/font_hover_color = Color(0, 0, 0, 0)
51 | theme_override_colors/font_focus_color = Color(0, 0, 0, 0)
52 | theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 0)
53 | theme_override_colors/font_disabled_color = Color(0, 0, 0, 0)
54 | theme_override_colors/font_outline_color = Color(0, 0, 0, 0)
55 | disabled = true
56 | text = " X "
57 | icon = ExtResource("3_sbbmy")
58 | icon_alignment = 1
59 |
60 | [node name="VSeparator" type="HSeparator" parent="ParamValue"]
61 | layout_mode = 2
62 |
63 | [node name="MarginContainer" type="MarginContainer" parent="ParamValue"]
64 | layout_mode = 2
65 | size_flags_vertical = 3
66 | theme_override_constants/margin_left = 5
67 | theme_override_constants/margin_right = 5
68 |
69 | [node name="ScrollContainer" type="ScrollContainer" parent="ParamValue/MarginContainer"]
70 | layout_mode = 2
71 | size_flags_vertical = 3
72 |
73 | [node name="itemList" type="VBoxContainer" parent="ParamValue/MarginContainer/ScrollContainer"]
74 | unique_name_in_owner = true
75 | layout_mode = 2
76 | size_flags_horizontal = 3
77 |
78 | [node name="HSeparator" type="HSeparator" parent="ParamValue"]
79 | layout_mode = 2
80 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/float_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://cs4r8tfwegfb3"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/float_schema.gd" id="1_xrp0f"]
4 |
5 | [node name="float_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_xrp0f")
8 |
9 | [node name="ParamName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Float type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/float.svg[/img] Float Name"
16 | fit_content = true
17 |
18 | [node name="ParamValue" type="SpinBox" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 | step = 0.0
22 | allow_greater = true
23 | allow_lesser = true
24 | custom_arrow_step = 0.05
25 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/int_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://bd5mhn3a5phr7"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/int_schema.gd" id="1_l4i83"]
4 |
5 | [node name="int_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_l4i83")
8 |
9 | [node name="ParamName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Int type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/int.svg[/img] Int Name"
16 | fit_content = true
17 |
18 | [node name="ParamValue" type="SpinBox" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 | rounded = true
22 | allow_greater = true
23 | allow_lesser = true
24 | custom_arrow_step = 1.0
25 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/invalid_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://c4lssdribnyiw"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/invalid_schema.gd" id="1_rdj4u"]
4 |
5 | [node name="InvalidSchema" type="HBoxContainer"]
6 | anchors_preset = 15
7 | anchor_right = 1.0
8 | anchor_bottom = 1.0
9 | grow_horizontal = 2
10 | grow_vertical = 2
11 | script = ExtResource("1_rdj4u")
12 |
13 | [node name="paramName" type="RichTextLabel" parent="."]
14 | layout_mode = 2
15 | size_flags_horizontal = 3
16 | size_flags_stretch_ratio = 0.4
17 |
18 | [node name="paramValue" type="RichTextLabel" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 | tooltip_text = "This type is supported by Godot but not by the plugin at the moment, so you can only see a preview of it, without editing it!"
22 | mouse_default_cursor_shape = 8
23 | text = "This type is supported by Godot but not by the plugin at the moment"
24 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/plane_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dl8gaa43nw4av"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/plane_schema.gd" id="1_j3mir"]
4 |
5 | [node name="plane_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_j3mir")
8 |
9 | [node name="paramName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | bbcode_enabled = true
14 | text = "[img]res://addons/datatable_godot/icons/Plane.png[/img] Plane Name"
15 | fit_content = true
16 |
17 | [node name="paramValue" type="VBoxContainer" parent="."]
18 | layout_mode = 2
19 | size_flags_horizontal = 3
20 |
21 | [node name="x_box" type="HBoxContainer" parent="paramValue"]
22 | layout_mode = 2
23 |
24 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/x_box"]
25 | custom_minimum_size = Vector2(30, 0)
26 | layout_mode = 2
27 | size_flags_stretch_ratio = 0.2
28 | bbcode_enabled = true
29 | text = "[color=fab293]X: [/color]"
30 | fit_content = true
31 |
32 | [node name="x_value" type="SpinBox" parent="paramValue/x_box"]
33 | layout_mode = 2
34 | size_flags_horizontal = 3
35 | step = 0.0
36 | allow_greater = true
37 | allow_lesser = true
38 | suffix = "px"
39 | custom_arrow_step = 0.05
40 |
41 | [node name="y_box" type="HBoxContainer" parent="paramValue"]
42 | layout_mode = 2
43 |
44 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/y_box"]
45 | custom_minimum_size = Vector2(30, 0)
46 | layout_mode = 2
47 | size_flags_stretch_ratio = 0.2
48 | bbcode_enabled = true
49 | text = "[color=93fab2]Y: [/color]"
50 | fit_content = true
51 |
52 | [node name="y_value" type="SpinBox" parent="paramValue/y_box"]
53 | layout_mode = 2
54 | size_flags_horizontal = 3
55 | step = 0.0
56 | allow_greater = true
57 | allow_lesser = true
58 | suffix = "px"
59 | custom_arrow_step = 0.05
60 |
61 | [node name="z_box" type="HBoxContainer" parent="paramValue"]
62 | layout_mode = 2
63 |
64 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/z_box"]
65 | custom_minimum_size = Vector2(30, 0)
66 | layout_mode = 2
67 | size_flags_stretch_ratio = 0.2
68 | bbcode_enabled = true
69 | text = "[color=b293fa]Z: [/color]"
70 | fit_content = true
71 |
72 | [node name="z_value" type="SpinBox" parent="paramValue/z_box"]
73 | layout_mode = 2
74 | size_flags_horizontal = 3
75 | step = 0.0
76 | allow_greater = true
77 | allow_lesser = true
78 | suffix = "px"
79 | custom_arrow_step = 0.05
80 |
81 | [node name="d_box" type="HBoxContainer" parent="paramValue"]
82 | layout_mode = 2
83 |
84 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/d_box"]
85 | custom_minimum_size = Vector2(30, 0)
86 | layout_mode = 2
87 | size_flags_stretch_ratio = 0.2
88 | bbcode_enabled = true
89 | text = "[color=93dbfa]D: [/color]"
90 | fit_content = true
91 |
92 | [node name="d_value" type="SpinBox" parent="paramValue/d_box"]
93 | layout_mode = 2
94 | size_flags_horizontal = 3
95 | step = 0.0
96 | allow_greater = true
97 | allow_lesser = true
98 | suffix = "px"
99 | custom_arrow_step = 0.05
100 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/quat_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://cxv2241ipje06"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/quaternionSchema.gd" id="1_vbljs"]
4 |
5 | [node name="quat_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_vbljs")
8 |
9 | [node name="paramName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | bbcode_enabled = true
14 | text = "[img]res://addons/datatable_godot/icons/Quaternion.png[/img] Quaternion Name"
15 | fit_content = true
16 |
17 | [node name="paramValue" type="VBoxContainer" parent="."]
18 | layout_mode = 2
19 | size_flags_horizontal = 3
20 |
21 | [node name="x_box" type="HBoxContainer" parent="paramValue"]
22 | layout_mode = 2
23 |
24 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/x_box"]
25 | custom_minimum_size = Vector2(30, 0)
26 | layout_mode = 2
27 | size_flags_stretch_ratio = 0.2
28 | bbcode_enabled = true
29 | text = "[color=fab293]X: [/color]"
30 | fit_content = true
31 |
32 | [node name="x_value" type="SpinBox" parent="paramValue/x_box"]
33 | layout_mode = 2
34 | size_flags_horizontal = 3
35 | step = 0.0
36 | allow_greater = true
37 | allow_lesser = true
38 | suffix = "px"
39 | custom_arrow_step = 0.05
40 |
41 | [node name="y_box" type="HBoxContainer" parent="paramValue"]
42 | layout_mode = 2
43 |
44 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/y_box"]
45 | custom_minimum_size = Vector2(30, 0)
46 | layout_mode = 2
47 | size_flags_stretch_ratio = 0.2
48 | bbcode_enabled = true
49 | text = "[color=93fab2]Y: [/color]"
50 | fit_content = true
51 |
52 | [node name="y_value" type="SpinBox" parent="paramValue/y_box"]
53 | layout_mode = 2
54 | size_flags_horizontal = 3
55 | step = 0.0
56 | allow_greater = true
57 | allow_lesser = true
58 | suffix = "px"
59 | custom_arrow_step = 0.05
60 |
61 | [node name="z_box" type="HBoxContainer" parent="paramValue"]
62 | layout_mode = 2
63 |
64 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/z_box"]
65 | custom_minimum_size = Vector2(30, 0)
66 | layout_mode = 2
67 | size_flags_stretch_ratio = 0.2
68 | bbcode_enabled = true
69 | text = "[color=b293fa]Z: [/color]"
70 | fit_content = true
71 |
72 | [node name="z_value" type="SpinBox" parent="paramValue/z_box"]
73 | layout_mode = 2
74 | size_flags_horizontal = 3
75 | step = 0.0
76 | allow_greater = true
77 | allow_lesser = true
78 | suffix = "px"
79 | custom_arrow_step = 0.05
80 |
81 | [node name="d_box" type="HBoxContainer" parent="paramValue"]
82 | layout_mode = 2
83 |
84 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/d_box"]
85 | custom_minimum_size = Vector2(30, 0)
86 | layout_mode = 2
87 | size_flags_stretch_ratio = 0.2
88 | bbcode_enabled = true
89 | text = "[color=93dbfa]D: [/color]"
90 | fit_content = true
91 |
92 | [node name="d_value" type="SpinBox" parent="paramValue/d_box"]
93 | layout_mode = 2
94 | size_flags_horizontal = 3
95 | step = 0.0
96 | allow_greater = true
97 | allow_lesser = true
98 | suffix = "px"
99 | custom_arrow_step = 0.05
100 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/rect_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://coygjo4cwrm7p"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/rect_schema.gd" id="1_bjn0f"]
4 |
5 | [node name="rect_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_bjn0f")
8 |
9 | [node name="paramName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Vector2 type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/Rect2.png[/img] Rect Name"
16 | fit_content = true
17 |
18 | [node name="paramValue" type="VBoxContainer" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 |
22 | [node name="HBoxContainer" type="HBoxContainer" parent="paramValue"]
23 | layout_mode = 2
24 |
25 | [node name="x_box" type="HBoxContainer" parent="paramValue/HBoxContainer"]
26 | layout_mode = 2
27 | size_flags_horizontal = 3
28 |
29 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/HBoxContainer/x_box"]
30 | custom_minimum_size = Vector2(30, 0)
31 | layout_mode = 2
32 | size_flags_stretch_ratio = 0.2
33 | bbcode_enabled = true
34 | text = "[color=fab293]X: [/color]"
35 | fit_content = true
36 |
37 | [node name="x_value" type="SpinBox" parent="paramValue/HBoxContainer/x_box"]
38 | layout_mode = 2
39 | size_flags_horizontal = 3
40 | step = 0.0
41 | allow_greater = true
42 | allow_lesser = true
43 | suffix = "px"
44 | custom_arrow_step = 0.05
45 |
46 | [node name="y_box" type="HBoxContainer" parent="paramValue/HBoxContainer"]
47 | layout_mode = 2
48 | size_flags_horizontal = 3
49 |
50 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/HBoxContainer/y_box"]
51 | custom_minimum_size = Vector2(30, 0)
52 | layout_mode = 2
53 | size_flags_stretch_ratio = 0.2
54 | bbcode_enabled = true
55 | text = "[color=93fab2]Y: [/color]"
56 | fit_content = true
57 |
58 | [node name="y_value" type="SpinBox" parent="paramValue/HBoxContainer/y_box"]
59 | layout_mode = 2
60 | size_flags_horizontal = 3
61 | step = 0.0
62 | allow_greater = true
63 | allow_lesser = true
64 | suffix = "px"
65 | custom_arrow_step = 0.05
66 |
67 | [node name="HBoxContainer2" type="HBoxContainer" parent="paramValue"]
68 | layout_mode = 2
69 |
70 | [node name="w_box" type="HBoxContainer" parent="paramValue/HBoxContainer2"]
71 | layout_mode = 2
72 | size_flags_horizontal = 3
73 |
74 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/HBoxContainer2/w_box"]
75 | custom_minimum_size = Vector2(30, 0)
76 | layout_mode = 2
77 | size_flags_stretch_ratio = 0.2
78 | bbcode_enabled = true
79 | text = "[color=fab293]W: [/color]"
80 | fit_content = true
81 |
82 | [node name="w_value" type="SpinBox" parent="paramValue/HBoxContainer2/w_box"]
83 | layout_mode = 2
84 | size_flags_horizontal = 3
85 | step = 0.0
86 | allow_greater = true
87 | allow_lesser = true
88 | suffix = "px"
89 | custom_arrow_step = 0.05
90 |
91 | [node name="h_box" type="HBoxContainer" parent="paramValue/HBoxContainer2"]
92 | layout_mode = 2
93 | size_flags_horizontal = 3
94 |
95 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/HBoxContainer2/h_box"]
96 | custom_minimum_size = Vector2(30, 0)
97 | layout_mode = 2
98 | size_flags_stretch_ratio = 0.2
99 | bbcode_enabled = true
100 | text = "[color=93fab2]H: [/color]"
101 | fit_content = true
102 |
103 | [node name="y_value" type="SpinBox" parent="paramValue/HBoxContainer2/h_box"]
104 | layout_mode = 2
105 | size_flags_horizontal = 3
106 | step = 0.0
107 | allow_greater = true
108 | allow_lesser = true
109 | suffix = "px"
110 | custom_arrow_step = 0.05
111 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/ress_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://b6xlum6l21b2x"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/ress_schema.gd" id="1_4nhhx"]
4 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/buttons/newTable/b_resource_import.gd" id="2_wose6"]
5 |
6 | [node name="ress_schema" type="HBoxContainer"]
7 | visible = false
8 | script = ExtResource("1_4nhhx")
9 |
10 | [node name="RichTextLabel" type="RichTextLabel" parent="."]
11 | layout_mode = 2
12 | size_flags_horizontal = 3
13 | size_flags_stretch_ratio = 0.4
14 | tooltip_text = "Ressource type"
15 | bbcode_enabled = true
16 | text = "[img]res://addons/datatable_godot/icons/Ressource.png[/img] test"
17 | fit_content = true
18 |
19 | [node name="VBoxContainer" type="VBoxContainer" parent="."]
20 | layout_mode = 2
21 | size_flags_horizontal = 3
22 |
23 | [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
24 | layout_mode = 2
25 | size_flags_horizontal = 3
26 |
27 | [node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
28 | layout_mode = 2
29 | size_flags_horizontal = 3
30 | mouse_filter = 0
31 | clip_text = true
32 | text_overrun_behavior = 3
33 |
34 | [node name="b_resource_import" type="Button" parent="VBoxContainer/HBoxContainer"]
35 | layout_mode = 2
36 | text = "Import..."
37 | script = ExtResource("2_wose6")
38 |
39 | [node name="FileDialog" type="FileDialog" parent="VBoxContainer/HBoxContainer/b_resource_import"]
40 | title = "Open a File"
41 | initial_position = 2
42 | size = Vector2i(500, 400)
43 | ok_button_text = "Ouvrir"
44 | file_mode = 0
45 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/string_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://c4ta5t13uakf"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/string_schema.gd" id="1_v5why"]
4 |
5 | [node name="string_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_v5why")
8 |
9 | [node name="RichTextLabel" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "String type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/String.svg[/img] String Name"
16 | fit_content = true
17 |
18 | [node name="LineEdit" type="LineEdit" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/vector_2_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://5rktw2u0p57u"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/vector2_schema.gd" id="1_sy1le"]
4 |
5 | [node name="vector2_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_sy1le")
8 |
9 | [node name="paramName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Vector2 type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/Vector2.svg[/img] Vec2 Name"
16 | fit_content = true
17 |
18 | [node name="paramValue" type="VBoxContainer" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 |
22 | [node name="x_box" type="HBoxContainer" parent="paramValue"]
23 | layout_mode = 2
24 |
25 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/x_box"]
26 | custom_minimum_size = Vector2(30, 0)
27 | layout_mode = 2
28 | size_flags_stretch_ratio = 0.2
29 | bbcode_enabled = true
30 | text = "[color=fab293]X: [/color]"
31 | fit_content = true
32 |
33 | [node name="x_value" type="SpinBox" parent="paramValue/x_box"]
34 | layout_mode = 2
35 | size_flags_horizontal = 3
36 | step = 0.0
37 | allow_greater = true
38 | allow_lesser = true
39 | suffix = "px"
40 | custom_arrow_step = 0.05
41 |
42 | [node name="y_box" type="HBoxContainer" parent="paramValue"]
43 | layout_mode = 2
44 |
45 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/y_box"]
46 | custom_minimum_size = Vector2(30, 0)
47 | layout_mode = 2
48 | size_flags_stretch_ratio = 0.2
49 | bbcode_enabled = true
50 | text = "[color=93fab2]Y: [/color]"
51 | fit_content = true
52 |
53 | [node name="y_value" type="SpinBox" parent="paramValue/y_box"]
54 | layout_mode = 2
55 | size_flags_horizontal = 3
56 | step = 0.0
57 | allow_greater = true
58 | allow_lesser = true
59 | suffix = "px"
60 | custom_arrow_step = 0.05
61 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/vector_3_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://cgl178asspmcf"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/vector3_schema.gd" id="1_42sv7"]
4 |
5 | [node name="vector3_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_42sv7")
8 |
9 | [node name="paramName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Vector3 type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/Vector3.svg[/img] Vec3 Name"
16 | fit_content = true
17 |
18 | [node name="paramValue" type="VBoxContainer" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 |
22 | [node name="x_box" type="HBoxContainer" parent="paramValue"]
23 | layout_mode = 2
24 |
25 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/x_box"]
26 | custom_minimum_size = Vector2(30, 0)
27 | layout_mode = 2
28 | size_flags_stretch_ratio = 0.2
29 | bbcode_enabled = true
30 | text = "[color=fab293]X: [/color]"
31 | fit_content = true
32 |
33 | [node name="x_value" type="SpinBox" parent="paramValue/x_box"]
34 | layout_mode = 2
35 | size_flags_horizontal = 3
36 | step = 0.0
37 | allow_greater = true
38 | allow_lesser = true
39 | suffix = "px"
40 | custom_arrow_step = 0.05
41 |
42 | [node name="y_box" type="HBoxContainer" parent="paramValue"]
43 | layout_mode = 2
44 |
45 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/y_box"]
46 | custom_minimum_size = Vector2(30, 0)
47 | layout_mode = 2
48 | size_flags_stretch_ratio = 0.2
49 | bbcode_enabled = true
50 | text = "[color=93fab2]Y: [/color]"
51 | fit_content = true
52 |
53 | [node name="y_value" type="SpinBox" parent="paramValue/y_box"]
54 | layout_mode = 2
55 | size_flags_horizontal = 3
56 | step = 0.0
57 | allow_greater = true
58 | allow_lesser = true
59 | suffix = "px"
60 | custom_arrow_step = 0.05
61 |
62 | [node name="z_box" type="HBoxContainer" parent="paramValue"]
63 | layout_mode = 2
64 |
65 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/z_box"]
66 | custom_minimum_size = Vector2(30, 0)
67 | layout_mode = 2
68 | size_flags_stretch_ratio = 0.2
69 | bbcode_enabled = true
70 | text = "[color=b293fa]Z: [/color]"
71 | fit_content = true
72 |
73 | [node name="z_value" type="SpinBox" parent="paramValue/z_box"]
74 | layout_mode = 2
75 | size_flags_horizontal = 3
76 | step = 0.0
77 | allow_greater = true
78 | allow_lesser = true
79 | suffix = "px"
80 | custom_arrow_step = 0.05
81 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/nodes/schema/vector_4_schema.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://c8puq7wjihn8l"]
2 |
3 | [ext_resource type="Script" path="res://addons/datatable_godot/ui/schema/new_table/vector4_schema.gd" id="1_lp2ny"]
4 |
5 | [node name="vector4_schema" type="HBoxContainer"]
6 | visible = false
7 | script = ExtResource("1_lp2ny")
8 |
9 | [node name="paramName" type="RichTextLabel" parent="."]
10 | layout_mode = 2
11 | size_flags_horizontal = 3
12 | size_flags_stretch_ratio = 0.4
13 | tooltip_text = "Vector4 type"
14 | bbcode_enabled = true
15 | text = "[img]res://addons/datatable_godot/icons/Vector4.svg[/img] Vec4 Name"
16 | fit_content = true
17 |
18 | [node name="paramValue" type="VBoxContainer" parent="."]
19 | layout_mode = 2
20 | size_flags_horizontal = 3
21 |
22 | [node name="x_box" type="HBoxContainer" parent="paramValue"]
23 | layout_mode = 2
24 |
25 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/x_box"]
26 | custom_minimum_size = Vector2(30, 0)
27 | layout_mode = 2
28 | size_flags_stretch_ratio = 0.2
29 | bbcode_enabled = true
30 | text = "[color=fab293]X: [/color]"
31 | fit_content = true
32 |
33 | [node name="x_value" type="SpinBox" parent="paramValue/x_box"]
34 | layout_mode = 2
35 | size_flags_horizontal = 3
36 | step = 0.0
37 | allow_greater = true
38 | allow_lesser = true
39 | suffix = "px"
40 | custom_arrow_step = 0.05
41 |
42 | [node name="y_box" type="HBoxContainer" parent="paramValue"]
43 | layout_mode = 2
44 |
45 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/y_box"]
46 | custom_minimum_size = Vector2(30, 0)
47 | layout_mode = 2
48 | size_flags_stretch_ratio = 0.2
49 | bbcode_enabled = true
50 | text = "[color=93fab2]Y: [/color]"
51 | fit_content = true
52 |
53 | [node name="y_value" type="SpinBox" parent="paramValue/y_box"]
54 | layout_mode = 2
55 | size_flags_horizontal = 3
56 | step = 0.0
57 | allow_greater = true
58 | allow_lesser = true
59 | suffix = "px"
60 | custom_arrow_step = 0.05
61 |
62 | [node name="z_box" type="HBoxContainer" parent="paramValue"]
63 | layout_mode = 2
64 |
65 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/z_box"]
66 | custom_minimum_size = Vector2(30, 0)
67 | layout_mode = 2
68 | size_flags_stretch_ratio = 0.2
69 | bbcode_enabled = true
70 | text = "[color=b293fa]Z: [/color]"
71 | fit_content = true
72 |
73 | [node name="z_value" type="SpinBox" parent="paramValue/z_box"]
74 | layout_mode = 2
75 | size_flags_horizontal = 3
76 | step = 0.0
77 | allow_greater = true
78 | allow_lesser = true
79 | suffix = "px"
80 | custom_arrow_step = 0.05
81 |
82 | [node name="w_box" type="HBoxContainer" parent="paramValue"]
83 | layout_mode = 2
84 |
85 | [node name="RichTextLabel" type="RichTextLabel" parent="paramValue/w_box"]
86 | custom_minimum_size = Vector2(30, 0)
87 | layout_mode = 2
88 | size_flags_stretch_ratio = 0.2
89 | bbcode_enabled = true
90 | text = "[color=93dbfa]W: [/color]"
91 | fit_content = true
92 |
93 | [node name="w_value" type="SpinBox" parent="paramValue/w_box"]
94 | layout_mode = 2
95 | size_flags_horizontal = 3
96 | step = 0.0
97 | allow_greater = true
98 | allow_lesser = true
99 | suffix = "px"
100 | custom_arrow_step = 0.05
101 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/VBC_itemTableDataList.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends VBoxContainer
3 |
4 | @onready var common = %signals
5 |
6 |
7 |
8 | @onready var data: Dictionary = {}
9 |
10 | @onready var OB_TableType: OptionButton = $"../../../../../VBoxContainer/param_block/MarginContainer/VBoxContainer/table_type_box/OB_tableType"
11 |
12 | @onready var structure: Dictionary = {}
13 |
14 | @onready var node_structure:Dictionary = {}
15 |
16 | signal save_data(data_to_save: Dictionary)
17 |
18 |
19 | func _clean(remove_form: bool):
20 |
21 | save_data.emit(data)
22 |
23 | if remove_form:
24 | for i: Node in get_children():
25 | i.queue_free()
26 |
27 | structure = {}
28 |
29 | data = {}
30 |
31 | func reload(new_data: Dictionary):
32 |
33 | save_data_of_struct()
34 |
35 | var struct = OB_TableType.get_selected_metadata()
36 |
37 | if structure == struct:
38 | _clean(false)
39 | else:
40 | _clean(true)
41 |
42 | data = new_data
43 |
44 | if struct == null:
45 | common.popup_alert_ask.emit("Can't open this data", "The plugin can't load this data because the structure of the table is not found!")
46 | return
47 |
48 | reload_from_struct(struct)
49 |
50 | if data.has('columns'):
51 | var columns: Dictionary = data['columns']
52 |
53 | if columns.size() != 0:
54 | for i in columns:
55 | var data: Dictionary = columns[i]
56 | var value: Variant = data['value']
57 | var key: String = data['name']
58 |
59 | if !structure['params'][key].has('default'):
60 | structure['params'][key]['default'] = null
61 |
62 | var default = structure['params'][key]['default']
63 |
64 | if structure['params'][key]['size'] == 1:
65 | default = null
66 |
67 | set_data_on_struct(key, value, default)
68 | else:
69 | reset_data_on_struct()
70 | save_data_of_struct()
71 |
72 | func reload_from_struct(struct: Dictionary):
73 |
74 | if structure == struct:
75 | return
76 |
77 | structure = struct
78 | node_structure = {}
79 |
80 | for key: String in struct['params']:
81 | var separator = MarginContainer.new()
82 | separator.add_theme_constant_override("margin_top",5)
83 | var param: Dictionary = struct['params'][key]
84 |
85 | var type: int = param['type']
86 | var title: String = param['name']
87 | var paramSize: int = param['size']
88 | var comment: String = param['comment']
89 | var default: Variant = null
90 |
91 | if param.has('default'):
92 | default = param['default']
93 |
94 | var schema = _dt_schema.get_instance().get_schema(type)
95 |
96 | if paramSize != 0: # detect if the item is an array
97 | var parent = _dt_schema.get_instance().array_schema.instantiate()
98 | add_child(parent)
99 | add_child(separator)
100 |
101 | parent.set_type(type)
102 | parent.set_title(title)
103 | var name_node = parent.get_child(0).get_child(0)
104 |
105 | name_node.set_tooltip_text(comment)
106 | node_structure[key] = parent
107 |
108 | parent.visible = true
109 |
110 | continue
111 |
112 | var object: Node = schema.instantiate()
113 |
114 | add_child(object) ## adding it to the VBox
115 |
116 | object.set_value(default)
117 |
118 | add_child(separator)
119 |
120 | node_structure[key] = object
121 |
122 | object.set_title(title)
123 |
124 | var name_node = object.get_child(0)
125 | name_node.set_tooltip_text(comment)
126 |
127 | object.visible = true
128 |
129 | func save_data_of_struct():
130 |
131 | if structure == {}:
132 | return
133 |
134 | for i: String in node_structure:
135 |
136 | if !structure['params'].has(i):
137 | return
138 |
139 | var node: Node = node_structure[i]
140 | var struct_data: Dictionary = structure['params'][i]
141 |
142 | if !data['columns'].has(i):
143 | data['columns'][i] = {}
144 |
145 | data['columns'][i]['name'] = struct_data['name']
146 | data['columns'][i]['type'] = struct_data['type']
147 | data['columns'][i]['value'] = node.get_value()
148 | data['columns'][i]['size'] = struct_data['size']
149 |
150 |
151 | func set_data_on_struct(key: String, data: Variant, default: Variant = null):
152 |
153 | if node_structure.has(key):
154 | var node:Node = node_structure.get(key)
155 |
156 | if data != null:
157 | node.set_value(data)
158 | return
159 |
160 | node.set_value(default)
161 |
162 | func reset_data_on_struct():
163 |
164 | for i:String in node_structure:
165 | var node: Node = node_structure[i]
166 |
167 | node.set_value()
168 |
169 | func force_add_node(node: Node):
170 |
171 | add_child(node)
172 |
173 | var separator = MarginContainer.new()
174 | separator.add_theme_constant_override("margin_top",5)
175 | add_child(separator)
176 |
177 | node.visible = true
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/aabb_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var x_input: SpinBox
5 | var y_input: SpinBox
6 | var z_input: SpinBox
7 |
8 | var w_input: SpinBox
9 | var h_input: SpinBox
10 | var d_input: SpinBox
11 |
12 | var v0: HBoxContainer
13 | var v1: HBoxContainer
14 |
15 | var text: RichTextLabel
16 | @onready var paramName: String = ""
17 |
18 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/AABB.png[/img] "
19 |
20 | @onready var type: int = -1
21 | func get_type():
22 | return type
23 | func set_type(new_type: int):
24 | type = new_type
25 |
26 | func set_title(new_name: String):
27 | text.set_text(str(icon,new_name))
28 | paramName = new_name
29 |
30 | func get_title():
31 | return paramName
32 |
33 | # Called when the node enters the scene tree for the first time.
34 | func _ready():
35 |
36 | text = get_child(0)
37 |
38 | v0 = get_child(1).get_child(0)
39 | v1 = get_child(1).get_child(1)
40 |
41 | x_input = v0.get_child(0).get_child(1)
42 | y_input = v0.get_child(1).get_child(1)
43 | z_input = v0.get_child(2).get_child(1)
44 |
45 | w_input = v1.get_child(0).get_child(1)
46 | h_input = v1.get_child(1).get_child(1)
47 | d_input = v1.get_child(2).get_child(1)
48 |
49 | pass # Replace with function body.
50 |
51 |
52 | func get_value() -> String:
53 |
54 | var vx = Vector3(x_input.get_value(), y_input.get_value(), z_input.get_value())
55 | var vy = Vector3(w_input.get_value(), h_input.get_value(), d_input.get_value())
56 |
57 | var aabb = AABB(vx, vy)
58 |
59 | return var_to_str(aabb)
60 |
61 |
62 |
63 | func set_value(new_value: Variant = null):
64 |
65 | var data: AABB
66 |
67 | if typeof(new_value) == TYPE_AABB:
68 | data = new_value
69 |
70 | if typeof(new_value) == TYPE_STRING && new_value != null:
71 |
72 | var converted:Variant = str_to_var(new_value)
73 |
74 | if typeof(converted) != TYPE_AABB:
75 | push_error("[DataTable] Invalid AABB data: " + new_value)
76 | push_error("[DataTable] Converted value: " + str(converted))
77 | push_error("[DataTable] Type: " + str(typeof(converted)))
78 | return
79 |
80 | data = converted
81 |
82 | if typeof(data) == TYPE_AABB && data != null:
83 |
84 | x_input.set_value((round((data.position.x)*10000))/10000)
85 | y_input.set_value((round((data.position.y)*10000))/10000)
86 | z_input.set_value((round((data.position.z)*10000))/10000)
87 | w_input.set_value((round((data.size.x)*10000))/10000)
88 | h_input.set_value((round((data.size.y)*10000))/10000)
89 | d_input.set_value((round((data.size.z)*10000))/10000)
90 |
91 | return
92 |
93 | x_input.set_value(0)
94 | y_input.set_value(0)
95 | z_input.set_value(0)
96 |
97 | w_input.set_value(0)
98 | h_input.set_value(0)
99 | d_input.set_value(0)
100 |
101 | func set_disabled(disable: bool):
102 |
103 | x_input.editable = !disable
104 | y_input.editable = !disable
105 | z_input.editable = !disable
106 |
107 | w_input.editable = !disable
108 | h_input.editable = !disable
109 | d_input.editable = !disable
110 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/basis_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var xx_input: SpinBox
5 | var xy_input: SpinBox
6 | var xz_input: SpinBox
7 |
8 | var yx_input: SpinBox
9 | var yy_input: SpinBox
10 | var yz_input: SpinBox
11 |
12 | var zx_input: SpinBox
13 | var zy_input: SpinBox
14 | var zz_input: SpinBox
15 |
16 | var v0: HBoxContainer
17 | var v1: HBoxContainer
18 | var v2: HBoxContainer
19 |
20 | var text: RichTextLabel
21 | @onready var paramName: String = ""
22 |
23 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Basis.png[/img] "
24 |
25 | @onready var type: int = -1
26 | func get_type():
27 | return type
28 | func set_type(new_type: int):
29 | type = new_type
30 |
31 |
32 | func set_title(new_name: String):
33 | text.set_text(str(icon,new_name))
34 | paramName = new_name
35 |
36 | func get_title():
37 | return paramName
38 |
39 | # Called when the node enters the scene tree for the first time.
40 | func _ready():
41 |
42 | text = get_child(0)
43 |
44 | var vector_box = get_child(1)
45 |
46 | v0 = vector_box.get_child(0)
47 | v1 = vector_box.get_child(1)
48 | v2 = vector_box.get_child(2)
49 |
50 | xx_input = v0.get_child(0).get_child(1)
51 | xy_input = v0.get_child(1).get_child(1)
52 | xz_input = v0.get_child(2).get_child(1)
53 |
54 | yx_input = v1.get_child(0).get_child(1)
55 | yy_input = v1.get_child(1).get_child(1)
56 | yz_input = v1.get_child(2).get_child(1)
57 |
58 | zx_input = v2.get_child(0).get_child(1)
59 | zy_input = v2.get_child(1).get_child(1)
60 | zz_input = v2.get_child(2).get_child(1)
61 |
62 |
63 | pass # Replace with function body.
64 |
65 |
66 | func get_value() -> String:
67 |
68 | var vx = Vector3(xx_input.get_value(), xy_input.get_value(), xz_input.get_value())
69 | var vy = Vector3(yx_input.get_value(), yy_input.get_value(), yz_input.get_value())
70 | var vz = Vector3(zx_input.get_value(), zy_input.get_value(), zz_input.get_value())
71 |
72 | var basis_object = Basis(vx, vy, vz)
73 |
74 | return var_to_str(basis_object)
75 |
76 |
77 |
78 | func set_value(new_value: Variant = null):
79 |
80 | var data: Basis
81 |
82 | if typeof(new_value) == TYPE_BASIS:
83 | data = new_value
84 |
85 | if typeof(new_value) == TYPE_STRING && new_value != null:
86 |
87 | var converted: Variant = str_to_var(new_value)
88 |
89 | if typeof(converted) != TYPE_BASIS:
90 | push_error("[DataTable] Invalid Basis data: " + new_value)
91 | return
92 |
93 | data = converted
94 |
95 | if typeof(data) == TYPE_BASIS && data != null:
96 |
97 | var vec_x: Vector3 = data.x
98 | var vec_y: Vector3 = data.y
99 | var vec_z: Vector3 = data.z
100 |
101 | xx_input.set_value((round((vec_x.x)*10000))/10000)
102 | xy_input.set_value((round((vec_x.y)*10000))/10000)
103 | xz_input.set_value((round((vec_x.z)*10000))/10000)
104 |
105 | yx_input.set_value((round((vec_y.x)*10000))/10000)
106 | yy_input.set_value((round((vec_y.y)*10000))/10000)
107 | yz_input.set_value((round((vec_y.z)*10000))/10000)
108 |
109 | zx_input.set_value((round((vec_z.x)*10000))/10000)
110 | zy_input.set_value((round((vec_z.y)*10000))/10000)
111 | zz_input.set_value((round((vec_z.z)*10000))/10000)
112 |
113 | return
114 |
115 | xx_input.set_value(0)
116 | xy_input.set_value(0)
117 | xz_input.set_value(0)
118 |
119 | yx_input.set_value(0)
120 | yy_input.set_value(0)
121 | yz_input.set_value(0)
122 |
123 | zx_input.set_value(0)
124 | zy_input.set_value(0)
125 | zz_input.set_value(0)
126 |
127 | func set_disabled(disable: bool):
128 |
129 | xx_input.editable = !disable
130 | xy_input.editable = !disable
131 | xz_input.editable = !disable
132 |
133 | yx_input.editable = !disable
134 | yy_input.editable = !disable
135 | yz_input.editable = !disable
136 |
137 | zx_input.editable = !disable
138 | zy_input.editable = !disable
139 | zz_input.editable = !disable
140 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/bool_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var input: CheckBox
5 | var text: RichTextLabel
6 | @onready var paramName: String = ""
7 |
8 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/bool.png[/img] "
9 |
10 | @onready var type: int = -1
11 | func get_type():
12 | return type
13 | func set_type(new_type: int):
14 | type = new_type
15 |
16 | func set_title(new_name: String):
17 | text.set_text(str(icon,new_name))
18 | paramName = new_name
19 |
20 | func get_title():
21 | return paramName
22 |
23 | # Called when the node enters the scene tree for the first time.
24 | func _ready():
25 |
26 | text = get_child(0)
27 | input = get_child(1)
28 |
29 | pass # Replace with function body.
30 |
31 |
32 | func get_value():
33 | return input.is_pressed()
34 |
35 | func set_value(new_value: Variant = null):
36 | if typeof(new_value) == TYPE_BOOL && new_value != null:
37 | input.set_pressed(new_value)
38 | return
39 | if typeof(new_value) == TYPE_STRING && new_value != null:
40 | if new_value == "true":
41 | input.set_pressed(true)
42 | return
43 | input.set_pressed(false)
44 | return
45 |
46 | input.set_pressed(false)
47 |
48 | func set_disabled(disable: bool):
49 |
50 | input.disabled = disable
51 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/color_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var input: ColorPickerButton
5 | var text: RichTextLabel
6 | @onready var paramName: String = ""
7 |
8 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Color.svg[/img] "
9 |
10 | @onready var type: int = -1
11 | func get_type():
12 | return type
13 | func set_type(new_type: int):
14 | type = new_type
15 |
16 |
17 | func set_title(new_name: String):
18 | text.set_text(str(icon,new_name))
19 | paramName = new_name
20 |
21 | func get_title():
22 | return paramName
23 |
24 | # Called when the node enters the scene tree for the first time.
25 | func _ready():
26 |
27 | text = get_child(0)
28 | input = get_child(1)
29 |
30 | pass # Replace with function body.
31 |
32 |
33 | func get_value() -> String:
34 |
35 | var color: Color = input.get_pick_color()
36 |
37 | return var_to_str(color)
38 |
39 |
40 | func set_value(new_value: Variant = null):
41 |
42 | if typeof(new_value) == TYPE_STRING && new_value != null:
43 |
44 | var converted: Variant = str_to_var(new_value)
45 |
46 | if typeof(converted) != TYPE_COLOR:
47 | push_error("Invalid color value: " + new_value)
48 | return
49 |
50 | input.set_pick_color(converted)
51 | return
52 |
53 | if typeof(new_value) == TYPE_COLOR && new_value != null:
54 | input.set_pick_color(new_value)
55 | return
56 | input.set_pick_color(Color.BLACK)
57 |
58 | func set_disabled(disable: bool):
59 |
60 | input.disabled = disable
61 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/dict_item_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | @onready var _item_value_node: VBoxContainer = %ItemValue
5 | @onready var _item_name_node: RichTextLabel = %ItemName
6 | @onready var _item_delete_node: Button = %ItemDelete
7 |
8 |
9 | var type_: int = -1:
10 | set(new_value):
11 | if new_value >= _dt_common.TYPE_MAX:
12 | push_error("[DataTable] Invalid type, must be less than " + str(_dt_common.TYPE_MAX))
13 | new_value = -1
14 | type_ = new_value
15 | _schema = _dt_schema.get_instance().get_schema(type_)
16 |
17 | var gdtype_: int = -1:
18 | set(new_value):
19 | gdtype_ = new_value
20 |
21 | var name_: Variant = "":
22 | set(new_value):
23 | name_ = new_value
24 |
25 | var itemName = str(var_to_str(new_value))
26 |
27 | if typeof(name_) == TYPE_STRING:
28 | itemName = name_
29 |
30 | %ItemName.set_text(itemName)
31 |
32 | var size_: int = 0:
33 | set(new_value):
34 | size_ = new_value
35 |
36 | var raw_value_: Variant = null
37 |
38 | var _schema: Resource = null
39 |
40 | func generate_value_node() -> void:
41 |
42 | var schema = _schema.instantiate()
43 |
44 | if size_ == _dt_common.SIZE_ARRAY:
45 | match(gdtype_):
46 | Variant.Type.TYPE_PACKED_STRING_ARRAY:
47 | schema = _dt_schema.get_instance().array_schema.instantiate()
48 |
49 | schema.set_type(_dt_common.TYPE_STRING)
50 | schema.set_gdsize(Variant.Type.TYPE_PACKED_STRING_ARRAY)
51 | Variant.Type.TYPE_PACKED_INT32_ARRAY:
52 | schema = _dt_schema.get_instance().array_schema.instantiate()
53 |
54 | schema.set_type(_dt_common.TYPE_INT)
55 | schema.set_gdsize(Variant.Type.TYPE_PACKED_INT32_ARRAY)
56 | Variant.Type.TYPE_PACKED_FLOAT32_ARRAY:
57 | schema = _dt_schema.get_instance().array_schema.instantiate()
58 |
59 | schema.set_type(_dt_common.TYPE_FLOAT)
60 | schema.set_gdsize(Variant.Type.TYPE_PACKED_FLOAT32_ARRAY)
61 | Variant.Type.TYPE_PACKED_VECTOR2_ARRAY:
62 | schema = _dt_schema.get_instance().array_schema.instantiate()
63 |
64 | schema.set_type(_dt_common.TYPE_VECTOR2)
65 | schema.set_gdsize(Variant.Type.TYPE_PACKED_VECTOR2_ARRAY)
66 | Variant.Type.TYPE_PACKED_VECTOR3_ARRAY:
67 | schema = _dt_schema.get_instance().array_schema.instantiate()
68 |
69 | schema.set_type(_dt_common.TYPE_VECTOR3)
70 | schema.set_gdsize(Variant.Type.TYPE_PACKED_VECTOR3_ARRAY)
71 | Variant.Type.TYPE_PACKED_COLOR_ARRAY:
72 | schema = _dt_schema.get_instance().array_schema.instantiate()
73 |
74 | schema.set_type(_dt_common.TYPE_COLOR)
75 | schema.set_gdsize(Variant.Type.TYPE_PACKED_COLOR_ARRAY)
76 | Variant.Type.TYPE_PACKED_INT64_ARRAY:
77 | schema = _dt_schema.get_instance().array_schema.instantiate()
78 |
79 | schema.set_type(_dt_common.TYPE_INT)
80 | schema.set_gdsize(Variant.Type.TYPE_PACKED_INT64_ARRAY)
81 | Variant.Type.TYPE_PACKED_FLOAT64_ARRAY:
82 | schema = _dt_schema.get_instance().array_schema.instantiate()
83 |
84 | schema.set_type(_dt_common.TYPE_FLOAT)
85 | schema.set_gdsize(Variant.Type.TYPE_PACKED_FLOAT64_ARRAY)
86 |
87 |
88 |
89 | _item_value_node.add_child(schema)
90 |
91 | if type_ == _dt_common.TYPE_DICT:
92 | schema._parent = self
93 |
94 | schema.layout_mode = 1 # We want the schema to have the layout mode "Anchors" (0: Container, 1: Anchors)
95 | schema.set_anchors_preset(PRESET_FULL_RECT)
96 | schema.get_child(0).visible = false
97 | schema.size_flags_vertical = SIZE_EXPAND_FILL
98 | schema.visible = true
99 |
100 | if size_ == _dt_common.SIZE_ARRAY:
101 | schema.get_child(0).visible = true
102 | if schema.get_child(0).get_child(0):
103 | schema.get_child(0).get_child(0).visible = false
104 |
105 | pass
106 |
107 | func get_value() -> Variant:
108 |
109 | var schema = _item_value_node.get_child(0)
110 |
111 | if !schema:
112 | return ""
113 |
114 | return schema.get_value()
115 |
116 | func set_value(new_value: Variant):
117 |
118 | if !new_value:
119 | return
120 |
121 | var schema = _item_value_node.get_child(0)
122 |
123 | _item_value_node.get_child(0).visible = true
124 |
125 | if !schema:
126 | return
127 |
128 | if size_ == _dt_common.SIZE_ARRAY:
129 | print(new_value)
130 | schema.set_value(new_value)
131 | else:
132 | schema.set_value(new_value)
133 |
134 | schema.set_value(new_value)
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/dict_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var dict_name: String = "":
5 | set(new_value):
6 | %ParamName.text = str("[img]res://addons/datatable_godot/icons/dictionary.png[/img] ", new_value)
7 | dict_name = new_value
8 |
9 | var dict_data: Dictionary = {}
10 |
11 | var _res_schema_window: Resource = null
12 |
13 | @onready var _param_name: RichTextLabel = %ParamName
14 | @onready var _param_interact: Button = %ParamInteract
15 |
16 | var _parent: Node = EditorInterface.get_base_control()
17 |
18 | func _ready():
19 | _res_schema_window = load("res://addons/datatable_godot/ui/nodes/schema/dict_win_schema.tscn")
20 | _param_interact.pressed.connect(_on_open_pressed)
21 |
22 | func _on_open_pressed() -> void:
23 |
24 | print("Open editor")
25 |
26 | print(dict_data)
27 |
28 | var schema = _res_schema_window.instantiate()
29 |
30 | var window = ConfirmationDialog.new()
31 |
32 | window.set_title("Edit Dictionary")
33 | window.add_child(schema)
34 |
35 | window.min_size = Vector2(800, 500)
36 |
37 | _parent.add_child(window)
38 | window.popup_centered()
39 |
40 | window.close_requested.connect(schema._on_window_close)
41 |
42 | schema.dict_name = dict_name
43 |
44 | for i in dict_data.keys():
45 | schema.dict_add_item({i: dict_data[i]})
46 |
47 | schema.dict_edit.connect(_on_dict_edit)
48 |
49 | pass
50 |
51 | func set_title(new_title: String) -> void:
52 | dict_name = new_title
53 |
54 | func set_value(new_value: Variant) -> void:
55 |
56 | if typeof(new_value) == TYPE_STRING:
57 | var local_dict_data:Dictionary = {}
58 | var parsed_data:Variant = JSON.parse_string(new_value)
59 | var is_success:bool = (parsed_data != null)
60 |
61 | if is_success:
62 | local_dict_data = parsed_data
63 | else:
64 | push_error("Invalid JSON data")
65 | return
66 |
67 |
68 | if local_dict_data == null || typeof(local_dict_data) != TYPE_DICTIONARY:
69 | push_error("Invalid dictionary data")
70 | return
71 |
72 | new_value = local_dict_data
73 |
74 | if typeof(new_value) != TYPE_DICTIONARY:
75 | return
76 |
77 | dict_data = new_value
78 |
79 | func get_value() -> Dictionary:
80 | return dict_data
81 |
82 | func _on_dict_edit(dict: Dictionary) -> void:
83 | print(dict)
84 | dict_data = dict
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/dict_win_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | signal dict_edit(new_value: Dictionary)
5 |
6 | @onready var _dict_name_node: RichTextLabel = %ParamName
7 | @onready var _dict_value_node: VBoxContainer = %ParamValue
8 |
9 | var dict_name: String = "":
10 | set(new_value):
11 | %ParamName.text = new_value
12 | dict_name = new_value
13 |
14 | var _items: Dictionary = {}
15 |
16 | @onready var _root_add: Button = %rootAdd
17 | @onready var _root_type: OptionButton = %rootType
18 | @onready var _root_name: LineEdit = %rootName
19 |
20 | @onready var _item_list: VBoxContainer = %itemList
21 |
22 | func _ready():
23 | _root_add.pressed.connect(_on_add_pressed)
24 | _root_name.text_changed.connect(_on_name_changed)
25 |
26 | func _on_name_changed(new_name: String) -> void:
27 |
28 | new_name = new_name.strip_edges()
29 | _root_name.remove_theme_color_override("font_color")
30 |
31 | _root_add.disabled = new_name.is_empty()
32 |
33 | if _items.has(new_name):
34 | _root_add.disabled = true
35 | _root_name.add_theme_color_override("font_color", _dt_common.color.ERROR)
36 |
37 |
38 | func _on_add_pressed() -> void:
39 |
40 | var type = _root_type.get_selected_id()
41 |
42 | if type == -1:
43 | push_error("Please select a type")
44 | return
45 |
46 | var name = _root_name.text.strip_edges()
47 |
48 | if name.is_empty():
49 | push_error("Please enter a name")
50 | return
51 |
52 | var _schema = _dt_schema.get_instance().get_schema(_dt_common.TYPE_DICT_ITEM)
53 |
54 | if !_schema:
55 | push_error("Schema not found")
56 | return
57 |
58 | var schema = _schema.instantiate()
59 |
60 | if !schema:
61 | push_error("Schema not instantiated")
62 | return
63 |
64 | schema.name_ = name
65 | schema.type_ = type
66 |
67 | _item_list.add_child(schema)
68 |
69 | _items[name] = {
70 | "item": schema,
71 | "name": name,
72 | "type": type
73 | }
74 |
75 | func dict_add_item(item: Dictionary) -> void:
76 |
77 | var schema = _dt_schema.get_instance().get_schema(_dt_common.TYPE_DICT_ITEM).instantiate()
78 |
79 | if !schema:
80 | push_error("Schema not instantiated")
81 | return
82 |
83 | schema.name_ = item.keys()[0]
84 | schema.raw_value_ = item.values()[0]
85 |
86 | print("raw value: ", item.values()[0])
87 | print("raw type: ", type_string(typeof(item.values()[0])))
88 |
89 | var gdtype = typeof(item.values()[0])
90 | schema.type_ = _dt_schema.get_instance().gdType_to_plugType(gdtype)
91 |
92 | if schema.type_ == _dt_common.TYPE_STRING:
93 | var newgdtype = typeof(str_to_var(item.values()[0]))
94 | var newtype_ = _dt_schema.get_instance().gdType_to_plugType(newgdtype)
95 | if typeof(str_to_var(item.values()[0])) != 0:
96 | gdtype = newgdtype
97 | schema.type_ = newtype_
98 |
99 | schema.size_ = _dt_schema.get_instance().gdSize_to_plugSize(gdtype)
100 | schema.gdtype_ = gdtype
101 |
102 | _item_list.add_child(schema)
103 |
104 | _items[schema.name_] = {
105 | "item": schema,
106 | "name": schema.name_,
107 | "type": schema.type_,
108 | "size": schema.size_
109 | }
110 |
111 | schema.generate_value_node()
112 |
113 | var item_value = item.get(schema.name_)
114 |
115 | schema.set_value(item_value)
116 |
117 | func _on_window_close() -> void:
118 |
119 | var new_dict: Dictionary = {}
120 |
121 | for key in _items.keys():
122 | var item: Dictionary = _items[key]
123 |
124 | var name: Variant = item["name"]
125 | var schema: Control = item["item"]
126 |
127 | new_dict[item.name] = schema.get_value()
128 | dict_edit.emit(new_dict)
129 |
130 | print("close window...")
131 |
132 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/float_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var input: SpinBox
5 | var text: RichTextLabel
6 | @onready var paramName: String = ""
7 |
8 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/float.svg[/img] "
9 |
10 | @onready var type: int = -1
11 | func get_type():
12 | return type
13 | func set_type(new_type: int):
14 | type = new_type
15 |
16 | func set_title(new_name: String):
17 | text.set_text(str(icon,new_name))
18 | paramName = new_name
19 |
20 | func get_title():
21 | return paramName
22 |
23 | # Called when the node enters the scene tree for the first time.
24 | func _ready():
25 |
26 | text = get_child(0)
27 | input = get_child(1)
28 |
29 | pass # Replace with function body.
30 |
31 |
32 | func get_value():
33 | return input.get_value()
34 |
35 |
36 | func set_value(new_value: Variant = null):
37 |
38 | if typeof(new_value) == TYPE_FLOAT && new_value != null:
39 | input.set_value(new_value)
40 | return
41 | if typeof(new_value) == TYPE_STRING && new_value != null:
42 | input.set_value(float(new_value))
43 | return
44 | input.set_value(0)
45 |
46 | func set_disabled(disable: bool):
47 |
48 | input.editable = !disable
49 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/int_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var input: SpinBox
5 | var text: RichTextLabel
6 | @onready var paramName: String = ""
7 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/int.svg[/img] "
8 |
9 | @onready var type: int = -1
10 | func get_type():
11 | return type
12 | func set_type(new_type: int):
13 | type = new_type
14 |
15 | func set_title(new_name: String):
16 | text.set_text(str(icon,new_name))
17 | paramName = new_name
18 |
19 | func get_title():
20 | return paramName
21 |
22 | # Called when the node enters the scene tree for the first time.
23 | func _ready():
24 |
25 | text = get_child(0)
26 | input = get_child(1)
27 |
28 | pass # Replace with function body.
29 |
30 |
31 | func get_value():
32 | return input.get_value()
33 |
34 |
35 | func set_value(new_value: Variant = null):
36 |
37 | if (typeof(new_value) == TYPE_INT || typeof(new_value) == TYPE_FLOAT) && new_value != null:
38 | input.set_value(new_value)
39 | return
40 | if typeof(new_value) == TYPE_STRING && new_value != null:
41 | input.set_value(float(new_value))
42 | return
43 |
44 | input.set_value(0)
45 |
46 | func set_disabled(disable: bool):
47 |
48 | input.editable = !disable
49 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/invalid_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var input: RichTextLabel
5 | var title: RichTextLabel
6 |
7 | var value: Variant = ""
8 |
9 | @onready var paramName: String = ""
10 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/invalid_type.png[/img] "
11 | @onready var type: int = -1
12 |
13 | func get_type():
14 | return type
15 |
16 | func set_type(new_type: int):
17 | type = new_type
18 |
19 | func set_title(new_name: String):
20 | title.set_text(new_name)
21 | paramName = new_name
22 |
23 | func get_title():
24 | return paramName
25 |
26 | func _ready():
27 | title = get_child(0)
28 | input = get_child(1)
29 | pass # Replace with function body.
30 |
31 | func get_value()->Variant:
32 | return value
33 |
34 | func set_value(new_value: Variant = null):
35 |
36 | value = new_value
37 |
38 | if new_value == null:
39 | input.set_text("null")
40 | else:
41 | input.set_text(var_to_str(new_value))
42 |
43 | func set_disabled(disable: bool):
44 |
45 | # This function is needed to respect the way all schema nodes are used, if it's not present it cause an error
46 | # when the schema is used in the editor, so need to keep it here even if it's empty and not used
47 |
48 | pass
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/plane_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var x_input: SpinBox
5 | var y_input: SpinBox
6 | var z_input: SpinBox
7 | var d_input: SpinBox
8 | var text: RichTextLabel
9 | @onready var paramName: String = ""
10 |
11 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Plane.png[/img] "
12 |
13 | @onready var type: int = -1
14 | func get_type():
15 | return type
16 | func set_type(new_type: int):
17 | type = new_type
18 |
19 |
20 | func set_title(new_name: String):
21 | text.set_text(str(icon,new_name))
22 | paramName = new_name
23 |
24 | func get_title():
25 | return paramName
26 |
27 | # Called when the node enters the scene tree for the first time.
28 | func _ready():
29 |
30 | text = get_child(0)
31 | x_input = get_child(1).get_child(0).get_child(1)
32 | y_input = get_child(1).get_child(1).get_child(1)
33 | z_input = get_child(1).get_child(2).get_child(1)
34 | d_input = get_child(1).get_child(3).get_child(1)
35 |
36 | pass # Replace with function body.
37 |
38 |
39 | func get_value() -> String:
40 |
41 | var x: float = x_input.get_value()
42 | var y: float = y_input.get_value()
43 | var z: float = z_input.get_value()
44 | var d: float = d_input.get_value()
45 |
46 | var plane_object: Plane = Plane(x,y,z,d)
47 |
48 | return var_to_str(plane_object)
49 |
50 | func set_value(new_value: Variant = null):
51 |
52 |
53 | if typeof(new_value) == TYPE_STRING:
54 |
55 | var converted: Variant = str_to_var(new_value)
56 |
57 | if typeof(converted) != TYPE_PLANE:
58 | push_error("Plane schema: Invalid value: " + new_value)
59 | return
60 |
61 | new_value = converted
62 |
63 |
64 | if typeof(new_value) == TYPE_PLANE && new_value != null:
65 | x_input.set_value((round((new_value.x)*10000))/10000)
66 | y_input.set_value((round((new_value.y)*10000))/10000)
67 | z_input.set_value((round((new_value.z)*10000))/10000)
68 | d_input.set_value((round((new_value.d)*10000))/10000)
69 | return
70 | x_input.set_value(0)
71 | y_input.set_value(0)
72 | z_input.set_value(0)
73 | d_input.set_value(0)
74 |
75 | func set_disabled(disable: bool):
76 |
77 | x_input.editable = !disable
78 | y_input.editable = !disable
79 | z_input.editable = !disable
80 | d_input.editable = !disable
81 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/quaternionSchema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var x_input: SpinBox
5 | var y_input: SpinBox
6 | var z_input: SpinBox
7 | var d_input: SpinBox
8 | var text: RichTextLabel
9 | @onready var paramName: String = ""
10 |
11 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Quaternion.png[/img] "
12 |
13 | @onready var type: int = -1
14 | func get_type():
15 | return type
16 | func set_type(new_type: int):
17 | type = new_type
18 |
19 |
20 | func set_title(new_name: String):
21 | text.set_text(str(icon,new_name))
22 | paramName = new_name
23 |
24 | func get_title():
25 | return paramName
26 |
27 | # Called when the node enters the scene tree for the first time.
28 | func _ready():
29 |
30 | text = get_child(0)
31 | x_input = get_child(1).get_child(0).get_child(1)
32 | y_input = get_child(1).get_child(1).get_child(1)
33 | z_input = get_child(1).get_child(2).get_child(1)
34 | d_input = get_child(1).get_child(3).get_child(1)
35 |
36 | pass # Replace with function body.
37 |
38 |
39 | func get_value() -> String:
40 |
41 | var x: float = x_input.get_value()
42 | var y: float = y_input.get_value()
43 | var z: float = z_input.get_value()
44 | var d: float = d_input.get_value()
45 |
46 | var quaternion_object: Quaternion = Quaternion(x,y,z,d)
47 |
48 | return var_to_str(quaternion_object)
49 |
50 |
51 | func set_value(new_value: Variant = null):
52 |
53 | if typeof(new_value) == TYPE_STRING:
54 |
55 | var converted: Variant = str_to_var(new_value)
56 |
57 | if typeof(converted) != TYPE_QUATERNION:
58 | push_error("Quaternion schema: Invalid value: " + new_value)
59 | return
60 |
61 | new_value = converted
62 |
63 | if typeof(new_value) == TYPE_QUATERNION && new_value != null:
64 | x_input.set_value((round((new_value.x)*10000))/10000)
65 | y_input.set_value((round((new_value.y)*10000))/10000)
66 | z_input.set_value((round((new_value.z)*10000))/10000)
67 | d_input.set_value((round((new_value.w)*10000))/10000)
68 | return
69 | x_input.set_value(0)
70 | y_input.set_value(0)
71 | z_input.set_value(0)
72 | d_input.set_value(0)
73 |
74 | func set_disabled(disable: bool):
75 |
76 | x_input.editable = !disable
77 | y_input.editable = !disable
78 | z_input.editable = !disable
79 | d_input.editable = !disable
80 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/rect_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var x_input: SpinBox
5 | var y_input: SpinBox
6 |
7 | var w_input: SpinBox
8 | var h_input: SpinBox
9 | var text: RichTextLabel
10 | @onready var paramName: String = ""
11 |
12 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Rect2.png[/img] "
13 |
14 | @onready var type: int = -1
15 | func get_type():
16 | return type
17 | func set_type(new_type: int):
18 | type = new_type
19 |
20 |
21 | func set_title(new_name: String):
22 | text.set_text(str(icon,new_name))
23 | paramName = new_name
24 |
25 | func get_title():
26 | return paramName
27 |
28 | # Called when the node enters the scene tree for the first time.
29 | func _ready():
30 |
31 | text = get_child(0)
32 | x_input = get_child(1).get_child(0).get_child(0).get_child(1)
33 | y_input = get_child(1).get_child(0).get_child(1).get_child(1)
34 | w_input = get_child(1).get_child(1).get_child(0).get_child(1)
35 | h_input = get_child(1).get_child(1).get_child(1).get_child(1)
36 |
37 | pass # Replace with function body.
38 |
39 |
40 | func get_value() -> String:
41 |
42 | var vy: Vector2 = Vector2(w_input.get_value(), h_input.get_value())
43 | var vx: Vector2 = Vector2(x_input.get_value(), y_input.get_value())
44 |
45 | var rect_object: Rect2 = Rect2(vx, vy)
46 |
47 | return var_to_str(rect_object)
48 |
49 | func set_value(new_value: Variant = null):
50 |
51 | if typeof(new_value) == TYPE_STRING:
52 |
53 | var converted: Variant = str_to_var(new_value)
54 |
55 | if typeof(converted) != TYPE_RECT2:
56 | push_error("Rect2 schema: Invalid value: " + new_value)
57 | return
58 |
59 | new_value = converted
60 |
61 | if typeof(new_value) == TYPE_RECT2 && new_value != null:
62 | x_input.set_value((round((new_value.position.x)*10000))/10000)
63 | y_input.set_value((round((new_value.position.y)*10000))/10000)
64 | w_input.set_value((round((new_value.size.x)*10000))/10000)
65 | h_input.set_value((round((new_value.size.y)*10000))/10000)
66 | return
67 | x_input.set_value(0)
68 | y_input.set_value(0)
69 | w_input.set_value(0)
70 | h_input.set_value(0)
71 |
72 | func set_disabled(disable: bool):
73 |
74 | x_input.editable = !disable
75 | y_input.editable = !disable
76 | w_input.editable = !disable
77 | h_input.editable = !disable
78 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/ress_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var text: RichTextLabel
5 | var path_label: Label
6 | var b_open_file: Button
7 | var file_dialog: FileDialog
8 |
9 | var param_name: String
10 |
11 | const icon: String = "[img]res://addons/datatable_godot/icons/Ressource.png[/img] "
12 |
13 | var select_path: String = "res://" :
14 | set(new_path):
15 | select_path = str(new_path)
16 | path_label.set_text(new_path)
17 | path_label.set_tooltip_text(new_path)
18 | get:
19 | return select_path
20 |
21 | func _ready():
22 | text = get_child(0)
23 | path_label = get_child(1).get_child(0).get_child(0)
24 | b_open_file = get_child(1).get_child(0).get_child(1)
25 | file_dialog = b_open_file.get_child(0)
26 |
27 | b_open_file.pressed.connect(_on_open_file_pressed)
28 |
29 | b_open_file.dropped_file_on.connect(_on_file_selected)
30 | file_dialog.file_selected.connect(_on_file_selected)
31 |
32 | set_title("test")
33 |
34 | func _on_open_file_pressed():
35 | file_dialog.visible = true
36 |
37 | func _on_file_selected(file_path: String):
38 | select_path = file_path
39 |
40 | func set_title(new_name: String):
41 | text.set_text(str(icon,new_name))
42 | param_name = new_name
43 |
44 | func get_title():
45 | return param_name
46 |
47 | func get_value():
48 | return select_path
49 |
50 | func set_value(file_path: Variant = null):
51 |
52 | if typeof(file_path) == TYPE_STRING && file_path != null:
53 | select_path = file_path
54 | return
55 |
56 | select_path = "res://"
57 |
58 | func set_disabled(toggle: bool):
59 | b_open_file.visible = !toggle
60 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/schema_table.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | @onready var text: Node
5 |
6 | func _ready():
7 | text = get_child(0)
8 |
9 | func select(toggle: bool):
10 |
11 | if text == null:
12 | return
13 |
14 | if toggle:
15 | text.add_theme_color_override("default_color", get_theme_color("accent_color", "Editor"))
16 | else:
17 | text.remove_theme_color_override("default_color")
18 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/string_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var input: LineEdit
5 | var text: RichTextLabel
6 |
7 |
8 | @onready var paramName: String = ""
9 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/String.svg[/img] "
10 | @onready var type: int = -1
11 |
12 | func get_type():
13 | return type
14 | func set_type(new_type: int):
15 | type = new_type
16 |
17 | func set_title(new_name: String):
18 | text.set_text(str(icon,new_name))
19 | paramName = new_name
20 | func get_title():
21 | return paramName
22 |
23 | # Called when the node enters the scene tree for the first time.
24 | func _ready():
25 |
26 | text = get_child(0)
27 | input = get_child(1)
28 |
29 | pass # Replace with function body.
30 |
31 |
32 | func get_value():
33 | return input.get_text()
34 |
35 | func set_value(new_value: Variant = null):
36 | if typeof(new_value) == TYPE_STRING && new_value != null:
37 | input.set_text(new_value)
38 | return
39 | input.set_text("")
40 |
41 | func set_disabled(disable: bool):
42 |
43 | input.editable = !disable
44 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/t2_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var xx_input: SpinBox
5 | var xy_input: SpinBox
6 | var xo_input: SpinBox
7 |
8 | var yx_input: SpinBox
9 | var yy_input: SpinBox
10 | var yo_input: SpinBox
11 |
12 | var v0: HBoxContainer
13 | var v1: HBoxContainer
14 |
15 | var text: RichTextLabel
16 | @onready var paramName: String = ""
17 |
18 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Transform2D.png[/img] "
19 |
20 | @onready var type: int = -1
21 | func get_type():
22 | return type
23 | func set_type(new_type: int):
24 | type = new_type
25 |
26 |
27 | func set_title(new_name: String):
28 | text.set_text(str(icon,new_name))
29 | paramName = new_name
30 |
31 | func get_title():
32 | return paramName
33 |
34 | # Called when the node enters the scene tree for the first time.
35 | func _ready():
36 |
37 | text = get_child(0)
38 |
39 | v0 = get_child(1).get_child(0)
40 | v1 = get_child(1).get_child(1)
41 |
42 | xx_input = v0.get_child(0).get_child(1)
43 | xy_input = v0.get_child(1).get_child(1)
44 | xo_input = v0.get_child(2).get_child(1)
45 |
46 | yx_input = v1.get_child(0).get_child(1)
47 | yy_input = v1.get_child(1).get_child(1)
48 | yo_input = v1.get_child(2).get_child(1)
49 |
50 |
51 | pass # Replace with function body.
52 |
53 | func get_value():
54 |
55 | var vx: Vector2 = Vector2(xx_input.get_value(), xy_input.get_value())
56 | var vy: Vector2 = Vector2(yx_input.get_value(), yy_input.get_value())
57 | var vo: Vector2 = Vector2(xo_input.get_value(), yo_input.get_value())
58 |
59 | var transform_object: Transform2D = Transform2D(vx, vy, vo)
60 |
61 | return var_to_str(transform_object)
62 |
63 | func set_value(new_value: Variant = null):
64 |
65 | var data: Transform2D
66 |
67 | if typeof(new_value) == TYPE_TRANSFORM2D:
68 | data = new_value
69 |
70 | if typeof(new_value) == TYPE_STRING && new_value != null:
71 |
72 | var converted: Variant = str_to_var(new_value)
73 |
74 | if typeof(converted) != TYPE_TRANSFORM2D:
75 | push_error("Transform2D schema: Invalid value: " + new_value)
76 | return
77 |
78 | data = converted
79 |
80 | if typeof(data) == TYPE_TRANSFORM2D && data != null:
81 |
82 | xx_input.set_value((round((data.x.x)*10000))/10000)
83 | xy_input.set_value((round((data.x.y)*10000))/10000)
84 | xo_input.set_value((round((data.origin.x)*10000))/10000)
85 |
86 | yx_input.set_value((round((data.y.x)*10000))/10000)
87 | yy_input.set_value((round((data.y.y)*10000))/10000)
88 | yo_input.set_value((round((data.origin.y)*10000))/10000)
89 |
90 | return
91 |
92 | xx_input.set_value(0)
93 | xy_input.set_value(0)
94 | xo_input.set_value(0)
95 |
96 | yx_input.set_value(0)
97 | yy_input.set_value(0)
98 | yo_input.set_value(0)
99 |
100 | func set_disabled(disable: bool):
101 |
102 | xx_input.editable = !disable
103 | xy_input.editable = !disable
104 | xo_input.editable = !disable
105 |
106 | yx_input.editable = !disable
107 | yy_input.editable = !disable
108 | yo_input.editable = !disable
109 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/t3_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var xx_input: SpinBox
5 | var xy_input: SpinBox
6 | var xz_input: SpinBox
7 | var xo_input: SpinBox
8 |
9 | var yx_input: SpinBox
10 | var yy_input: SpinBox
11 | var yz_input: SpinBox
12 | var yo_input: SpinBox
13 |
14 | var zx_input: SpinBox
15 | var zy_input: SpinBox
16 | var zz_input: SpinBox
17 | var zo_input: SpinBox
18 |
19 | var v0: HBoxContainer
20 | var v1: HBoxContainer
21 | var v2: HBoxContainer
22 |
23 | var text: RichTextLabel
24 | @onready var paramName: String = ""
25 |
26 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Transform3D.png[/img] "
27 |
28 | @onready var type: int = -1
29 | func get_type():
30 | return type
31 | func set_type(new_type: int):
32 | type = new_type
33 |
34 |
35 | func set_title(new_name: String):
36 | text.set_text(str(icon,new_name))
37 | paramName = new_name
38 |
39 | func get_title():
40 | return paramName
41 |
42 | # Called when the node enters the scene tree for the first time.
43 | func _ready():
44 |
45 |
46 | text = get_child(0)
47 |
48 | var vector_box = get_child(1)
49 |
50 | v0 = vector_box.get_child(0)
51 | v1 = vector_box.get_child(1)
52 | v2 = vector_box.get_child(2)
53 |
54 | xx_input = v0.get_child(0).get_child(1)
55 | xy_input = v0.get_child(1).get_child(1)
56 | xz_input = v0.get_child(2).get_child(1)
57 | xo_input = v0.get_child(3).get_child(1)
58 |
59 | yx_input = v1.get_child(0).get_child(1)
60 | yy_input = v1.get_child(1).get_child(1)
61 | yz_input = v1.get_child(2).get_child(1)
62 | yo_input = v1.get_child(3).get_child(1)
63 |
64 | zx_input = v2.get_child(0).get_child(1)
65 | zy_input = v2.get_child(1).get_child(1)
66 | zz_input = v2.get_child(2).get_child(1)
67 | zo_input = v2.get_child(3).get_child(1)
68 |
69 |
70 | pass # Replace with function body.
71 |
72 |
73 | func get_value() -> String:
74 |
75 | var vx = Vector3(xx_input.get_value(), xy_input.get_value(), xz_input.get_value())
76 | var vy = Vector3(yx_input.get_value(), yy_input.get_value(), yz_input.get_value())
77 | var vz = Vector3(zx_input.get_value(), zy_input.get_value(), zz_input.get_value())
78 | var vo = Vector3(xo_input.get_value(), yo_input.get_value(), zo_input.get_value())
79 |
80 | var transform_object: Transform3D = Transform3D(vx, vy, vz, vo)
81 |
82 | return var_to_str(transform_object)
83 |
84 |
85 |
86 | func set_value(new_value: Variant = null):
87 |
88 | var data: Transform3D
89 |
90 | if typeof(new_value) == TYPE_TRANSFORM3D:
91 | data = new_value
92 |
93 | if typeof(new_value) == TYPE_STRING && new_value != null:
94 |
95 | var converted: Variant = str_to_var(new_value)
96 |
97 | if typeof(converted) != TYPE_TRANSFORM3D:
98 | push_error("Transform3D schema: Invalid value: " + new_value)
99 | return
100 |
101 | data = converted
102 |
103 | if typeof(data) == TYPE_TRANSFORM3D && data != null:
104 |
105 | var vec_x: Vector3 = data.basis.x
106 | var vec_y: Vector3 = data.basis.y
107 | var vec_z: Vector3 = data.basis.z
108 | var vec_o: Vector3 = data.origin
109 |
110 | xx_input.set_value((round((vec_x.x)*10000))/10000)
111 | xy_input.set_value((round((vec_x.y)*10000))/10000)
112 | xz_input.set_value((round((vec_x.z)*10000))/10000)
113 | xo_input.set_value((round((vec_o.x)*10000))/10000)
114 |
115 | yx_input.set_value((round((vec_y.x)*10000))/10000)
116 | yy_input.set_value((round((vec_y.y)*10000))/10000)
117 | yz_input.set_value((round((vec_y.z)*10000))/10000)
118 | yo_input.set_value((round((vec_o.y)*10000))/10000)
119 |
120 | zx_input.set_value((round((vec_z.x)*10000))/10000)
121 | zy_input.set_value((round((vec_z.y)*10000))/10000)
122 | zz_input.set_value((round((vec_z.z)*10000))/10000)
123 | zo_input.set_value((round((vec_o.z)*10000))/10000)
124 |
125 | return
126 |
127 | xx_input.set_value(0)
128 | xy_input.set_value(0)
129 | xz_input.set_value(0)
130 | xo_input.set_value(0)
131 |
132 | yx_input.set_value(0)
133 | yy_input.set_value(0)
134 | yz_input.set_value(0)
135 | yo_input.set_value(0)
136 |
137 | zx_input.set_value(0)
138 | zy_input.set_value(0)
139 | zz_input.set_value(0)
140 | zo_input.set_value(0)
141 |
142 | func set_disabled(disable: bool):
143 |
144 | xx_input.editable = !disable
145 | xy_input.editable = !disable
146 | xz_input.editable = !disable
147 | xo_input.editable = !disable
148 |
149 | yx_input.editable = !disable
150 | yy_input.editable = !disable
151 | yz_input.editable = !disable
152 | yo_input.editable = !disable
153 |
154 | zx_input.editable = !disable
155 | zy_input.editable = !disable
156 | zz_input.editable = !disable
157 | zo_input.editable = !disable
158 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/tableItemSchema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var tableItemName: RichTextLabel
5 | var itemName: String
6 |
7 | var item_delete: Button
8 |
9 | signal item_pressed(item_node: Node)
10 | signal item_deleted(item_node: Node)
11 |
12 | var common
13 | var table_name
14 |
15 | # Called when the node enters the scene tree for the first time.
16 | func _ready():
17 |
18 | tableItemName = get_child(0)
19 | item_delete = get_child(1).get_child(0)
20 |
21 | tableItemName.pressed.connect(_item_pressed_on)
22 |
23 | pass # Replace with function body.
24 |
25 | func set_title(new_value: String):
26 | tableItemName.common = common
27 | tableItemName.table_name = table_name
28 | itemName = new_value
29 | tableItemName.set_text(new_value)
30 | item_delete.pressed.connect(_delete_event)
31 |
32 | func set_data(data: Dictionary):
33 | set_meta("item_data", data)
34 |
35 | func has_data():
36 | return has_meta("item_data")
37 |
38 | func get_data():
39 | return get_meta('item_data')
40 |
41 | func get_title():
42 | return itemName
43 |
44 | # Called every frame. 'delta' is the elapsed time since the previous frame.
45 | func _process(delta):
46 | pass
47 |
48 | func _delete_event():
49 | item_deleted.emit(self)
50 |
51 | func _item_pressed_on():
52 | item_pressed.emit(self)
53 |
54 | func select(toggle: bool):
55 |
56 | if tableItemName == null:
57 | return
58 |
59 | if toggle:
60 | tableItemName.add_theme_color_override("default_color", get_theme_color("accent_color", "Editor"))
61 | else:
62 | tableItemName.remove_theme_color_override("default_color")
63 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/vector2_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var vec_input: Node
5 |
6 | var x_input: SpinBox
7 | var y_input: SpinBox
8 | var text: RichTextLabel
9 | @onready var paramName: String = ""
10 |
11 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Vector2.svg[/img] "
12 |
13 | @onready var type: int = -1
14 | func get_type():
15 | return type
16 | func set_type(new_type: int):
17 | type = new_type
18 |
19 |
20 | func set_title(new_name: String):
21 | text.set_text(str(icon,new_name))
22 | paramName = new_name
23 |
24 | func get_title():
25 | return paramName
26 |
27 | # Called when the node enters the scene tree for the first time.
28 | func _ready():
29 |
30 | text = get_child(0)
31 | x_input = get_child(1).get_child(0).get_child(1)
32 | y_input = get_child(1).get_child(1).get_child(1)
33 |
34 | pass # Replace with function body.
35 |
36 |
37 | func get_value():
38 | return Vector2(x_input.get_value(), y_input.get_value())
39 |
40 |
41 |
42 | func set_value(new_value: Variant = null):
43 |
44 | if typeof(new_value) == TYPE_STRING && new_value != null:
45 |
46 | new_value = new_value.replace("(", "").replace(")", "")
47 |
48 | var v2_string: PackedStringArray = new_value.split(",")
49 |
50 | if v2_string.size() == 2:
51 | new_value = Vector2(float(v2_string[0]), float(v2_string[1]))
52 |
53 | if typeof(new_value) == TYPE_VECTOR2 && new_value != null:
54 | x_input.set_value( (round((new_value.x)*10000))/10000)
55 | y_input.set_value( (round((new_value.y)*10000))/10000)
56 | return
57 | x_input.set_value(0)
58 | y_input.set_value(0)
59 |
60 | func set_disabled(disable: bool):
61 |
62 | x_input.editable = !disable
63 | y_input.editable = !disable
64 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/vector3_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var x_input: SpinBox
5 | var y_input: SpinBox
6 | var z_input: SpinBox
7 | var text: RichTextLabel
8 | @onready var paramName: String = ""
9 |
10 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Vector3.svg[/img] "
11 |
12 | @onready var type: int = -1
13 | func get_type():
14 | return type
15 | func set_type(new_type: int):
16 | type = new_type
17 |
18 |
19 | func set_title(new_name: String):
20 | text.set_text(str(icon,new_name))
21 | paramName = new_name
22 |
23 | func get_title():
24 | return paramName
25 |
26 | # Called when the node enters the scene tree for the first time.
27 | func _ready():
28 |
29 | text = get_child(0)
30 | x_input = get_child(1).get_child(0).get_child(1)
31 | y_input = get_child(1).get_child(1).get_child(1)
32 | z_input = get_child(1).get_child(2).get_child(1)
33 |
34 | pass # Replace with function body.
35 |
36 |
37 | func get_value():
38 | return Vector3(x_input.get_value(), y_input.get_value(), z_input.get_value())
39 |
40 |
41 | func set_value(new_value: Variant = null):
42 |
43 | if typeof(new_value) == TYPE_STRING && new_value != null:
44 |
45 | var converted: Variant = str_to_var(new_value)
46 |
47 | if typeof(converted) != TYPE_VECTOR3:
48 | push_error("Vector3 schema: Invalid value: " + new_value)
49 | return
50 |
51 | new_value = converted
52 |
53 | if typeof(new_value) == TYPE_VECTOR3 && new_value != null:
54 | x_input.set_value((round((new_value.x)*10000))/10000)
55 | y_input.set_value((round((new_value.y)*10000))/10000)
56 | z_input.set_value((round((new_value.z)*10000))/10000)
57 | return
58 | x_input.set_value(0)
59 | y_input.set_value(0)
60 | z_input.set_value(0)
61 |
62 | func set_disabled(disable: bool):
63 |
64 | x_input.editable = !disable
65 | y_input.editable = !disable
66 | z_input.editable = !disable
67 |
--------------------------------------------------------------------------------
/addons/datatable_godot/ui/schema/new_table/vector4_schema.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends HBoxContainer
3 |
4 | var x_input: SpinBox
5 | var y_input: SpinBox
6 | var z_input: SpinBox
7 | var w_input: SpinBox
8 | var text: RichTextLabel
9 | @onready var paramName: String = ""
10 |
11 | @onready var icon: String = "[img]res://addons/datatable_godot/icons/Vector4.svg[/img] "
12 |
13 | @onready var type: int = -1
14 | func get_type():
15 | return type
16 | func set_type(new_type: int):
17 | type = new_type
18 |
19 |
20 | func set_title(new_name: String):
21 | text.set_text(str(icon,new_name))
22 | paramName = new_name
23 |
24 | func get_title():
25 | return paramName
26 |
27 | # Called when the node enters the scene tree for the first time.
28 | func _ready():
29 |
30 | text = get_child(0)
31 | x_input = get_child(1).get_child(0).get_child(1)
32 | y_input = get_child(1).get_child(1).get_child(1)
33 | z_input = get_child(1).get_child(2).get_child(1)
34 | w_input = get_child(1).get_child(3).get_child(1)
35 |
36 | pass # Replace with function body.
37 |
38 |
39 | func get_value() -> String:
40 |
41 | var x: float = x_input.get_value()
42 | var y: float = y_input.get_value()
43 | var z: float = z_input.get_value()
44 | var w: float = w_input.get_value()
45 |
46 | var vector4_object: Vector4 = Vector4(x,y,z,w)
47 |
48 | return var_to_str(vector4_object)
49 |
50 | func set_value(new_value: Variant = null):
51 |
52 | if typeof(new_value) == TYPE_STRING:
53 |
54 | var converted: Variant = str_to_var(new_value)
55 |
56 | if typeof(converted) != TYPE_VECTOR4:
57 | push_error("Vector4 schema: Invalid value: " + new_value)
58 | return
59 |
60 | new_value = converted
61 |
62 | if typeof(new_value) == TYPE_VECTOR4 && new_value != null:
63 | x_input.set_value((round((new_value.x)*10000))/10000)
64 | y_input.set_value((round((new_value.y)*10000))/10000)
65 | z_input.set_value((round((new_value.z)*10000))/10000)
66 | w_input.set_value((round((new_value.w)*10000))/10000)
67 | return
68 | x_input.set_value(0)
69 | y_input.set_value(0)
70 | z_input.set_value(0)
71 | w_input.set_value(0)
72 |
73 | func set_disabled(disable: bool):
74 |
75 | x_input.editable = !disable
76 | y_input.editable = !disable
77 | z_input.editable = !disable
78 | w_input.editable = !disable
79 |
--------------------------------------------------------------------------------