forked from woofmeow/straywild
Optimize PortMaster low-memory profile
This commit is contained in:
parent
b27883d115
commit
021de5aca4
16 changed files with 327 additions and 31 deletions
|
|
@ -1723,6 +1723,10 @@ func get_title_screen() -> TitleScreenType:
|
|||
return _title_screen
|
||||
|
||||
|
||||
func set_light_performance_profile(light_profile: bool) -> void:
|
||||
_player_menu.set_light_performance_profile(light_profile)
|
||||
|
||||
|
||||
func set_effective_ui_pixel_size(pixel_size: int) -> void:
|
||||
_title_settings_panel.set_effective_ui_pixel_size(pixel_size)
|
||||
_pause_settings_panel.set_effective_ui_pixel_size(pixel_size)
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ const BAG_STORAGE_COLUMNS: int = 5
|
|||
const BAG_STORAGE_MINIMUM_SLOTS: int = 15
|
||||
const SALE_CONFIRMATION_SIZE := Vector2(520.0, 190.0)
|
||||
const CONTROLLER_PICKUP_HOLD_SECONDS: float = 0.42
|
||||
const LIGHT_COOLER_WATER_COLOR := Color(0.037, 0.27, 0.375, 1.0)
|
||||
|
||||
@onready var _navigation_cluster: BubbleClusterType = %NavigationCluster
|
||||
@onready var _presentation_scale_root: Control = %PlayerMenuPresentationScaleRoot
|
||||
|
|
@ -253,6 +254,7 @@ var _sale_buyer_override: FishBuyerProfileType
|
|||
var _shop_cooler_context_active: bool = false
|
||||
var _cooler_original_parent: Node
|
||||
var _cooler_original_index: int = -1
|
||||
var _authored_cooler_water_material: ShaderMaterial
|
||||
var _confirmation_original_parent: Node
|
||||
var _confirmation_original_index: int = -1
|
||||
var _catalog: FishPoolType
|
||||
|
|
@ -325,6 +327,9 @@ var _motion_elapsed: float = 0.0
|
|||
|
||||
|
||||
func _ready() -> void:
|
||||
_authored_cooler_water_material = (
|
||||
_cooler_water_surface.material as ShaderMaterial
|
||||
)
|
||||
_configure_inventory_transition_group()
|
||||
_cooler_original_parent = _cooler_page.get_parent()
|
||||
_cooler_original_index = _cooler_page.get_index()
|
||||
|
|
@ -445,6 +450,21 @@ func _update_cooler_water_mask() -> void:
|
|||
)
|
||||
|
||||
|
||||
func set_light_performance_profile(light_profile: bool) -> void:
|
||||
_cooler_water_surface.material = (
|
||||
null if light_profile else _authored_cooler_water_material
|
||||
)
|
||||
_cooler_water_surface.color = (
|
||||
LIGHT_COOLER_WATER_COLOR if light_profile else Color.WHITE
|
||||
)
|
||||
if not light_profile:
|
||||
_update_cooler_water_mask()
|
||||
|
||||
|
||||
func is_cooler_water_effect_enabled() -> bool:
|
||||
return _cooler_water_surface.material is ShaderMaterial
|
||||
|
||||
|
||||
func setup(
|
||||
player: PlayerType,
|
||||
inventory: FishInventoryType,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ script = ExtResource("1")
|
|||
[node name="Viewport" type="SubViewport" parent="."]
|
||||
transparent_bg = true
|
||||
size = Vector2i(320, 330)
|
||||
render_target_update_mode = 4
|
||||
render_target_update_mode = 2
|
||||
world_3d = SubResource("PreviewWorld")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="Viewport"]
|
||||
|
|
|
|||
|
|
@ -155,6 +155,7 @@ var _decorative_bubbles: Array[TextureRect] = []
|
|||
var _decorative_bubble_tweens: Dictionary[int, Tween] = {}
|
||||
var _transition_bubble_ids: Dictionary[int, bool] = {}
|
||||
var _pending_cluster_bubbles: int = 0
|
||||
var _minimal_presentation: bool = false
|
||||
var _awaiting_start_input: bool = false
|
||||
var _start_prompt_elapsed: float = 0.0
|
||||
var _navigation_focus_active: bool = false
|
||||
|
|
@ -260,6 +261,14 @@ func setup(
|
|||
_begin_title_entry()
|
||||
|
||||
|
||||
func set_minimal_presentation(enabled: bool) -> void:
|
||||
_minimal_presentation = enabled
|
||||
if _minimal_presentation:
|
||||
_stop_decorative_presentation()
|
||||
elif visible:
|
||||
_start_decorative_presentation()
|
||||
|
||||
|
||||
func reopen() -> void:
|
||||
_cancel_title_entry_transition()
|
||||
_cancel_title_settings_transition()
|
||||
|
|
@ -1513,6 +1522,7 @@ func _start_decorative_presentation() -> void:
|
|||
not _decorative_presentation_ready
|
||||
or not visible
|
||||
or _decorative_presentation_active
|
||||
or _minimal_presentation
|
||||
):
|
||||
return
|
||||
_decorative_generation += 1
|
||||
|
|
@ -1977,7 +1987,11 @@ func _get_idle_decorative_bubble_count() -> int:
|
|||
|
||||
|
||||
func _emit_navigation_bubble_flurry() -> void:
|
||||
if not _decorative_presentation_active or not visible:
|
||||
if (
|
||||
_minimal_presentation
|
||||
or not _decorative_presentation_active
|
||||
or not visible
|
||||
):
|
||||
return
|
||||
var bubble_count: int = _decorative_rng.randi_range(
|
||||
TRANSITION_BUBBLE_COUNT_MIN,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue