mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
Fixed icon name in saved library
This commit is contained in:
parent
85599c2fea
commit
40fa352dc6
@ -347,11 +347,11 @@ func do_add_to_user_library(name, nodes) -> void:
|
|||||||
dir.make_dir("user://library")
|
dir.make_dir("user://library")
|
||||||
dir.make_dir("user://library/user")
|
dir.make_dir("user://library/user")
|
||||||
data.library = "user://library/user.json"
|
data.library = "user://library/user.json"
|
||||||
data.icon = name.right(name.rfind("/")+1).to_lower()
|
data.icon = library.get_icon_name(name)
|
||||||
var result = nodes[0].generator.render(0, 64)
|
var result = nodes[0].generator.render(0, 64)
|
||||||
while result is GDScriptFunctionState:
|
while result is GDScriptFunctionState:
|
||||||
result = yield(result, "completed")
|
result = yield(result, "completed")
|
||||||
result.save_to_file("user://library/user/"+library.get_icon_name(name)+".png")
|
result.save_to_file("user://library/user/"+data.icon+".png")
|
||||||
result.release()
|
result.release()
|
||||||
library.add_item(data, name, library.get_preview_texture(data))
|
library.add_item(data, name, library.get_preview_texture(data))
|
||||||
library.save_library("user://library/user.json")
|
library.save_library("user://library/user.json")
|
||||||
|
Loading…
Reference in New Issue
Block a user