Skip to content

Commit

Permalink
Merge pull request #5 from Qubus0/alpha15
Browse files Browse the repository at this point in the history
updated for godot 4 alpha 15
  • Loading branch information
Qubus0 authored Sep 6, 2022
2 parents 2487877 + 926672a commit 8bd5739
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.godot
.import
.import/
*.import
Binary file modified Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

`! Note:` this plugin only works for Godot 4.x

Made in 4.0.alpha3. Things may change and break with other Godot versions.
Updated to 4.0.alpha15. Things may still break, older alphas may not be compatible right away.

Now avalable on the Godot Asset Library: [Color Preview](https://godotengine.org/asset-library/asset/1252)
Now available on the Godot Asset Library: [Color Preview](https://godotengine.org/asset-library/asset/1252)

## Installation
1. In the Godot Editor, got to the `AssetLib` tab
1. Search for 'Color Preview', select and <kbd>Download</kbd>
1. Select only the `addons/ColorPreview` folder and <kbd>Install</kbd>
1. Search for 'Color Preview', select and press <kbd>Download</kbd>
1. Select only the `addons/ColorPreview` folder and press <kbd>Install</kbd>

**Or**:

1. Download/Pull this repository
1. Add the `ColorPreview/` directory and its contents to the `addons/` directory in your Godot project

## Enabling the addon
Go to `Project > Project Settings... > Plugins` and <kbd>Enable</kbd>
Go to `Project > Project Settings... > Plugins` and press <kbd>Enable</kbd>


Once you have done this, every line containing a Color will have a preview left of the breakpoint gutter.
Expand Down
6 changes: 3 additions & 3 deletions addons/ColorPreview/ColorPreview.gd
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ func get_all_text_editors(parent : Node) -> void:

if child.is_connected("text_changed", text_changed):
child.disconnect("text_changed", text_changed)
child.connect("text_changed", text_changed, [child])
child.text_changed.connect(text_changed.bind(child))

if child.is_connected("caret_changed", caret_changed):
child.disconnect("caret_changed", caret_changed)
child.connect("caret_changed", caret_changed, [child])
child.caret_changed.connect(caret_changed.bind(child))


func caret_changed(textedit: TextEdit) -> void:
Expand All @@ -88,7 +88,7 @@ func text_changed(textedit : TextEdit) -> void:
func handle_change(textedit : TextEdit) -> void:
current_textedit = textedit
if not current_textedit.is_connected("gui_input", textedit_clicked):
current_textedit.connect("gui_input", textedit_clicked, [textedit])
current_textedit.gui_input.connect(textedit_clicked.bind(textedit))

var editor = get_editor_interface()
if not editors.has(textedit):
Expand Down
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ config_version=5
[application]

config/name="ColorPreview"
config/icon="res://icon.png"
config/features=PackedStringArray("4.0")
config/icon="res://icon.png"

[editor_plugins]

Expand Down

0 comments on commit 8bd5739

Please sign in to comment.