Compare commits

...

4 Commits

19 changed files with 2991 additions and 222 deletions

View File

@ -20,20 +20,46 @@ var cards : Array[Card] = []
var board_was_completed: bool = false var board_was_completed: bool = false
var current_context : int = NAVIGATE var current_context : Context = Context.NAVIGATE
var selection_state : SelectionState var selection_state : SelectionState
var last_card_selected: Card
var last_note_selected: StickyNote
var selection: Draggable = null:
set(value):
if selection == value: return
if selection:
if selection is Card:
last_card_selected = selection
elif selection is StickyNote:
last_note_selected = selection
# Select & highlight new
if selection: selection.highlighted = false
selection = value
if selection: selection.highlighted = true
# Are we selecting cards or stickies?
if selection is Card:
selection_state = SelectionState.CARDS
if current_context == Context.ASSIGN:
selection.preview_sticky_note(last_note_selected)
if selection is StickyNote:
selection_state = SelectionState.STICKIES
#@onready var instructions := $instructions_panel/HBoxContainer/cards_remaining #@onready var instructions := $instructions_panel/HBoxContainer/cards_remaining
@onready var dropzone : Control = %CardZone @onready var dropzone : Control = %CardZone
@onready var notezone : Control = %NoteZone @onready var sideboard : SideBoard = %SideBoard
enum SelectionState {FREE,STICKIES,CARDS} enum SelectionState {FREE,STICKIES,CARDS}
enum {NAVIGATE, ASSIGN, DRAG} enum Context {NAVIGATE, ASSIGN, DRAG}
func _ready() -> void: func _ready() -> void:
prints("card-board.gd:", "_ready()", self, "room:", State.room, owner) prints("card-board.gd:", "_ready()", self, "room:", State.active_room, owner)
super._ready() super._ready()
_delayed_ready.call_deferred() _delayed_ready.call_deferred()
@ -42,9 +68,10 @@ func _ready() -> void:
# We need to wait for our room further up our parent hierarchy to actually make itself known # We need to wait for our room further up our parent hierarchy to actually make itself known
# for interactables to do things with it, e.g. CardBoard needs to register itself # for interactables to do things with it, e.g. CardBoard needs to register itself
func _delayed_ready() ->void: func _delayed_ready() ->void:
var board_room := State.room as RoomWithBoard var board_room := State.active_room as RoomWithBoard
assert(board_room, "CardBoard spawned in room that's not a RoomWithboard.") if not get_tree().root == get_parent():
board_room.card_board = self assert(board_room, "CardBoard spawned in room that's not a RoomWithboard.")
board_room.card_board = self
is_memory_board = is_memory_board is_memory_board = is_memory_board
@ -75,23 +102,6 @@ var mementos_collected: int = 0:
mementos_collected = mementos mementos_collected = mementos
var selection: Draggable = null:
set(value):
if selection == value: return
# Select & highlight new
if selection: selection.highlighted = false
selection = value
if selection: selection.highlighted = true
# Are we selecting cards or stickies?
if selection is Card:
selection_state = SelectionState.CARDS
if selection is StickyNote:
selection_state = SelectionState.STICKIES
func _navigate_next(): func _navigate_next():
var candidates := _selection_candidates var candidates := _selection_candidates
var index := maxi(0, candidates.find(selection)) var index := maxi(0, candidates.find(selection))
@ -111,34 +121,6 @@ func _smooth(current: Vector2, goal: Vector2, delta: float) -> Vector2:
return (k) * current + (1.0-k) * goal return (k) * current + (1.0-k) * goal
func _process(delta: float):
var zone_position := Vector2(notezone.get_screen_position().x + sticky_width / 3.0, sticky_height)
var dragging := notes.any(func (n : Draggable): return n.is_dragged)
if dragging:
# Y-sort the nodes, this lets us fill the gap more nicely.
notes.sort_custom(func (a:Draggable, b:Draggable): return a.global_position.y < b.global_position.y)
for note in notes:
# Skip all dragged and already attached notes
if note.is_attached: continue
if note.is_dragged: continue
# Magnetically move all notes to where they ought to be on screen
note.home = zone_position
zone_position.y += sticky_height
# Only if not already in transit / animated or user holding on to one
if not dragging and not note.tween:
note.animate_home()
else:
# do adjustment with FIR filter
note.position = _smooth(note.position, note.home, delta)
note.z_index = 0
func _check_completion() -> void: func _check_completion() -> void:
if is_board_complete(): if is_board_complete():
board_was_completed = true board_was_completed = true
@ -148,7 +130,7 @@ func _check_completion() -> void:
## Finalizes board state before closing (ends drags, cleans up transitions) ## Finalizes board state before closing (ends drags, cleans up transitions)
func _finalize_board_state() -> void: func _finalize_board_state() -> void:
# End any active drag operations # End any active drag operations
if current_context == DRAG: if current_context == Context.DRAG:
_end_drag(selection) _end_drag(selection)
for item in notes: for item in notes:
item.is_dragged = false item.is_dragged = false
@ -157,7 +139,7 @@ func _finalize_board_state() -> void:
item.is_dragged = false item.is_dragged = false
# Reset context to NAVIGATE # Reset context to NAVIGATE
current_context = NAVIGATE current_context = Context.NAVIGATE
print("CardBoard: Board state finalized") print("CardBoard: Board state finalized")
@ -181,8 +163,8 @@ func populate_board(names: Array[StringName]):
for new_card: Card in all_new["cards"]: for new_card: Card in all_new["cards"]:
add_card(new_card) add_card(new_card)
for new_sticky_note: StickyNote in all_new["sticky_notes"]:
add_note(new_sticky_note) notes += sideboard.populate(all_new["sticky_notes"])
# FIXME: This can be made even simpler. # FIXME: This can be made even simpler.
@ -243,14 +225,14 @@ func add_note(note: StickyNote) -> void:
note.is_draggable = true note.is_draggable = true
func appear(): func appear():
await Main.curtain.close() #await Main.curtain.close()
show() show()
await Main.curtain.open() #await Main.curtain.open()
func vanish(): func vanish():
await Main.curtain.close() #await Main.curtain.close()
hide() hide()
await Main.curtain.open() #await Main.curtain.open()
# Called by notes when a mouse event needs handling # Called by notes when a mouse event needs handling
@ -265,13 +247,15 @@ func handle_mouse_button(input: InputEventMouseButton, target: Draggable) -> voi
_end_drag(target) _end_drag(target)
return return
var parent_before_drag: Node
## Starts a drag operation for the given draggable ## Starts a drag operation for the given draggable
func _start_drag(draggable: Draggable) -> void: func _start_drag(draggable: Draggable) -> void:
parent_before_drag = draggable.get_parent()
selection = draggable selection = draggable
current_context = DRAG current_context = Context.DRAG
var mouse_offset := get_viewport().get_mouse_position() - draggable.global_position var mouse_offset := get_viewport().get_mouse_position() - draggable.global_position
draggable.start_drag(mouse_offset) draggable.start_drag(mouse_offset)
draggable.reparent(self)
## Ends a drag operation and handles the drop ## Ends a drag operation and handles the drop
@ -279,26 +263,30 @@ func _end_drag(draggable: Draggable) -> void:
selection = draggable selection = draggable
# Cleanup and state update # Cleanup and state update
current_context = NAVIGATE current_context = Context.NAVIGATE
var destination := draggable.end_drag() var destination := draggable.end_drag()
if destination:
if destination is Card:
# If dropped on a card, attach it
if draggable is StickyNote:
destination.attach_or_exchange_note(draggable)
elif destination is SideBoundary:
if not sideboard.accept_drop(draggable):
#FIXME remove if handle_drop and can_accept_drop is properly implemented.
destination = null
# If dropped on board (no destination), ensure it's a child of the board
if not destination:
if draggable is StickyNote:
reclaim_sticky(draggable)
# Handle sticky note drops # Check win condition after any sticky movement
if draggable is StickyNote: check_board_completion()
var sticky := draggable as StickyNote
# If dropped on a card, attach it parent_before_drag = null
if destination and destination is Card:
var target_card := destination as Card
target_card.attach_or_exchange_note(sticky)
# If dropped on board (no destination), ensure it's a child of the board
elif not destination:
if sticky.is_attached:
reclaim_sticky(sticky)
# Check win condition after any sticky movement
check_board_completion()
func reclaim_sticky(note: StickyNote): func reclaim_sticky(note: StickyNote):
@ -384,8 +372,6 @@ func _nearest_hovered(candidates: Array[Draggable]) -> Draggable:
return null return null
func _by_spatial(a: Draggable, b: Draggable) -> bool: func _by_spatial(a: Draggable, b: Draggable) -> bool:
return a.position.x + a.position.y * 10000 > b.position.x + b.position.y * 10000 return a.position.x + a.position.y * 10000 > b.position.x + b.position.y * 10000
@ -408,6 +394,7 @@ func _sort_by_positions() -> void:
func can_accept_drop(draggable: Draggable) -> bool: func can_accept_drop(draggable: Draggable) -> bool:
return draggable is Card or draggable is StickyNote return draggable is Card or draggable is StickyNote
# FIXME: this function seems to not be used.
## Handles dropping a draggable onto the board (into the dropzone) ## Handles dropping a draggable onto the board (into the dropzone)
func handle_drop(draggable: Draggable) -> int: func handle_drop(draggable: Draggable) -> int:
if not can_accept_drop(draggable): if not can_accept_drop(draggable):
@ -423,12 +410,49 @@ func _perform(action : StringName) -> void:
# Takes the inputs for control inputs # Takes the inputs for control inputs
func _input(event : InputEvent) -> void: func _input(event : InputEvent) -> void:
if selection and not selection.is_dragged and event is InputEventMouseMotion and not event.is_action_pressed("mouse_left"): # trying to not do the double check on the line below.
var is_mouse_left:= false
if event is InputEventMouseButton:
is_mouse_left = event.button_index == MOUSE_BUTTON_LEFT
if selection and not selection.is_dragged and event is InputEventMouseMotion and not is_mouse_left:
var candidate := _nearest_hovered(_sort_by_proximity_and_depth(notes)) var candidate := _nearest_hovered(_sort_by_proximity_and_depth(notes))
if not candidate: if not candidate:
candidate = _nearest_hovered(_sort_by_proximity_and_depth(cards)) candidate = _nearest_hovered(_sort_by_proximity_and_depth(cards))
selection = candidate selection = candidate
if event.is_action_pressed("ui_left"):
_handle_direction_input(Vector2.LEFT)
if event.is_action_pressed("ui_right"):
_handle_direction_input(Vector2.RIGHT)
if event.is_action_pressed("ui_up"):
_handle_direction_input(Vector2.UP)
if event.is_action_pressed("ui_down"):
_handle_direction_input(Vector2.DOWN)
#TODO: make this work with the prompter once more.
if event.is_action_pressed("ui_cancel"):
get_viewport().set_input_as_handled()
closed.emit()
func _handle_direction_input(direction: Vector2):
if current_context == Context.NAVIGATE and _assure_selection():
try_select_nearest_card(selection.global_position, direction, (current_context != Context.ASSIGN))
func _assure_selection() -> bool:
if selection:
return true
else:
if selection_state == SelectionState.STICKIES or selection_state == SelectionState.FREE:
if dropzone.get_child_count() > 0:
selection = dropzone.get_child(0)
return true
## Attempting to still select a Card if no sticky could be found.
if sideboard.get_child_count() > 0:
selection = sideboard.get_child(0)
return true
return false
## Saves board state directly to SaveGame resource ## Saves board state directly to SaveGame resource
func save_to_resource(savegame: SaveGame) -> void: func save_to_resource(savegame: SaveGame) -> void:
@ -572,3 +596,65 @@ func _debug_mode() -> void:
populate_board(["c_out_of_world", 'c_confusion', "p_outer_conflict", "p_unique"]) populate_board(["c_out_of_world", 'c_confusion', "p_outer_conflict", "p_unique"])
await get_tree().process_frame await get_tree().process_frame
play() play()
func try_select_nearest_card(from: Vector2, towards: Vector2, include_stickies: bool = false) -> bool:
var selection_transform = Transform2D(0, from).looking_at(from+towards)
var scores: Dictionary[int, Area2D] = {-1: null}
for child:Area2D in dropzone.get_children():
if not (child is StickyNote and include_stickies):
scores[get_distance_score(child.global_position, selection_transform)] = child
scores.erase(-1)
scores.sort()
if include_stickies:
var panel_scores: Dictionary[int, Control] = {-1: null}
for child:Control in sideboard.get_children():
if not child.is_empty():
panel_scores[get_distance_score(child.attached_sticky_note.global_position, selection_transform)] = child
panel_scores.erase(-1)
panel_scores.sort()
if panel_scores != {}:
if scores != {}:
if panel_scores.keys()[0] < scores.keys()[0]:
if current_context == Context.ASSIGN: return false
selection = panel_scores.values()[0]
selection_state = SelectionState.STICKIES
return true
else:
if current_context == Context.ASSIGN: return false
selection = panel_scores.values()[0]
selection_state = SelectionState.STICKIES
return true
if scores != {}:
selection = scores.values()[0]
return true
return false
func try_select_nearest_empty_card(from: Vector2) -> bool:
var scores: Dictionary[int, Area2D] = {}
for card in dropzone.get_children():
if card is Card:
if not card.has_note_attached():
scores[int((from-card.global_position).length())] = card
scores.sort()
if scores != {}:
selection = scores.values()[0]
return true
return false
func get_distance_score(from: Vector2, to: Transform2D) -> int:
var diff = from * to
var dir = diff.normalized()
if dir.x > 0.5 and diff.length() > 0:
return int((abs(dir.y) + 0.5) * diff.length())
else:
return -1

