Skip to content

Commit

Permalink
Simple loader(Quite useless)
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Oct 19, 2022
1 parent 1c4f57d commit 6672a42
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Loading.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
extends Node

var images_to_load: Array = []

func _ready():
var file_handler = FileAccess.open("/home/rafal/Projekty/Rust/Rozne/images.txt", FileAccess.READ)
images_to_load = file_handler.get_as_text().split('\n')

var line_index : int = 0
var all_lines: int = images_to_load.size()

print("Loading " + (images_to_load.size()) + " images")
# Image
# for i in images_to_load:
# line_index += 1
# print("Loading line " + str(line_index) +"/"+str(all_lines)+ " --- " + i)
# Image.load_from_file(i)

# Load normal
for i in images_to_load:
line_index += 1
print("Loading line " + str(line_index) +"/"+str(all_lines)+ " --- " + i)
load(i)

print("==================================================== ENDING =======================================")
get_tree().quit()
6 changes: 6 additions & 0 deletions Loading.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://by8g1jwhspswr"]

[ext_resource type="Script" path="res://Loading.gd" id="1_nyewk"]

[node name="Loading" type="Node"]
script = ExtResource("1_nyewk")

0 comments on commit 6672a42

Please sign in to comment.