Skip to content

Commit

Permalink
Alternative simpler work around with different behaviour.
Browse files Browse the repository at this point in the history
This work around is simpler but with less desirable features:

 * Generates red error output in console on first run.
   (But doesn't prevent plugin from loading.)

 * Doesn't display the custom type icon on first run only generic.
   (But the custom types can still be interacted with.
  • Loading branch information
follower committed Feb 18, 2020
1 parent 2d7db76 commit 313f626
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions addons/godot-camera-plugin.funabab/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ const ANDROID_MODULE = "org/godotengine/godot/funabab/camera/FunababCameraPlugin
const CUSTOM_NODE_NAME = "CameraView";

func _enter_tree():
var custom_icon: Image = Image.new()
custom_icon.load("res://addons/godot-camera-plugin.funabab/icon_node.png")

var custom_icon_texture: ImageTexture = ImageTexture.new()
custom_icon_texture.create_from_image(custom_icon)

add_custom_type(CUSTOM_NODE_NAME, "Control", preload("camera_view.gd"), custom_icon_texture);
pass
add_custom_type(CUSTOM_NODE_NAME, "Control", preload("camera_view.gd"), ResourceLoader.load("res://addons/godot-camera-plugin.funabab/icon_node.png"))

func _exit_tree():
remove_custom_type(CUSTOM_NODE_NAME);
Expand Down

0 comments on commit 313f626

Please sign in to comment.