Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
81
scripts/Investigations/InvestigationBase.gd
Normal file
81
scripts/Investigations/InvestigationBase.gd
Normal file
|
@ -0,0 +1,81 @@
|
|||
extends Control
|
||||
|
||||
signal endOfInvestigation;
|
||||
|
||||
var cluesFound = [];
|
||||
|
||||
var IsNormalDifficulty;
|
||||
var cluesToFind = 0;
|
||||
|
||||
var isHovering;
|
||||
|
||||
var kekDelta = 0.0;
|
||||
var shaderValue = 0.0;
|
||||
var isRising;
|
||||
|
||||
var defaultCursor = preload("res://resources/cursors/arrow2.webp");
|
||||
var lendsCursor = preload("res://resources/cursors/magnifier2.webp");
|
||||
|
||||
func _ready():
|
||||
if Dialogic.get_variable("EasyMode") == "0":
|
||||
cluesToFind = 3;
|
||||
else :
|
||||
cluesToFind = 5;
|
||||
|
||||
InitClues();
|
||||
|
||||
func InitClues():
|
||||
pass
|
||||
|
||||
func EndInvestigationLoop(code):
|
||||
if cluesFound.size() == cluesToFind:
|
||||
Dialogic.set_variable("IsLastClue", "1");
|
||||
elif cluesFound.size() == cluesToFind:
|
||||
Dialogic.set_variable("IsLastClue", "1");
|
||||
else :
|
||||
Dialogic.set_variable("IsLastClue", "0");
|
||||
|
||||
Dialogic.set_variable("PreviousTimelineChoice", code);
|
||||
emit_signal("endOfInvestigation");
|
||||
|
||||
func onButtonHoverOn(button):
|
||||
if CheckHover():
|
||||
Input.set_custom_mouse_cursor(lendsCursor, Input.CURSOR_ARROW, Vector2(19, 19))
|
||||
button.material.set_shader_param("mixing", 0.15);
|
||||
isHovering = true;
|
||||
|
||||
func onButtonHoverOff(button):
|
||||
if CheckHover():
|
||||
Input.set_custom_mouse_cursor(defaultCursor)
|
||||
button.material.set_shader_param("mixing", 0.0);
|
||||
isHovering = false;
|
||||
|
||||
func CheckHover()->bool:
|
||||
return not (get_tree().root.get_node("Root").isMenuVisible or get_tree().root.get_node("Root").isSaveLoadVisible)
|
||||
|
||||
func _process(delta):
|
||||
if IsNormalDifficulty:
|
||||
return ;
|
||||
|
||||
if isHovering:
|
||||
return ;
|
||||
|
||||
kekDelta += delta;
|
||||
if kekDelta > 0.2:
|
||||
kekDelta = 0;
|
||||
|
||||
if shaderValue <= 0.0:
|
||||
isRising = true
|
||||
|
||||
if shaderValue >= 0.13:
|
||||
isRising = false;
|
||||
|
||||
if isRising:
|
||||
shaderValue += 0.005;
|
||||
else :
|
||||
shaderValue -= 0.005;
|
||||
|
||||
for i in $Clues.get_children():
|
||||
i.material.set_shader_param("mixing", shaderValue);
|
||||
else :
|
||||
kekDelta += delta;
|
Loading…
Add table
Add a link
Reference in a new issue