mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Main nodes for mat_maker_gd and Initial setup for an editor plugin.
This commit is contained in:
parent
46dae7373b
commit
059cabc48b
21
game/addons/mat_maker_gd/editor/MatMakerGDEditor.tscn
Normal file
21
game/addons/mat_maker_gd/editor/MatMakerGDEditor.tscn
Normal file
@ -0,0 +1,21 @@
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="MatMakerGDEditor" type="MarginContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_min_size = Vector2( 0, 200 )
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 600.0
|
||||
|
||||
[node name="GraphEdit" type="GraphEdit" parent="VBoxContainer"]
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 600.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
static func clampv3(v : Vector3, mi : Vector3, ma : Vector3) -> Vector3:
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
@ -1,3 +1,4 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
7
game/addons/mat_maker_gd/nodes/mm_material.gd
Normal file
7
game/addons/mat_maker_gd/nodes/mm_material.gd
Normal file
@ -0,0 +1,7 @@
|
||||
tool
|
||||
class_name MMMateial
|
||||
extends Resource
|
||||
|
||||
var MMMNode = preload("res://addons/mat_maker_gd/nodes/mm_node.gd")
|
||||
|
||||
export(Array) var nodes : Array
|
4
game/addons/mat_maker_gd/nodes/mm_node.gd
Normal file
4
game/addons/mat_maker_gd/nodes/mm_node.gd
Normal file
@ -0,0 +1,4 @@
|
||||
tool
|
||||
extends Resource
|
||||
|
||||
|
@ -1,10 +1,59 @@
|
||||
tool
|
||||
extends EditorPlugin
|
||||
|
||||
var MMNode = preload("res://addons/mat_maker_gd/nodes/mm_node.gd")
|
||||
var MMMaterial = preload("res://addons/mat_maker_gd/nodes/mm_material.gd")
|
||||
|
||||
var editor_packed_scene = preload("res://addons/mat_maker_gd/editor/MatMakerGDEditor.tscn")
|
||||
var editor_scene = null
|
||||
|
||||
var tool_button : ToolButton = null
|
||||
|
||||
func _enter_tree():
|
||||
pass
|
||||
|
||||
|
||||
add_custom_type("MMNode", "Resource", MMNode, null)
|
||||
|
||||
editor_scene = editor_packed_scene.instance()
|
||||
|
||||
tool_button = add_control_to_bottom_panel(editor_scene, "MMGD")
|
||||
tool_button.hide()
|
||||
|
||||
func _exit_tree():
|
||||
remove_custom_type("MMNode")
|
||||
|
||||
remove_control_from_bottom_panel(editor_scene)
|
||||
|
||||
if editor_scene:
|
||||
editor_scene.queue_free()
|
||||
|
||||
editor_scene = null
|
||||
tool_button = null
|
||||
|
||||
func handles(object):
|
||||
return object is MMMateial
|
||||
|
||||
func edit(object):
|
||||
#if editor_scene:
|
||||
# make_bottom_panel_item_visible(editor_scene)
|
||||
pass
|
||||
|
||||
func make_visible(visible):
|
||||
if tool_button:
|
||||
if visible:
|
||||
tool_button.show()
|
||||
else:
|
||||
#if tool_button.pressed:
|
||||
# tool_button.pressed = false
|
||||
|
||||
if !tool_button.pressed:
|
||||
tool_button.hide()
|
||||
|
||||
func get_plugin_icon():
|
||||
return null
|
||||
|
||||
func get_plugin_name():
|
||||
return "MatMakerGD"
|
||||
|
||||
func has_main_screen():
|
||||
return false
|
||||
|
||||
|
||||
|
@ -144,6 +144,11 @@ _global_script_classes=[ {
|
||||
"language": "GDScript",
|
||||
"path": "res://texture_tools/LayeredTextureMaker.gd"
|
||||
}, {
|
||||
"base": "Resource",
|
||||
"class": "MMMateial",
|
||||
"language": "GDScript",
|
||||
"path": "res://addons/mat_maker_gd/nodes/mm_material.gd"
|
||||
}, {
|
||||
"base": "Node",
|
||||
"class": "Main",
|
||||
"language": "GDScript",
|
||||
@ -247,6 +252,7 @@ _global_script_class_icons={
|
||||
"HealthResource": "",
|
||||
"ItemTemplateGD": "",
|
||||
"LayeredTextureMaker": "",
|
||||
"MMMateial": "",
|
||||
"Main": "",
|
||||
"MainTPlanetGenerator": "",
|
||||
"ManaResource": "",
|
||||
@ -310,7 +316,7 @@ window/size/ui_scale_touch=1.0
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PoolStringArray( "res://addons/Godoxel/plugin.cfg", "res://addons/color-palette/plugin.cfg", "res://addons/mesh_data_resource_editor/plugin.cfg" )
|
||||
enabled=PoolStringArray( "res://addons/Godoxel/plugin.cfg", "res://addons/color-palette/plugin.cfg", "res://addons/mat_maker_gd/plugin.cfg", "res://addons/mesh_data_resource_editor/plugin.cfg" )
|
||||
|
||||
[ess]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user