Initial Android commit

This commit is contained in:
OleSTEEP 2024-11-10 03:34:28 +03:00
commit 1e2b80c13d
8521 changed files with 231475 additions and 0 deletions

View file

@ -0,0 +1,74 @@
extends Control
signal galleryPressed;
var unlocked;
var sceneName;
var path;
func _ready():
pass
func Init(content, type):
sceneName = content["name"]
if content.has("multi"):
var multi = content["multi"];
for i in multi:
if GallerySingleton.HaveImage(i):
unlocked = true;
$TextureRect.texture = load(str("res://resources/graphics/Gallery/Images/", i, ".webp"));
$TextureRect.material = $TextureRect.material.duplicate()
return ;
unlocked = false;
$TextureRect.texture = load("res://resources/graphics/Gallery/locked.webp")
return ;
if content.has("multiB"):
var multi = content["multiB"];
for i in multi:
if GallerySingleton.HaveBackground(i):
unlocked = true;
$TextureRect.texture = load(str("res://resources/graphics/Gallery/Backgrounds/", i, ".webp"));
$TextureRect.material = $TextureRect.material.duplicate()
return ;
unlocked = false;
$TextureRect.texture = load("res://resources/graphics/Gallery/locked.webp")
return
if type == "background":
unlocked = GallerySingleton.HaveBackground(sceneName);
else :
unlocked = GallerySingleton.HaveImage(sceneName);
if unlocked:
path = content["path"];
$TextureRect.texture = load(path);
$TextureRect.material = $TextureRect.material.duplicate()
else :
$TextureRect.texture = load("res://resources/graphics/Gallery/locked.webp")
func setShaderOn():
if unlocked:
$TextureRect.material.set_shader_param("mixing", 0.15);
func setShaderOff():
if unlocked:
$TextureRect.material.set_shader_param("mixing", 0.0);
func _on_ResizeTimer_timeout():
var scale = 288.0 / $TextureRect.rect_size.x * 1.0;
$TextureRect.rect_scale = Vector2(scale, scale);
func _on_Control_gui_input(event):
if not unlocked:
return ;
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
emit_signal("galleryPressed")