View File

@ -43,7 +43,7 @@ var transfor_arr: Array[Transform2D] = [
@export_range(1, 2) var scale_bump: float = 1.05 @export_range(1, 2) var scale_bump: float = 1.05
@export_range(1.0, 10.0) var bounce_speed: float = 5 @export_range(1.0, 10.0) var bounce_speed: float = 5
@export_color_no_alpha var highlight_color: Color = Color(1.4, 1.4, 1.4) @export_color_no_alpha var highlight_color: Color = Color(1.2, 1.2, 1.2)
## Override set_highlight to add visual feedback for cards ## Override set_highlight to add visual feedback for cards
func set_highlight(value: bool) -> void: func set_highlight(value: bool) -> void:
@ -231,6 +231,10 @@ func get_attached_note() -> StickyNote:
return null return null
func get_size() -> Vector2:
return $CollisionShape2D.shape.size
func preview_sticky_note(sticky_note: StickyNote): func preview_sticky_note(sticky_note: StickyNote):
if not is_instance_valid(sticky_note): if not is_instance_valid(sticky_note):
return return
@ -252,7 +256,7 @@ func attach_or_exchange_note(note: StickyNote, instant: bool = false) -> void:
old.reparent(note.attached_to) old.reparent(note.attached_to)
old.animate_home() old.animate_home()
else: else:
remove_note_if_present() # just kick out our old note return_old_child(note) # just kick out our old note
# ... in with the new # ... in with the new
note.reparent(self) note.reparent(self)
@ -268,12 +272,18 @@ func attach_or_exchange_note(note: StickyNote, instant: bool = false) -> void:
Steam.storeStats() Steam.storeStats()
func remove_note_if_present() -> void: func return_old_child(new_note: StickyNote = null) -> void:
var former_child: StickyNote = get_attached_note() var former_child: StickyNote = get_attached_note()
if not former_child: return if not former_child: return
former_child.reparent(get_parent())
former_child.tween = null # the positioning logic in card-board will pick that one up and calc a nice slot. former_child.tween = null # the positioning logic in card-board will pick that one up and calc a nice slot.
if new_note:
former_child.reparent(new_note.last_parent)
former_child.animate_home(new_note.home)
else:
former_child.reparent(get_parent())
# === DROP TARGET PATTERN IMPLEMENTATION === # === DROP TARGET PATTERN IMPLEMENTATION ===
@ -282,6 +292,7 @@ func remove_note_if_present() -> void:
func can_accept_drop(draggable: Draggable) -> bool: func can_accept_drop(draggable: Draggable) -> bool:
return draggable is StickyNote return draggable is StickyNote
# FIXME: this function seems to not be used.
## Handles dropping a sticky note onto this card ## Handles dropping a sticky note onto this card
## Returns DropResult indicating success, rejection, or exchange ## Returns DropResult indicating success, rejection, or exchange
func handle_drop(draggable: StickyNote) -> int: func handle_drop(draggable: StickyNote) -> int:
@ -292,6 +303,23 @@ func handle_drop(draggable: StickyNote) -> int:
draggable.z_index = 0 draggable.z_index = 0
return Draggable.DropResult.ACCEPTED return Draggable.DropResult.ACCEPTED
## End drag operation and return the node we were dropped on
func end_drag() -> Node:
super.end_drag()
return _find_drop_target()
## Find best drop target: Card > Panel > Board (in priority order)
func _find_drop_target() -> Node:
print(get_overlapping_areas())
# Priority 1: Check for overlapping cards in dropzone
for area in get_overlapping_areas():
if area is SideBoundary:
return area
return null
# === DRAG LIFECYCLE OVERRIDES === # === DRAG LIFECYCLE OVERRIDES ===
## Cards always drop back to board dropzone ## Cards always drop back to board dropzone

View File

@ -9,7 +9,7 @@ size = Vector2(277, 231)
[node name="Card" type="Area2D" unique_id=5263467] [node name="Card" type="Area2D" unique_id=5263467]
collision_layer = 4 collision_layer = 4
collision_mask = 0 collision_mask = 8
priority = 50 priority = 50
script = ExtResource("1_emip0") script = ExtResource("1_emip0")
text = "card" text = "card"
@ -34,6 +34,7 @@ offset_right = 136.0
offset_bottom = 77.95834 offset_bottom = 77.95834
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_default_cursor_shape = 13
theme = ExtResource("3_mdi7r") theme = ExtResource("3_mdi7r")
theme_type_variation = &"card_text" theme_type_variation = &"card_text"
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "

View File

@ -40,6 +40,7 @@ func set_highlight(value: bool) -> void:
var _drag_start_position: Vector2 var _drag_start_position: Vector2
var _mouse_drag_offset: Vector2 var _mouse_drag_offset: Vector2
var _drag_source: Node = null # Where the drag started from var _drag_source: Node = null # Where the drag started from
var last_parent: Node = null # Where they were last dragged from. Used by return_old_child() in Card
## === SETUP ### ## === SETUP ###
func _ready() -> void: func _ready() -> void:
@ -69,11 +70,15 @@ func _get_button_handler() -> Node:
var tween : Tween = null var tween : Tween = null
func animate_home() -> void: func animate_home(target: Vector2 = home) -> void:
z_index = 100 z_index = 100
if tween: tween.kill() if tween: tween.kill()
tween = create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_QUART) tween = create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_QUART)
tween.tween_property(self, "position", home, 0.5) tween.tween_property(self, "position", target, 0.5)
func get_size() -> Vector2:
assert(false, "This function needs to be overridden!")
return Vector2.ZERO
func _on_mouse_entered() -> void: func _on_mouse_entered() -> void:
#prints("Draggable[base]._on_mouse_entered", self, self.name) #prints("Draggable[base]._on_mouse_entered", self, self.name)
@ -110,6 +115,7 @@ func start_drag(mouse_offset: Vector2) -> void:
_drag_start_position = global_position _drag_start_position = global_position
_mouse_drag_offset = mouse_offset _mouse_drag_offset = mouse_offset
_drag_source = get_parent() _drag_source = get_parent()
last_parent = _drag_source
z_index = 60 z_index = 60
is_dragged = true is_dragged = true
@ -132,6 +138,11 @@ func end_drag() -> Node:
_drag_source = null _drag_source = null
return null return null
func _set_home() -> void:
var parent = get_parent()
if parent is Control:
confine_to_screen()
home = position
## Confines this draggable element to stay within screen or container bounds ## Confines this draggable element to stay within screen or container bounds
## Skip this check if a sticky note is attached to a card ## Skip this check if a sticky note is attached to a card

View File

@ -4,10 +4,12 @@
[ext_resource type="Shader" uid="uid://kyd37e0s6fdu" path="res://logic-scenes/board/physics-board.gdshader" id="1_ggnth"] [ext_resource type="Shader" uid="uid://kyd37e0s6fdu" path="res://logic-scenes/board/physics-board.gdshader" id="1_ggnth"]
[ext_resource type="Script" uid="uid://cqsor57nvowni" path="res://logic-scenes/board/card-board.gd" id="3_8v4c4"] [ext_resource type="Script" uid="uid://cqsor57nvowni" path="res://logic-scenes/board/card-board.gd" id="3_8v4c4"]
[ext_resource type="AudioStream" uid="uid://bywmf3patoe56" path="res://base-environments/youth_room/audio/board_completed.wav" id="5_qjqy3"] [ext_resource type="AudioStream" uid="uid://bywmf3patoe56" path="res://base-environments/youth_room/audio/board_completed.wav" id="5_qjqy3"]
[ext_resource type="Script" uid="uid://cwc0k3mtj4k1f" path="res://logic-scenes/board/side_board.gd" id="6_kvxnu"]
[ext_resource type="AudioStream" uid="uid://bgtohhyd8whbm" path="res://base-environments/youth_room/audio/board_completed_de.wav" id="6_ni75f"] [ext_resource type="AudioStream" uid="uid://bgtohhyd8whbm" path="res://base-environments/youth_room/audio/board_completed_de.wav" id="6_ni75f"]
[ext_resource type="AudioStream" uid="uid://dj8fpajqhj4k7" path="res://base-environments/youth_room/audio/board_incomplete.wav" id="6_vtvtf"] [ext_resource type="AudioStream" uid="uid://dj8fpajqhj4k7" path="res://base-environments/youth_room/audio/board_incomplete.wav" id="6_vtvtf"]
[ext_resource type="AudioStream" uid="uid://brolrc3lhaeid" path="res://base-environments/youth_room/audio/board_unfitting.wav" id="7_0phgc"] [ext_resource type="AudioStream" uid="uid://brolrc3lhaeid" path="res://base-environments/youth_room/audio/board_unfitting.wav" id="7_0phgc"]
[ext_resource type="AudioStream" uid="uid://swlo6elqs4vx" path="res://base-environments/youth_room/audio/board_incomplete_de.wav" id="7_2qppy"] [ext_resource type="AudioStream" uid="uid://swlo6elqs4vx" path="res://base-environments/youth_room/audio/board_incomplete_de.wav" id="7_2qppy"]
[ext_resource type="Script" uid="uid://c7gbr6rdk843f" path="res://logic-scenes/board/side_boundary.gd" id="7_k5h0q"]
[ext_resource type="Script" uid="uid://c1oub0cs7cph6" path="res://dev-util/stereo-switch.gd" id="8_ni75f"] [ext_resource type="Script" uid="uid://c1oub0cs7cph6" path="res://dev-util/stereo-switch.gd" id="8_ni75f"]
[ext_resource type="AudioStream" uid="uid://y8fg3wjscvci" path="res://base-environments/youth_room/audio/board_unfitting_de.wav" id="10_kvxnu"] [ext_resource type="AudioStream" uid="uid://y8fg3wjscvci" path="res://base-environments/youth_room/audio/board_unfitting_de.wav" id="10_kvxnu"]
[ext_resource type="Texture2D" uid="uid://diviesbhf6p77" path="res://logic-scenes/board/board-texture/cardbord-box.png" id="11_ni75f"] [ext_resource type="Texture2D" uid="uid://diviesbhf6p77" path="res://logic-scenes/board/board-texture/cardbord-box.png" id="11_ni75f"]
@ -20,6 +22,9 @@ shader_parameter/magic_scale_factor = 1500.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_m1g7s"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_m1g7s"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_htay1"]
normal = Vector2(-1, 0)
[sub_resource type="Animation" id="Animation_qjqy3"] [sub_resource type="Animation" id="Animation_qjqy3"]
length = 0.001 length = 0.001
@ -164,7 +169,6 @@ script = ExtResource("3_8v4c4")
[node name="CardboardBox" type="TextureRect" parent="." unique_id=450836053] [node name="CardboardBox" type="TextureRect" parent="." unique_id=450836053]
unique_name_in_owner = true unique_name_in_owner = true
visible = false
clip_contents = true clip_contents = true
layout_direction = 3 layout_direction = 3
layout_mode = 2 layout_mode = 2
@ -173,8 +177,10 @@ expand_mode = 2
[node name="Label" type="Label" parent="CardboardBox" unique_id=1585163137] [node name="Label" type="Label" parent="CardboardBox" unique_id=1585163137]
layout_mode = 0 layout_mode = 0
offset_right = 274.0 offset_left = 14.0
offset_bottom = 99.416664 offset_top = 13.0
offset_right = 288.0
offset_bottom = 112.416664
size_flags_horizontal = 8 size_flags_horizontal = 8
size_flags_vertical = 0 size_flags_vertical = 0
theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_colors/font_color = Color(0, 0, 0, 1)
@ -192,11 +198,28 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
mouse_filter = 2 mouse_filter = 2
[node name="NoteZone" type="Control" parent="HBoxContainer" unique_id=92501430] [node name="SideBoard" type="ScrollContainer" parent="HBoxContainer" unique_id=738913213]
unique_name_in_owner = true unique_name_in_owner = true
clip_contents = false
custom_minimum_size = Vector2(400, 0) custom_minimum_size = Vector2(400, 0)
layout_mode = 2 layout_mode = 2
mouse_filter = 1 horizontal_scroll_mode = 0
vertical_scroll_mode = 3
script = ExtResource("6_kvxnu")
[node name="Panel" type="Control" parent="HBoxContainer/SideBoard" unique_id=1893108919]
custom_minimum_size = Vector2(400, 1500)
layout_mode = 2
mouse_filter = 2
[node name="SideBoundary" type="Area2D" parent="HBoxContainer/SideBoard" unique_id=1180680912]
position = Vector2(155, 0)
collision_layer = 8
collision_mask = 0
script = ExtResource("7_k5h0q")
[node name="CollisionShape2D" type="CollisionShape2D" parent="HBoxContainer/SideBoard/SideBoundary" unique_id=1692634692]
shape = SubResource("WorldBoundaryShape2D_htay1")
[node name="Timer" type="Timer" parent="." unique_id=1859393351] [node name="Timer" type="Timer" parent="." unique_id=1859393351]

