Add portable RV homes and decor prototype

This commit is contained in:
Alexander Sellite 2026-08-30 21:37:26 -04:00
parent 81decf2b71
commit fe099f47dd
56 changed files with 5459 additions and 112 deletions

View file

@ -20,6 +20,7 @@ const TitleScreenType = preload("res://ui/title_screen.gd")
const PauseMenuType = preload("res://ui/pause_menu.gd")
const NetworkSessionType = preload("res://network/network_session.gd")
const FishingShopType = preload("res://ui/fishing_shop.gd")
const DecorShopType = preload("res://ui/decor_shop.gd")
const SettingsPanelType = preload("res://ui/settings_panel.gd")
const PlayerFishingUpgradesType = preload(
"res://progression/player_fishing_upgrades.gd"
@ -27,7 +28,11 @@ const PlayerFishingUpgradesType = preload(
const ShopInteractionType = preload(
"res://world/fishing_shop_interaction.gd"
)
const DecorShopInteractionType = preload(
"res://world/decor_shop_interaction.gd"
)
const PlayerStorageType = preload("res://ui/player_storage.gd")
const HomeDecorToolbarType = preload("res://ui/home_decor_toolbar.gd")
const PlayerStorageInteractionType = preload(
"res://world/player_storage_interaction.gd"
)
@ -71,6 +76,9 @@ const MAIN_BUBBLE_PROFILE: BubbleMenuProfile = preload(
const ACTIVE_BAIT_EMPTY_ICON: Texture2D = preload(
"res://ui/icons/pictograms/x_dark.png"
)
const RV_STORAGE_ICON: Texture2D = preload(
"res://ui/icons/tab_menu/inventory_simple.png"
)
signal pixelation_settings_visibility_changed(is_visible: bool)
signal crisp_reset_focus_requested
@ -82,6 +90,7 @@ signal virtual_pointer_mode_changed(is_active: bool)
signal social_prompt_accepted
signal social_prompt_declined
signal data_root_changed
signal rv_storage_requested
const VIRTUAL_MOUSE_INPUT_OWNER: StringName = &"controller_virtual_mouse"
const EMOTE_RADIAL_CAMERA_OWNER: StringName = &"emote_radial_menu"
@ -145,7 +154,10 @@ const SHOP_NPC_SPEECH_COOLDOWN_MILLISECONDS: int = 5000
@onready var _social_prompt: BubbleConfirmationPage = %SocialPrompt
@onready var _hotbar_ui: HotbarUIType = %Hotbar
@onready var _fishing_shop: FishingShopType = %FishingShop
@onready var _decor_shop: DecorShopType = %DecorShop
@onready var _player_storage: PlayerStorageType = %PlayerStorage
@onready var _home_decor_toolbar: HomeDecorToolbarType = %HomeDecorToolbar
@onready var _rv_storage_button: Button = %RVStorageButton
@onready var _storage_prompt: PanelContainer = %StoragePrompt
@onready var _storage_prompt_message: Label = %StoragePromptMessage
@onready var _shop_prompt: Control = %ShopPrompt
@ -195,6 +207,7 @@ var _chat_input_open: bool = false
var _player_menu_hotbar_visible: bool = false
var _main_shop_buyer: FishBuyerProfileType
var _shop_interaction: ShopInteractionType
var _decor_shop_interaction: DecorShopInteractionType
var _storage_interaction: PlayerStorageInteractionType
var _surface_drawing: NetworkSurfaceDrawingService
var _surface_drawing_hotbar_selected: bool = false
@ -221,14 +234,17 @@ var _controller_text_entry_request: Callable
var _controller_text_entry_is_open: Callable
var _controller_text_entry_close: Callable
var _restore_chat_keyboard_after_fishing: bool = false
var _rv_storage_button_requested_visible: bool = false
func _ready() -> void:
_prioritize_surface_drawing_pointer_input()
_bite_prompt_button.pressed.connect(_on_bite_prompt_pressed)
_rv_storage_button.pressed.connect(_on_rv_storage_button_pressed)
_social_prompt.confirmed.connect(_accept_social_prompt)
_social_prompt.cancelled.connect(_decline_social_prompt)
_apply_active_bait_indicator_style()
_apply_rv_storage_button_style()
_refresh_active_bait_indicator()
_refresh_interaction_prompt_bindings()
# Reward feedback must remain above full-screen canonical menus. Keeping the
@ -346,11 +362,13 @@ func setup(
fishing_upgrades: PlayerFishingUpgradesType,
shop_interaction: ShopInteractionType,
storage_interaction: PlayerStorageInteractionType,
decor_shop_interaction: DecorShopInteractionType,
item_effects: PlayerItemEffectsType,
cooler_capacity: PlayerCoolerCapacityType,
network_session: NetworkSessionType,
network_sale_service: NetworkSaleService,
network_shop_service: NetworkShopService,
home_state: PlayerHomeState,
network_chat_service: NetworkChatService,
network_profile: NetworkProfilePreferences,
spawn_service: PlayerSpawnService,
@ -494,6 +512,15 @@ func setup(
network_sale_service,
reservations,
)
_decor_shop.setup(
player,
wallet,
fishing_spot,
decor_shop_interaction,
bag,
home_state,
network_shop_service,
)
_player_storage.setup(
player,
fishing_spot,
@ -509,6 +536,8 @@ func setup(
)
_fishing_shop.menu_visibility_changed.connect(_on_shop_visibility_changed)
_fishing_shop.menu_exit_started.connect(_on_shop_exit_started)
_decor_shop.menu_visibility_changed.connect(_on_shop_visibility_changed)
_decor_shop.menu_exit_started.connect(_on_shop_exit_started)
_fishing_shop.sell_fish_requested.connect(_on_shop_sell_fish_requested)
_fishing_shop.shop_cooler_return_requested.connect(
_on_shop_cooler_return_requested
@ -518,6 +547,7 @@ func setup(
)
_main_shop_buyer = main_shop_buyer
_shop_interaction = shop_interaction
_decor_shop_interaction = decor_shop_interaction
_storage_interaction = storage_interaction
_surface_drawing = surface_drawing
if (
@ -540,11 +570,14 @@ func setup(
func set_world_interactions(
shop_interaction: ShopInteractionType,
storage_interaction: PlayerStorageInteractionType,
decor_shop_interaction: DecorShopInteractionType,
) -> void:
_shop_interaction = shop_interaction
_storage_interaction = storage_interaction
_decor_shop_interaction = decor_shop_interaction
_fishing_shop.set_world_interaction(shop_interaction)
_player_storage.set_world_interaction(storage_interaction)
_decor_shop.set_world_interaction(decor_shop_interaction)
func _prioritize_surface_drawing_pointer_input() -> void:
@ -1655,6 +1688,34 @@ func _apply_active_bait_indicator_style() -> void:
_active_bait_button.add_theme_color_override(state, Color.WHITE)
func _apply_rv_storage_button_style() -> void:
var normal_style: StyleBoxFlat = MAIN_BUBBLE_PROFILE.make_normal_style()
var hover_style: StyleBoxFlat = MAIN_BUBBLE_PROFILE.make_hover_style()
var pressed_style: StyleBoxFlat = MAIN_BUBBLE_PROFILE.make_pressed_style()
for style: StyleBoxFlat in [normal_style, hover_style, pressed_style]:
style.set_corner_radius_all(29)
style.content_margin_left = 9.0
style.content_margin_top = 9.0
style.content_margin_right = 9.0
style.content_margin_bottom = 9.0
_rv_storage_button.icon = RV_STORAGE_ICON
_rv_storage_button.add_theme_stylebox_override("normal", normal_style)
_rv_storage_button.add_theme_stylebox_override("hover", hover_style)
_rv_storage_button.add_theme_stylebox_override("focus", hover_style)
_rv_storage_button.add_theme_stylebox_override("pressed", pressed_style)
for state: StringName in [
&"icon_normal_color",
&"icon_hover_color",
&"icon_focus_color",
&"icon_pressed_color",
]:
_rv_storage_button.add_theme_color_override(state, Color.WHITE)
func _on_rv_storage_button_pressed() -> void:
rv_storage_requested.emit()
func _refresh_active_bait_indicator() -> void:
_refresh_active_bait_indicator_visibility()
if not is_node_ready():
@ -1718,17 +1779,20 @@ func set_gameplay_ui_enabled(enabled: bool) -> void:
if not enabled:
_gameplay_hud_hidden = false
_refresh_active_bait_indicator_visibility()
_refresh_rv_storage_button_visibility()
if enabled:
_try_start_shop_npc_speech()
_refresh_gameplay_hud_visibility()
_refresh_chat_availability()
if not enabled:
_home_decor_toolbar.set_active(false)
_end_virtual_mouse()
_close_radial_menus()
if _surface_drawing != null:
_surface_drawing.deactivate()
close_player_menu_for_session_end()
_fishing_shop.close_for_session_end()
_decor_shop.close_for_session_end()
_player_storage.close_for_session_end()
_fishing_panel.visible = false
_shop_prompt.hide()
@ -1749,6 +1813,7 @@ func set_gameplay_hud_hidden(hidden: bool) -> void:
_quick_radial_menu.set_hud_hidden(hidden)
_refresh_gameplay_hud_visibility()
_refresh_active_bait_indicator_visibility()
_refresh_rv_storage_button_visibility()
_refresh_hotbar_visibility()
_refresh_chat_availability()
@ -1864,13 +1929,43 @@ func get_fishing_shop() -> FishingShopType:
return _fishing_shop
func get_decor_shop() -> DecorShopType:
return _decor_shop
func get_player_storage() -> PlayerStorageType:
return _player_storage
func get_home_decor_toolbar() -> HomeDecorToolbarType:
return _home_decor_toolbar
func set_rv_interior_camera_mode(enabled: bool) -> void:
_hotbar_ui.set_rv_interior_camera_mode(enabled)
func set_rv_storage_button_visible(requested_visible: bool) -> void:
_rv_storage_button_requested_visible = requested_visible
_refresh_rv_storage_button_visibility()
func _refresh_rv_storage_button_visibility() -> void:
_rv_storage_button.visible = (
_rv_storage_button_requested_visible
and _gameplay_ui_enabled
and not _gameplay_hud_hidden
and not _system_menu_open
and not _player_menu_open
and not _shop_open
and not _storage_open
)
func set_storage_prompt_visible(
requested_visible: bool,
world_anchor: Vector3 = Vector3(0.0, INF, 0.0),
action_text: String = "open storage",
) -> void:
if not _storage_prompt.has_meta(&"styled"):
_storage_prompt.set_meta(&"styled", true)
@ -1879,6 +1974,7 @@ func set_storage_prompt_visible(
)
style.anti_aliasing = false
_storage_prompt.add_theme_stylebox_override("panel", style)
_storage_prompt_message.text = action_text
_storage_prompt.visible = (
requested_visible
and _gameplay_ui_enabled
@ -2762,6 +2858,7 @@ func _refresh_hotbar_visibility() -> void:
func _emit_interactive_pointer_ui_changed() -> void:
_refresh_active_bait_indicator_visibility()
_refresh_rv_storage_button_visibility()
interactive_pointer_ui_changed.emit(
_system_menu_open
or _player_menu_open