mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Add more methods to ExtensionsAPI
This commit is contained in:
parent
b5d268e7e1
commit
a368ea500a
|
@ -1,3 +1,4 @@
|
||||||
|
# gdlint: ignore=max-public-methods
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
enum { FILE, EDIT, SELECT, IMAGE, VIEW, WINDOW, HELP }
|
enum { FILE, EDIT, SELECT, IMAGE, VIEW, WINDOW, HELP }
|
||||||
|
@ -15,6 +16,14 @@ func get_extensions_node() -> Node:
|
||||||
return Global.control.get_node("Extensions")
|
return Global.control.get_node("Extensions")
|
||||||
|
|
||||||
|
|
||||||
|
func get_config_file() -> ConfigFile:
|
||||||
|
return Global.config_cache
|
||||||
|
|
||||||
|
|
||||||
|
func get_canvas() -> Canvas:
|
||||||
|
return Global.canvas
|
||||||
|
|
||||||
|
|
||||||
func _get_popup_menu(menu_type: int) -> PopupMenu:
|
func _get_popup_menu(menu_type: int) -> PopupMenu:
|
||||||
match menu_type:
|
match menu_type:
|
||||||
FILE:
|
FILE:
|
||||||
|
@ -39,7 +48,9 @@ func add_menu_item(menu_type: int, item_name: String, item_metadata, item_id :=
|
||||||
if not image_menu:
|
if not image_menu:
|
||||||
return -1
|
return -1
|
||||||
image_menu.add_item(item_name, item_id)
|
image_menu.add_item(item_name, item_id)
|
||||||
var idx: int = image_menu.get_item_count() - 1
|
var idx := item_id
|
||||||
|
if item_id == -1:
|
||||||
|
idx = image_menu.get_item_count() - 1
|
||||||
image_menu.set_item_metadata(idx, item_metadata)
|
image_menu.set_item_metadata(idx, item_metadata)
|
||||||
|
|
||||||
return idx
|
return idx
|
||||||
|
|
Loading…
Reference in a new issue