View File

@ -0,0 +1,136 @@
class_name SideBoard extends ScrollContainer
@export var h_margin: = 8
# Panel is a bit easier to understand as a name, while Control is easier to use.
var panel: Control
var board: CardBoard
func _ready() -> void:
panel = $Panel
panel.custom_minimum_size = Vector2(size.x, 0)
board = owner
func _start_drag(draggable: Draggable) -> void:
assert(false)
func get_nearest_legal_position(from: Vector2, target: Draggable) -> Vector2:
var children := get_children_sorted()
var nearest_child_below: Draggable
var nearest_child_above: Draggable
var min_distance_above: float
var min_distance_below: float
for i in range(children.size()):
if children[i].home.y < from.y:
nearest_child_above = children[i]
min_distance_above = children[i].get_size().y/2 + h_margin + target.get_size().y/2
if i > 0:
nearest_child_below = children[i-1]
min_distance_below = children[i-1].get_size().y/2 + h_margin + target.get_size().y/2
if nearest_child_above:
from.y = minf(from.y, nearest_child_above.home.y - min_distance_above)
if nearest_child_below:
from.y = maxf(from.y, nearest_child_below.home.y - min_distance_below)
from.x = _get_x_pos(target)
return from
func can_accept_drop(draggable: Draggable) -> bool:
return (draggable is Card and board.is_memory_board) or draggable is StickyNote
# FIXME: this function seems to not be used.
func handle_drop(draggable: Draggable) -> int:
if not can_accept_drop(draggable):
return Draggable.DropResult.REJECTED
return Draggable.DropResult.ACCEPTED
# FIXME: integrate this into functions mentioned above!
func accept_drop(draggable: Draggable) -> bool:
if can_accept_drop(draggable):
draggable.home = get_nearest_legal_position(draggable.global_position, draggable)
draggable.reparent(panel)
_scoot_children()
return true
return false
func populate(with_notes: Array) -> Array[StickyNote]:
var notes: Array[StickyNote] = []
for note: StickyNote in with_notes:
notes.append(note)
panel.add_child(note)
_scoot_children(true)
return notes
func _scoot_children(force_packing: bool = false):
#FIXME: the non-force-packing algorythm is borked right now
force_packing = true
var children := get_children_sorted()
if children.size() < 2: return
var min_size := h_margin
for child in children:
min_size += child.get_size().y + h_margin
# If space is too tight, children will be spaced optimally.
if maxf(min_size, children[-1].home.y + children[-1].get_size().y) > (size.y - h_margin) or force_packing:
var top :float = h_margin
for child in children:
child.home = Vector2(_get_x_pos(child), top + child.get_size().y/2)
top += h_margin + child.get_size().y
child.animate_home()
else:
children[1].home.y = maxf(children[0].get_size().y + h_margin, children[1].home.y)
var last_distance := 0.0
for i in range(1, children.size()-1):
var min_distance_bottom: float = children[i+1].get_size().y/2 + h_margin + children[i].get_size().y/2
var bottom_distance: float = children[i+1].home.y - children[i].home.y
if bottom_distance < min_distance_bottom:
children[i-1].home.y = children[i-1].home.y - min(last_distance, bottom_distance)
children[i].home.y = children[i-1].home.y + min_distance_bottom
last_distance = maxf(children[i].home.y - children[i-1].home.y - min_distance_bottom, 0)
for child in children:
child.home.x = _get_x_pos(child)
child.animate_home()
if children[-1]:
panel.custom_minimum_size.y = children[-1].home.y + children[-1].get_size().y
func get_children_sorted() -> Array[Draggable]:
var children: Array[Draggable] = []
for child in panel.get_children(true):
if child is Draggable:
children.append(child)
children.sort_custom(_by_position)
return children
func _get_x_pos(target: Draggable) -> float:
if target is StickyNote:
return size.x - 256
if target is Card:
return size.x - 160
return 42
func _by_position(a: Draggable, b: Draggable) -> bool:
return a.position.y < b.position.y

View File

@ -0,0 +1 @@
uid://cwc0k3mtj4k1f

View File

@ -0,0 +1 @@
class_name SideBoundary extends Area2D

View File

@ -0,0 +1 @@
uid://c7gbr6rdk843f

View File

@ -71,8 +71,7 @@ func init(sticky_name: String = "sticky_note", card_id: StringName = "-1") -> vo
parent_id = StringName(card_id.rsplit(".", false, 1)[0]) parent_id = StringName(card_id.rsplit(".", false, 1)[0])
sticky_id = card_id sticky_id = card_id
# first digit of the card id is 0-3 for youth cards. from_youth = int((card_id as String)[0]) < (Scenes.id.TRANSITION as int)
from_youth = (card_id as String)[0] as int < 4
func _ready() -> void: func _ready() -> void:
super._ready() super._ready()
@ -112,14 +111,19 @@ func end_drag() -> Node:
## Find best drop target: Card > Panel > Board (in priority order) ## Find best drop target: Card > Panel > Board (in priority order)
func _find_drop_target() -> Node: func _find_drop_target() -> Node:
# Priority 1: Check for overlapping cards in dropzone # Priority 1: Check for overlapping cards in dropzone
var closest : Card = null var closest : Node = null
for area in get_overlapping_areas(): for area in get_overlapping_areas():
if area is StickyNote and not area.is_attached: continue # Can only drop on attached stickies if area is StickyNote and not area.is_attached: continue # Can only drop on attached stickies
if area is Card: if area is Card:
if (not closest) or ((area.position - position).length() < (closest.position - position).length()): if (not closest) or ((area.position - position).length() < (closest.position - position).length()):
closest = area closest = area
if area is SideBoundary:
if not closest:
closest = area
return closest return closest
@ -127,3 +131,7 @@ func _find_drop_target() -> Node:
## Sticky notes are exempt from confinement if stuck to a card ## Sticky notes are exempt from confinement if stuck to a card
func confine_to_screen() -> void: func confine_to_screen() -> void:
if attached_to is not Card: super.confine_to_screen() if attached_to is not Card: super.confine_to_screen()
func get_size() -> Vector2:
return Vector2($CollisionShape2D.shape.height, $CollisionShape2D.shape.radius*2)

View File

@ -10,7 +10,7 @@ height = 312.0
[node name="sticky-note" type="Area2D" unique_id=1136333559] [node name="sticky-note" type="Area2D" unique_id=1136333559]
collision_layer = 2 collision_layer = 2
collision_mask = 6 collision_mask = 14
priority = 100 priority = 100
script = ExtResource("1_yvh5n") script = ExtResource("1_yvh5n")
text = "card" text = "card"
@ -37,12 +37,13 @@ anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.5 anchor_bottom = 0.5
offset_left = -52.0 offset_left = -43.0
offset_top = -50.0 offset_top = -46.0
offset_right = 243.0 offset_right = 243.0
offset_bottom = 47.0 offset_bottom = 42.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_default_cursor_shape = 13
theme = ExtResource("3_qmm0h") theme = ExtResource("3_qmm0h")
theme_type_variation = &"card_text" theme_type_variation = &"card_text"
text = "sticksum ipsum dolor sit amet met post-it sulcum dulce est 3M, et tesa est." text = "sticksum ipsum dolor sit amet met post-it sulcum dulce est 3M, et tesa est."

View File

