Revise Art Kit workflow and refresh fox patterns
This commit is contained in:
parent
117fdbfdaa
commit
c06d5714c0
21 changed files with 363 additions and 141 deletions
|
|
@ -122,6 +122,7 @@ const SHOP_ANIMALESE_VOICE_ID: String = "natural"
|
|||
const SHOP_ANIMALESE_BASE_PITCH: float = 1.08
|
||||
const SHOP_SPEECH_CHARACTERS_PER_SECOND: float = 28.0
|
||||
const SHOP_NPC_SPEECH_COOLDOWN_MILLISECONDS: int = 5000
|
||||
const ART_KIT_ITEM_ID: StringName = &"art_kit"
|
||||
|
||||
|
||||
@onready var _canonical_stage: Control = %CanonicalStage
|
||||
|
|
@ -164,6 +165,7 @@ var _network_chat_service: NetworkChatService
|
|||
var _network_profile: NetworkProfilePreferences
|
||||
var _spawn_service: PlayerSpawnService
|
||||
var _bag: PlayerBagType
|
||||
var _hotbar: PlayerHotbarType
|
||||
var _item_catalog: ItemCatalogType
|
||||
var _player_menu_open: bool = false
|
||||
var _gameplay_ui_enabled: bool = false
|
||||
|
|
@ -177,6 +179,7 @@ var _item_effects: PlayerItemEffectsType
|
|||
var _main_shop_buyer: FishBuyerProfileType
|
||||
var _shop_interaction: ShopInteractionType
|
||||
var _surface_drawing: NetworkSurfaceDrawingService
|
||||
var _surface_drawing_hotbar_selected: bool = false
|
||||
var _experience: PlayerExperienceType
|
||||
var _experience_award_queue: Array[Dictionary] = []
|
||||
var _experience_animation_active: bool = false
|
||||
|
|
@ -293,6 +296,7 @@ func setup(
|
|||
_network_profile = network_profile
|
||||
_spawn_service = spawn_service
|
||||
_bag = bag
|
||||
_hotbar = hotbar
|
||||
_item_catalog = item_catalog
|
||||
_settings_manager = settings_manager
|
||||
_fishing_spot = fishing_spot
|
||||
|
|
@ -448,16 +452,7 @@ func _input(event: InputEvent) -> void:
|
|||
)
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
var drawing_can_open: bool = (
|
||||
_gameplay_ui_enabled
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
and not _chat_input_open
|
||||
and not _showcase_active
|
||||
and _fishing_spot != null
|
||||
and _fishing_spot.can_use_surface_drawing()
|
||||
)
|
||||
var drawing_can_open: bool = _can_surface_drawing_be_active()
|
||||
if (
|
||||
_surface_drawing != null
|
||||
and _surface_drawing.handle_input(
|
||||
|
|
@ -630,7 +625,7 @@ func _on_quick_action_selected(action_id: StringName) -> void:
|
|||
&"online":
|
||||
_player_menu.open_section(PlayerMenuType.Section.PLAYERS)
|
||||
&"paint":
|
||||
_toggle_surface_drawing()
|
||||
_select_art_kit_hotbar_slot()
|
||||
&"chat":
|
||||
_chat_ui.open_chat()
|
||||
&"freecam":
|
||||
|
|
@ -1121,25 +1116,46 @@ static func get_virtual_mouse_window_bounds(window_size: Vector2) -> Rect2:
|
|||
return Rect2(cursor_margin, bounds_size)
|
||||
|
||||
|
||||
func _toggle_surface_drawing() -> void:
|
||||
if _surface_drawing == null:
|
||||
func _select_art_kit_hotbar_slot() -> void:
|
||||
if _hotbar == null:
|
||||
return
|
||||
if _surface_drawing.is_active():
|
||||
_surface_drawing.deactivate()
|
||||
elif _surface_drawing.can_activate():
|
||||
_surface_drawing.activate(_drawing_pointer_window_position())
|
||||
for slot_index: int in range(PlayerHotbarType.SLOT_COUNT):
|
||||
if _hotbar.get_item_id(slot_index) == ART_KIT_ITEM_ID:
|
||||
_hotbar.select_slot(slot_index)
|
||||
return
|
||||
|
||||
|
||||
func set_surface_drawing_hotbar_selected(is_selected: bool) -> void:
|
||||
_surface_drawing_hotbar_selected = is_selected
|
||||
_refresh_surface_drawing_activation()
|
||||
|
||||
|
||||
func _refresh_surface_drawing_activation() -> void:
|
||||
if _surface_drawing == null:
|
||||
return
|
||||
if is_selected:
|
||||
if not _surface_drawing.is_active() and _surface_drawing.can_activate():
|
||||
_surface_drawing.activate(_drawing_pointer_window_position())
|
||||
elif _surface_drawing.is_active():
|
||||
var should_be_active: bool = _can_surface_drawing_be_active()
|
||||
if should_be_active and not _surface_drawing.is_active():
|
||||
_surface_drawing.activate(_drawing_pointer_window_position())
|
||||
elif not should_be_active and _surface_drawing.is_active():
|
||||
_surface_drawing.deactivate()
|
||||
|
||||
|
||||
func _can_surface_drawing_be_active() -> bool:
|
||||
return (
|
||||
_surface_drawing_hotbar_selected
|
||||
and _gameplay_ui_enabled
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
and not _chat_input_open
|
||||
and not _showcase_active
|
||||
and _fishing_spot != null
|
||||
and _fishing_spot.can_use_surface_drawing()
|
||||
and _surface_drawing != null
|
||||
and _surface_drawing.can_activate()
|
||||
)
|
||||
|
||||
|
||||
func _drawing_pointer_window_position() -> Vector2:
|
||||
if _virtual_mouse_active:
|
||||
return _virtual_mouse_window_position
|
||||
|
|
@ -1462,6 +1478,7 @@ func set_gameplay_ui_enabled(enabled: bool) -> void:
|
|||
_hotbar_ui.set_gameplay_input_enabled(true)
|
||||
_refresh_fishing_panel_visibility()
|
||||
call_deferred("_start_next_experience_animation")
|
||||
_refresh_surface_drawing_activation()
|
||||
|
||||
|
||||
func set_gameplay_hud_hidden(hidden: bool) -> void:
|
||||
|
|
@ -1505,8 +1522,7 @@ func _refresh_gameplay_hud_visibility() -> void:
|
|||
|
||||
func set_system_menu_open(is_open: bool) -> void:
|
||||
_system_menu_open = is_open
|
||||
if is_open and _surface_drawing != null:
|
||||
_surface_drawing.deactivate()
|
||||
_refresh_surface_drawing_activation()
|
||||
_refresh_gameplay_hud_visibility()
|
||||
_refresh_chat_availability()
|
||||
_refresh_hotbar_visibility()
|
||||
|
|
@ -1862,6 +1878,7 @@ func _on_showcase_changed(
|
|||
showcase_visible: bool,
|
||||
) -> void:
|
||||
_showcase_active = showcase_visible
|
||||
_refresh_surface_drawing_activation()
|
||||
if not showcase_visible:
|
||||
_set_fishing_panel_showcase_position(false)
|
||||
_showcase_details.text = ""
|
||||
|
|
@ -2103,8 +2120,7 @@ func _on_player_menu_visibility_changed(is_open: bool) -> void:
|
|||
_player_menu_open = is_open
|
||||
if is_open:
|
||||
_end_virtual_mouse()
|
||||
if is_open and _surface_drawing != null:
|
||||
_surface_drawing.deactivate()
|
||||
_refresh_surface_drawing_activation()
|
||||
_refresh_gameplay_hud_visibility()
|
||||
if is_open:
|
||||
_hotbar_ui.set_drag_enabled(false)
|
||||
|
|
@ -2156,8 +2172,7 @@ func _on_shop_exit_started() -> void:
|
|||
|
||||
func _on_shop_visibility_changed(is_open: bool) -> void:
|
||||
_shop_open = is_open
|
||||
if is_open and _surface_drawing != null:
|
||||
_surface_drawing.deactivate()
|
||||
_refresh_surface_drawing_activation()
|
||||
if is_open:
|
||||
shop_backdrop_visibility_changed.emit(true)
|
||||
if not is_open and _player_menu.is_shop_cooler_mounted():
|
||||
|
|
@ -2309,8 +2324,7 @@ func _emit_interactive_pointer_ui_changed() -> void:
|
|||
|
||||
func _on_chat_text_entry_ownership_changed(active: bool) -> void:
|
||||
_chat_input_open = active
|
||||
if active and _surface_drawing != null:
|
||||
_surface_drawing.deactivate()
|
||||
_refresh_surface_drawing_activation()
|
||||
_refresh_chat_availability()
|
||||
_emit_interactive_pointer_ui_changed()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,13 @@ class_name SurfaceDrawingToolbar
|
|||
extends Control
|
||||
|
||||
const UtilityPageStyleType = preload("res://ui/utility_page_style.gd")
|
||||
const TOOLBAR_WIDTH: float = 580.0
|
||||
const MARKER_MODE_ICON: Texture2D = preload(
|
||||
"res://items/icons/art/art_kit_marker.png"
|
||||
)
|
||||
const GRID_MODE_ICON: Texture2D = preload(
|
||||
"res://items/icons/art/art_kit_grid_light.png"
|
||||
)
|
||||
const TOOLBAR_WIDTH: float = 510.0
|
||||
const TOOLBAR_HEIGHT: float = 373.0
|
||||
const COLOR_RAIL_WIDTH: float = 46.0
|
||||
|
||||
|
|
@ -17,7 +23,6 @@ const COLOR_RAIL_WIDTH: float = 46.0
|
|||
@onready var _hide_guide_button: Button = %HideGuideButton
|
||||
@onready var _restore_guide_button: Button = %RestoreGuideButton
|
||||
@onready var _finalize_guide_button: Button = %FinalizeGuideButton
|
||||
@onready var _close_button: Button = %CloseButton
|
||||
|
||||
var _service: NetworkSurfaceDrawingService
|
||||
var _unlocks: PlayerArtUnlocks
|
||||
|
|
@ -36,10 +41,11 @@ func _ready() -> void:
|
|||
UtilityPageStyleType.apply_ocean_button(button)
|
||||
button.custom_minimum_size = Vector2(48, 44)
|
||||
_make_button_round(button, 22)
|
||||
_enlarge_action_icon(_eraser_button)
|
||||
_enlarge_action_icon(_undo_button)
|
||||
_mode_button.custom_minimum_size = Vector2(48, 48)
|
||||
_make_button_round(_mode_button, 24)
|
||||
_enlarge_action_icon(_mode_button)
|
||||
for button: Button in _action_buttons():
|
||||
_enlarge_action_icon(button)
|
||||
_mode_button.pressed.connect(_toggle_mode)
|
||||
_eraser_button.pressed.connect(_toggle_eraser)
|
||||
_undo_button.pressed.connect(_undo_last_stroke)
|
||||
|
|
@ -52,7 +58,6 @@ func _ready() -> void:
|
|||
_finalize_guide_button.pressed.connect(
|
||||
_arm_guide_action.bind(NetworkSurfaceDrawingService.GuideAction.FINALIZE)
|
||||
)
|
||||
_close_button.pressed.connect(_close_toolbar)
|
||||
_brush_option.item_selected.connect(_select_brush)
|
||||
_grid_option.item_selected.connect(_select_grid)
|
||||
_build_options()
|
||||
|
|
@ -77,7 +82,6 @@ func _action_buttons() -> Array[Button]:
|
|||
_hide_guide_button,
|
||||
_restore_guide_button,
|
||||
_finalize_guide_button,
|
||||
_close_button,
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -146,6 +150,8 @@ func _apply_dock_side() -> void:
|
|||
offset_right = 0.0 if _dock_right else TOOLBAR_WIDTH
|
||||
offset_top = 0.0
|
||||
offset_bottom = TOOLBAR_HEIGHT
|
||||
_top_panel.offset_left = 0.0
|
||||
_top_panel.offset_right = TOOLBAR_WIDTH
|
||||
_color_panel.offset_left = (
|
||||
TOOLBAR_WIDTH - COLOR_RAIL_WIDTH if _dock_right else 0.0
|
||||
)
|
||||
|
|
@ -276,11 +282,6 @@ func _arm_guide_action(action: int) -> void:
|
|||
_service.arm_guide_action(action)
|
||||
|
||||
|
||||
func _close_toolbar() -> void:
|
||||
if _service != null:
|
||||
_service.deactivate()
|
||||
|
||||
|
||||
func _on_unlocks_changed(_unlock_mask: int) -> void:
|
||||
_refresh_unlocks()
|
||||
|
||||
|
|
@ -297,7 +298,14 @@ func _on_service_state_changed(
|
|||
visible = is_active
|
||||
if not is_active:
|
||||
return
|
||||
_mode_button.text = "▦" if mode_name == "place grid" else "●"
|
||||
_mode_button.icon = (
|
||||
GRID_MODE_ICON if mode_name == "place grid" else MARKER_MODE_ICON
|
||||
)
|
||||
_mode_button.accessibility_name = (
|
||||
"switch to marker mode"
|
||||
if mode_name == "place grid"
|
||||
else "switch to grid mode"
|
||||
)
|
||||
_mode_button.tooltip_text = (
|
||||
"Switch to marker mode"
|
||||
if mode_name == "place grid"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
[gd_scene load_steps=8 format=3]
|
||||
[gd_scene load_steps=11 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/surface_drawing_toolbar.gd" id="1_script"]
|
||||
[ext_resource type="Theme" path="res://ui/game_theme.tres" id="2_theme"]
|
||||
[ext_resource type="Texture2D" path="res://ui/icons/pictograms/undo_light.png" id="3_undo_light"]
|
||||
[ext_resource type="Texture2D" path="res://ui/icons/pictograms/check_mark_light.png" id="4_check_mark_light"]
|
||||
[ext_resource type="Texture2D" path="res://ui/icons/pictograms/x_light.png" id="5_x_light"]
|
||||
[ext_resource type="Texture2D" path="res://items/icons/art/art_kit_eraser.png" id="6_art_kit_eraser"]
|
||||
[ext_resource type="Texture2D" path="res://items/icons/art/art_kit_eraser.png" id="4_art_kit_eraser"]
|
||||
[ext_resource type="Texture2D" path="res://items/icons/art/art_kit_marker.png" id="5_art_kit_marker"]
|
||||
[ext_resource type="Texture2D" path="res://items/icons/art/art_kit_grid_light.png" id="6_grid_light"]
|
||||
[ext_resource type="Texture2D" path="res://items/icons/art/art_kit_grid_hidden_light.png" id="7_grid_hidden"]
|
||||
[ext_resource type="Texture2D" path="res://items/icons/art/art_kit_grid_restore_light.png" id="8_grid_restore"]
|
||||
[ext_resource type="Texture2D" path="res://items/icons/art/art_kit_grid_finish_light.png" id="9_grid_finish"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="GuideActionGroup"]
|
||||
allow_unpress = true
|
||||
|
|
@ -17,7 +20,7 @@ layout_mode = 0
|
|||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -580.0
|
||||
offset_left = -510.0
|
||||
offset_bottom = 373.0
|
||||
grow_horizontal = 0
|
||||
mouse_filter = 2
|
||||
|
|
@ -27,19 +30,13 @@ script = ExtResource("1_script")
|
|||
[node name="TopPanel" type="PanelContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 580.0
|
||||
offset_right = 510.0
|
||||
offset_bottom = 60.0
|
||||
|
||||
[node name="Top" type="HBoxContainer" parent="TopPanel"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="ModeButton" type="Button" parent="TopPanel/Top"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "switch between grid and marker mode"
|
||||
text = "▦"
|
||||
|
||||
[node name="BrushOption" type="OptionButton" parent="TopPanel/Top"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(80, 48)
|
||||
|
|
@ -59,7 +56,7 @@ texture_filter = 1
|
|||
tooltip_text = "toggle eraser"
|
||||
toggle_mode = true
|
||||
accessibility_name = "toggle eraser"
|
||||
icon = ExtResource("6_art_kit_eraser")
|
||||
icon = ExtResource("4_art_kit_eraser")
|
||||
expand_icon = true
|
||||
|
||||
[node name="UndoButton" type="Button" parent="TopPanel/Top"]
|
||||
|
|
@ -74,18 +71,24 @@ expand_icon = true
|
|||
[node name="HideGuideButton" type="Button" parent="TopPanel/Top"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture_filter = 1
|
||||
tooltip_text = "toggle hide grid mode"
|
||||
toggle_mode = true
|
||||
button_group = SubResource("GuideActionGroup")
|
||||
text = "◌"
|
||||
accessibility_name = "toggle hide grid mode"
|
||||
icon = ExtResource("7_grid_hidden")
|
||||
expand_icon = true
|
||||
|
||||
[node name="RestoreGuideButton" type="Button" parent="TopPanel/Top"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture_filter = 1
|
||||
tooltip_text = "toggle show grid mode"
|
||||
toggle_mode = true
|
||||
button_group = SubResource("GuideActionGroup")
|
||||
text = "▤"
|
||||
accessibility_name = "toggle show grid mode"
|
||||
icon = ExtResource("8_grid_restore")
|
||||
expand_icon = true
|
||||
|
||||
[node name="FinalizeGuideButton" type="Button" parent="TopPanel/Top"]
|
||||
unique_name_in_owner = true
|
||||
|
|
@ -95,24 +98,24 @@ tooltip_text = "toggle finalize grid mode"
|
|||
toggle_mode = true
|
||||
button_group = SubResource("GuideActionGroup")
|
||||
accessibility_name = "toggle finalize grid mode"
|
||||
icon = ExtResource("4_check_mark_light")
|
||||
icon = ExtResource("9_grid_finish")
|
||||
expand_icon = true
|
||||
|
||||
[node name="CloseButton" type="Button" parent="TopPanel/Top"]
|
||||
[node name="ModeButton" type="Button" parent="TopPanel/Top"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture_filter = 1
|
||||
tooltip_text = "close art tools"
|
||||
accessibility_name = "close art tools"
|
||||
icon = ExtResource("5_x_light")
|
||||
tooltip_text = "switch between grid and marker mode"
|
||||
accessibility_name = "switch to grid mode"
|
||||
icon = ExtResource("5_art_kit_marker")
|
||||
expand_icon = true
|
||||
|
||||
[node name="ColorPanel" type="PanelContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 534.0
|
||||
offset_left = 464.0
|
||||
offset_top = 54.0
|
||||
offset_right = 580.0
|
||||
offset_right = 510.0
|
||||
offset_bottom = 373.0
|
||||
|
||||
[node name="ColorList" type="VBoxContainer" parent="ColorPanel"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue