Skip to content

Commit

Permalink
:)
Browse files Browse the repository at this point in the history
  • Loading branch information
leogeier committed Aug 24, 2023
1 parent cca7dd2 commit bfc30b8
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 76 deletions.
28 changes: 17 additions & 11 deletions addons/pronto/behaviors/ValueBehavior.gd
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func _draw():
var font := ThemeDB.fallback_font
var text_size = 4
draw_string(font,
Vector2(font.get_string_size(str, HORIZONTAL_ALIGNMENT_CENTER, -1, text_size).x / -2, 12),
Vector2(font.get_string_size(str, HORIZONTAL_ALIGNMENT_CENTER, -1, text_size).x / -2, 22),
str,
HORIZONTAL_ALIGNMENT_CENTER,
-1,
Expand Down Expand Up @@ -197,23 +197,29 @@ class DropPropertyPrompt extends ColorRect:
# the prompt is only displayed if we have a drag operation with a valid object
return true

func empty_script(a: Array, expr: String, return_value: bool):
var script := ConnectionScript.new(a, return_value, expr)
return script

func _drop_data(at_position, data):
var root = editor_interface.get_edited_scene_root()
var current = data["object"].get(data["property"])

var v = ValueBehavior.new()
v.from = min(0.0, current)
v.to = max(1.0, current)
v.value = current
v.float_from = min(0.0, current)
v.float_to = max(1.0, current)
v.float_value = current
v.name = data["property"]
v.position = Vector2(50, 50)
data["object"].add_child(v)
v.owner = root

var b = BindBehavior.new()
b.to_prop = data["property"]
b.name = "bind_" + b.to_prop
b.position = Vector2(100, 50)
b.convert = "G.at('{0}')".format([data["property"]])
data["object"].add_child(b)
b.owner = root
Connection.connect_target(v, "value_changed", "..", "set", [empty_script(["value"], "\"%s\"" % [data["property"]], true), empty_script(["value"], "value", true)], [], empty_script(["value"], "true", true))

# var b = BindBehavior.new()
# b.to_prop = data["property"]
# b.name = "bind_" + b.to_prop
# b.position = Vector2(100, 50)
# b.convert = "G.at('{0}')".format([data["property"]])
# data["object"].add_child(b)
# b.owner = root
2 changes: 1 addition & 1 deletion addons/pronto/behaviors/WatchBehavior.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func _ready():
func _process(delta):
super._process(delta)
if not Engine.is_editor_hint():
var val = str(evaluate.run([], self))
var val = str(await evaluate.run([], self))
if _last != val:
if EngineDebugger.is_active(): EngineDebugger.send_message("pronto:watch_put", [get_path(), val])
_last = val
Expand Down
2 changes: 1 addition & 1 deletion addons/pronto/helpers/G.gd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func maybe_add_value_user_interface():
return

var panel = PanelContainer.new()
panel.size = Vector2(200, 200)
panel.size = Vector2(300, 200)
var ui = PrototypingUIBehavior.new()
ui.name = 'Config'
panel.add_child(ui)
Expand Down
111 changes: 55 additions & 56 deletions addons/pronto/signal_connecting/expression_edit.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,58 @@ name = "RotateLeft"
[sub_resource type="SystemFont" id="SystemFont_xd5ge"]
font_names = PackedStringArray("Monospace")

[sub_resource type="CodeHighlighter" id="CodeHighlighter_we5wh"]
number_color = Color(0, 0.55, 0.28, 1)
symbol_color = Color(0, 0, 0.61, 1)
function_color = Color(0, 0.225, 0.9, 1)
member_variable_color = Color(0, 0.4, 0.68, 1)
[sub_resource type="CodeHighlighter" id="CodeHighlighter_86c27"]
number_color = Color(0.63, 1, 0.88, 1)
symbol_color = Color(0.67, 0.79, 1, 1)
function_color = Color(0.34, 0.7, 1, 1)
member_variable_color = Color(0.736, 0.88, 1, 1)
keyword_colors = {
"INF": Color(0.9, 0.135, 0.51, 1),
"NAN": Color(0.9, 0.135, 0.51, 1),
"PI": Color(0.9, 0.135, 0.51, 1),
"TAU": Color(0.9, 0.135, 0.51, 1),
"and": Color(0.9, 0.135, 0.51, 1),
"as": Color(0.9, 0.135, 0.51, 1),
"assert": Color(0.9, 0.135, 0.51, 1),
"await": Color(0.9, 0.135, 0.51, 1),
"bool": Color(0.9, 0.135, 0.51, 1),
"break": Color(0.9, 0.135, 0.51, 1),
"breakpoint": Color(0.9, 0.135, 0.51, 1),
"class": Color(0.9, 0.135, 0.51, 1),
"class_name": Color(0.9, 0.135, 0.51, 1),
"const": Color(0.9, 0.135, 0.51, 1),
"continue": Color(0.9, 0.135, 0.51, 1),
"elif": Color(0.9, 0.135, 0.51, 1),
"else": Color(0.9, 0.135, 0.51, 1),
"enum": Color(0.9, 0.135, 0.51, 1),
"extends": Color(0.9, 0.135, 0.51, 1),
"false": Color(0.9, 0.135, 0.51, 1),
"float": Color(0.9, 0.135, 0.51, 1),
"for": Color(0.9, 0.135, 0.51, 1),
"func": Color(0.9, 0.135, 0.51, 1),
"if": Color(0.9, 0.135, 0.51, 1),
"in": Color(0.9, 0.135, 0.51, 1),
"int": Color(0.9, 0.135, 0.51, 1),
"is": Color(0.9, 0.135, 0.51, 1),
"match": Color(0.9, 0.135, 0.51, 1),
"not": Color(0.9, 0.135, 0.51, 1),
"null": Color(0.9, 0.135, 0.51, 1),
"or": Color(0.9, 0.135, 0.51, 1),
"pass": Color(0.9, 0.135, 0.51, 1),
"preload": Color(0.9, 0.135, 0.51, 1),
"return": Color(0.9, 0.135, 0.51, 1),
"self": Color(0.9, 0.135, 0.51, 1),
"signal": Color(0.9, 0.135, 0.51, 1),
"static": Color(0.9, 0.135, 0.51, 1),
"super": Color(0.9, 0.135, 0.51, 1),
"true": Color(0.9, 0.135, 0.51, 1),
"var": Color(0.9, 0.135, 0.51, 1),
"void": Color(0.9, 0.135, 0.51, 1),
"while": Color(0.9, 0.135, 0.51, 1)
"INF": Color(1, 0.44, 0.52, 1),
"NAN": Color(1, 0.44, 0.52, 1),
"PI": Color(1, 0.44, 0.52, 1),
"TAU": Color(1, 0.44, 0.52, 1),
"and": Color(1, 0.44, 0.52, 1),
"as": Color(1, 0.44, 0.52, 1),
"assert": Color(1, 0.44, 0.52, 1),
"await": Color(1, 0.44, 0.52, 1),
"bool": Color(1, 0.44, 0.52, 1),
"break": Color(1, 0.44, 0.52, 1),
"breakpoint": Color(1, 0.44, 0.52, 1),
"class": Color(1, 0.44, 0.52, 1),
"class_name": Color(1, 0.44, 0.52, 1),
"const": Color(1, 0.44, 0.52, 1),
"continue": Color(1, 0.44, 0.52, 1),
"elif": Color(1, 0.44, 0.52, 1),
"else": Color(1, 0.44, 0.52, 1),
"enum": Color(1, 0.44, 0.52, 1),
"extends": Color(1, 0.44, 0.52, 1),
"false": Color(1, 0.44, 0.52, 1),
"float": Color(1, 0.44, 0.52, 1),
"for": Color(1, 0.44, 0.52, 1),
"func": Color(1, 0.44, 0.52, 1),
"if": Color(1, 0.44, 0.52, 1),
"in": Color(1, 0.44, 0.52, 1),
"int": Color(1, 0.44, 0.52, 1),
"is": Color(1, 0.44, 0.52, 1),
"match": Color(1, 0.44, 0.52, 1),
"not": Color(1, 0.44, 0.52, 1),
"null": Color(1, 0.44, 0.52, 1),
"or": Color(1, 0.44, 0.52, 1),
"pass": Color(1, 0.44, 0.52, 1),
"preload": Color(1, 0.44, 0.52, 1),
"return": Color(1, 0.44, 0.52, 1),
"self": Color(1, 0.44, 0.52, 1),
"signal": Color(1, 0.44, 0.52, 1),
"static": Color(1, 0.44, 0.52, 1),
"super": Color(1, 0.44, 0.52, 1),
"true": Color(1, 0.44, 0.52, 1),
"var": Color(1, 0.44, 0.52, 1),
"void": Color(1, 0.44, 0.52, 1),
"while": Color(1, 0.44, 0.52, 1)
}
color_regions = {
"\"": Color(0.6, 0.42, 0, 1),
"'": Color(0.6, 0.42, 0, 1)
"\" \"": Color(1, 0.93, 0.63, 1),
"' '": Color(1, 0.93, 0.63, 1)
}

[sub_resource type="Texture2D" id="Texture2D_8ynin"]
Expand All @@ -80,17 +80,16 @@ script = ExtResource("2_au0w8")
name = "NodeWarning"

[node name="expression_edit" type="VBoxContainer"]
custom_minimum_size = Vector2(0, 34.0249)
offset_right = 180.0
offset_bottom = 34.0249
custom_minimum_size = Vector2(0, 104.701)
offset_right = 500.0
offset_bottom = 104.701
size_flags_horizontal = 3
theme_override_constants/separation = 0
script = ExtResource("1_lndi8")
expression_label = null
placeholder_text = "Expression..."

[node name="row" type="HBoxContainer" parent="."]
custom_minimum_size = Vector2(180, 32)
custom_minimum_size = Vector2(500, 60)
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 0
Expand All @@ -110,9 +109,8 @@ layout_mode = 2
size_flags_horizontal = 3
theme_override_fonts/font = SubResource("SystemFont_xd5ge")
placeholder_text = "Expression..."
wrap_mode = 1
draw_tabs = true
syntax_highlighter = SubResource("CodeHighlighter_we5wh")
syntax_highlighter = SubResource("CodeHighlighter_86c27")
code_completion_enabled = true
code_completion_prefixes = Array[String]([".", ",", "(", "=", "$", "@", "\"", "'"])
indent_automatic = true
Expand All @@ -122,6 +120,7 @@ script = ExtResource("2_7vlfx")
[node name="OpenFile" type="Button" parent="row"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 0
tooltip_text = "Open script"
icon = SubResource("Texture2D_8ynin")
Expand Down
3 changes: 2 additions & 1 deletion addons/pronto/signal_connecting/node_to_node_configurator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ var undo_redo: EditorUndoRedoManager
var anchor: Node:
set(n):
anchor = n
reset_size()
# reset_size()
size = custom_minimum_size
%FunctionName.anchor = n
var from: Node
var existing_connection = null
Expand Down
13 changes: 8 additions & 5 deletions addons/pronto/signal_connecting/node_to_node_configurator.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ script = ExtResource("2_2ll7t")
name = "Remove"

[node name="Node To Node Configurator" type="PanelContainer"]
offset_right = 364.0
offset_bottom = 200.0
custom_minimum_size = Vector2(2000, 2.08165e-12)
offset_right = 2000.0
offset_bottom = 363.0
scale = Vector2(1, 1.00268)
size_flags_horizontal = 3
size_flags_vertical = 3
Expand Down Expand Up @@ -122,13 +123,14 @@ size_flags_horizontal = 3
text = " "

[node name="AddReferenceButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"]
layout_direction = 2
layout_mode = 2
tooltip_text = "Add reference"
icon = SubResource("Texture2D_i0w25")

[node name="VSeparator" type="Control" parent="MarginContainer/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 2.08165e-12)
layout_mode = 2
size_flags_horizontal = 3

[node name="ChangesNotifier" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
Expand Down Expand Up @@ -175,6 +177,7 @@ text = "("
[node name="Args" type="BoxContainer" parent="MarginContainer/VBoxContainer/Receiver"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3

[node name="RightParen" type="Label" parent="MarginContainer/VBoxContainer/Receiver"]
layout_mode = 2
Expand All @@ -188,7 +191,7 @@ sync_handles_x = true

[node name="Expression" parent="MarginContainer/VBoxContainer/ResizableContainer" instance=ExtResource("5_ujudk")]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 34.1782)
custom_minimum_size = Vector2(0, 102.28)
layout_mode = 2
size_flags_horizontal = 1
return_value = false
Expand All @@ -210,7 +213,7 @@ sync_handles_x = true

[node name="Condition" parent="MarginContainer/VBoxContainer/HBoxContainer2/ResizableContainer2" instance=ExtResource("5_ujudk")]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 34.8133)
custom_minimum_size = Vector2(0, 104.186)
layout_mode = 2
default_text = "true"
max_width = 500
Expand Down
3 changes: 2 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config_version=5
[application]

config/name="pronto"
config/features=PackedStringArray("4.1", "Forward Plus")
config/features=PackedStringArray("4.2", "Forward Plus")
run/low_processor_mode=true
config/icon="res://icon.svg"

Expand All @@ -23,6 +23,7 @@ LanguageClient="*res://addons/pronto/helpers/LanguageClient.gd"

[display]

window/size/mode=2
window/stretch/mode="canvas_items"

[editor_plugins]
Expand Down

0 comments on commit bfc30b8

Please sign in to comment.