@ -1,37 +1,45 @@
[gd_scene load_steps=5 format=3 uid="uid://dreokijo757l1"] [gd_scene format=3 uid="uid://dreokijo757l1"]
[ext_resource type="Script" uid="uid://bp6s7vhdd6btk" path="res://logic-scenes/interactable/interactable.gd" id="1_ih54h"] [ext_resource type="Script" uid="uid://bp6s7vhdd6btk" path="res://logic-scenes/interactable/interactable.gd" id="1_ih54h"]
[ext_resource type="Texture2D" uid="uid://0j2nrhijh7lm" path="res://import/interface-elements/frame-square.png" id="2_ih54h"] [ext_resource type="Texture2D" uid="uid://0j2nrhijh7lm" path="res://import/interface-elements/frame-square.png" id="2_ih54h"]
[ext_resource type="Shader" uid="uid://c1ufy6ee6x24x" path="res://logic-scenes/interactable/interactable.gdshader" id="2_m0u7p"]
[ext_resource type="PackedScene" uid="uid://bdnesuqroi7ss" path="res://vfx/collectable_particles.tscn" id="6_a6wx8"] [ext_resource type="PackedScene" uid="uid://bdnesuqroi7ss" path="res://vfx/collectable_particles.tscn" id="6_a6wx8"]
[sub_resource type="SphereShape3D" id="SphereShape3D_ih54h"] [sub_resource type="SphereShape3D" id="SphereShape3D_ih54h"]
[node name="Interactable" type="Area3D" groups=["interactables"]] [sub_resource type="ShaderMaterial" id="ShaderMaterial_kupkd"]
render_priority = 0
shader = ExtResource("2_m0u7p")
shader_parameter/frame_texture = ExtResource("2_ih54h")
[node name="Interactable" type="Area3D" unique_id=847160499 groups=["interactables"]]
collision_layer = 16 collision_layer = 16
collision_mask = 16 collision_mask = 16
script = ExtResource("1_ih54h") script = ExtResource("1_ih54h")
metadata/_custom_type_script = "uid://bp6s7vhdd6btk" metadata/_custom_type_script = "uid://bp6s7vhdd6btk"
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] [node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=553285003]
transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, 0, 0, 0) transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, 0, 0, 0)
shape = SubResource("SphereShape3D_ih54h") shape = SubResource("SphereShape3D_ih54h")
[node name="OmniLight3D" type="OmniLight3D" parent="."] [node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=1409525651]
light_energy = 0.01 light_energy = 0.01
light_indirect_energy = 0.0 light_indirect_energy = 0.0
light_specular = 0.0 light_specular = 0.0
omni_range = 0.4 omni_range = 0.4
[node name="Frame" type="Sprite3D" parent="."] [node name="Frame" type="Sprite3D" parent="." unique_id=677642595]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0) transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0)
pixel_size = 0.0005 material_override = SubResource("ShaderMaterial_kupkd")
modulate = Color(1, 1, 1, 0)
pixel_size = 0.000669
no_depth_test = true no_depth_test = true
render_priority = 100 render_priority = 100
texture = ExtResource("2_ih54h") texture = ExtResource("2_ih54h")
[node name="collectable_particles" parent="." instance=ExtResource("6_a6wx8")] [node name="collectable_particles" parent="." unique_id=1080033644 instance=ExtResource("6_a6wx8")]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0) transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0)
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1268805139]
layer = -1 layer = -1
visible = false visible = false

View File

@ -20,10 +20,6 @@ func _apply_enabled_state() -> void:
if has_entered: if has_entered:
ui_exited.emit() ui_exited.emit()
# Show hand cursor when player is enabled
if hand_cursor:
hand_cursor.visible = true
else: else:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
jitter_tween = create_tween() jitter_tween = create_tween()
@ -31,8 +27,7 @@ func _apply_enabled_state() -> void:
if has_entered: if has_entered:
ui_exited.emit() ui_exited.emit()
# Hide hand cursor when player is disabled # Hide hand cursor when player is disabled
if hand_cursor:
hand_cursor.visible = false
sleeping = not enabled sleeping = not enabled
@export var mouse_sensitivity: Vector2 = Vector2(6, 5) @export var mouse_sensitivity: Vector2 = Vector2(6, 5)
@ -90,7 +85,6 @@ var crouched:bool = false:
@onready var camera: Camera3D = $Yaw/Pitch/Mount/Camera3D @onready var camera: Camera3D = $Yaw/Pitch/Mount/Camera3D
@onready var focus_ray: RayCast3D = $Yaw/Pitch/Mount/Camera3D/RayCast3D @onready var focus_ray: RayCast3D = $Yaw/Pitch/Mount/Camera3D/RayCast3D
@onready var ui_prober: Area3D = $Yaw/Pitch/Mount/Camera3D/UiProber @onready var ui_prober: Area3D = $Yaw/Pitch/Mount/Camera3D/UiProber
@onready var hand_cursor: TextureRect = %Cursor
# Cursor textures (preloaded for performance) # Cursor textures (preloaded for performance)
const cursor_default: Texture2D = preload("res://import/interface-elements/cursor_point.png") const cursor_default: Texture2D = preload("res://import/interface-elements/cursor_point.png")
@ -125,22 +119,12 @@ func _ready():
$CrouchDetector.area_entered.connect(enter_crouch) $CrouchDetector.area_entered.connect(enter_crouch)
$CrouchDetector.area_exited.connect(exit_crouch) $CrouchDetector.area_exited.connect(exit_crouch)
# Setup hand cursor
_setup_hand_cursor()
# Apply exported enabled state now that nodes are ready # Apply exported enabled state now that nodes are ready
_apply_enabled_state() _apply_enabled_state()
func _on_player_enable(enable: bool) -> void: func _on_player_enable(enable: bool) -> void:
enabled = enable enabled = enable
## Setup the hand cursor in the center of the screen
func _setup_hand_cursor() -> void:
# Configure the existing TextureRect for cursor display
hand_cursor.texture = cursor_default # Start with default cursor
hand_cursor.visible = false
## Restores player position and camera rotation from save game ## Restores player position and camera rotation from save game
func restore_from_save(save: SaveGame) -> void: func restore_from_save(save: SaveGame) -> void:
prints("player_controller.gd", restore_from_save, save.player_position, save.player_yaw, save.player_pitch) prints("player_controller.gd", restore_from_save, save.player_position, save.player_yaw, save.player_pitch)
@ -153,7 +137,7 @@ func _process(_delta) -> void:
return return
if not has_entered: if not has_entered:
camera.fov = base_fov / (1 + Input.get_action_raw_strength("zoom_in_controller")) camera.fov = base_fov / (1 + Input.get_action_raw_strength("zoom"))
var has_entered:bool = false: var has_entered:bool = false:
set(val): set(val):
@ -174,9 +158,7 @@ func _on_ray_entered(_area : Area3D) -> void:
if not interactable.visible: return if not interactable.visible: return
#printt("ray entered", parent.name, parent) #printt("ray entered", parent.name, parent)
interactable.hover = true interactable.hover = true
# Switch to pointing hand cursor when hovering over interactable
if hand_cursor:
hand_cursor.texture = cursor_point
func _on_ray_exited(_area : Area3D) -> void: func _on_ray_exited(_area : Area3D) -> void:
var interactable := _area as Interactable var interactable := _area as Interactable
@ -185,21 +167,19 @@ func _on_ray_exited(_area : Area3D) -> void:
if not interactable.visible: return if not interactable.visible: return
#printt("ray exited", parent.name, parent) #printt("ray exited", parent.name, parent)
interactable.hover = false interactable.hover = false
# Switch back to default cursor when not hovering
if hand_cursor:
hand_cursor.texture = cursor_default
func _physics_process(delta: float): func _physics_process(delta: float):
if enabled: if enabled:
_handle_movement(delta) _handle_movement(delta)
_handle_rotation(delta) _handle_rotation(delta)
if jitter_strength > 0 and not State.reduce_motion: if jitter_strength > 0 and not (State.reduce_motion or State.disable_bobbing):
_handle_jitter(delta) _handle_jitter(delta)
func _handle_movement(_delta:float): func _handle_movement(_delta:float):
var input:Vector2 = Vector2(Input.get_action_strength("player_right") - Input.get_action_strength("player_left"), #TODO: change this to the Four-Axis call with SteamInput!
Input.get_action_strength("player_backwards")*0.8 - Input.get_action_strength("player_forwards")) var input:Vector2 = Vector2(Input.get_action_strength("walk_right") - Input.get_action_strength("walk_left"),
Input.get_action_strength("walk_negative")*0.8 - Input.get_action_strength("walk_positive"))
if input.length()>1: if input.length()>1:
input = input.normalized() input = input.normalized()
@ -215,7 +195,7 @@ func _handle_movement(_delta:float):
func _handle_rotation(delta:float): func _handle_rotation(delta:float):
var smoothness = min(3, 60.0/Engine.get_frames_per_second()) var smoothness = min(3, 60.0/Engine.get_frames_per_second())
var input_speed := Vector2( Input.get_action_strength("look_right")-Input.get_action_strength("look_left"), Input.get_action_strength("look_up")-Input.get_action_strength("look_down")) * gamepad_response var input_speed := Vector2( Input.get_action_strength("look_right")-Input.get_action_strength("look_left"), Input.get_action_strength("look_positive")-Input.get_action_strength("look_negative")) * gamepad_response
# secretly, inverted y axis is the default # secretly, inverted y axis is the default
if not State.inverty_y_axis: input_speed *= Vector2(1, -1) if not State.inverty_y_axis: input_speed *= Vector2(1, -1)
@ -275,7 +255,7 @@ func _input(event: InputEvent) -> void:
elif Input.is_action_just_pressed("zoom_out_mouse"): elif Input.is_action_just_pressed("zoom_out_mouse"):
zoomed = false zoomed = false
if event.is_action_pressed("collect_memento_ui") or event.is_action_pressed("option_memento_ui"): if event.is_action_pressed("interact") or event.is_action_pressed("summarize"):
if focus_ray.is_colliding(): if focus_ray.is_colliding():
var collider := focus_ray.get_collider() var collider := focus_ray.get_collider()
if collider is Interactable: if collider is Interactable:

View File

