diff --git a/Global/GlobalSignal.gd b/Global/GlobalSignal.gd index 53ed5fc26..fdb157486 100644 --- a/Global/GlobalSignal.gd +++ b/Global/GlobalSignal.gd @@ -30,6 +30,9 @@ signal missing_map signal missing_3rd signal missing_1st +# Perspective handling +signal main_perspective_active(is_active) + # signal the ui to show the miniview again signal miniview_show diff --git a/Global/PlayerInfo.gd b/Global/PlayerInfo.gd index be92ccf68..43cab5cb1 100644 --- a/Global/PlayerInfo.gd +++ b/Global/PlayerInfo.gd @@ -13,6 +13,7 @@ var last_player_pos = Vector3(0, 0, 0) var last_player_look_direction = Vector3(0, 0, 0) var is_follow_enabled: bool = true +var is_main_active: bool = false var walk_speed: float = 10 diff --git a/Perspectives/AbstractPlayer/AbstractPlayer.gd b/Perspectives/AbstractPlayer/AbstractPlayer.gd index 2cecbc473..20d875eb3 100644 --- a/Perspectives/AbstractPlayer/AbstractPlayer.gd +++ b/Perspectives/AbstractPlayer/AbstractPlayer.gd @@ -12,6 +12,16 @@ var mouse_sensitivity = Settings.get_setting("player", "mouse-sensitivity") func _ready(): Offset.connect("shift_world", self, "shift") + + if is_main_perspective: + PlayerInfo.is_main_active = true + + +# This is a function that can handle notification, we will use it for "destructor"-purposes +func _notification(what): + if what == NOTIFICATION_PREDELETE: + if is_main_perspective: + PlayerInfo.is_main_active = false func _physics_process(delta): @@ -88,7 +98,8 @@ func _handle_general_input(event): # Shift the player's in-engine translation by a certain offset, but not the player's true coordinates. func shift(delta_x, delta_z): - PlayerInfo.add_player_pos(Vector3(delta_x, 0, delta_z)) + if is_main_perspective or not PlayerInfo.is_main_active: + PlayerInfo.add_player_pos(Vector3(delta_x, 0, delta_z)) translation.x += delta_x translation.z += delta_z \ No newline at end of file diff --git a/default-settings.json b/default-settings.json index 8f4f5608c..342078117 100644 --- a/default-settings.json +++ b/default-settings.json @@ -14,10 +14,10 @@ "level-0-tile-size": 9783.93962, "level-0-osm-zoom": 12, - "default-tile-subdivision": 32, + "default-tile-subdivision": 16, "update-interval-seconds": 0.2, "world-shift-distance": 1000, - "tile-spawn-radius": 1, + "tile-spawn-radius": 3, "tile-removal-check-radius-summand": 2, "distances": [ 5000, @@ -47,7 +47,7 @@ }, "item-spawner": { - "camera-ray-length": 2000 + "camera-ray-length": 5000 }, "herbage": {