mirror of
https://github.com/Relintai/pandemonium_paint_experimental.git
synced 2024-11-07 16:52:10 +01:00
Test inspector plugin.
This commit is contained in:
parent
0c6ed1316a
commit
912e9b2f79
@ -52,6 +52,7 @@ func handle_mouse_button_down(local_position : Vector2, event: InputEvent) -> vo
|
|||||||
var arr : Array = Array()
|
var arr : Array = Array()
|
||||||
arr.push_back(cell_mouse_position)
|
arr.push_back(cell_mouse_position)
|
||||||
arr.push_back(last_cell_mouse_position)
|
arr.push_back(last_cell_mouse_position)
|
||||||
|
#STORE color here
|
||||||
arr.push_back(get_current_color())
|
arr.push_back(get_current_color())
|
||||||
elif current_tool == COLORPICKER:
|
elif current_tool == COLORPICKER:
|
||||||
print("TODO")
|
print("TODO")
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
[node name="PaintProject" type="PaintProject"]
|
[node name="PaintProject" type="PaintProject"]
|
||||||
size = Vector2i( 128, 128 )
|
size = Vector2i( 128, 128 )
|
||||||
current_color = Color( 0.254063, 0.387148, 0.290244, 1 )
|
current_color = Color( 0.511169, 0.141401, 0.0907945, 1 )
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="PaintCanvas" type="PaintCanvas" parent="."]
|
[node name="PaintCanvas" type="PaintCanvas" parent="."]
|
||||||
|
9
game/addons/paint_canvas/color_grid_inxpector_plugin.gd
Normal file
9
game/addons/paint_canvas/color_grid_inxpector_plugin.gd
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
tool
|
||||||
|
extends EditorInspectorPlugin
|
||||||
|
|
||||||
|
func can_handle(object: Object) -> bool:
|
||||||
|
return object is PaintNode
|
||||||
|
|
||||||
|
|
||||||
|
func parse_begin(object: Object) -> void:
|
||||||
|
add_custom_control(PaintColorGrid.new())
|
@ -1,7 +1,10 @@
|
|||||||
tool
|
tool
|
||||||
extends EditorPlugin
|
extends EditorPlugin
|
||||||
|
|
||||||
|
var ColorGridInspectorPlugin
|
||||||
|
|
||||||
var active_canvas : PaintCanvas = null
|
var active_canvas : PaintCanvas = null
|
||||||
|
var ip : EditorInspectorPlugin
|
||||||
|
|
||||||
func handles(object: Object) -> bool:
|
func handles(object: Object) -> bool:
|
||||||
return object is PaintCanvas
|
return object is PaintCanvas
|
||||||
@ -10,6 +13,11 @@ func edit(object: Object) -> void:
|
|||||||
active_canvas = object
|
active_canvas = object
|
||||||
|
|
||||||
func _enter_tree() -> void:
|
func _enter_tree() -> void:
|
||||||
|
ColorGridInspectorPlugin = load("res://addons/paint_canvas/color_grid_inxpector_plugin.gd")
|
||||||
|
|
||||||
|
ip = ColorGridInspectorPlugin.new()
|
||||||
|
add_inspector_plugin(ip)
|
||||||
|
|
||||||
#get_tree().connect("node_removed", self, "on_node_removed")
|
#get_tree().connect("node_removed", self, "on_node_removed")
|
||||||
|
|
||||||
var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin")
|
var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin")
|
||||||
@ -20,6 +28,9 @@ func _enter_tree() -> void:
|
|||||||
#print(sidebar)
|
#print(sidebar)
|
||||||
|
|
||||||
func _exit_tree() -> void:
|
func _exit_tree() -> void:
|
||||||
|
if ip:
|
||||||
|
remove_inspector_plugin(ip)
|
||||||
|
|
||||||
var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin")
|
var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin")
|
||||||
|
|
||||||
if paint_editor_plugin:
|
if paint_editor_plugin:
|
||||||
|
Loading…
Reference in New Issue
Block a user