Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
170
scripts/AlternativeChoices/Timeline_17.gd
Normal file
170
scripts/AlternativeChoices/Timeline_17.gd
Normal file
|
@ -0,0 +1,170 @@
|
|||
extends Node
|
||||
|
||||
var twoGirls;
|
||||
|
||||
signal endOfChoice;
|
||||
|
||||
const imagesBackgroupLoading:String = "res://resources/customControls/Timeline_17_Images/Images.tscn";
|
||||
|
||||
var previousImage:TextureRect = null;
|
||||
var currentImage:TextureRect = null;
|
||||
|
||||
func _ready():
|
||||
PrepareTextures();
|
||||
Localization();
|
||||
SetHover()
|
||||
ChechVariables();
|
||||
|
||||
func PrepareTextures():
|
||||
var _temp = SceneLoader.connect("on_scene_loaded", self, "LoadTextures")
|
||||
SceneLoader.load_scene(imagesBackgroupLoading);
|
||||
|
||||
func LoadTextures(obj):
|
||||
if obj.path != imagesBackgroupLoading:
|
||||
return ;
|
||||
|
||||
var scene = obj.instance;
|
||||
var array:Array = scene.GetTextures();
|
||||
for i in $Girls.get_child_count():
|
||||
var image:TextureRect = $Girls.get_child(i);
|
||||
image.texture = array[i];
|
||||
scene.queue_free()
|
||||
|
||||
SceneLoader.disconnect("on_scene_loaded", self, "LoadTextures")
|
||||
|
||||
|
||||
var buttons = $Buttons.get_children();
|
||||
for i in buttons:
|
||||
i.disabled = false;
|
||||
|
||||
func Localization():
|
||||
$Buttons / Pink.text = tr("ui_name_pink").to_upper();
|
||||
$Buttons / Purple.text = tr("ui_name_purple").to_upper();
|
||||
$Buttons / Green.text = tr("ui_name_green").to_upper();
|
||||
$Buttons / Black.text = tr("ui_name_black").to_upper();
|
||||
$Buttons / Blue.text = tr("ui_name_blue_f").to_upper();
|
||||
$Buttons / Orange.text = tr("choice109.2").to_upper();
|
||||
$Buttons / Guys.text = tr("choice109.1").to_upper();
|
||||
|
||||
func SetHover():
|
||||
var hover = [
|
||||
{"button":$Buttons / Pink, "texture":$Girls / Pink},
|
||||
{"button":$Buttons / Purple, "texture":$Girls / Purple},
|
||||
{"button":$Buttons / Green, "texture":$Girls / Green},
|
||||
{"button":$Buttons / Black, "texture":$Girls / Black},
|
||||
{"button":$Buttons / Blue, "texture":$Girls / Blue},
|
||||
{"button":$Buttons / Orange, "texture":$Girls / Orange},
|
||||
]
|
||||
|
||||
for i in hover:
|
||||
i["button"].connect("mouse_entered", self, "onButtonHoverOn", [i["button"], i["texture"]]);
|
||||
i["button"].connect("mouse_exited", self, "onButtonHoverOff", [i["button"]]);
|
||||
|
||||
func onButtonHoverOn(button, texture):
|
||||
if not CheckHover():return
|
||||
button.get("custom_fonts/font").outline_color = Color(255, 255, 255, 255);
|
||||
button.set("custom_colors/font_color", Color(0, 0, 0, 255));
|
||||
|
||||
for i in $Girls.get_children():
|
||||
if i == texture:
|
||||
continue;
|
||||
i.modulate = Color(1, 1, 1, 0);
|
||||
|
||||
if currentImage != texture:
|
||||
currentImage = texture;
|
||||
texture.modulate = Color(1, 1, 1, 1);
|
||||
|
||||
if previousImage != texture and previousImage != null:
|
||||
previousImage.modulate = Color(1, 1, 1, 0);
|
||||
|
||||
func onButtonHoverOff(button):
|
||||
if not CheckHover():return
|
||||
button.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255);
|
||||
button.set("custom_colors/font_color", Color(255, 255, 255, 255));
|
||||
|
||||
previousImage = currentImage;
|
||||
|
||||
func _on_Guys_mouse_entered():
|
||||
$Buttons / Guys.get("custom_fonts/font").outline_color = Color(255, 255, 255, 255);
|
||||
$Buttons / Guys.set("custom_colors/font_color", Color(255, 0, 0, 255));
|
||||
|
||||
currentImage = null;
|
||||
previousImage = null;
|
||||
|
||||
for i in $Girls.get_children():
|
||||
i.modulate = Color(1, 1, 1, 0);
|
||||
|
||||
func _on_Guys_mouse_exited():
|
||||
$Buttons / Guys.get("custom_fonts/font").outline_color = Color(0, 0, 0, 255);
|
||||
$Buttons / Guys.set("custom_colors/font_color", Color(255, 255, 255, 255));
|
||||
|
||||
func ChechVariables():
|
||||
twoGirls = int(Dialogic.get_variable("TwoGirls"));
|
||||
|
||||
if twoGirls == 0:
|
||||
|
||||
for i in $Buttons.get_children():
|
||||
i.visible = true;
|
||||
elif twoGirls == 2:
|
||||
|
||||
$Buttons / Pink.visible = int(Dialogic.get_variable("Pink_Karma")) >= 5;
|
||||
$Buttons / Purple.visible = int(Dialogic.get_variable("Purple_Karma")) >= 5;
|
||||
$Buttons / Green.visible = int(Dialogic.get_variable("Green_Karma")) >= 5;
|
||||
$Buttons / Black.visible = int(Dialogic.get_variable("Black_Karma")) >= 5;
|
||||
$Buttons / Blue.visible = int(Dialogic.get_variable("Blue_F_Karma")) >= 5;
|
||||
|
||||
var buttons = $Buttons.get_children();
|
||||
for i in buttons:
|
||||
i.disabled = true;
|
||||
|
||||
func _on_Pink_button_up():
|
||||
if not CheckHover():return
|
||||
Dialogic.set_variable("Chosen_Girl", "Pink");
|
||||
Dialogic.set_variable("ChosenAlibi", "Pink");
|
||||
EndOfChoice();
|
||||
|
||||
func _on_Purple_button_up():
|
||||
if not CheckHover():return
|
||||
Dialogic.set_variable("Chosen_Girl", "Purple");
|
||||
Dialogic.set_variable("ChosenAlibi", "Purple");
|
||||
EndOfChoice();
|
||||
|
||||
func _on_Green_button_up():
|
||||
if not CheckHover():return
|
||||
Dialogic.set_variable("Chosen_Girl", "Green");
|
||||
Dialogic.set_variable("ChosenAlibi", "Green");
|
||||
EndOfChoice();
|
||||
|
||||
func _on_Black_button_up():
|
||||
if not CheckHover():return
|
||||
Dialogic.set_variable("Chosen_Girl", "Black");
|
||||
Dialogic.set_variable("ChosenAlibi", "Black");
|
||||
EndOfChoice();
|
||||
|
||||
func _on_Blue_button_up():
|
||||
if not CheckHover():return
|
||||
Dialogic.set_variable("Chosen_Girl", "Blue");
|
||||
Dialogic.set_variable("ChosenAlibi", "Blue");
|
||||
EndOfChoice();
|
||||
|
||||
func _on_Orange_button_up():
|
||||
if not CheckHover():return
|
||||
Dialogic.set_variable("Chosen_Girl", "Loser");
|
||||
var game = get_tree().root.get_node("Root/GameLogic");
|
||||
game.after17result = "Bar";
|
||||
EndOfChoice();
|
||||
|
||||
func _on_Guys_button_up():
|
||||
if not CheckHover():return
|
||||
Dialogic.set_variable("Chosen_Girl", "Loser");
|
||||
var game = get_tree().root.get_node("Root/GameLogic");
|
||||
game.after17result = "Guys";
|
||||
EndOfChoice();
|
||||
|
||||
func CheckHover()->bool:
|
||||
return not (get_tree().root.get_node("Root").isMenuVisible or get_tree().root.get_node("Root").isSaveLoadVisible)
|
||||
|
||||
func EndOfChoice():
|
||||
emit_signal("endOfChoice");
|
||||
for i in $Girls.get_children():
|
||||
i.queue_free();
|
Loading…
Add table
Add a link
Reference in a new issue