@ -1,7 +1,6 @@
[gd_scene load_steps=18 format=3 uid="uid://mkccbig41bqb"] [gd_scene format=3 uid="uid://mkccbig41bqb"]
[ext_resource type="Script" uid="uid://bk618uyhghswx" path="res://logic-scenes/player_controller/player_controller.gd" id="1_0b4mi"] [ext_resource type="Script" uid="uid://bk618uyhghswx" path="res://logic-scenes/player_controller/player_controller.gd" id="1_0b4mi"]
[ext_resource type="Texture2D" uid="uid://d005qvnbnishb" path="res://import/interface-elements/cursor_grab.png" id="2_x6v75"]
[sub_resource type="PhysicsMaterial" id="10"] [sub_resource type="PhysicsMaterial" id="10"]
friction = 0.0 friction = 0.0
@ -610,7 +609,7 @@ _data = {
[sub_resource type="SphereShape3D" id="SphereShape3D_hpoj0"] [sub_resource type="SphereShape3D" id="SphereShape3D_hpoj0"]
radius = 0.3 radius = 0.3
[node name="PlayerController" type="RigidBody3D"] [node name="PlayerController" type="RigidBody3D" unique_id=458178412]
collision_layer = 3 collision_layer = 3
collision_mask = 3 collision_mask = 3
axis_lock_angular_x = true axis_lock_angular_x = true
@ -621,42 +620,42 @@ can_sleep = false
script = ExtResource("1_0b4mi") script = ExtResource("1_0b4mi")
max_acceleration = 7.0 max_acceleration = 7.0
[node name="ShadowCaster" type="MeshInstance3D" parent="."] [node name="ShadowCaster" type="MeshInstance3D" parent="." unique_id=1345401097]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.54540473, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.54540473, 0)
layers = 1024 layers = 1024
cast_shadow = 3 cast_shadow = 3
gi_mode = 2 gi_mode = 2
mesh = SubResource("CapsuleMesh_x6v75") mesh = SubResource("CapsuleMesh_x6v75")
[node name="Yaw" type="Node3D" parent="."] [node name="Yaw" type="Node3D" parent="." unique_id=375035441]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.22534, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.22534, 0)
[node name="Pitch" type="Node3D" parent="Yaw"] [node name="Pitch" type="Node3D" parent="Yaw" unique_id=2024736202]
transform = Transform3D(1, 0, 0, 0, 0.9999993, 0, 0, 0, 0.9999993, 0, 0, 0) transform = Transform3D(1, 0, 0, 0, 0.9999993, 0, 0, 0, 0.9999993, 0, 0, 0)
[node name="Mount" type="Node3D" parent="Yaw/Pitch"] [node name="Mount" type="Node3D" parent="Yaw/Pitch" unique_id=843946387]
[node name="Camera3D" type="Camera3D" parent="Yaw/Pitch/Mount"] [node name="Camera3D" type="Camera3D" parent="Yaw/Pitch/Mount" unique_id=1103233897]
unique_name_in_owner = true unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.202, 0.157) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.202, 0.157)
cull_mask = 7 cull_mask = 7
current = true current = true
[node name="RayCast3D" type="RayCast3D" parent="Yaw/Pitch/Mount/Camera3D"] [node name="RayCast3D" type="RayCast3D" parent="Yaw/Pitch/Mount/Camera3D" unique_id=1162056013]
target_position = Vector3(0, 0, -1.5) target_position = Vector3(0, 0, -1.5)
collision_mask = 16 collision_mask = 16
collide_with_areas = true collide_with_areas = true
[node name="UiProber" type="Area3D" parent="Yaw/Pitch/Mount/Camera3D"] [node name="UiProber" type="Area3D" parent="Yaw/Pitch/Mount/Camera3D" unique_id=1719268439]
transform = Transform3D(1, 0, 0, 0, 1, 2.98023e-08, 0, -2.98023e-08, 1, 0, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 2.98023e-08, 0, -2.98023e-08, 1, 0, 0, 0)
collision_layer = 0 collision_layer = 0
collision_mask = 16 collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="Yaw/Pitch/Mount/Camera3D/UiProber"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Yaw/Pitch/Mount/Camera3D/UiProber" unique_id=1296155920]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 0) transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 0)
shape = SubResource("SeparationRayShape3D_hpoj0") shape = SubResource("SeparationRayShape3D_hpoj0")
[node name="TextureRect" type="TextureRect" parent="Yaw/Pitch/Mount/Camera3D"] [node name="TextureRect" type="TextureRect" parent="Yaw/Pitch/Mount/Camera3D" unique_id=1075830184]
visible = false visible = false
modulate = Color(1, 1, 1, 0) modulate = Color(1, 1, 1, 0)
anchors_preset = 15 anchors_preset = 15
@ -670,37 +669,18 @@ mouse_filter = 2
texture = SubResource("GradientTexture2D_x6v75") texture = SubResource("GradientTexture2D_x6v75")
expand_mode = 4 expand_mode = 4
[node name="Cursor" type="TextureRect" parent="Yaw/Pitch/Mount/Camera3D"] [node name="PlayerCollision" type="CollisionShape3D" parent="." unique_id=57703964]
unique_name_in_owner = true
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = ExtResource("2_x6v75")
stretch_mode = 3
[node name="PlayerCollision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -1, 8.74228e-08, 0, -8.74228e-08, -1, 0, 0.6, 0) transform = Transform3D(1, 0, 0, 0, -1, 8.74228e-08, 0, -8.74228e-08, -1, 0, 0.6, 0)
shape = SubResource("CapsuleShape3D_hpoj0") shape = SubResource("CapsuleShape3D_hpoj0")
[node name="PlayerAnimationPlayer" type="AnimationPlayer" parent="."] [node name="PlayerAnimationPlayer" type="AnimationPlayer" parent="." unique_id=1528985038]
libraries = { libraries/ = SubResource("AnimationLibrary_xbx3w")
&"": SubResource("AnimationLibrary_xbx3w") autoplay = &"RESET"
}
autoplay = "RESET"
[node name="CrouchDetector" type="Area3D" parent="."] [node name="CrouchDetector" type="Area3D" parent="." unique_id=1140653929]
collision_layer = 3 collision_layer = 3
collision_mask = 3 collision_mask = 3
[node name="CollisionShape3D" type="CollisionShape3D" parent="CrouchDetector"] [node name="CollisionShape3D" type="CollisionShape3D" parent="CrouchDetector" unique_id=184769616]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.35, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.35, 0)
shape = SubResource("SphereShape3D_hpoj0") shape = SubResource("SphereShape3D_hpoj0")

View File

