Skip to content

Commit

Permalink
Merge commit 'b6c34dd79479212999444236d13894fb0453807e'
Browse files Browse the repository at this point in the history
  • Loading branch information
Finn-HPI committed Jul 28, 2023
1 parent f069e85 commit f0e09a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/pronto/behaviors/ExportBehavior.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var export_path

func _ready():
super._ready()

if OS.has_feature("release"): return

var scene_path = get_tree().current_scene.scene_file_path
var tmp = scene_path.split("/")
Expand All @@ -34,6 +36,7 @@ func _ready():

_create_game_json()

if not take_screenshot: return
# start thumbnail timer
timer = Timer.new()
timer.connect("timeout", _take_screenshot)
Expand All @@ -43,15 +46,15 @@ func _ready():
timer.start()

func _take_screenshot():
if not take_screenshot: return
var vpt = get_viewport()
var tex = vpt.get_texture()
tex.get_image().save_png(export_path + "thumbnail.png")
print("screenshot taken")

func _create_game_json():
var game_dict = {
"title": title
"title": title,
"time": Time.get_date_string_from_system()
}
if not authors.is_empty():
game_dict["authors"] = authors
Expand Down

0 comments on commit f0e09a1

Please sign in to comment.