Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
627
scripts/Gallery.gd
Normal file
627
scripts/Gallery.gd
Normal file
|
@ -0,0 +1,627 @@
|
|||
extends Control
|
||||
|
||||
onready var paginationButton = preload("res://resources/customControls/GalleryControls/GalleryPaginationButton.tscn")
|
||||
onready var stateButton = preload("res://resources/customControls/GalleryControls/GalleryStateButton.tscn")
|
||||
onready var musicPlayerInstance = preload("res://resources/customControls/GalleryControls/GalleryMusicPlayer.tscn")
|
||||
onready var backgroundInstance = preload("res://resources/customControls/GalleryControls/GalleryBackground.tscn")
|
||||
|
||||
var menuMusicRestart:bool = false;
|
||||
|
||||
var backgroundsLoaded:bool = false;
|
||||
var imagesLoaded:bool = false;
|
||||
var dlcLoaded:bool = false;
|
||||
|
||||
var musics;
|
||||
var backgrounds;
|
||||
var images;
|
||||
var dlcs:Array;
|
||||
|
||||
var isLoading = false;
|
||||
|
||||
func _ready():
|
||||
SetBackground();
|
||||
|
||||
GallerySingleton.CheckForGreatCollector();
|
||||
|
||||
musics = GallerySingleton.GetMusicSettings();
|
||||
backgrounds = GallerySingleton.GetBackgroundsSettings();
|
||||
images = GallerySingleton.GetImagesSettings();
|
||||
dlcs = GallerySingleton.GetDlcsSettings();
|
||||
|
||||
var backbutton = $UIRoot / CenterContainer / BackToMenu;
|
||||
var backRoot = $BigViewBackgroundsImages / BackRoot;
|
||||
backbutton.text = tr("ui_back_to_menu");
|
||||
backRoot.text = tr("ui_back");
|
||||
|
||||
|
||||
CheckForMusic();
|
||||
|
||||
func SetBackground():
|
||||
var windowSize = SettingsSingleton.GetCurrectScreenResolutionVector2()
|
||||
|
||||
$Blur.set_polygon(PoolVector2Array([
|
||||
Vector2(0, 0),
|
||||
Vector2(0, windowSize.y),
|
||||
Vector2(windowSize.x, windowSize.y),
|
||||
Vector2(windowSize.x, 0)
|
||||
]))
|
||||
|
||||
var backgroundsSize = Vector2(3840, 2160);
|
||||
var scaleX = 1 / float(backgroundsSize.x / windowSize.x);
|
||||
var scaleY = 1 / float(backgroundsSize.y / windowSize.y);
|
||||
$House.scale = Vector2(scaleX, scaleY);
|
||||
|
||||
var cloudH = 2160;
|
||||
|
||||
var cloudScale = windowSize.y * 0.53 / cloudH;
|
||||
|
||||
$Cloud1.scale = Vector2(cloudScale, cloudScale);
|
||||
$Cloud3.scale = Vector2(cloudScale, cloudScale);
|
||||
|
||||
$Loading / LoadingLabel.text = tr("ui_loading");
|
||||
|
||||
var localization = ["ui_music_tab_name", "ui_background_tab_name", "ui_images_tab_name", "ui_dlc_tab_name"]
|
||||
var container = $UIRoot / TabContainer;
|
||||
for i in localization.size():
|
||||
container.set_tab_title(i, tr(localization[i]));
|
||||
|
||||
if not SettingsSingleton.GetDLC():
|
||||
var dlcTab = $UIRoot / TabContainer / DlcTab
|
||||
container.remove_child(dlcTab)
|
||||
|
||||
|
||||
func _on_TabContainer_tab_changed(tab):
|
||||
match tab:
|
||||
1:
|
||||
if backgroundsLoaded:
|
||||
return
|
||||
CheckForBackgrounds();
|
||||
backgroundsLoaded = true;
|
||||
2:
|
||||
if imagesLoaded:
|
||||
return
|
||||
CheckForImages();
|
||||
imagesLoaded = true;
|
||||
3:
|
||||
if dlcLoaded:
|
||||
return ;
|
||||
CheckForDlc();
|
||||
dlcLoaded = true;
|
||||
|
||||
func CheckForMusic():
|
||||
var musicSize = musics.size();
|
||||
|
||||
if musicSize > 15:
|
||||
var musicPageContainer = $UIRoot / TabContainer / MusicTab / MusicPagination;
|
||||
musicPageContainer.visible = true;
|
||||
var amountOfPages = ceil(musicSize / 15.0);
|
||||
for i in amountOfPages:
|
||||
var pagButton = paginationButton.instance();
|
||||
pagButton.text = str(i + 1);
|
||||
pagButton.connect("pressed", self, "LoadMusicOnPage", [i]);
|
||||
musicPageContainer.add_child(pagButton);
|
||||
|
||||
LoadMusicOnPage(0);
|
||||
|
||||
func LoadMusicOnPage(page:int):
|
||||
var musicContainer = $UIRoot / TabContainer / MusicTab / VBoxContainer;
|
||||
var paginationContainer = $UIRoot / TabContainer / MusicTab / MusicPagination;
|
||||
|
||||
for i in musicContainer.get_children():
|
||||
musicContainer.remove_child(i);
|
||||
|
||||
var temp = musics.slice(page * 15, (page + 1) * 15 - 1, 1, true);
|
||||
|
||||
var musicSize = temp.size();
|
||||
|
||||
var index = page * 15;
|
||||
|
||||
for i in temp.size():
|
||||
if i % 3 != 0:
|
||||
continue
|
||||
|
||||
var hBoxContainer = HBoxContainer.new();
|
||||
hBoxContainer.set("custom_constants/separation", 488);
|
||||
for j in range(3):
|
||||
if i + j >= musicSize:
|
||||
break;
|
||||
var musicPlayer = musicPlayerInstance.instance();
|
||||
|
||||
index += 1;
|
||||
musicPlayer.name = str("MusicPlayer", index);
|
||||
musicPlayer.Init(temp[i + j], index);
|
||||
musicPlayer.connect("PlayerStarted", self, "StartMusicPlayer", [musicPlayer]);
|
||||
hBoxContainer.add_child(musicPlayer);
|
||||
|
||||
musicContainer.add_child(hBoxContainer);
|
||||
|
||||
for i in paginationContainer.get_child_count():
|
||||
var button = paginationContainer.get_child(i);
|
||||
if i == page:
|
||||
button.disabled = true;
|
||||
button._on_Button_mouse_entered();
|
||||
else :
|
||||
button.disabled = false;
|
||||
button._on_Button_mouse_exited();
|
||||
|
||||
func StartMusicPlayer(playerControl):
|
||||
|
||||
menuMusicRestart = true;
|
||||
get_node("/root/BgmScene").StopMenuMusic()
|
||||
|
||||
var player = $MusicPlayer;
|
||||
if player.playing and not playerControl.state:
|
||||
player.stop();
|
||||
return
|
||||
else :
|
||||
player.stop();
|
||||
|
||||
var container = $UIRoot / TabContainer / MusicTab / VBoxContainer;
|
||||
for i in container.get_children():
|
||||
|
||||
for j in i.get_children():
|
||||
if j == playerControl:
|
||||
continue;
|
||||
|
||||
j.state = false;
|
||||
j.DrawButtonIcon();
|
||||
|
||||
var stream = playerControl.GetAudioStream();
|
||||
if stream == null:
|
||||
return ;
|
||||
|
||||
player.stream = stream;
|
||||
if stream is AudioStreamMP3:
|
||||
stream.loop = true;
|
||||
else :
|
||||
player.stream.set_loop_mode(1);
|
||||
player.play()
|
||||
|
||||
func CheckForBackgrounds():
|
||||
var backgroundSize = backgrounds.size();
|
||||
|
||||
if backgroundSize > 12:
|
||||
var backgroundPageContainer = $UIRoot / TabContainer / BackgroundsTab / BackgroundPagination;
|
||||
backgroundPageContainer.visible = true;
|
||||
var amountOfPages = ceil(backgroundSize / 12.0);
|
||||
for i in amountOfPages:
|
||||
var pagButton = paginationButton.instance();
|
||||
pagButton.text = str(i + 1);
|
||||
pagButton.connect("pressed", self, "LoadBackgroundOnPage", [i]);
|
||||
backgroundPageContainer.add_child(pagButton);
|
||||
|
||||
LoadBackgroundOnPage(0);
|
||||
|
||||
func LoadBackgroundOnPage(page:int):
|
||||
var backgroundContainer = $UIRoot / TabContainer / BackgroundsTab / VBoxContainer;
|
||||
var paginationContainer = $UIRoot / TabContainer / BackgroundsTab / BackgroundPagination;
|
||||
|
||||
for i in backgroundContainer.get_children():
|
||||
backgroundContainer.remove_child(i);
|
||||
|
||||
var temp = backgrounds.slice(page * 12, (page + 1) * 12 - 1, 1, true);
|
||||
|
||||
var backgroundSize = temp.size();
|
||||
|
||||
for i in temp.size():
|
||||
if i % 4 != 0:
|
||||
continue
|
||||
|
||||
var hBoxContainer = HBoxContainer.new();
|
||||
hBoxContainer.set("custom_constants/separation", 360);
|
||||
for j in range(4):
|
||||
if i + j >= backgroundSize:
|
||||
break;
|
||||
var backgroundControl = backgroundInstance.instance();
|
||||
|
||||
backgroundControl.Init(temp[i + j], "background");
|
||||
backgroundControl.connect("mouse_entered", self, "onButtonHoverOn_background", [backgroundControl]);
|
||||
backgroundControl.connect("mouse_exited", self, "onButtonHoverOff_background", [backgroundControl]);
|
||||
backgroundControl.connect("galleryPressed", self, "onBackgroundPressed", [backgroundControl]);
|
||||
hBoxContainer.add_child(backgroundControl);
|
||||
|
||||
backgroundContainer.add_child(hBoxContainer);
|
||||
|
||||
for i in paginationContainer.get_child_count():
|
||||
var button = paginationContainer.get_child(i);
|
||||
if i == page:
|
||||
button.disabled = true;
|
||||
button._on_Button_mouse_entered();
|
||||
else :
|
||||
button.disabled = false;
|
||||
button._on_Button_mouse_exited();
|
||||
|
||||
func onButtonHoverOn_background(control):
|
||||
control.setShaderOn();
|
||||
|
||||
func onButtonHoverOff_background(control):
|
||||
control.setShaderOff();
|
||||
|
||||
func onBackgroundPressed(control):
|
||||
if not isLoading:
|
||||
onButtonHoverOff_background(control)
|
||||
LoadToBigView(control);
|
||||
|
||||
func CheckForImages():
|
||||
var imagesSize = images.size();
|
||||
|
||||
if imagesSize > 12:
|
||||
var imagesPageContainer = $UIRoot / TabContainer / ImagesTab / ImagesPagination;
|
||||
imagesPageContainer.visible = true;
|
||||
var amountOfPages = ceil(imagesSize / 12.0);
|
||||
for i in amountOfPages:
|
||||
var pagButton = paginationButton.instance();
|
||||
pagButton.text = str(i + 1);
|
||||
pagButton.connect("pressed", self, "LoadImagesOnPage", [i]);
|
||||
imagesPageContainer.add_child(pagButton);
|
||||
|
||||
LoadImagesOnPage(0);
|
||||
|
||||
func LoadImagesOnPage(page:int):
|
||||
var imagesContainer = $UIRoot / TabContainer / ImagesTab / VBoxContainer;
|
||||
var paginationContainer = $UIRoot / TabContainer / ImagesTab / ImagesPagination;
|
||||
|
||||
for i in imagesContainer.get_children():
|
||||
imagesContainer.remove_child(i);
|
||||
|
||||
var temp = images.slice(page * 12, (page + 1) * 12 - 1, 1, true);
|
||||
|
||||
var imagesSize = temp.size();
|
||||
|
||||
for i in temp.size():
|
||||
if i % 4 != 0:
|
||||
continue
|
||||
|
||||
var hBoxContainer = HBoxContainer.new();
|
||||
hBoxContainer.set("custom_constants/separation", 360);
|
||||
for j in range(4):
|
||||
if i + j >= imagesSize:
|
||||
break;
|
||||
var imagesControl = backgroundInstance.instance();
|
||||
|
||||
imagesControl.Init(temp[i + j], "image");
|
||||
imagesControl.connect("mouse_entered", self, "onButtonHoverOn_background", [imagesControl]);
|
||||
imagesControl.connect("mouse_exited", self, "onButtonHoverOff_background", [imagesControl]);
|
||||
imagesControl.connect("galleryPressed", self, "onImagePressed", [imagesControl]);
|
||||
hBoxContainer.add_child(imagesControl);
|
||||
|
||||
imagesContainer.add_child(hBoxContainer);
|
||||
|
||||
for i in paginationContainer.get_child_count():
|
||||
var button = paginationContainer.get_child(i);
|
||||
if i == page:
|
||||
button.disabled = true;
|
||||
button._on_Button_mouse_entered();
|
||||
else :
|
||||
button.disabled = false;
|
||||
button._on_Button_mouse_exited();
|
||||
|
||||
func CheckForDlc():
|
||||
var dlcsSize = dlcs.size();
|
||||
|
||||
if dlcsSize > 12:
|
||||
var dlcsPageContainer = $UIRoot / TabContainer / DlcTab / ImagesPagination;
|
||||
dlcsPageContainer.visible = true;
|
||||
var amountOfPages = ceil(dlcsSize / 12.0);
|
||||
for i in amountOfPages:
|
||||
var pagButton = paginationButton.instance();
|
||||
pagButton.text = str(i + 1);
|
||||
pagButton.connect("pressed", self, "LoadDlcsOnPage", [i]);
|
||||
dlcsPageContainer.add_child(pagButton);
|
||||
|
||||
LoadDlcsOnPage(0);
|
||||
|
||||
func LoadDlcsOnPage(page:int):
|
||||
var dlcsContainer = $UIRoot / TabContainer / DlcTab / VBoxContainer;
|
||||
var paginationContainer = $UIRoot / TabContainer / DlcTab / ImagesPagination;
|
||||
|
||||
for i in dlcsContainer.get_children():
|
||||
dlcsContainer.remove_child(i);
|
||||
|
||||
var temp = dlcs.slice(page * 12, (page + 1) * 12 - 1, 1, true);
|
||||
|
||||
var dlcsSize = temp.size();
|
||||
|
||||
for i in temp.size():
|
||||
if i % 4 != 0:
|
||||
continue
|
||||
|
||||
var hBoxContainer = HBoxContainer.new();
|
||||
hBoxContainer.set("custom_constants/separation", 360);
|
||||
for j in range(4):
|
||||
if i + j >= dlcsSize:
|
||||
break;
|
||||
var imagesControl = backgroundInstance.instance();
|
||||
|
||||
imagesControl.Init(temp[i + j], "image");
|
||||
imagesControl.connect("mouse_entered", self, "onButtonHoverOn_background", [imagesControl]);
|
||||
imagesControl.connect("mouse_exited", self, "onButtonHoverOff_background", [imagesControl]);
|
||||
imagesControl.connect("galleryPressed", self, "onImagePressed", [imagesControl]);
|
||||
hBoxContainer.add_child(imagesControl);
|
||||
|
||||
dlcsContainer.add_child(hBoxContainer);
|
||||
|
||||
for i in paginationContainer.get_child_count():
|
||||
var button = paginationContainer.get_child(i);
|
||||
if i == page:
|
||||
button.disabled = true;
|
||||
button._on_Button_mouse_entered();
|
||||
else :
|
||||
button.disabled = false;
|
||||
button._on_Button_mouse_exited();
|
||||
|
||||
func onImagePressed(control):
|
||||
if not isLoading:
|
||||
onButtonHoverOff_background(control)
|
||||
LoadToBigView(control);
|
||||
|
||||
func _input(ev):
|
||||
if ev is InputEventKey and ev.scancode == KEY_ESCAPE and ev.pressed == false:
|
||||
if $BigViewBackgroundsImages.visible:
|
||||
_on_BackRoot_pressed();
|
||||
else :
|
||||
_on_BackToMenu_pressed();
|
||||
|
||||
func _on_BackToMenu_pressed():
|
||||
if isLoading:
|
||||
return ;
|
||||
|
||||
|
||||
|
||||
if menuMusicRestart:
|
||||
get_tree().root.get_node("BgmScene").StartMenuMusic();
|
||||
|
||||
if not SceneLoader.is_connected("on_scene_loaded", self, "MenuLoaded"):
|
||||
SceneLoader.connect("on_scene_loaded", self, "MenuLoaded");
|
||||
SceneLoader.load_scene("res://scenes/MainMenu.tscn")
|
||||
|
||||
func MenuLoaded(obj):
|
||||
if obj.path != "res://scenes/MainMenu.tscn":
|
||||
return ;
|
||||
|
||||
if obj.instance != null:
|
||||
get_tree().root.add_child(obj.instance);
|
||||
|
||||
|
||||
for i in get_tree().root.get_children():
|
||||
if i.name == "Gallery":
|
||||
get_tree().root.remove_child(i);
|
||||
break;
|
||||
|
||||
SceneLoader.disconnect("on_scene_loaded", self, "MenuLoaded");
|
||||
|
||||
func _on_BackToMenu_mouse_entered():
|
||||
$UIRoot / CenterContainer / BackToMenu.get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
|
||||
$UIRoot / CenterContainer / BackToMenu.set("custom_colors/font_color", Color(0, 0, 0, 255))
|
||||
|
||||
func _on_BackToMenu_mouse_exited():
|
||||
$UIRoot / CenterContainer / BackToMenu.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
|
||||
$UIRoot / CenterContainer / BackToMenu.set("custom_colors/font_color", Color(213, 55, 29, 255));
|
||||
|
||||
|
||||
|
||||
var thread:Thread;
|
||||
|
||||
func LoadToBigView(control):
|
||||
if thread == null:
|
||||
thread = Thread.new();
|
||||
|
||||
if thread.is_active():
|
||||
return
|
||||
|
||||
var path = str("res://scenes/BackgroundScenes/", control["sceneName"], ".tscn");
|
||||
|
||||
SetLoading(true);
|
||||
thread.start(self, "LoadScene", path, Thread.PRIORITY_HIGH);
|
||||
|
||||
func LoadScene(path:String):
|
||||
var scene = load(path);
|
||||
var instance = scene.instance();
|
||||
call_deferred("async_scene_loaded");
|
||||
return instance;
|
||||
|
||||
func async_scene_loaded():
|
||||
var scene = thread.wait_to_finish();
|
||||
$BigViewBackgroundsImages / SceneContainer.add_child(scene);
|
||||
SetLoading(false);
|
||||
var settings = scene.InitForGallery();
|
||||
|
||||
var isToggle = false;
|
||||
var toggleScenes = ["Podval", "Garaj", "Pistol", "Scene2_1", "Panorama", "Car", "Room_Agatha", "Room_Dana", "Room_Linda", "Room_Martin"];
|
||||
if scene.name in toggleScenes:
|
||||
isToggle = true;
|
||||
|
||||
if settings.size() != 0:
|
||||
for i in settings:
|
||||
var settingsButton = stateButton.instance();
|
||||
var text = tr(i)
|
||||
settingsButton.text = text;
|
||||
if isToggle:
|
||||
settingsButton.toggle_mode = true;
|
||||
settingsButton.connect("pressed", self, "GalleryToggleSettingsPressed", [scene, settingsButton]);
|
||||
else :
|
||||
settingsButton.connect("pressed", self, "GallerySettingsPressed", [scene, text]);
|
||||
$BigViewBackgroundsImages / SettingsContainer.add_child(settingsButton)
|
||||
elif scene.has_method("IsItDLCScene"):
|
||||
var dlcCount = $BigViewBackgroundsImages / DlcCount;
|
||||
var check = $BigViewBackgroundsImages / DlcAutoCheck;
|
||||
var left = $BigViewBackgroundsImages / DlcLeft;
|
||||
var right = $BigViewBackgroundsImages / DlcRight;
|
||||
|
||||
scene.AddCountLabel(dlcCount);
|
||||
|
||||
if check.is_connected("toggled", scene, "AutoPressed"):
|
||||
check.disconnect("toggled", scene, "AutoPressed");
|
||||
check.connect("toggled", scene, "AutoPressed");
|
||||
|
||||
if left.is_connected("pressed", self, "GalleryDlcButtonPressed"):
|
||||
left.disconnect("pressed", self, "GalleryDlcButtonPressed");
|
||||
if right.is_connected("pressed", self, "GalleryDlcButtonPressed"):
|
||||
right.disconnect("pressed", self, "GalleryDlcButtonPressed");
|
||||
left.connect("pressed", self, "GalleryDlcButtonPressed", [scene, "previous"]);
|
||||
right.connect("pressed", self, "GalleryDlcButtonPressed", [scene, "next"]);
|
||||
|
||||
left.visible = true;
|
||||
right.visible = true;
|
||||
dlcCount.visible = true;
|
||||
check.visible = true;
|
||||
$BigViewBackgroundsImages / DLCAutoIcon.visible = true;
|
||||
|
||||
$BigViewBackgroundsImages.visible = true;
|
||||
$Sky.visible = false;
|
||||
$UIRoot.visible = false;
|
||||
$Cloud1.visible = false;
|
||||
$Cloud3.visible = false;
|
||||
$House.visible = false;
|
||||
$Blur.visible = false;
|
||||
|
||||
func GallerySettingsPressed(scene, settings):
|
||||
scene.SetSettings(settings);
|
||||
|
||||
func GalleryToggleSettingsPressed(scene, button):
|
||||
scene.SetToggleSettings(button);
|
||||
|
||||
func GalleryDlcButtonPressed(scene, direciton):
|
||||
if direciton == "previous":
|
||||
scene.ShowPrevious();
|
||||
elif direciton == "next":
|
||||
scene.ShowNext();
|
||||
|
||||
func SetLoading(value:bool):
|
||||
isLoading = value;
|
||||
if value:
|
||||
$Blur.z_index = 1;
|
||||
$Loading.visible = true;
|
||||
else :
|
||||
$Blur.z_index = 0;
|
||||
$Loading.visible = false;
|
||||
|
||||
func _on_SettingsContainer_resized():
|
||||
var settingsContainer = $BigViewBackgroundsImages / SettingsContainer;
|
||||
var width = settingsContainer.rect_size.x;
|
||||
if width != 0:
|
||||
settingsContainer.rect_global_position = Vector2(1920 - settingsContainer.rect_size.x - 50, 540 - settingsContainer.rect_size.y / 2)
|
||||
|
||||
func _on_BackRoot_pressed():
|
||||
for i in $BigViewBackgroundsImages / SceneContainer.get_children():
|
||||
$BigViewBackgroundsImages / SceneContainer.remove_child(i);
|
||||
for i in $BigViewBackgroundsImages / SettingsContainer.get_children():
|
||||
$BigViewBackgroundsImages / SettingsContainer.remove_child(i)
|
||||
|
||||
$BigViewBackgroundsImages / SettingsContainer.rect_size = Vector2(0, 0);
|
||||
|
||||
$BigViewBackgroundsImages.visible = false;
|
||||
$UIRoot.visible = true;
|
||||
$Sky.visible = true;
|
||||
$Cloud1.visible = true;
|
||||
$Cloud3.visible = true;
|
||||
$House.visible = true;
|
||||
$Blur.visible = true;
|
||||
$BigViewBackgroundsImages / DlcCount.visible = false;
|
||||
$BigViewBackgroundsImages / DlcAutoCheck.visible = false;
|
||||
$BigViewBackgroundsImages / DLCAutoIcon.visible = false;
|
||||
$BigViewBackgroundsImages / DlcLeft.visible = false;
|
||||
$BigViewBackgroundsImages / DlcRight.visible = false;
|
||||
|
||||
_on_BackRoot_mouse_exited();
|
||||
|
||||
var iconPressed:bool = false;
|
||||
var iconHover:bool = false;
|
||||
onready var checkIcon = $BigViewBackgroundsImages / DLCAutoIcon as TextureRect;
|
||||
onready var nonHoverNonPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward.webp");
|
||||
onready var hoverNonPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward_lighted.webp");
|
||||
onready var nonHoverPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward_pressed.webp");
|
||||
onready var hoverPressedCheckIcon = preload("res://resources/graphics/GUI/InGameMenu/forward_pressed_lighted.webp");
|
||||
|
||||
func _on_DlcAutoCheck_toggled(button_pressed):
|
||||
iconPressed = button_pressed;
|
||||
UpdateCheckIcon()
|
||||
|
||||
func _on_DlcAutoCheck_mouse_entered():
|
||||
iconHover = true;
|
||||
UpdateCheckIcon()
|
||||
|
||||
func _on_DlcAutoCheck_mouse_exited():
|
||||
iconHover = false;
|
||||
UpdateCheckIcon()
|
||||
|
||||
func UpdateCheckIcon():
|
||||
var offsetIcon:bool = true;
|
||||
|
||||
if iconPressed and iconHover:
|
||||
checkIcon.texture = hoverPressedCheckIcon;
|
||||
elif iconPressed and not iconHover:
|
||||
checkIcon.texture = nonHoverPressedCheckIcon;
|
||||
elif not iconPressed and iconHover:
|
||||
checkIcon.texture = hoverNonPressedCheckIcon;
|
||||
elif not iconPressed and not iconHover:
|
||||
checkIcon.texture = nonHoverNonPressedCheckIcon;
|
||||
offsetIcon = false;
|
||||
|
||||
if offsetIcon:
|
||||
checkIcon.rect_position = Vector2(1020, 2);
|
||||
else :
|
||||
checkIcon.rect_position = Vector2(1028, 10);
|
||||
|
||||
func _on_BackRoot_mouse_entered():
|
||||
$BigViewBackgroundsImages / BackRoot.get("custom_fonts/font").outline_color = Color(213, 55, 29, 255)
|
||||
$BigViewBackgroundsImages / BackRoot.set("custom_colors/font_color", Color(0, 0, 0, 255))
|
||||
|
||||
|
||||
func _on_BackRoot_mouse_exited():
|
||||
$BigViewBackgroundsImages / BackRoot.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255)
|
||||
$BigViewBackgroundsImages / BackRoot.set("custom_colors/font_color", Color(213, 55, 29, 255));
|
||||
|
||||
func _exit_tree():
|
||||
if thread != null and thread.is_active():
|
||||
var _temp = thread.wait_to_finish();
|
||||
|
||||
|
||||
var state:int = 0;
|
||||
var controls:Array = [];
|
||||
onready var tween = $BigViewBackgroundsImages / Tween;
|
||||
|
||||
func _on_TextureButton_mouse_entered():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
controls = [
|
||||
$BigViewBackgroundsImages / FullView,
|
||||
$BigViewBackgroundsImages / BackRoot,
|
||||
$BigViewBackgroundsImages / SettingsContainer,
|
||||
$BigViewBackgroundsImages / DlcCount,
|
||||
$BigViewBackgroundsImages / DlcAutoCheck,
|
||||
$BigViewBackgroundsImages / DLCAutoIcon,
|
||||
$BigViewBackgroundsImages / DlcLeft,
|
||||
$BigViewBackgroundsImages / DlcRight
|
||||
];
|
||||
StartTween(1);
|
||||
|
||||
func _on_TextureButton_mouse_exited():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
controls = [
|
||||
$BigViewBackgroundsImages / FullView,
|
||||
$BigViewBackgroundsImages / BackRoot,
|
||||
$BigViewBackgroundsImages / SettingsContainer,
|
||||
$BigViewBackgroundsImages / DlcCount,
|
||||
$BigViewBackgroundsImages / DlcAutoCheck,
|
||||
$BigViewBackgroundsImages / DLCAutoIcon,
|
||||
$BigViewBackgroundsImages / DlcLeft,
|
||||
$BigViewBackgroundsImages / DlcRight
|
||||
];
|
||||
StartTween(2);
|
||||
|
||||
func StartTween(value):
|
||||
if (state == 1 and value == 2) or (state == 2 and value == 1):
|
||||
tween.remove_all();
|
||||
|
||||
state = value;
|
||||
|
||||
var modulateValue = Color(1, 1, 1, 1);
|
||||
if state == 1:
|
||||
modulateValue = Color(1, 1, 1, 0);
|
||||
|
||||
for i in controls:
|
||||
tween.interpolate_property(i, "modulate", i.modulate, modulateValue, 0.2, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT, 0)
|
||||
tween.start()
|
||||
|
||||
func _on_Tween_tween_all_completed():
|
||||
state = 0;
|
Loading…
Add table
Add a link
Reference in a new issue