2026-07-25 21:24:01 -04:00
|
|
|
|
class_name FishingShop
|
|
|
|
|
|
extends Control
|
|
|
|
|
|
|
|
|
|
|
|
const INPUT_OWNER: StringName = &"fishing_shop"
|
|
|
|
|
|
const MAIN_SHOP_BUYER_ID: StringName = &"main_fishing_shop"
|
|
|
|
|
|
const FishBuyerProfileType = preload("res://economy/fish_buyer_profile.gd")
|
|
|
|
|
|
const PlayerWalletType = preload("res://economy/player_wallet.gd")
|
2026-07-25 22:15:39 -04:00
|
|
|
|
const FishingShopStockType = preload("res://economy/fishing_shop_stock.gd")
|
|
|
|
|
|
const ItemCatalogType = preload("res://items/item_catalog.gd")
|
|
|
|
|
|
const ItemDataType = preload("res://items/item_data.gd")
|
|
|
|
|
|
const PlayerBagType = preload("res://inventory/player_bag.gd")
|
2026-07-25 21:24:01 -04:00
|
|
|
|
const FishingSpotType = preload("res://fishing/fishing_spot.gd")
|
|
|
|
|
|
const PlayerFishingUpgradesType = preload(
|
|
|
|
|
|
"res://progression/player_fishing_upgrades.gd"
|
|
|
|
|
|
)
|
|
|
|
|
|
const PlayerType = preload("res://player/player.gd")
|
2026-07-25 22:15:39 -04:00
|
|
|
|
const PlayerCoolerCapacityType = preload(
|
|
|
|
|
|
"res://progression/player_cooler_capacity.gd"
|
|
|
|
|
|
)
|
2026-08-02 00:45:07 -04:00
|
|
|
|
const PlayerArtUnlocksType = preload(
|
|
|
|
|
|
"res://progression/player_art_unlocks.gd"
|
|
|
|
|
|
)
|
|
|
|
|
|
const ArtShopStockType = preload("res://economy/art_shop_stock.gd")
|
2026-07-25 21:24:01 -04:00
|
|
|
|
const ShopInteractionType = preload(
|
|
|
|
|
|
"res://world/fishing_shop_interaction.gd"
|
|
|
|
|
|
)
|
2026-07-31 21:20:23 -04:00
|
|
|
|
const UtilityPageStyleType = preload("res://ui/utility_page_style.gd")
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
signal menu_visibility_changed(is_open: bool)
|
2026-07-31 21:20:23 -04:00
|
|
|
|
signal sell_fish_requested
|
|
|
|
|
|
signal shop_cooler_return_requested
|
|
|
|
|
|
signal shop_cooler_confirmation_cancel_requested
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
enum CloseReason {
|
|
|
|
|
|
USER,
|
|
|
|
|
|
RANGE_EXIT,
|
|
|
|
|
|
WATER_RECOVERY,
|
|
|
|
|
|
SESSION_END,
|
|
|
|
|
|
TEARDOWN,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@onready var _wallet_label: Label = %WalletLabel
|
2026-07-31 21:20:23 -04:00
|
|
|
|
@onready var _shop_panel: PanelContainer = %ShopPanel
|
|
|
|
|
|
@onready var _shop_cooler_page: Control = %ShopCoolerPage
|
|
|
|
|
|
@onready var _shop_cooler_mount: Control = %ShopCoolerMount
|
|
|
|
|
|
@onready var _back_to_shop_button: Button = %BackToShopButton
|
|
|
|
|
|
@onready var _buy_mode_button: Button = %BuyModeButton
|
|
|
|
|
|
@onready var _sell_mode_button: Button = %SellModeButton
|
2026-07-25 21:24:01 -04:00
|
|
|
|
@onready var _feedback: Label = %Feedback
|
|
|
|
|
|
@onready var _reel_level: Label = %ReelLevel
|
|
|
|
|
|
@onready var _reel_effect: Label = %ReelEffect
|
|
|
|
|
|
@onready var _reel_cost: Label = %ReelCost
|
|
|
|
|
|
@onready var _reel_purchase: Button = %ReelPurchase
|
|
|
|
|
|
@onready var _barrier_level: Label = %BarrierLevel
|
|
|
|
|
|
@onready var _barrier_effect: Label = %BarrierEffect
|
|
|
|
|
|
@onready var _barrier_cost: Label = %BarrierCost
|
|
|
|
|
|
@onready var _barrier_purchase: Button = %BarrierPurchase
|
2026-07-25 22:15:39 -04:00
|
|
|
|
@onready var _supplies_list: VBoxContainer = %SuppliesList
|
|
|
|
|
|
@onready var _cooler_level: Label = %CoolerLevel
|
|
|
|
|
|
@onready var _cooler_effect: Label = %CoolerEffect
|
|
|
|
|
|
@onready var _cooler_cost: Label = %CoolerCost
|
|
|
|
|
|
@onready var _cooler_purchase: Button = %CoolerPurchase
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
var _player: PlayerType
|
|
|
|
|
|
var _wallet: PlayerWalletType
|
|
|
|
|
|
var _buyer: FishBuyerProfileType
|
|
|
|
|
|
var _upgrades: PlayerFishingUpgradesType
|
|
|
|
|
|
var _fishing_spot: FishingSpotType
|
|
|
|
|
|
var _interaction: ShopInteractionType
|
2026-07-25 22:15:39 -04:00
|
|
|
|
var _bag: PlayerBagType
|
|
|
|
|
|
var _item_catalog: ItemCatalogType
|
|
|
|
|
|
var _cooler_capacity: PlayerCoolerCapacityType
|
2026-08-02 00:45:07 -04:00
|
|
|
|
var _art_unlocks: PlayerArtUnlocksType
|
2026-07-29 18:51:51 -04:00
|
|
|
|
var _network_shop: NetworkShopService
|
2026-07-25 21:24:01 -04:00
|
|
|
|
var _prior_movement_enabled: bool = true
|
|
|
|
|
|
var _prior_camera_enabled: bool = true
|
|
|
|
|
|
var _prior_mouse_mode: Input.MouseMode = Input.MOUSE_MODE_VISIBLE
|
|
|
|
|
|
var _snapshot_stored: bool = false
|
|
|
|
|
|
var _mouse_snapshot_stored: bool = false
|
|
|
|
|
|
var _transaction_in_progress: bool = false
|
|
|
|
|
|
var _closing: bool = false
|
2026-07-31 21:20:23 -04:00
|
|
|
|
var _cooler_page_active: bool = false
|
|
|
|
|
|
var _cooler_modal_open: bool = false
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
2026-07-31 21:20:23 -04:00
|
|
|
|
UtilityPageStyleType.apply_page(self)
|
|
|
|
|
|
_apply_shop_styles()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
%CloseButton.pressed.connect(close_shop)
|
2026-07-31 21:20:23 -04:00
|
|
|
|
_buy_mode_button.pressed.connect(_focus_buy_page)
|
|
|
|
|
|
_sell_mode_button.pressed.connect(_request_shop_cooler)
|
|
|
|
|
|
_back_to_shop_button.pressed.connect(shop_cooler_return_requested.emit)
|
2026-07-25 21:24:01 -04:00
|
|
|
|
_reel_purchase.pressed.connect(_purchase_reel_speed)
|
|
|
|
|
|
_barrier_purchase.pressed.connect(_purchase_barrier_power)
|
2026-07-25 22:15:39 -04:00
|
|
|
|
_cooler_purchase.pressed.connect(_purchase_cooler_capacity)
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
2026-07-31 21:20:23 -04:00
|
|
|
|
func _request_shop_cooler() -> void:
|
|
|
|
|
|
if _transaction_in_progress:
|
|
|
|
|
|
_feedback.text = "Finish the current transaction first."
|
|
|
|
|
|
return
|
|
|
|
|
|
if not _is_transaction_context_valid():
|
|
|
|
|
|
_feedback.text = "The fishing shop is no longer available."
|
|
|
|
|
|
return
|
|
|
|
|
|
sell_fish_requested.emit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _focus_buy_page() -> void:
|
|
|
|
|
|
_feedback.text = ""
|
2026-08-02 00:45:07 -04:00
|
|
|
|
for child: Node in _supplies_list.get_children():
|
|
|
|
|
|
var stock_button := child as Button
|
|
|
|
|
|
if stock_button != null and not stock_button.disabled:
|
|
|
|
|
|
stock_button.grab_focus()
|
2026-07-31 21:20:23 -04:00
|
|
|
|
return
|
|
|
|
|
|
_reel_purchase.grab_focus()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _apply_shop_styles() -> void:
|
|
|
|
|
|
var shop_panel := $ShopPanel as PanelContainer
|
|
|
|
|
|
var shop_panel_style := UtilityPageStyleType.panel_style()
|
|
|
|
|
|
shop_panel_style.set_corner_radius_all(24)
|
|
|
|
|
|
shop_panel_style.content_margin_left = 0.0
|
|
|
|
|
|
shop_panel_style.content_margin_top = 0.0
|
|
|
|
|
|
shop_panel_style.content_margin_right = 0.0
|
|
|
|
|
|
shop_panel_style.content_margin_bottom = 0.0
|
|
|
|
|
|
shop_panel.add_theme_stylebox_override(
|
|
|
|
|
|
"panel", shop_panel_style
|
|
|
|
|
|
)
|
|
|
|
|
|
for panel: PanelContainer in [
|
|
|
|
|
|
$ShopPanel/Margin/Layout/Body/Upgrades/ReelCard,
|
|
|
|
|
|
$ShopPanel/Margin/Layout/Body/Upgrades/BarrierCard,
|
|
|
|
|
|
$ShopPanel/Margin/Layout/Body/Upgrades/CoolerCard,
|
|
|
|
|
|
]:
|
|
|
|
|
|
panel.add_theme_stylebox_override(
|
|
|
|
|
|
"panel", UtilityPageStyleType.row_style()
|
|
|
|
|
|
)
|
|
|
|
|
|
for button: BaseButton in [
|
|
|
|
|
|
%CloseButton,
|
|
|
|
|
|
_buy_mode_button,
|
|
|
|
|
|
_sell_mode_button,
|
|
|
|
|
|
_reel_purchase,
|
|
|
|
|
|
_barrier_purchase,
|
|
|
|
|
|
_cooler_purchase,
|
|
|
|
|
|
_back_to_shop_button,
|
|
|
|
|
|
]:
|
|
|
|
|
|
UtilityPageStyleType.apply_ocean_button(button)
|
|
|
|
|
|
_buy_mode_button.add_theme_stylebox_override(
|
|
|
|
|
|
"normal",
|
|
|
|
|
|
UtilityPageStyleType.ocean_button_style(
|
|
|
|
|
|
UtilityPageStyleType.OCEAN_SELECTED
|
|
|
|
|
|
),
|
|
|
|
|
|
)
|
|
|
|
|
|
_feedback.add_theme_color_override(
|
|
|
|
|
|
"font_color", UtilityPageStyleType.OCEAN_TEXT_SECONDARY
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 21:24:01 -04:00
|
|
|
|
func setup(
|
|
|
|
|
|
player: PlayerType,
|
|
|
|
|
|
wallet: PlayerWalletType,
|
|
|
|
|
|
buyer: FishBuyerProfileType,
|
|
|
|
|
|
upgrades: PlayerFishingUpgradesType,
|
|
|
|
|
|
fishing_spot: FishingSpotType,
|
|
|
|
|
|
interaction: ShopInteractionType,
|
2026-07-25 22:15:39 -04:00
|
|
|
|
bag: PlayerBagType,
|
|
|
|
|
|
item_catalog: ItemCatalogType,
|
|
|
|
|
|
cooler_capacity: PlayerCoolerCapacityType,
|
2026-08-02 00:45:07 -04:00
|
|
|
|
art_unlocks: PlayerArtUnlocksType,
|
2026-07-29 18:51:51 -04:00
|
|
|
|
network_shop: NetworkShopService,
|
2026-07-25 21:24:01 -04:00
|
|
|
|
) -> void:
|
|
|
|
|
|
_player = player
|
|
|
|
|
|
_wallet = wallet
|
|
|
|
|
|
_buyer = buyer
|
|
|
|
|
|
_upgrades = upgrades
|
|
|
|
|
|
_fishing_spot = fishing_spot
|
|
|
|
|
|
_interaction = interaction
|
2026-07-25 22:15:39 -04:00
|
|
|
|
_bag = bag
|
|
|
|
|
|
_item_catalog = item_catalog
|
|
|
|
|
|
_cooler_capacity = cooler_capacity
|
2026-08-02 00:45:07 -04:00
|
|
|
|
_art_unlocks = art_unlocks
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_network_shop = network_shop
|
|
|
|
|
|
if (
|
|
|
|
|
|
_network_shop != null
|
|
|
|
|
|
and not _network_shop.local_purchase_pending.is_connected(
|
|
|
|
|
|
_on_network_purchase_pending
|
|
|
|
|
|
)
|
|
|
|
|
|
):
|
|
|
|
|
|
_network_shop.local_purchase_pending.connect(
|
|
|
|
|
|
_on_network_purchase_pending
|
|
|
|
|
|
)
|
|
|
|
|
|
_network_shop.local_purchase_finished.connect(
|
|
|
|
|
|
_on_network_purchase_finished
|
|
|
|
|
|
)
|
2026-07-25 21:24:01 -04:00
|
|
|
|
if not _wallet.balance_changed.is_connected(_on_wallet_changed):
|
|
|
|
|
|
_wallet.balance_changed.connect(_on_wallet_changed)
|
|
|
|
|
|
if not _upgrades.upgrades_changed.is_connected(_on_upgrades_changed):
|
|
|
|
|
|
_upgrades.upgrades_changed.connect(_on_upgrades_changed)
|
2026-07-25 22:15:39 -04:00
|
|
|
|
if not _bag.contents_changed.is_connected(_on_bag_changed):
|
|
|
|
|
|
_bag.contents_changed.connect(_on_bag_changed)
|
|
|
|
|
|
if not _cooler_capacity.capacity_changed.is_connected(
|
|
|
|
|
|
_on_cooler_capacity_changed
|
|
|
|
|
|
):
|
|
|
|
|
|
_cooler_capacity.capacity_changed.connect(_on_cooler_capacity_changed)
|
2026-08-02 00:45:07 -04:00
|
|
|
|
if not _art_unlocks.unlocks_changed.is_connected(_on_art_unlocks_changed):
|
|
|
|
|
|
_art_unlocks.unlocks_changed.connect(_on_art_unlocks_changed)
|
2026-07-25 21:24:01 -04:00
|
|
|
|
_refresh_all()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func open_shop() -> bool:
|
|
|
|
|
|
if (
|
|
|
|
|
|
visible
|
|
|
|
|
|
or _player == null
|
|
|
|
|
|
or _interaction == null
|
|
|
|
|
|
or not _interaction.is_local_player_in_range()
|
|
|
|
|
|
or _fishing_spot == null
|
|
|
|
|
|
or not _fishing_spot.can_open_fishing_shop()
|
|
|
|
|
|
or _buyer == null
|
|
|
|
|
|
or not _buyer.is_valid()
|
|
|
|
|
|
or _buyer.id != MAIN_SHOP_BUYER_ID
|
|
|
|
|
|
):
|
|
|
|
|
|
return false
|
|
|
|
|
|
_closing = false
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_transaction_in_progress = (
|
|
|
|
|
|
_network_shop != null
|
|
|
|
|
|
and _network_shop.is_local_purchase_pending()
|
|
|
|
|
|
)
|
2026-07-25 21:24:01 -04:00
|
|
|
|
_prior_movement_enabled = _player.is_movement_enabled()
|
|
|
|
|
|
_prior_camera_enabled = _player.is_camera_input_enabled()
|
|
|
|
|
|
_prior_mouse_mode = Input.mouse_mode
|
|
|
|
|
|
_snapshot_stored = true
|
|
|
|
|
|
_mouse_snapshot_stored = true
|
|
|
|
|
|
_player.set_movement_enabled(false)
|
|
|
|
|
|
_player.set_camera_input_enabled(false)
|
|
|
|
|
|
_fishing_spot.set_local_menu_input_suppressed(INPUT_OWNER, true)
|
|
|
|
|
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
|
|
|
|
|
_feedback.text = ""
|
2026-07-31 21:20:23 -04:00
|
|
|
|
deactivate_shop_cooler_page()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
show()
|
|
|
|
|
|
_refresh_all()
|
2026-07-31 21:20:23 -04:00
|
|
|
|
_buy_mode_button.grab_focus()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
menu_visibility_changed.emit(true)
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func consume_escape() -> bool:
|
|
|
|
|
|
if not visible:
|
|
|
|
|
|
return false
|
2026-07-31 21:20:23 -04:00
|
|
|
|
if _cooler_page_active:
|
|
|
|
|
|
if _cooler_modal_open:
|
|
|
|
|
|
shop_cooler_confirmation_cancel_requested.emit()
|
|
|
|
|
|
else:
|
|
|
|
|
|
shop_cooler_return_requested.emit()
|
|
|
|
|
|
return true
|
|
|
|
|
|
close_shop()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
return true
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-31 21:20:23 -04:00
|
|
|
|
func get_shop_cooler_mount() -> Control:
|
|
|
|
|
|
return _shop_cooler_mount
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func activate_shop_cooler_page() -> void:
|
|
|
|
|
|
_cooler_page_active = true
|
|
|
|
|
|
_shop_panel.hide()
|
|
|
|
|
|
_shop_cooler_page.show()
|
|
|
|
|
|
_back_to_shop_button.disabled = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func deactivate_shop_cooler_page() -> void:
|
|
|
|
|
|
_cooler_page_active = false
|
|
|
|
|
|
_cooler_modal_open = false
|
|
|
|
|
|
_back_to_shop_button.disabled = false
|
|
|
|
|
|
_shop_cooler_page.hide()
|
|
|
|
|
|
_shop_panel.show()
|
|
|
|
|
|
if visible:
|
|
|
|
|
|
_buy_mode_button.grab_focus()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func set_shop_cooler_modal_open(is_open: bool) -> void:
|
|
|
|
|
|
_cooler_modal_open = is_open
|
|
|
|
|
|
_back_to_shop_button.disabled = is_open
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 21:24:01 -04:00
|
|
|
|
func close_shop(
|
|
|
|
|
|
reason: CloseReason = CloseReason.USER,
|
|
|
|
|
|
restore_controls: bool = true,
|
|
|
|
|
|
) -> void:
|
|
|
|
|
|
if not visible:
|
|
|
|
|
|
return
|
|
|
|
|
|
_closing = true
|
|
|
|
|
|
_transaction_in_progress = false
|
|
|
|
|
|
hide()
|
2026-08-06 01:00:52 -04:00
|
|
|
|
var current_viewport: Viewport = get_viewport()
|
|
|
|
|
|
if current_viewport != null:
|
|
|
|
|
|
current_viewport.gui_release_focus()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
if _fishing_spot != null and is_instance_valid(_fishing_spot):
|
|
|
|
|
|
_fishing_spot.set_local_menu_input_suppressed(INPUT_OWNER, false)
|
|
|
|
|
|
if (
|
|
|
|
|
|
restore_controls
|
|
|
|
|
|
and _snapshot_stored
|
|
|
|
|
|
and _fishing_spot != null
|
|
|
|
|
|
and _fishing_spot.is_ready_for_shop_transaction()
|
|
|
|
|
|
):
|
|
|
|
|
|
_player.set_movement_enabled(_prior_movement_enabled)
|
|
|
|
|
|
_player.set_camera_input_enabled(_prior_camera_enabled)
|
|
|
|
|
|
_snapshot_stored = false
|
|
|
|
|
|
_apply_mouse_close_policy(reason)
|
|
|
|
|
|
_closing = false
|
|
|
|
|
|
menu_visibility_changed.emit(false)
|
2026-07-31 21:20:23 -04:00
|
|
|
|
deactivate_shop_cooler_page()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func close_for_range_exit() -> void:
|
|
|
|
|
|
close_shop(CloseReason.RANGE_EXIT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func close_for_water_recovery() -> void:
|
|
|
|
|
|
# Recovery emits its starting signal immediately before it captures the
|
|
|
|
|
|
# player's current control state. Restore our local snapshot synchronously
|
|
|
|
|
|
# so recovery captures the pre-shop state, then becomes the new authority
|
|
|
|
|
|
# before another frame can process gameplay input.
|
|
|
|
|
|
close_shop(CloseReason.WATER_RECOVERY, true)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func close_for_session_end() -> void:
|
|
|
|
|
|
close_shop(CloseReason.SESSION_END, false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _exit_tree() -> void:
|
|
|
|
|
|
if visible:
|
|
|
|
|
|
close_shop(CloseReason.TEARDOWN, false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _refresh_all() -> void:
|
|
|
|
|
|
if not is_node_ready():
|
|
|
|
|
|
return
|
|
|
|
|
|
_refresh_wallet()
|
|
|
|
|
|
_refresh_upgrades()
|
2026-07-25 22:15:39 -04:00
|
|
|
|
_refresh_supplies()
|
|
|
|
|
|
_refresh_cooler_capacity()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _refresh_wallet() -> void:
|
|
|
|
|
|
_wallet_label.text = (
|
2026-07-26 23:18:51 -04:00
|
|
|
|
"wallet: $%d" % _wallet.get_balance()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
if _wallet != null
|
2026-07-26 23:18:51 -04:00
|
|
|
|
else "wallet: $0"
|
2026-07-25 21:24:01 -04:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _refresh_upgrades() -> void:
|
|
|
|
|
|
if _upgrades == null:
|
|
|
|
|
|
return
|
|
|
|
|
|
var reel_level: int = _upgrades.get_reel_speed_level()
|
|
|
|
|
|
var reel_cost: int = _upgrades.get_next_reel_speed_cost()
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_reel_level.text = "level %d" % reel_level
|
2026-07-25 21:24:01 -04:00
|
|
|
|
_reel_purchase.disabled = (
|
|
|
|
|
|
reel_cost < 0
|
|
|
|
|
|
or _transaction_in_progress
|
|
|
|
|
|
or _closing
|
2026-07-30 14:01:07 -04:00
|
|
|
|
or _network_shop == null
|
|
|
|
|
|
or not _network_shop.can_request_purchase()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
or not _upgrades.can_purchase_reel_speed(_wallet)
|
|
|
|
|
|
)
|
2026-07-30 14:01:07 -04:00
|
|
|
|
_reel_purchase.tooltip_text = (
|
|
|
|
|
|
"Purchases are unavailable in this session."
|
|
|
|
|
|
if _network_shop == null or not _network_shop.can_request_purchase()
|
|
|
|
|
|
else ""
|
|
|
|
|
|
)
|
2026-07-25 21:24:01 -04:00
|
|
|
|
if reel_cost < 0:
|
|
|
|
|
|
_reel_effect.text = "%.2f×" % _upgrades.get_reel_speed_multiplier()
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_reel_cost.text = "max"
|
2026-07-25 21:24:01 -04:00
|
|
|
|
else:
|
|
|
|
|
|
_reel_effect.text = (
|
|
|
|
|
|
"%.2f× → %.2f×"
|
|
|
|
|
|
% [
|
|
|
|
|
|
_upgrades.get_reel_speed_multiplier(),
|
|
|
|
|
|
1.0 + float(reel_level + 1) * 0.10,
|
|
|
|
|
|
]
|
|
|
|
|
|
)
|
|
|
|
|
|
_reel_cost.text = "$%d" % reel_cost
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_reel_purchase.text = "max" if reel_cost < 0 else "purchase"
|
2026-07-25 21:24:01 -04:00
|
|
|
|
var barrier_level: int = _upgrades.get_barrier_power_level()
|
|
|
|
|
|
var barrier_cost: int = _upgrades.get_next_barrier_power_cost()
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_barrier_level.text = "level %d" % barrier_level
|
2026-07-25 21:24:01 -04:00
|
|
|
|
_barrier_purchase.disabled = (
|
|
|
|
|
|
barrier_cost < 0
|
|
|
|
|
|
or _transaction_in_progress
|
|
|
|
|
|
or _closing
|
2026-07-30 14:01:07 -04:00
|
|
|
|
or _network_shop == null
|
|
|
|
|
|
or not _network_shop.can_request_purchase()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
or not _upgrades.can_purchase_barrier_power(_wallet)
|
|
|
|
|
|
)
|
2026-07-30 14:01:07 -04:00
|
|
|
|
_barrier_purchase.tooltip_text = _reel_purchase.tooltip_text
|
2026-07-25 21:24:01 -04:00
|
|
|
|
if barrier_cost < 0:
|
|
|
|
|
|
_barrier_effect.text = "%d damage" % _upgrades.get_barrier_damage()
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_barrier_cost.text = "max"
|
2026-07-25 21:24:01 -04:00
|
|
|
|
else:
|
|
|
|
|
|
_barrier_effect.text = (
|
|
|
|
|
|
"%d damage → %d damage"
|
|
|
|
|
|
% [
|
|
|
|
|
|
_upgrades.get_barrier_damage(),
|
|
|
|
|
|
barrier_level + 2,
|
|
|
|
|
|
]
|
|
|
|
|
|
)
|
|
|
|
|
|
_barrier_cost.text = "$%d" % barrier_cost
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_barrier_purchase.text = "max" if barrier_cost < 0 else "purchase"
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 22:15:39 -04:00
|
|
|
|
func _refresh_supplies() -> void:
|
|
|
|
|
|
if _supplies_list == null:
|
|
|
|
|
|
return
|
|
|
|
|
|
for child: Node in _supplies_list.get_children():
|
|
|
|
|
|
_supplies_list.remove_child(child)
|
|
|
|
|
|
child.queue_free()
|
2026-08-02 00:45:07 -04:00
|
|
|
|
_add_stock_section("supplies")
|
2026-07-25 22:15:39 -04:00
|
|
|
|
for item_id: StringName in FishingShopStockType.get_stock_item_ids():
|
|
|
|
|
|
var item: ItemDataType = _item_catalog.get_item_by_id(item_id)
|
|
|
|
|
|
if item == null:
|
|
|
|
|
|
continue
|
|
|
|
|
|
var button := Button.new()
|
|
|
|
|
|
button.custom_minimum_size = Vector2(195, 54)
|
|
|
|
|
|
button.icon = item.icon
|
|
|
|
|
|
button.expand_icon = true
|
|
|
|
|
|
button.alignment = HORIZONTAL_ALIGNMENT_LEFT
|
2026-07-26 23:18:51 -04:00
|
|
|
|
button.text = "%s\n$%d • owned %d" % [
|
2026-07-25 22:15:39 -04:00
|
|
|
|
item.display_name,
|
|
|
|
|
|
FishingShopStockType.get_price(item_id),
|
|
|
|
|
|
_bag.get_quantity(item_id),
|
|
|
|
|
|
]
|
2026-08-06 01:00:52 -04:00
|
|
|
|
if FishingShopStockType.is_bait_topoff(item_id):
|
|
|
|
|
|
button.text = "%s\n$%d each • %d/%d" % [
|
|
|
|
|
|
item.display_name,
|
|
|
|
|
|
FishingShopStockType.get_price(item_id),
|
|
|
|
|
|
_bag.get_quantity(item_id),
|
|
|
|
|
|
FishingShopStockType.WORM_MAX_STACK,
|
|
|
|
|
|
]
|
2026-07-25 22:15:39 -04:00
|
|
|
|
button.tooltip_text = item.description
|
|
|
|
|
|
button.disabled = (
|
|
|
|
|
|
_transaction_in_progress
|
|
|
|
|
|
or _closing
|
2026-07-30 14:01:07 -04:00
|
|
|
|
or _network_shop == null
|
|
|
|
|
|
or not _network_shop.can_request_purchase()
|
2026-08-06 01:00:52 -04:00
|
|
|
|
or FishingShopStockType.get_purchase_quantity(item_id, _bag.get_quantity(item_id)) <= 0
|
|
|
|
|
|
or not _bag.can_add_item(item_id, FishingShopStockType.get_purchase_quantity(item_id, _bag.get_quantity(item_id)))
|
2026-07-25 22:15:39 -04:00
|
|
|
|
or not _wallet.can_afford(
|
2026-08-06 01:00:52 -04:00
|
|
|
|
FishingShopStockType.get_price(item_id) * FishingShopStockType.get_purchase_quantity(item_id, _bag.get_quantity(item_id))
|
2026-07-25 22:15:39 -04:00
|
|
|
|
)
|
|
|
|
|
|
)
|
2026-07-30 14:01:07 -04:00
|
|
|
|
button.tooltip_text = (
|
|
|
|
|
|
"Purchases are unavailable in this session."
|
|
|
|
|
|
if _network_shop == null or not _network_shop.can_request_purchase()
|
|
|
|
|
|
else item.description
|
|
|
|
|
|
)
|
2026-07-31 21:20:23 -04:00
|
|
|
|
UtilityPageStyleType.apply_ocean_button(button)
|
2026-07-25 22:15:39 -04:00
|
|
|
|
button.pressed.connect(_purchase_supply.bind(item_id))
|
|
|
|
|
|
_supplies_list.add_child(button)
|
2026-08-02 00:45:07 -04:00
|
|
|
|
_add_stock_section("art kit")
|
|
|
|
|
|
_add_art_kit_button()
|
|
|
|
|
|
_add_stock_section("markers")
|
|
|
|
|
|
for product_id: StringName in ArtShopStockType.MARKER_PRODUCTS:
|
|
|
|
|
|
_add_art_upgrade_button(product_id)
|
|
|
|
|
|
_add_stock_section("brushes")
|
|
|
|
|
|
for product_id: StringName in ArtShopStockType.BRUSH_PRODUCTS:
|
|
|
|
|
|
_add_art_upgrade_button(product_id)
|
|
|
|
|
|
_add_stock_section("grids")
|
|
|
|
|
|
for product_id: StringName in ArtShopStockType.GRID_PRODUCTS:
|
|
|
|
|
|
_add_art_upgrade_button(product_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _add_stock_section(title: String) -> void:
|
|
|
|
|
|
var label := Label.new()
|
|
|
|
|
|
label.text = title
|
|
|
|
|
|
label.add_theme_font_size_override("font_size", 21)
|
|
|
|
|
|
label.add_theme_color_override(
|
|
|
|
|
|
"font_color", UtilityPageStyleType.OCEAN_TEXT_SECONDARY
|
|
|
|
|
|
)
|
|
|
|
|
|
_supplies_list.add_child(label)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _add_art_kit_button() -> void:
|
|
|
|
|
|
var item: ItemDataType = _item_catalog.get_item_by_id(
|
|
|
|
|
|
ArtShopStockType.ART_KIT_ITEM_ID
|
|
|
|
|
|
)
|
|
|
|
|
|
if item == null:
|
|
|
|
|
|
return
|
|
|
|
|
|
var owned: bool = _bag.get_quantity(ArtShopStockType.ART_KIT_ITEM_ID) > 0
|
|
|
|
|
|
var button: Button = _make_stock_button(
|
|
|
|
|
|
"%s\n$%d • %s" % [
|
|
|
|
|
|
item.display_name,
|
|
|
|
|
|
ArtShopStockType.ART_KIT_PRICE,
|
|
|
|
|
|
"owned" if owned else "not owned",
|
|
|
|
|
|
],
|
|
|
|
|
|
item.description,
|
|
|
|
|
|
)
|
|
|
|
|
|
button.icon = item.icon
|
|
|
|
|
|
button.expand_icon = true
|
|
|
|
|
|
button.disabled = (
|
|
|
|
|
|
owned
|
|
|
|
|
|
or _transaction_in_progress
|
|
|
|
|
|
or _closing
|
|
|
|
|
|
or _network_shop == null
|
|
|
|
|
|
or not _network_shop.can_request_art_purchase()
|
|
|
|
|
|
or not _bag.can_add_item(ArtShopStockType.ART_KIT_ITEM_ID, 1)
|
|
|
|
|
|
or not _wallet.can_afford(ArtShopStockType.ART_KIT_PRICE)
|
|
|
|
|
|
)
|
|
|
|
|
|
button.pressed.connect(_purchase_art_kit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _add_art_upgrade_button(product_id: StringName) -> void:
|
|
|
|
|
|
var kit_owned: bool = (
|
|
|
|
|
|
_bag.get_quantity(ArtShopStockType.ART_KIT_ITEM_ID) > 0
|
|
|
|
|
|
)
|
|
|
|
|
|
var unlocked: bool = _art_unlocks.owns_product(product_id)
|
|
|
|
|
|
var button: Button = _make_stock_button(
|
|
|
|
|
|
"%s\n$%d • %s" % [
|
|
|
|
|
|
ArtShopStockType.get_display_name(product_id),
|
|
|
|
|
|
ArtShopStockType.UPGRADE_PRICE,
|
|
|
|
|
|
"unlocked" if unlocked else "locked",
|
|
|
|
|
|
],
|
|
|
|
|
|
ArtShopStockType.get_description(product_id),
|
|
|
|
|
|
)
|
|
|
|
|
|
button.disabled = (
|
|
|
|
|
|
not kit_owned
|
|
|
|
|
|
or unlocked
|
|
|
|
|
|
or _transaction_in_progress
|
|
|
|
|
|
or _closing
|
|
|
|
|
|
or _network_shop == null
|
|
|
|
|
|
or not _network_shop.can_request_art_purchase()
|
|
|
|
|
|
or not _wallet.can_afford(ArtShopStockType.UPGRADE_PRICE)
|
|
|
|
|
|
)
|
|
|
|
|
|
button.pressed.connect(_purchase_art_upgrade.bind(product_id))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _make_stock_button(button_text: String, tooltip: String) -> Button:
|
|
|
|
|
|
var button := Button.new()
|
|
|
|
|
|
button.custom_minimum_size = Vector2(195, 54)
|
|
|
|
|
|
button.alignment = HORIZONTAL_ALIGNMENT_LEFT
|
|
|
|
|
|
button.text = button_text
|
|
|
|
|
|
button.tooltip_text = tooltip
|
|
|
|
|
|
UtilityPageStyleType.apply_ocean_button(button)
|
|
|
|
|
|
_supplies_list.add_child(button)
|
|
|
|
|
|
return button
|
2026-07-25 22:15:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _refresh_cooler_capacity() -> void:
|
|
|
|
|
|
if _cooler_capacity == null:
|
|
|
|
|
|
return
|
|
|
|
|
|
var level: int = _cooler_capacity.get_level()
|
|
|
|
|
|
var cost: int = _cooler_capacity.get_next_cost()
|
|
|
|
|
|
var next_capacity: int = _cooler_capacity.get_next_capacity()
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_cooler_level.text = "level %d" % level
|
2026-07-25 22:15:39 -04:00
|
|
|
|
_cooler_purchase.disabled = (
|
|
|
|
|
|
cost < 0
|
|
|
|
|
|
or _transaction_in_progress
|
|
|
|
|
|
or _closing
|
2026-07-30 14:01:07 -04:00
|
|
|
|
or _network_shop == null
|
|
|
|
|
|
or not _network_shop.can_request_purchase()
|
2026-07-25 22:15:39 -04:00
|
|
|
|
or not _cooler_capacity.can_purchase(_wallet)
|
|
|
|
|
|
)
|
2026-07-30 14:01:07 -04:00
|
|
|
|
_cooler_purchase.tooltip_text = _reel_purchase.tooltip_text
|
2026-07-25 22:15:39 -04:00
|
|
|
|
if cost < 0:
|
|
|
|
|
|
_cooler_effect.text = "%d fish" % _cooler_capacity.get_capacity()
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_cooler_cost.text = "max"
|
|
|
|
|
|
_cooler_purchase.text = "max"
|
2026-07-25 22:15:39 -04:00
|
|
|
|
else:
|
|
|
|
|
|
_cooler_effect.text = "%d → %d fish" % [
|
|
|
|
|
|
_cooler_capacity.get_capacity(),
|
|
|
|
|
|
next_capacity,
|
|
|
|
|
|
]
|
|
|
|
|
|
_cooler_cost.text = "$%d" % cost
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_cooler_purchase.text = "purchase"
|
2026-07-25 22:15:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 21:24:01 -04:00
|
|
|
|
func _purchase_reel_speed() -> void:
|
|
|
|
|
|
_purchase_upgrade(true)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _purchase_barrier_power() -> void:
|
|
|
|
|
|
_purchase_upgrade(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 22:15:39 -04:00
|
|
|
|
func _purchase_supply(item_id: StringName) -> void:
|
|
|
|
|
|
if _transaction_in_progress or not _is_transaction_context_valid():
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_feedback.text = "unable to complete purchase."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
2026-08-06 01:00:52 -04:00
|
|
|
|
var owned: int = _bag.get_quantity(item_id)
|
|
|
|
|
|
var quantity: int = FishingShopStockType.get_purchase_quantity(item_id, owned)
|
|
|
|
|
|
if quantity <= 0 or not _bag.can_add_item(item_id, quantity):
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_feedback.text = "Your Bag is full."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
2026-08-06 01:00:52 -04:00
|
|
|
|
if not _wallet.can_afford(FishingShopStockType.get_price(item_id) * quantity):
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_feedback.text = "Not enough fish coin."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
2026-07-29 18:51:51 -04:00
|
|
|
|
if _network_shop == null:
|
|
|
|
|
|
_feedback.text = "Purchase could not be completed."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_network_shop.request_supply(item_id)
|
2026-07-25 22:15:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
2026-08-02 00:45:07 -04:00
|
|
|
|
func _purchase_art_kit() -> void:
|
|
|
|
|
|
if _network_shop == null or not _is_transaction_context_valid():
|
|
|
|
|
|
_feedback.text = "Purchase could not be completed."
|
|
|
|
|
|
return
|
|
|
|
|
|
_network_shop.request_art_kit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _purchase_art_upgrade(product_id: StringName) -> void:
|
|
|
|
|
|
if _network_shop == null or not _is_transaction_context_valid():
|
|
|
|
|
|
_feedback.text = "Purchase could not be completed."
|
|
|
|
|
|
return
|
|
|
|
|
|
_network_shop.request_art_upgrade(product_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 22:15:39 -04:00
|
|
|
|
func _purchase_cooler_capacity() -> void:
|
|
|
|
|
|
if _transaction_in_progress or not _is_transaction_context_valid():
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_feedback.text = "unable to complete purchase."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
|
|
|
|
|
var cost: int = _cooler_capacity.get_next_cost()
|
|
|
|
|
|
if cost < 0:
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_feedback.text = "Upgrade is already at maximum."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
|
|
|
|
|
if not _wallet.can_afford(cost):
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_feedback.text = "Not enough fish coin."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
2026-07-29 18:51:51 -04:00
|
|
|
|
if _network_shop == null:
|
|
|
|
|
|
_feedback.text = "Purchase could not be completed."
|
2026-07-25 22:15:39 -04:00
|
|
|
|
return
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_network_shop.request_cooler_capacity_upgrade()
|
2026-07-25 22:15:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 21:24:01 -04:00
|
|
|
|
func _purchase_upgrade(is_reel_speed: bool) -> void:
|
|
|
|
|
|
if _transaction_in_progress or not _is_transaction_context_valid():
|
2026-07-26 23:18:51 -04:00
|
|
|
|
_feedback.text = "unable to complete purchase."
|
2026-07-25 21:24:01 -04:00
|
|
|
|
return
|
|
|
|
|
|
var cost: int = (
|
|
|
|
|
|
_upgrades.get_next_reel_speed_cost()
|
|
|
|
|
|
if is_reel_speed
|
|
|
|
|
|
else _upgrades.get_next_barrier_power_cost()
|
|
|
|
|
|
)
|
|
|
|
|
|
if cost < 0:
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_feedback.text = "Upgrade is already at maximum."
|
2026-07-25 21:24:01 -04:00
|
|
|
|
return
|
|
|
|
|
|
if not _wallet.can_afford(cost):
|
2026-07-29 18:51:51 -04:00
|
|
|
|
_feedback.text = "Not enough fish coin."
|
2026-07-25 21:24:01 -04:00
|
|
|
|
return
|
2026-07-29 18:51:51 -04:00
|
|
|
|
if _network_shop == null:
|
|
|
|
|
|
_feedback.text = "Purchase could not be completed."
|
|
|
|
|
|
return
|
|
|
|
|
|
if is_reel_speed:
|
|
|
|
|
|
_network_shop.request_reel_speed_upgrade()
|
|
|
|
|
|
else:
|
|
|
|
|
|
_network_shop.request_barrier_power_upgrade()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_network_purchase_pending(_request_id: String) -> void:
|
2026-07-25 21:24:01 -04:00
|
|
|
|
_transaction_in_progress = true
|
2026-07-29 18:51:51 -04:00
|
|
|
|
if visible:
|
|
|
|
|
|
_feedback.text = "Purchasing…"
|
|
|
|
|
|
_refresh_all()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_network_purchase_finished(
|
|
|
|
|
|
_request_id: String,
|
|
|
|
|
|
accepted: bool,
|
|
|
|
|
|
message: String,
|
|
|
|
|
|
_product_id: StringName,
|
|
|
|
|
|
_category: int,
|
|
|
|
|
|
_quantity: int,
|
|
|
|
|
|
total_cost: int,
|
|
|
|
|
|
) -> void:
|
2026-07-25 21:24:01 -04:00
|
|
|
|
_transaction_in_progress = false
|
2026-07-29 18:51:51 -04:00
|
|
|
|
if not visible:
|
2026-07-25 21:24:01 -04:00
|
|
|
|
return
|
|
|
|
|
|
_feedback.text = (
|
2026-07-29 18:51:51 -04:00
|
|
|
|
"Purchase complete. $%d spent." % total_cost
|
|
|
|
|
|
if accepted
|
|
|
|
|
|
else message
|
2026-07-25 21:24:01 -04:00
|
|
|
|
)
|
|
|
|
|
|
_refresh_all()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _is_transaction_context_valid() -> bool:
|
|
|
|
|
|
return (
|
|
|
|
|
|
visible
|
|
|
|
|
|
and not _closing
|
|
|
|
|
|
and _interaction != null
|
|
|
|
|
|
and _interaction.is_local_player_in_range()
|
|
|
|
|
|
and _fishing_spot != null
|
|
|
|
|
|
and _fishing_spot.is_ready_for_shop_transaction()
|
|
|
|
|
|
and _buyer != null
|
|
|
|
|
|
and _buyer.is_valid()
|
|
|
|
|
|
and _buyer.id == MAIN_SHOP_BUYER_ID
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_wallet_changed(_balance: int, _delta: int) -> void:
|
|
|
|
|
|
_refresh_wallet()
|
|
|
|
|
|
_refresh_upgrades()
|
2026-07-25 22:15:39 -04:00
|
|
|
|
_refresh_supplies()
|
|
|
|
|
|
_refresh_cooler_capacity()
|
2026-07-25 21:24:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_changed(
|
|
|
|
|
|
_reel_speed_level: int,
|
|
|
|
|
|
_barrier_power_level: int,
|
|
|
|
|
|
) -> void:
|
|
|
|
|
|
_refresh_upgrades()
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 22:15:39 -04:00
|
|
|
|
func _on_bag_changed() -> void:
|
|
|
|
|
|
_refresh_supplies()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_cooler_capacity_changed(_level: int, _capacity: int) -> void:
|
|
|
|
|
|
_refresh_cooler_capacity()
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-08-02 00:45:07 -04:00
|
|
|
|
func _on_art_unlocks_changed(_unlock_mask: int) -> void:
|
|
|
|
|
|
_refresh_supplies()
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 21:24:01 -04:00
|
|
|
|
func _apply_mouse_close_policy(reason: CloseReason) -> void:
|
|
|
|
|
|
if not _mouse_snapshot_stored:
|
|
|
|
|
|
return
|
|
|
|
|
|
match reason:
|
|
|
|
|
|
CloseReason.USER, CloseReason.RANGE_EXIT:
|
|
|
|
|
|
Input.mouse_mode = _prior_mouse_mode
|
|
|
|
|
|
CloseReason.WATER_RECOVERY:
|
|
|
|
|
|
Input.mouse_mode = _prior_mouse_mode
|
|
|
|
|
|
CloseReason.SESSION_END:
|
|
|
|
|
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
|
|
|
|
|
CloseReason.TEARDOWN:
|
|
|
|
|
|
pass
|
|
|
|
|
|
_mouse_snapshot_stored = false
|