-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
228 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
enum Severity { | ||
INFO = 0, | ||
WARNING = 1, | ||
ERROR = 2 | ||
} | ||
|
||
static var _editor_toaster: Node | ||
|
||
static func do(node: Node) -> void: | ||
if node == null: | ||
print("null") | ||
return | ||
var parent = node.get_parent() | ||
while parent != null: | ||
print(parent.name) | ||
parent = parent.get_parent() | ||
|
||
static func _get_editor_toaster() -> Node: | ||
var tmp_plugin: EditorPlugin = EditorPlugin.new() | ||
var tmp_ctrl: Control = Control.new() | ||
tmp_plugin.add_control_to_bottom_panel(tmp_ctrl, "tmp_ctrl") | ||
var toaster: Node = tmp_ctrl.get_parent().find_child("*EditorToaster*", true, false) | ||
tmp_plugin.remove_control_from_bottom_panel(tmp_ctrl) | ||
tmp_ctrl.queue_free() | ||
return toaster | ||
|
||
static func notify(message: String, severity: Severity = Severity.INFO, tooltip: String = "") -> void: | ||
if _editor_toaster == null: | ||
_editor_toaster = _get_editor_toaster() | ||
if not is_instance_valid(_editor_toaster): | ||
return | ||
|
||
_editor_toaster.call("_popup_str", message, severity, tooltip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
enum Severity { | ||
INFO = 0, | ||
WARNING = 1, | ||
ERROR = 2 | ||
} | ||
|
||
static var _editor_toaster: Node | ||
|
||
static func do(node: Node) -> void: | ||
if node == null: | ||
print("null") | ||
return | ||
var parent = node.get_parent() | ||
while parent != null: | ||
print(parent.name) | ||
parent = parent.get_parent() | ||
|
||
static func _get_editor_toaster() -> Node: | ||
var tmp_plugin: EditorPlugin = EditorPlugin.new() | ||
var tmp_ctrl: Control = Control.new() | ||
tmp_plugin.add_control_to_bottom_panel(tmp_ctrl, "tmp_ctrl") | ||
var toaster: Node = tmp_ctrl.get_parent().find_child("*EditorToaster*", true, false) | ||
tmp_plugin.remove_control_from_bottom_panel(tmp_ctrl) | ||
tmp_ctrl.queue_free() | ||
return toaster | ||
|
||
static func notify(message: String, severity: Severity = Severity.INFO, tooltip: String = "") -> void: | ||
if _editor_toaster == null: | ||
_editor_toaster = _get_editor_toaster() | ||
if not is_instance_valid(_editor_toaster): | ||
return | ||
|
||
_editor_toaster.call("_popup_str", message, severity, tooltip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.