restore full world effects outside portmaster
This commit is contained in:
parent
4fda6e97f6
commit
41b4f86ddf
15 changed files with 398 additions and 122 deletions
25
main/main.gd
25
main/main.gd
|
|
@ -146,6 +146,7 @@ const TITLE_MUSIC_PATH: String = (
|
|||
const NEW_GAME_MUSIC_PATH: String = "res://audio/music/world/tulips.wav"
|
||||
const DUSK_MUSIC_PATH: String = "res://audio/music/world/craft.mp3"
|
||||
const TIME_CROSSING_EPSILON_HOURS: float = 0.000001
|
||||
const RAIN_VISUAL_MOTION_MULTIPLIER: float = 2.0
|
||||
const DEDICATED_IDLE_PHYSICS_TICKS_PER_SECOND: int = 10
|
||||
const DEDICATED_ACTIVE_PHYSICS_TICKS_PER_SECOND: int = 30
|
||||
const HOME_ENTRY_INPUT_OWNER: StringName = &"home_entry_transition"
|
||||
|
|
@ -382,6 +383,25 @@ func _configure_audio_performance_profile(light_profile: bool) -> void:
|
|||
_rain_ambience.set_audio_enabled(true)
|
||||
|
||||
|
||||
func _on_world_weather_changed(
|
||||
weather: WorldWeatherService.Weather,
|
||||
_seconds_remaining: float,
|
||||
) -> void:
|
||||
_apply_weather_visual_motion(weather)
|
||||
|
||||
|
||||
func _apply_weather_visual_motion(
|
||||
weather: WorldWeatherService.Weather,
|
||||
) -> void:
|
||||
var multiplier: float = (
|
||||
RAIN_VISUAL_MOTION_MULTIPLIER
|
||||
if weather == WorldWeatherService.Weather.RAINY
|
||||
else 1.0
|
||||
)
|
||||
_test_world.set_foliage_wind_strength_multiplier(multiplier)
|
||||
_test_world.set_water_motion_strength_multiplier(multiplier)
|
||||
|
||||
|
||||
func _load_optional_audio_stream(path: String) -> AudioStream:
|
||||
if not ResourceLoader.exists(path, "AudioStream"):
|
||||
return null
|
||||
|
|
@ -654,6 +674,11 @@ func _initialize_application(dedicated: bool) -> void:
|
|||
Callable(_player, "get_active_gameplay_camera"),
|
||||
_performance_profile.is_light(),
|
||||
)
|
||||
if not _world_weather.weather_changed.is_connected(
|
||||
_on_world_weather_changed
|
||||
):
|
||||
_world_weather.weather_changed.connect(_on_world_weather_changed)
|
||||
_apply_weather_visual_motion(_world_weather.get_weather())
|
||||
if not _world_time.natural_time_advanced.is_connected(
|
||||
_on_natural_time_advanced
|
||||
):
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const NETFISHING_PROFILE_ENVIRONMENT_VARIABLE := (
|
|||
"NETFISHING_PERFORMANCE_PROFILE"
|
||||
)
|
||||
const NETFISHING_LIGHT_ENVIRONMENT_VARIABLE := "NETFISHING_LOW_END"
|
||||
const PORTMASTER_BUILD_FEATURE: StringName = &"straywild_portmaster"
|
||||
const NORMAL_PROFILE: StringName = &"normal"
|
||||
const LIGHT_PROFILE: StringName = &"light"
|
||||
const NORMAL_WORLD_RENDER_SCALE: float = 1.0
|
||||
|
|
@ -18,6 +19,16 @@ var _profile_name: StringName = NORMAL_PROFILE
|
|||
|
||||
|
||||
static func from_environment() -> RuntimePerformanceProfile:
|
||||
return from_environment_for_portmaster_build(
|
||||
OS.has_feature(PORTMASTER_BUILD_FEATURE)
|
||||
)
|
||||
|
||||
|
||||
static func from_environment_for_portmaster_build(
|
||||
is_portmaster_build: bool,
|
||||
) -> RuntimePerformanceProfile:
|
||||
if not is_portmaster_build:
|
||||
return from_name(NORMAL_PROFILE)
|
||||
var profile_name: String = OS.get_environment(
|
||||
PROFILE_ENVIRONMENT_VARIABLE
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue