mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-05 16:34:48 -04:00
Add hint tooltips for Project Brush buttons when importing them from image files
This commit is contained in:
parent
c42a8a7219
commit
8c02e696a9
2 changed files with 8 additions and 5 deletions
|
@ -71,10 +71,11 @@ static func add_file_brush(images : Array, hint := "") -> void:
|
||||||
button.brush.index = button.get_index()
|
button.brush.index = button.get_index()
|
||||||
|
|
||||||
|
|
||||||
static func add_project_brush(image : Image) -> void:
|
static func add_project_brush(image : Image, hint := "") -> void:
|
||||||
var button = create_button(image)
|
var button = create_button(image)
|
||||||
button.brush.type = CUSTOM
|
button.brush.type = CUSTOM
|
||||||
button.brush.image = image
|
button.brush.image = image
|
||||||
|
button.hint_tooltip = hint
|
||||||
var container = Global.brushes_popup.get_node("TabContainer/Project/ProjectBrushContainer")
|
var container = Global.brushes_popup.get_node("TabContainer/Project/ProjectBrushContainer")
|
||||||
container.add_child(button)
|
container.add_child(button)
|
||||||
button.brush.index = button.get_index()
|
button.brush.index = button.get_index()
|
||||||
|
|
|
@ -156,11 +156,12 @@ func spritesheet_frame_value_changed(value : int, vertical : bool) -> void:
|
||||||
|
|
||||||
|
|
||||||
func add_brush(type : int) -> void:
|
func add_brush(type : int) -> void:
|
||||||
var file_name_ext : String = path.get_file()
|
|
||||||
file_name_ext = brush_name_replace(file_name_ext)
|
|
||||||
var file_name : String = file_name_ext.get_basename()
|
|
||||||
image.convert(Image.FORMAT_RGBA8)
|
image.convert(Image.FORMAT_RGBA8)
|
||||||
if type == BrushTypes.FILE:
|
if type == BrushTypes.FILE:
|
||||||
|
var file_name_ext : String = path.get_file()
|
||||||
|
file_name_ext = brush_name_replace(file_name_ext)
|
||||||
|
var file_name : String = file_name_ext.get_basename()
|
||||||
|
|
||||||
file_name = brush_name_replace(file_name)
|
file_name = brush_name_replace(file_name)
|
||||||
Brushes.add_file_brush([image], file_name)
|
Brushes.add_file_brush([image], file_name)
|
||||||
|
|
||||||
|
@ -170,8 +171,9 @@ func add_brush(type : int) -> void:
|
||||||
dir.copy(path, Global.directory_module.xdg_data_home.plus_file(location))
|
dir.copy(path, Global.directory_module.xdg_data_home.plus_file(location))
|
||||||
|
|
||||||
elif type == BrushTypes.PROJECT:
|
elif type == BrushTypes.PROJECT:
|
||||||
|
var file_name : String = path.get_file().get_basename()
|
||||||
Global.current_project.brushes.append(image)
|
Global.current_project.brushes.append(image)
|
||||||
Brushes.add_project_brush(image)
|
Brushes.add_project_brush(image, file_name)
|
||||||
|
|
||||||
|
|
||||||
# Checks if the brush name already exists
|
# Checks if the brush name already exists
|
||||||
|
|
Loading…
Add table
Reference in a new issue