@ -185,7 +185,7 @@ toggle_fullscreen={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
] ]
} }
collect_memento_ui={ interact={
"deadzone": 0.2, "deadzone": 0.2,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)

View File

@ -11,7 +11,20 @@ static var _instance : Prompter = null
func _ready() -> void: func _ready() -> void:
_register_prompts() _register_prompts()
clear() clear()
%Cursor.hide()
Scenes.player_enable.connect(func(enable: bool): %Cursor.visible = enable)
func hover_cursor(enable: bool):
if enable:
$AnimationPlayer.play("show_cursor")
else:
$AnimationPlayer.play("hide_cursor")
func display_hint(message:String, duration: float, delay: float = 0):
#TODO implement a more streamlined version of displaying prompts during polish.
#This should cause other functions to become deprecated.
assert(false)
func _register_prompts() -> void: func _register_prompts() -> void:
assert(not _instance, "Cannot have two prompters (are you trying to run the prompter itself?)") assert(not _instance, "Cannot have two prompters (are you trying to run the prompter itself?)")
@ -43,6 +56,9 @@ func _clearInstruction() -> void:
%Instruction.text = "" %Instruction.text = ""
%Instruction.get_parent().hide() %Instruction.get_parent().hide()
func _clearContent() -> void:
%ContentSummary.text = ""
%ContentSummary.get_parent().hide()
func _show(container: Control, controls: Array[Control], overrides: Array[StringName] = []) -> void: func _show(container: Control, controls: Array[Control], overrides: Array[StringName] = []) -> void:
for i in range(len(controls)): for i in range(len(controls)):
@ -90,6 +106,7 @@ func clear() -> void:
_clear(%Center) _clear(%Center)
_clearInteraction() _clearInteraction()
_clearInstruction() _clearInstruction()
_clearContent()
## Selects a list of up to three prompts to be passed to the show_xxxxx() functions ## Selects a list of up to three prompts to be passed to the show_xxxxx() functions

View File

@ -1,7 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://btmlxxbucfqa7"] [gd_scene format=3 uid="uid://btmlxxbucfqa7"]
[ext_resource type="Script" uid="uid://de6ettn5s20va" path="res://ui/prompter/prompter.gd" id="1_ba0r8"] [ext_resource type="Script" uid="uid://de6ettn5s20va" path="res://ui/prompter/prompter.gd" id="1_ba0r8"]
[ext_resource type="FontFile" uid="uid://c5ql8u7tpd10j" path="res://import/fonts/KleeOne-SemiBold.ttf" id="3_xtx06"] [ext_resource type="FontFile" uid="uid://c5ql8u7tpd10j" path="res://import/fonts/KleeOne-SemiBold.ttf" id="3_xtx06"]
[ext_resource type="Texture2D" uid="uid://d005qvnbnishb" path="res://import/interface-elements/cursor_grab.png" id="4_ba0r8"]
[ext_resource type="Theme" uid="uid://c30n4maixii5g" path="res://logic-scenes/themes/content_note_theme.tres" id="5_7ych8"]
[ext_resource type="Texture2D" uid="uid://epjksqlw8frf" path="res://logic-scenes/collectable/decorative_paper.png" id="5_43eso"]
[ext_resource type="PackedScene" uid="uid://nvbffevo54eh" path="res://ui/prompter/prompt_button.tscn" id="5_fbpt0"] [ext_resource type="PackedScene" uid="uid://nvbffevo54eh" path="res://ui/prompter/prompt_button.tscn" id="5_fbpt0"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ba0r8"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ba0r8"]
@ -19,7 +22,163 @@ outline_color = Color(0, 0, 0, 1)
shadow_size = 4 shadow_size = 4
shadow_color = Color(0, 0, 0, 0.78431374) shadow_color = Color(0, 0, 0, 0.78431374)
[node name="Prompter" type="MarginContainer"] [sub_resource type="Gradient" id="Gradient_fbpt0"]
offsets = PackedFloat32Array(0.46281344, 0.72639626)
colors = PackedColorArray(0.93161064, 0.8421718, 0.75696284, 0.7058824, 0.94143397, 0.755365, 0.65018964, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_43eso"]
gradient = SubResource("Gradient_fbpt0")
width = 16
height = 16
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(0.5, 1)
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nhdl"]
[sub_resource type="Animation" id="Animation_7ych8"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect2:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_3nhdl"]
resource_name = "hide_cursor"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.26666668),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect2:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_ba0r8"]
resource_name = "init"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect2:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1e-05, 1e-05)]
}
[sub_resource type="Animation" id="Animation_foyvw"]
resource_name = "show_cursor"
length = 0.3
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(0.28319794, 1),
"update": 0,
"values": [Vector2(1e-05, 1e-05), Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect2:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("SafeZone/CenterContainer/Cursor/TextureRect:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5iaad"]
_data = {
&"RESET": SubResource("Animation_7ych8"),
&"hide_cursor": SubResource("Animation_3nhdl"),
&"init": SubResource("Animation_ba0r8"),
&"show_cursor": SubResource("Animation_foyvw")
}
[node name="Prompter" type="MarginContainer" unique_id=105769936]
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
@ -32,51 +191,47 @@ theme_override_constants/margin_right = 42
theme_override_constants/margin_bottom = 42 theme_override_constants/margin_bottom = 42
script = ExtResource("1_ba0r8") script = ExtResource("1_ba0r8")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="SafeZone" type="Control" parent="." unique_id=1934527498]
layer = 10 layout_mode = 2
[node name="SafeZone" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 0
offset_left = 42.0
offset_top = 42.0
offset_right = 1878.0
offset_bottom = 1038.0
mouse_filter = 2 mouse_filter = 2
[node name="CenterContainer" type="CenterContainer" parent="CanvasLayer/SafeZone"] [node name="CenterContainer" type="CenterContainer" parent="SafeZone" unique_id=1743985800]
layout_mode = 0 layout_mode = 1
offset_right = 1836.0 anchors_preset = 15
offset_bottom = 996.0 anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2 mouse_filter = 2
[node name="CenterZone" type="MarginContainer" parent="CanvasLayer/SafeZone/CenterContainer"] [node name="CenterZone" type="MarginContainer" parent="SafeZone/CenterContainer" unique_id=1707042356]
custom_minimum_size = Vector2(700, 700) custom_minimum_size = Vector2(700, 700)
layout_mode = 2 layout_mode = 2
mouse_filter = 2 mouse_filter = 2
theme_override_constants/margin_top = 42 theme_override_constants/margin_top = 42
theme_override_constants/margin_right = 42 theme_override_constants/margin_right = 42
[node name="TopCenter" type="PanelContainer" parent="CanvasLayer/SafeZone/CenterContainer/CenterZone"] [node name="TopCenter" type="PanelContainer" parent="SafeZone/CenterContainer/CenterZone" unique_id=592627471]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 0 size_flags_vertical = 0
mouse_filter = 2 mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_ba0r8") theme_override_styles/panel = SubResource("StyleBoxFlat_ba0r8")
[node name="Interaction" type="Label" parent="CanvasLayer/SafeZone/CenterContainer/CenterZone/TopCenter"] [node name="Interaction" type="Label" parent="SafeZone/CenterContainer/CenterZone/TopCenter" unique_id=947868457]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
text = "object to interact with" text = "object to interact with"
label_settings = SubResource("LabelSettings_fbpt0") label_settings = SubResource("LabelSettings_fbpt0")
horizontal_alignment = 1 horizontal_alignment = 1
[node name="CenterAnchor" type="Control" parent="CanvasLayer/SafeZone/CenterContainer/CenterZone"] [node name="CenterAnchor" type="Control" parent="SafeZone/CenterContainer/CenterZone" unique_id=1713330498]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 8 size_flags_vertical = 8
mouse_filter = 2
[node name="Center" type="VBoxContainer" parent="CanvasLayer/SafeZone/CenterContainer/CenterZone/CenterAnchor"] [node name="Center" type="VBoxContainer" parent="SafeZone/CenterContainer/CenterZone/CenterAnchor" unique_id=74145337]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 1 layout_mode = 1
anchors_preset = 7 anchors_preset = 7
@ -91,45 +246,91 @@ grow_horizontal = 2
grow_vertical = 0 grow_vertical = 0
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 8 size_flags_vertical = 8
mouse_filter = 2
theme_override_constants/separation = 48 theme_override_constants/separation = 48
alignment = 2 alignment = 2
[node name="collect_memento_ui" parent="CanvasLayer/SafeZone/CenterContainer/CenterZone/CenterAnchor/Center" instance=ExtResource("5_fbpt0")] [node name="collect_memento_ui" parent="SafeZone/CenterContainer/CenterZone/CenterAnchor/Center" unique_id=1149207037 instance=ExtResource("5_fbpt0")]
layout_mode = 2 layout_mode = 2
mouse_filter = 2
text = "collect_memento_ui" text = "collect_memento_ui"
action = &"collect_memento_ui"
[node name="option_memento_ui" parent="CanvasLayer/SafeZone/CenterContainer/CenterZone/CenterAnchor/Center" instance=ExtResource("5_fbpt0")] [node name="option_memento_ui" parent="SafeZone/CenterContainer/CenterZone/CenterAnchor/Center" unique_id=1048897975 instance=ExtResource("5_fbpt0")]
layout_mode = 2 layout_mode = 2
mouse_filter = 2
text = "option_memento_ui" text = "option_memento_ui"
action = &"option_memento_ui"
[node name="Top" type="PanelContainer" parent="CanvasLayer/SafeZone"] [node name="Cursor" type="Control" parent="SafeZone/CenterContainer" unique_id=1682682036]
unique_name_in_owner = true
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
mouse_filter = 2
[node name="TextureRect" type="TextureRect" parent="SafeZone/CenterContainer/Cursor" unique_id=1771227753]
layout_mode = 0
offset_left = 32.0
offset_top = 32.0
offset_right = 60.0
offset_bottom = 64.0
mouse_filter = 2
texture = ExtResource("4_ba0r8")
[node name="TextureRect2" type="TextureRect" parent="SafeZone/CenterContainer/Cursor" unique_id=1579264983]
layout_mode = 0
offset_left = 24.0
offset_top = 24.0
offset_right = 40.0
offset_bottom = 40.0
mouse_filter = 2
texture = SubResource("GradientTexture2D_43eso")
[node name="ContentContainer" type="VBoxContainer" parent="SafeZone/CenterContainer" unique_id=1198131767]
custom_minimum_size = Vector2(800, 0)
layout_mode = 2
mouse_filter = 2
[node name="ContentSummary" type="Label" parent="SafeZone/CenterContainer/ContentContainer" unique_id=1797481988]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("5_7ych8")
text = "summary_childhood"
autowrap_mode = 2
[node name="ClosePrompt" parent="SafeZone/CenterContainer/ContentContainer" unique_id=1963537997 instance=ExtResource("5_fbpt0")]
visible = false
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 2
[node name="Top" type="PanelContainer" parent="SafeZone" unique_id=1663835039]
layout_mode = 1 layout_mode = 1
anchors_preset = 5 anchors_preset = 5
anchor_left = 0.5 anchor_left = 0.5
anchor_right = 0.5 anchor_right = 0.5
offset_left = -230.5 offset_left = -273.5
offset_right = 230.5 offset_right = 273.5
offset_bottom = 98.33334 offset_bottom = 98.33334
grow_horizontal = 2 grow_horizontal = 2
mouse_filter = 2 mouse_filter = 2
[node name="Instruction" type="Label" parent="CanvasLayer/SafeZone/Top"] [node name="Instruction" type="Label" parent="SafeZone/Top" unique_id=366950450]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
text = "a general explanation or hint about what is going on text = "a general explanation or hint about what is going on
or an evaluation such as on the card-boardin" or an evaluation such as on the card-boardin"
horizontal_alignment = 1 horizontal_alignment = 1
[node name="LeftBottomAnchor" type="Control" parent="CanvasLayer/SafeZone"] [node name="LeftBottomAnchor" type="Control" parent="SafeZone" unique_id=897522273]
anchors_preset = 0 layout_mode = 1
offset_top = 996.0 anchors_preset = 2
offset_bottom = 996.0 anchor_top = 1.0
anchor_bottom = 1.0
grow_vertical = 0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 8 size_flags_vertical = 8
mouse_filter = 2
[node name="LeftBottom" type="VBoxContainer" parent="CanvasLayer/SafeZone/LeftBottomAnchor"] [node name="LeftBottom" type="VBoxContainer" parent="SafeZone/LeftBottomAnchor" unique_id=889712323]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 1 layout_mode = 1
anchors_preset = 2 anchors_preset = 2
@ -141,35 +342,38 @@ offset_right = 386.0
grow_vertical = 0 grow_vertical = 0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 4 size_flags_vertical = 4
mouse_filter = 2
theme_override_constants/separation = 48 theme_override_constants/separation = 48
alignment = 2 alignment = 2
[node name="ui_accept" parent="CanvasLayer/SafeZone/LeftBottomAnchor/LeftBottom" instance=ExtResource("5_fbpt0")] [node name="ui_accept" parent="SafeZone/LeftBottomAnchor/LeftBottom" unique_id=265719469 instance=ExtResource("5_fbpt0")]
layout_mode = 2 layout_mode = 2
mouse_filter = 2
[node name="ui_cancel" parent="CanvasLayer/SafeZone/LeftBottomAnchor/LeftBottom" instance=ExtResource("5_fbpt0")] [node name="ui_cancel" parent="SafeZone/LeftBottomAnchor/LeftBottom" unique_id=487509301 instance=ExtResource("5_fbpt0")]
layout_mode = 2 layout_mode = 2
mouse_filter = 2
text = "ui_cancel" text = "ui_cancel"
action = &"ui_cancel"
[node name="scene_skip" parent="CanvasLayer/SafeZone/LeftBottomAnchor/LeftBottom" instance=ExtResource("5_fbpt0")] [node name="scene_skip" parent="SafeZone/LeftBottomAnchor/LeftBottom" unique_id=854975043 instance=ExtResource("5_fbpt0")]
layout_mode = 2 layout_mode = 2
mouse_filter = 2
text = "scene_skip" text = "scene_skip"
action = &"scene_skip"
[node name="RightBottomAnchor" type="Control" parent="CanvasLayer/SafeZone"] [node name="RightBottomAnchor" type="Control" parent="SafeZone" unique_id=918246795]
layout_mode = 1 layout_mode = 1
anchors_preset = 3 anchors_preset = 3
anchor_left = 1.0 anchor_left = 1.0
anchor_top = 1.0 anchor_top = 1.0
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_left = -40.0 offset_left = -1836.0
offset_top = -40.0 offset_top = -996.0
grow_horizontal = 0 grow_horizontal = 0
grow_vertical = 0 grow_vertical = 0
mouse_filter = 2
[node name="RightBottom" type="VBoxContainer" parent="CanvasLayer/SafeZone/RightBottomAnchor"] [node name="RightBottom" type="VBoxContainer" parent="SafeZone/RightBottomAnchor" unique_id=24278891]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 1 layout_mode = 1
anchors_preset = 3 anchors_preset = 3
@ -183,5 +387,115 @@ grow_horizontal = 0
grow_vertical = 0 grow_vertical = 0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 4 size_flags_vertical = 4
mouse_filter = 2
theme_override_constants/separation = 48 theme_override_constants/separation = 48
alignment = 2 alignment = 2
[node name="BottomAncor" type="Control" parent="SafeZone" unique_id=269513583]
visible = false
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -918.0
offset_top = -996.0
offset_right = 918.0
grow_horizontal = 2
grow_vertical = 0
mouse_filter = 2
[node name="TextureRect" type="TextureRect" parent="SafeZone/BottomAncor" unique_id=1931879850]
layout_mode = 0
offset_left = 673.0
offset_top = 615.0
offset_right = 1186.0
offset_bottom = 981.0
mouse_filter = 2
texture = ExtResource("5_43eso")
expand_mode = 1
[node name="MementoMenu" type="VBoxContainer" parent="SafeZone/BottomAncor/TextureRect" unique_id=620199752]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -464.0
offset_top = -301.0
offset_right = -77.0
offset_bottom = -61.0
grow_horizontal = 0
grow_vertical = 0
size_flags_horizontal = 0
size_flags_vertical = 4
mouse_filter = 2
theme_override_constants/separation = 20
[node name="TitleLabel" type="Label" parent="SafeZone/BottomAncor/TextureRect/MementoMenu" unique_id=469307709]
modulate = Color(0, 0, 0, 1)
layout_mode = 2
theme_type_variation = &"HeaderLarge"
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.29200003)
text = "Old Mask"
[node name="CN_Label" type="Label" parent="SafeZone/BottomAncor/TextureRect/MementoMenu" unique_id=1540632272]
custom_minimum_size = Vector2(128, 0)
layout_mode = 2
theme = ExtResource("5_7ych8")
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.29200003)
text = "CN: Alienation, Eating Issues, Gender Dysphoria"
autowrap_mode = 3
[node name="MenentoCollect" parent="SafeZone/BottomAncor/TextureRect/MementoMenu" unique_id=1683993606 instance=ExtResource("5_fbpt0")]
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 2
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_styles/normal = SubResource("StyleBoxEmpty_3nhdl")
[node name="TraumaExtras" type="VBoxContainer" parent="SafeZone/BottomAncor/TextureRect" unique_id=970164645]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 112.0
offset_top = -307.0
offset_right = 499.0
offset_bottom = -67.0
grow_horizontal = 0
grow_vertical = 0
size_flags_horizontal = 0
size_flags_vertical = 4
mouse_filter = 2
theme_override_constants/separation = 48
[node name="MenentoCollect2" parent="SafeZone/BottomAncor/TextureRect/TraumaExtras" unique_id=2124099022 instance=ExtResource("5_fbpt0")]
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 2
theme = ExtResource("5_7ych8")
text = "scene_skip"
[node name="TitleLabel" type="Label" parent="SafeZone/BottomAncor/TextureRect/TraumaExtras" unique_id=331285775]
modulate = Color(0, 0, 0, 1)
layout_mode = 2
theme_type_variation = &"HeaderLarge"
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.29200003)
text = "Old Mask"
[node name="CN_Label" type="Label" parent="SafeZone/BottomAncor/TextureRect/TraumaExtras" unique_id=2075897855]
custom_minimum_size = Vector2(128, 0)
layout_mode = 2
theme = ExtResource("5_7ych8")
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.29200003)
text = "CN: Alienation, Eating Issues, Gender Dysphoria"
autowrap_mode = 3
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=612858505]
libraries/ = SubResource("AnimationLibrary_5iaad")
autoplay = &"init"

View File

@ -85,7 +85,7 @@ func _input(event: InputEvent) -> void:
$AnimationPlayer.play("reveal_skip") $AnimationPlayer.play("reveal_skip")
unrevealed = false unrevealed = false
if event.is_action_pressed("scene_skip"): if event.is_action_pressed("skip"):
if not (is_auto_proceeding or aborted): if not (is_auto_proceeding or aborted):
pressed = true pressed = true
else: else:
@ -96,13 +96,13 @@ func _input(event: InputEvent) -> void:
reset() reset()
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
elif event.is_action_released("scene_skip"): elif event.is_action_released("skip"):
if not is_auto_proceeding: if not is_auto_proceeding:
pressed = false pressed = false
time_pressed = 0 time_pressed = 0
progress.value = 0 progress.value = 0
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
elif Input.is_action_just_pressed("ui_accept") or Input.is_action_just_pressed("ui_focus_next") or Input.is_action_just_pressed("scene_skip") and is_auto_proceeding: elif Input.is_action_just_pressed("ui_accept") or Input.is_action_just_pressed("ui_focus_next") or Input.is_action_just_pressed("skip") and is_auto_proceeding:
proceed.emit() proceed.emit()
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
reset() reset()

2173
wireframe.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 122 KiB