Compare commits
No commits in common. "454839f20ac3bb7774ae841f0dcf75c36266608b" and "8fad1b60df70e82bb3c6303e9a4f1e4143e2333d" have entirely different histories.
454839f20a
...
8fad1b60df
|
|
@ -19,14 +19,14 @@ var max_lines: float = 0
|
|||
set(value):
|
||||
progress = value
|
||||
if is_node_ready() and not all_text_revealed:
|
||||
var start_index := 0
|
||||
var start_index = 0
|
||||
if progress >= substring_sizes.size() or progress < 0:
|
||||
label.visible_ratio = 1
|
||||
elif progress > 0:
|
||||
for i in range(min(progress, substring_sizes.size()-1) as int) if progress > 0 else range(substring_sizes.size()-1):
|
||||
start_index += substring_sizes[i]
|
||||
|
||||
label.visible_characters = start_index + int(substring_sizes[min(progress as int, substring_sizes.size()-1)] * fmod(progress, 1))
|
||||
label.visible_characters = start_index + substring_sizes[min(progress as int, substring_sizes.size()-1)] * fmod(progress, 1)
|
||||
else:
|
||||
label.visible_ratio = 0
|
||||
|
||||
|
|
@ -94,14 +94,14 @@ func _rebuild():
|
|||
max_lines = float(label.get_line_count())
|
||||
|
||||
func try_scroll():
|
||||
var forward_target: float
|
||||
var forward_target: int
|
||||
|
||||
#print( "max lines: " + str(max_lines))
|
||||
#print( "current lines: " + str(label.get_character_line(label.visible_characters)))
|
||||
#print_debug( "max lines: " + str(max_lines))
|
||||
#print_debug( "current lines: " + str(label.get_character_line(label.visible_characters)))
|
||||
|
||||
var visible_ratio: float = float(label.get_character_line(label.visible_characters)) / max_lines
|
||||
|
||||
#print("Tried scrolling with ratio of %f. Comparing %f against %f" % [visible_ratio, label.size.y * visible_ratio - scroll_container.scroll_vertical, scroll_container.size.y * 0.9])
|
||||
#print_debug("Tried scrolling with ratio of %f. Comparing %f against %f" % [visible_ratio, label.size.y * visible_ratio - scroll_container.scroll_vertical, scroll_container.size.y * 0.9])
|
||||
|
||||
if label.size.y * visible_ratio + scroll_container.scroll_vertical > scroll_container.size.y * 0.9:
|
||||
if scroll_container.scroll_vertical + scroll_container.size.y * 0.9 < label.size.y:
|
||||
|
|
@ -109,7 +109,7 @@ func try_scroll():
|
|||
else:
|
||||
forward_target = label.size.y - scroll_container.size.y
|
||||
if scroll_target != null:
|
||||
#var tween: Tween = get_tree().create_tween()
|
||||
var tween: Tween = get_tree().create_tween()
|
||||
##tween.set_trans()
|
||||
scroll_target = forward_target
|
||||
|
||||
|
|
@ -150,18 +150,18 @@ func play_scene():
|
|||
finished.emit()
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
var just_revealed_text := false
|
||||
var just_revealed_text = false
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
scroll_target += 40
|
||||
if not all_text_revealed:
|
||||
just_revealed_text = true
|
||||
if not all_text_revealed: just_revealed_text
|
||||
all_text_revealed = true
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
scroll_target -= 40
|
||||
if not all_text_revealed:
|
||||
just_revealed_text = true
|
||||
if just_revealed_text and animation_complete:
|
||||
all_text_revealed = true
|
||||
if not all_text_revealed: just_revealed_text
|
||||
all_text_revealed = true
|
||||
if just_revealed_text:
|
||||
if animation_complete: all_text_revealed = true
|
||||
|
||||
var scroll_target: float = 0:
|
||||
set(value):
|
||||
|
|
@ -170,7 +170,7 @@ func _process(delta: float) -> void:
|
|||
# FIXME: maybe change this to has stage?
|
||||
if visible and not Engine.is_editor_hint():
|
||||
if scroll_container.scroll_vertical != scroll_target:
|
||||
scroll_container.scroll_vertical += int((scroll_target-scroll_container.scroll_vertical)*delta*6)
|
||||
scroll_container.scroll_vertical += (scroll_target-scroll_container.scroll_vertical)*delta*6
|
||||
|
||||
var intro_triggered:= false
|
||||
func trigger_intro():
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=136 format=4 uid="uid://b3b0gyvklqn50"]
|
||||
[gd_scene load_steps=137 format=4 uid="uid://b3b0gyvklqn50"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsop46tqngddc" path="res://base-environments/youth_room/youth_room.gd" id="1_aitp0"]
|
||||
[ext_resource type="Script" uid="uid://belkrno67sft0" path="youth_room.gd" id="1_aitp0"]
|
||||
[ext_resource type="AudioStream" uid="uid://1h6k2d8q1kw3" path="res://base-environments/youth_room/import/sounds/rain_on_window.mp3" id="2_3haaq"]
|
||||
[ext_resource type="Resource" uid="uid://bgplfqxa852wo" path="res://dev-util/debug_save.tres" id="2_h6j14"]
|
||||
[ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="3_foj4y"]
|
||||
[ext_resource type="AudioStream" uid="uid://bbpo1hu35yer8" path="res://base-environments/youth_room/import/sounds/thunder.mp3" id="3_wcypa"]
|
||||
[ext_resource type="Script" uid="uid://c281w7earok6w" path="res://base-environments/youth_room/crouch_volume.gd" id="3_x3dlb"]
|
||||
|
|
@ -1732,11 +1733,11 @@ script/source = "extends Camera3D
|
|||
var camera: Camera3D
|
||||
|
||||
func _ready():
|
||||
camera = get_tree().root.get_viewport().get_camera_3d()
|
||||
camera = get_tree().root.get_viewport().get_camera_3d()
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
self.global_transform = camera.global_transform
|
||||
func _process(delta):
|
||||
self.global_transform = camera.global_transform
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_icgq0"]
|
||||
|
|
@ -1757,6 +1758,7 @@ func hide():
|
|||
[node name="youth room" type="Node3D" groups=["serializable"]]
|
||||
process_mode = 1
|
||||
script = ExtResource("1_aitp0")
|
||||
save_game = ExtResource("2_h6j14")
|
||||
|
||||
[node name="logic" type="Node3D" parent="."]
|
||||
|
||||
|
|
|
|||
|
|
@ -266,10 +266,9 @@ func _input(event:InputEvent):
|
|||
else:
|
||||
crouch_toggled = true
|
||||
|
||||
func play_scene(_id: int, _repeat: bool):
|
||||
pass
|
||||
#if id == Scenes.id.YOUTH_DRAEVEN:
|
||||
# var rotation_tween := create_tween()
|
||||
func play_scene(id: int, _repeat):
|
||||
if id == Scenes.id.YOUTH_DRAEVEN:
|
||||
var rotation_tween = create_tween()
|
||||
|
||||
func scene_finished(_id, repeat: bool):
|
||||
if repeat:
|
||||
|
|
|
|||
Loading…
Reference in New Issue