Skip to content
Snippets Groups Projects
Commit 0272e1a0 authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Config item to choose if movement inputs cancel interaction with counters

parent 0533380f
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,7 @@ player_config: ...@@ -91,6 +91,7 @@ player_config:
restricted_view: False restricted_view: False
view_angle: 70 view_angle: 70
view_range: 4 # in grid units, can be "null" view_range: 4 # in grid units, can be "null"
movement_stops_interact: false
effect_manager: effect_manager:
FireManager: FireManager:
......
...@@ -85,6 +85,8 @@ player_config: ...@@ -85,6 +85,8 @@ player_config:
restricted_view: False restricted_view: False
view_angle: 70 view_angle: 70
view_range: 4 # in grid units, can be "null" view_range: 4 # in grid units, can be "null"
movement_stops_interact: false
effect_manager: effect_manager:
FireManager: FireManager:
......
...@@ -44,6 +44,8 @@ class PlayerConfig: ...@@ -44,6 +44,8 @@ class PlayerConfig:
"""Angle of the players view if restricted.""" """Angle of the players view if restricted."""
view_range: float | None = None view_range: float | None = None
"""Range of the players view if restricted. In grid units.""" """Range of the players view if restricted. In grid units."""
movement_stops_interact: bool = True
"""If the player moves, the interaction with the counter stops."""
class Player: class Player:
...@@ -108,7 +110,7 @@ class Player: ...@@ -108,7 +110,7 @@ class Player:
function of the environment""" function of the environment"""
self.current_movement = move_vector self.current_movement = move_vector
self.movement_until = move_until self.movement_until = move_until
if self.interacting: if self.player_config.movement_stops_interact and self.interacting:
self.perform_interact_stop() self.perform_interact_stop()
def move_abs(self, new_pos: npt.NDArray[float]): def move_abs(self, new_pos: npt.NDArray[float]):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment