diff --git a/addons/easycpp/plugin.cfg b/addons/easycpp/plugin.cfg index 91c7790..1e7e375 100644 --- a/addons/easycpp/plugin.cfg +++ b/addons/easycpp/plugin.cfg @@ -2,5 +2,5 @@ name="Easy C++" description="Makes using C++ code easier." author="Daniel Kollmann" -version="0.1" +version="0.2" script="plugin.gd" diff --git a/addons/easycpp/plugin.gd b/addons/easycpp/plugin.gd index c93255f..5171ea9 100644 --- a/addons/easycpp/plugin.gd +++ b/addons/easycpp/plugin.gd @@ -16,6 +16,8 @@ func _enter_tree(): toolwindow = preload("res://addons/easycpp/scenes/tool_window.tscn").instance() + assert(toolwindow != null) + toolwindow.editorbase = get_editor_interface().get_base_control() add_control_to_dock(DOCK_SLOT_LEFT_UL, toolwindow) diff --git a/addons/easycpp/scenes/buildconfiguration.tscn b/addons/easycpp/scenes/buildconfiguration.tscn index c3c70f1..9a61f05 100644 --- a/addons/easycpp/scenes/buildconfiguration.tscn +++ b/addons/easycpp/scenes/buildconfiguration.tscn @@ -10,46 +10,59 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="PropertiesContainer" type="GridContainer" parent="."] +[node name="ScrollContainer" type="ScrollContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +scroll_horizontal_enabled = false +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="PropertiesContainer" type="GridContainer" parent="ScrollContainer"] margin_right = 1024.0 -margin_bottom = 408.0 +margin_bottom = 600.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 custom_constants/vseparation = 4 custom_constants/hseparation = 4 columns = 2 +__meta__ = { +"_edit_use_anchors_": false +} -[node name="NameLabel" type="Label" parent="PropertiesContainer"] +[node name="NameLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 5.0 margin_right = 165.0 margin_bottom = 19.0 text = "Name:" -[node name="NameLineEdit" type="LineEdit" parent="PropertiesContainer"] +[node name="NameLineEdit" type="LineEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_right = 1024.0 margin_bottom = 24.0 size_flags_horizontal = 3 -[node name="EnabledLabel" type="Label" parent="PropertiesContainer"] +[node name="EnabledLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 33.0 margin_right = 165.0 margin_bottom = 47.0 text = "Enabled:" -[node name="EnabledCheckBox" type="CheckBox" parent="PropertiesContainer"] +[node name="EnabledCheckBox" type="CheckBox" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 28.0 margin_right = 193.0 margin_bottom = 52.0 size_flags_horizontal = 0 -[node name="ArgumentsLabel" type="Label" parent="PropertiesContainer"] +[node name="ArgumentsLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 120.0 margin_right = 165.0 margin_bottom = 151.0 text = "Arguments: (One argument per line.)" -[node name="ArgumentsEdit" type="TextEdit" parent="PropertiesContainer"] +[node name="ArgumentsEdit" type="TextEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 56.0 margin_right = 1024.0 @@ -57,14 +70,14 @@ margin_bottom = 216.0 rect_min_size = Vector2( 0, 160 ) size_flags_horizontal = 3 -[node name="DefinesLabel" type="Label" parent="PropertiesContainer"] +[node name="DefinesLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 284.0 margin_right = 165.0 margin_bottom = 315.0 text = "Defines: (One define per line.)" -[node name="DefinesEdit" type="TextEdit" parent="PropertiesContainer"] +[node name="DefinesEdit" type="TextEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 220.0 margin_right = 1024.0 @@ -72,13 +85,13 @@ margin_bottom = 380.0 rect_min_size = Vector2( 0, 160 ) size_flags_horizontal = 3 -[node name="DebugLibLabel" type="Label" parent="PropertiesContainer"] +[node name="DebugLibLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 389.0 margin_right = 165.0 margin_bottom = 403.0 text = "Use debug libraries:" -[node name="DebugLibCheckbox" type="CheckBox" parent="PropertiesContainer"] +[node name="DebugLibCheckbox" type="CheckBox" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 384.0 margin_right = 193.0 diff --git a/addons/easycpp/scenes/buildplatform.tscn b/addons/easycpp/scenes/buildplatform.tscn index ce3800e..5cad863 100644 --- a/addons/easycpp/scenes/buildplatform.tscn +++ b/addons/easycpp/scenes/buildplatform.tscn @@ -10,76 +10,86 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="PropertiesContainer" type="GridContainer" parent="."] +[node name="ScrollContainer" type="ScrollContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +scroll_horizontal_enabled = false +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="PropertiesContainer" type="GridContainer" parent="ScrollContainer"] margin_right = 1024.0 -margin_bottom = 492.0 +margin_bottom = 600.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 custom_constants/vseparation = 4 custom_constants/hseparation = 4 columns = 2 -[node name="NameLabel" type="Label" parent="PropertiesContainer"] +[node name="NameLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 5.0 margin_right = 165.0 margin_bottom = 19.0 text = "Name:" -[node name="NameLineEdit" type="LineEdit" parent="PropertiesContainer"] +[node name="NameLineEdit" type="LineEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_right = 1024.0 margin_bottom = 24.0 size_flags_horizontal = 3 -[node name="EnabledLabel" type="Label" parent="PropertiesContainer"] +[node name="EnabledLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 33.0 margin_right = 165.0 margin_bottom = 47.0 text = "Enabled:" -[node name="EnabledCheckBox" type="CheckBox" parent="PropertiesContainer"] +[node name="EnabledCheckBox" type="CheckBox" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 28.0 margin_right = 193.0 margin_bottom = 52.0 size_flags_horizontal = 0 -[node name="AvailableOnLabel" type="Label" parent="PropertiesContainer"] +[node name="AvailableOnLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 61.0 margin_right = 165.0 margin_bottom = 75.0 text = "Available on:" -[node name="AvailableOnContainer" type="HBoxContainer" parent="PropertiesContainer"] +[node name="AvailableOnContainer" type="HBoxContainer" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 56.0 margin_right = 1024.0 margin_bottom = 80.0 size_flags_horizontal = 3 -[node name="WindowsCheckBox" type="CheckBox" parent="PropertiesContainer/AvailableOnContainer"] +[node name="WindowsCheckBox" type="CheckBox" parent="ScrollContainer/PropertiesContainer/AvailableOnContainer"] margin_right = 86.0 margin_bottom = 24.0 text = "Windows" -[node name="LinuxCheckBox" type="CheckBox" parent="PropertiesContainer/AvailableOnContainer"] +[node name="LinuxCheckBox" type="CheckBox" parent="ScrollContainer/PropertiesContainer/AvailableOnContainer"] margin_left = 90.0 margin_right = 189.0 margin_bottom = 24.0 text = "Linux / X11" -[node name="MacOSCheckBox" type="CheckBox" parent="PropertiesContainer/AvailableOnContainer"] +[node name="MacOSCheckBox" type="CheckBox" parent="ScrollContainer/PropertiesContainer/AvailableOnContainer"] margin_left = 193.0 margin_right = 266.0 margin_bottom = 24.0 text = "macOS" -[node name="ArgumentsLabel" type="Label" parent="PropertiesContainer"] +[node name="ArgumentsLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 148.0 margin_right = 165.0 margin_bottom = 179.0 text = "Arguments: (One argument per line.)" -[node name="ArgumentsEdit" type="TextEdit" parent="PropertiesContainer"] +[node name="ArgumentsEdit" type="TextEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 84.0 margin_right = 1024.0 @@ -87,14 +97,14 @@ margin_bottom = 244.0 rect_min_size = Vector2( 0, 160 ) size_flags_horizontal = 3 -[node name="DefinesLabel" type="Label" parent="PropertiesContainer"] +[node name="DefinesLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 312.0 margin_right = 165.0 margin_bottom = 343.0 text = "Defines: (One define per line.)" -[node name="DefinesEdit" type="TextEdit" parent="PropertiesContainer"] +[node name="DefinesEdit" type="TextEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 248.0 margin_right = 1024.0 @@ -102,43 +112,43 @@ margin_bottom = 408.0 rect_min_size = Vector2( 0, 160 ) size_flags_horizontal = 3 -[node name="OutputLabel" type="Label" parent="PropertiesContainer"] +[node name="OutputLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 417.0 margin_right = 165.0 margin_bottom = 431.0 text = "Output:" -[node name="OutputLineEdit" type="LineEdit" parent="PropertiesContainer"] +[node name="OutputLineEdit" type="LineEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 412.0 margin_right = 1024.0 margin_bottom = 436.0 size_flags_horizontal = 3 -[node name="GDNLIBLabel" type="Label" parent="PropertiesContainer"] +[node name="GDNLIBLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 445.0 margin_right = 165.0 margin_bottom = 459.0 text = "GDNLIB Key:" -[node name="GDNLIBLineEdit" type="LineEdit" parent="PropertiesContainer"] +[node name="GDNLIBLineEdit" type="LineEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 440.0 margin_right = 1024.0 margin_bottom = 464.0 size_flags_horizontal = 3 -[node name="VSToolchainLabel" type="Label" parent="PropertiesContainer"] +[node name="VSToolchainLabel" type="Label" parent="ScrollContainer/PropertiesContainer"] margin_top = 473.0 margin_right = 165.0 margin_bottom = 487.0 text = "Visual Studio Toolchain:" -[node name="VSToolchainLineEdit" type="LineEdit" parent="PropertiesContainer"] +[node name="VSToolchainLineEdit" type="LineEdit" parent="ScrollContainer/PropertiesContainer"] margin_left = 169.0 margin_top = 468.0 margin_right = 1024.0 margin_bottom = 492.0 size_flags_horizontal = 3 -[connection signal="text_changed" from="PropertiesContainer/NameLineEdit" to="." method="_on_NameLineEdit_text_changed"] +[connection signal="text_changed" from="ScrollContainer/PropertiesContainer/NameLineEdit" to="." method="_on_NameLineEdit_text_changed"] diff --git a/addons/easycpp/scenes/settings.tscn b/addons/easycpp/scenes/settings.tscn index 1404293..3824cda 100644 --- a/addons/easycpp/scenes/settings.tscn +++ b/addons/easycpp/scenes/settings.tscn @@ -33,6 +33,7 @@ __meta__ = { } [node name="HBoxContainer" type="HBoxContainer" parent="SettingsContainer"] +visible = false margin_right = 784.0 margin_bottom = 34.0 alignment = 2 @@ -44,14 +45,12 @@ margin_bottom = 34.0 text = "Show All Settings" [node name="TabContainer" type="TabContainer" parent="SettingsContainer"] -margin_top = 44.0 margin_right = 784.0 margin_bottom = 540.0 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="Settings" type="Tabs" parent="SettingsContainer/TabContainer"] -visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 @@ -206,6 +205,7 @@ caret_blink = true caret_blink_speed = 0.5 [node name="Build Platforms" type="Tabs" parent="SettingsContainer/TabContainer"] +visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 @@ -217,6 +217,7 @@ margin_bottom = -4.0 tabtype = ExtResource( 6 ) [node name="Build Configurations" type="Tabs" parent="SettingsContainer/TabContainer"] +visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 diff --git a/addons/easycpp/scenes/tabcontrol.tscn b/addons/easycpp/scenes/tabcontrol.tscn index f5f4d55..50004c7 100644 --- a/addons/easycpp/scenes/tabcontrol.tscn +++ b/addons/easycpp/scenes/tabcontrol.tscn @@ -45,6 +45,8 @@ text = "Delete Selected" anchor_right = 1.0 anchor_bottom = 1.0 margin_top = 24.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 [connection signal="pressed" from="VBoxContainer/HBoxContainer/AddButton" to="." method="_on_AddButton_pressed"] [connection signal="pressed" from="VBoxContainer/HBoxContainer/DuplicateButton" to="." method="_on_DuplicateButton_pressed"] diff --git a/addons/easycpp/scripts/buildconfigurationsetting.gd b/addons/easycpp/scripts/buildconfigurationsetting.gd index 55c8d1c..ecd697b 100644 --- a/addons/easycpp/scripts/buildconfigurationsetting.gd +++ b/addons/easycpp/scripts/buildconfigurationsetting.gd @@ -1,25 +1,25 @@ tool -extends Tabs +extends BuildSetting func setobj(bld :BuildConfiguration) -> void: name = bld.name - $PropertiesContainer/NameLineEdit.text = bld.name - $PropertiesContainer/EnabledCheckBox.pressed = bld.enabled - $PropertiesContainer/ArgumentsEdit.text = PoolStringArray(bld.arguments).join("\n") - $PropertiesContainer/DefinesEdit.text = PoolStringArray(bld.defines).join("\n") - $PropertiesContainer/DebugLibCheckbox.pressed = bld.debuglibs + $ScrollContainer/PropertiesContainer/NameLineEdit.text = bld.name + $ScrollContainer/PropertiesContainer/EnabledCheckBox.pressed = bld.enabled + $ScrollContainer/PropertiesContainer/ArgumentsEdit.text = PoolStringArray(bld.arguments).join("\n") + $ScrollContainer/PropertiesContainer/DefinesEdit.text = PoolStringArray(bld.defines).join("\n") + $ScrollContainer/PropertiesContainer/DebugLibCheckbox.pressed = bld.debuglibs func createobj() -> BuildConfiguration: var bld := BuildConfiguration.new() - bld.name = $PropertiesContainer/NameLineEdit.text.strip_edges() - bld.enabled = $PropertiesContainer/EnabledCheckBox.pressed - bld.arguments = Utils.split_clean($PropertiesContainer/ArgumentsEdit.text, "\n", false) - bld.defines = Utils.split_clean($PropertiesContainer/DefinesEdit.text, "\n", false) - bld.debuglibs = $PropertiesContainer/DebugLibCheckbox.pressed + bld.name = $ScrollContainer/PropertiesContainer/NameLineEdit.text.strip_edges() + bld.enabled = $ScrollContainer/PropertiesContainer/EnabledCheckBox.pressed + bld.arguments = Utils.split_clean($ScrollContainer/PropertiesContainer/ArgumentsEdit.text, "\n", false) + bld.defines = Utils.split_clean($ScrollContainer/PropertiesContainer/DefinesEdit.text, "\n", false) + bld.debuglibs = $ScrollContainer/PropertiesContainer/DebugLibCheckbox.pressed return bld diff --git a/addons/easycpp/scripts/buildplatformsetting.gd b/addons/easycpp/scripts/buildplatformsetting.gd index 29befdd..202c61d 100644 --- a/addons/easycpp/scripts/buildplatformsetting.gd +++ b/addons/easycpp/scripts/buildplatformsetting.gd @@ -1,41 +1,41 @@ tool -extends Tabs +extends BuildSetting func setobj(bld :BuildPlatform) -> void: name = bld.name - $PropertiesContainer/NameLineEdit.text = bld.name - $PropertiesContainer/EnabledCheckBox.pressed = bld.enabled - $PropertiesContainer/AvailableOnContainer/WindowsCheckBox.pressed = "Windows" in bld.availableon - $PropertiesContainer/AvailableOnContainer/LinuxCheckBox.pressed = "X11" in bld.availableon - $PropertiesContainer/AvailableOnContainer/MacOSCheckBox.pressed = "OSX" in bld.availableon - $PropertiesContainer/ArgumentsEdit.text = PoolStringArray(bld.arguments).join("\n") - $PropertiesContainer/DefinesEdit.text = PoolStringArray(bld.defines).join("\n") - $PropertiesContainer/OutputLineEdit.text = bld.outputname - $PropertiesContainer/GDNLIBLineEdit.text = bld.gdnlibkey - $PropertiesContainer/VSToolchainLineEdit.text = bld.vsplatform + $ScrollContainer/PropertiesContainer/NameLineEdit.text = bld.name + $ScrollContainer/PropertiesContainer/EnabledCheckBox.pressed = bld.enabled + $ScrollContainer/PropertiesContainer/AvailableOnContainer/WindowsCheckBox.pressed = "Windows" in bld.availableon + $ScrollContainer/PropertiesContainer/AvailableOnContainer/LinuxCheckBox.pressed = "X11" in bld.availableon + $ScrollContainer/PropertiesContainer/AvailableOnContainer/MacOSCheckBox.pressed = "OSX" in bld.availableon + $ScrollContainer/PropertiesContainer/ArgumentsEdit.text = PoolStringArray(bld.arguments).join("\n") + $ScrollContainer/PropertiesContainer/DefinesEdit.text = PoolStringArray(bld.defines).join("\n") + $ScrollContainer/PropertiesContainer/OutputLineEdit.text = bld.outputname + $ScrollContainer/PropertiesContainer/GDNLIBLineEdit.text = bld.gdnlibkey + $ScrollContainer/PropertiesContainer/VSToolchainLineEdit.text = bld.vsplatform func createobj() -> BuildPlatform: var bld := BuildPlatform.new() var availableon := [] - if $PropertiesContainer/AvailableOnContainer/WindowsCheckBox.pressed: + if $ScrollContainer/PropertiesContainer/AvailableOnContainer/WindowsCheckBox.pressed: availableon.append("Windows") - if $PropertiesContainer/AvailableOnContainer/LinuxCheckBox.pressed: + if $ScrollContainer/PropertiesContainer/AvailableOnContainer/LinuxCheckBox.pressed: availableon.append("X11") - if $PropertiesContainer/AvailableOnContainer/MacOSCheckBox.pressed: + if $ScrollContainer/PropertiesContainer/AvailableOnContainer/MacOSCheckBox.pressed: availableon.append("OSX") - bld.name = $PropertiesContainer/NameLineEdit.text.strip_edges() - bld.enabled = $PropertiesContainer/EnabledCheckBox.pressed + bld.name = $ScrollContainer/PropertiesContainer/NameLineEdit.text.strip_edges() + bld.enabled = $ScrollContainer/PropertiesContainer/EnabledCheckBox.pressed bld.availableon = PoolStringArray(availableon).join(" ") - bld.arguments = Utils.split_clean($PropertiesContainer/ArgumentsEdit.text, "\n", false) - bld.defines = Utils.split_clean($PropertiesContainer/DefinesEdit.text, "\n", false) - bld.outputname = $PropertiesContainer/OutputLineEdit.text.strip_edges() - bld.gdnlibkey = $PropertiesContainer/GDNLIBLineEdit.text.strip_edges() - bld.vsplatform = $PropertiesContainer/VSToolchainLineEdit.text.strip_edges() + bld.arguments = Utils.split_clean($ScrollContainer/PropertiesContainer/ArgumentsEdit.text, "\n", false) + bld.defines = Utils.split_clean($ScrollContainer/PropertiesContainer/DefinesEdit.text, "\n", false) + bld.outputname = $ScrollContainer/PropertiesContainer/OutputLineEdit.text.strip_edges() + bld.gdnlibkey = $ScrollContainer/PropertiesContainer/GDNLIBLineEdit.text.strip_edges() + bld.vsplatform = $ScrollContainer/PropertiesContainer/VSToolchainLineEdit.text.strip_edges() return bld diff --git a/addons/easycpp/scripts/buildsetting.gd b/addons/easycpp/scripts/buildsetting.gd new file mode 100644 index 0000000..29c4e1c --- /dev/null +++ b/addons/easycpp/scripts/buildsetting.gd @@ -0,0 +1,3 @@ +tool +extends Tabs +class_name BuildSetting diff --git a/addons/easycpp/scripts/easycpp.gd b/addons/easycpp/scripts/easycpp.gd index 6455697..fcb76d2 100644 --- a/addons/easycpp/scripts/easycpp.gd +++ b/addons/easycpp/scripts/easycpp.gd @@ -112,7 +112,7 @@ const gdcppgiturl = "https://github.com/godotengine/godot-cpp.git" const linuxpause = "read -p \"Press any key to resume ...\"\n" -var editorbase :Control +var editorbase #:Control var vs2015path :String var vs2017path :String