Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Label that would be interacted with is highlighted (#124)
Browse files Browse the repository at this point in the history
* Label that would be interacted with is highlighted

* Labels are now always smoothly hidden

* Label is always in the foreground
  • Loading branch information
porkbrain authored Mar 31, 2024
1 parent 8e76357 commit 013ae21
Show file tree
Hide file tree
Showing 7 changed files with 405 additions and 255 deletions.
186 changes: 93 additions & 93 deletions main_game/assets/maps/building1_player_floor.ron

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions main_game/assets/scenes/building1_player_floor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,17 @@ metadata/zone = "MeditationZone"
metadata/action = "StartMeditation"
metadata/label = "Meditate"

[node name="WinnieSleeping" type="Sprite2D" parent="BackwallFurniture"]
[node name="WinnieMeditating" type="Sprite2D" parent="BackwallFurniture/MeditationChair"]
visible = false
self_modulate = Color(1, 1, 1, 0.823529)
position = Vector2(-70, -67.5)
texture = ExtResource("5_u86a4")
position = Vector2(3, 0)
texture = ExtResource("6_5id1h")

[node name="WinnieMeditating" type="Sprite2D" parent="BackwallFurniture"]
[node name="WinnieSleeping" type="Sprite2D" parent="BackwallFurniture"]
visible = false
self_modulate = Color(1, 1, 1, 0.823529)
position = Vector2(41, -84)
texture = ExtResource("6_5id1h")
position = Vector2(-70, -67.5)
texture = ExtResource("5_u86a4")

[node name="Toilet" type="Sprite2D" parent="."]
z_index = 2
Expand Down
16 changes: 7 additions & 9 deletions main_game_lib/src/top_down.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,19 @@ where
app.register_type::<InspectLabel>()
.add_systems(
Update,
inspect_and_interact::show_all_in_vicinity
.run_if(in_state(running))
.run_if(common_action::inspect_pressed()),
(
inspect_and_interact::highlight_what_would_be_interacted_with,
inspect_and_interact::show_all_in_vicinity
.run_if(common_action::inspect_pressed()),
)
.chain() // easier to think about
.run_if(in_state(running)),
)
.add_systems(
Update,
inspect_and_interact::schedule_hide_all
.run_if(in_state(running))
.run_if(common_action::inspect_just_released()),
)
.add_systems(
Update,
inspect_and_interact::cancel_hide_all
.run_if(in_state(running))
.run_if(common_action::inspect_just_pressed()),
);

debug!("Adding interaction systems for {}", T::type_path());
Expand Down
Loading

0 comments on commit 013ae21

Please sign in to comment.