Improve PortMaster performance and controls

This commit is contained in:
Alexander Sellite 2026-08-15 09:53:30 -04:00
parent 9afa60f6a5
commit 57df54d82d
14 changed files with 328 additions and 126 deletions

View file

@ -122,7 +122,6 @@ 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
@ -612,20 +611,6 @@ func _on_emote_selected(emote_id: StringName) -> void:
func _on_quick_action_selected(action_id: StringName) -> void:
match action_id:
&"stuff":
_player_menu.open_section(PlayerMenuType.Section.COOLER)
&"logbook":
_player_menu.open_section(PlayerMenuType.Section.LOGBOOK)
&"fishnet":
_player_menu.open_section(PlayerMenuType.Section.NET)
&"mail":
_player_menu.open_section(PlayerMenuType.Section.MAIL)
&"profile":
_player_menu.open_section(PlayerMenuType.Section.PROFILE)
&"online":
_player_menu.open_section(PlayerMenuType.Section.PLAYERS)
&"paint":
_select_art_kit_hotbar_slot()
&"chat":
_chat_ui.open_chat()
&"freecam":
@ -1116,15 +1101,6 @@ static func get_virtual_mouse_window_bounds(window_size: Vector2) -> Rect2:
return Rect2(cursor_margin, bounds_size)
func _select_art_kit_hotbar_slot() -> void:
if _hotbar == null:
return
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()

View file

@ -4,10 +4,14 @@ uniform sampler2D pattern_texture : source_color, repeat_enable, filter_nearest;
uniform vec2 source_tile_size = vec2(128.0, 128.0);
uniform float display_scale : hint_range(0.5, 2.0, 0.05) = 0.85;
uniform vec2 scroll_velocity_pixels = vec2(-7.0, -5.0);
uniform bool animation_enabled = true;
void fragment() {
vec2 viewport_pixels = 1.0 / SCREEN_PIXEL_SIZE;
vec2 display_tile_size = max(source_tile_size * display_scale, vec2(1.0));
vec2 moving_pixels = UV * viewport_pixels + TIME * scroll_velocity_pixels;
vec2 moving_pixels = UV * viewport_pixels;
if (animation_enabled) {
moving_pixels += TIME * scroll_velocity_pixels;
}
COLOR = texture(pattern_texture, moving_pixels / display_tile_size);
}

View file

@ -16,30 +16,16 @@ const ControllerMappingManagerType = preload(
"res://settings/controller_mapping_manager.gd"
)
const ACTIONS: Array[StringName] = [
&"stuff",
&"logbook",
&"fishnet",
&"mail",
&"profile",
&"online",
&"paint",
&"chat",
&"freecam",
&"hud",
]
const LABELS: Array[String] = [
"stuff",
"logbook",
"fishnet",
"mail",
"profile",
"online",
"paint",
"chat",
"freecam",
"hide hud",
]
const SECTOR_COUNT: int = 10
const SECTOR_COUNT: int = 3
var _buttons: Array[BubbleButton] = []
var _is_open: bool = false

View file

@ -10,30 +10,52 @@ uniform float wave_speed : hint_range(0.0, 0.5, 0.01) = 0.10;
uniform float wave_scale : hint_range(0.5, 8.0, 0.1) = 2.4;
uniform float wave_strength : hint_range(0.0, 0.05, 0.001) = 0.012;
uniform float caustic_strength : hint_range(0.0, 0.08, 0.001) = 0.018;
uniform bool animation_enabled = true;
void fragment() {
vec2 grid_size = max(virtual_pixel_density, vec2(1.0));
vec2 pixel_uv = (floor(UV * grid_size) + vec2(0.5)) / grid_size;
float motion = TIME * wave_speed;
float broad_wave = sin(
pixel_uv.x * wave_scale + motion
);
float secondary_wave = sin(
pixel_uv.x * 1.1 + pixel_uv.y * 1.6 - motion * 0.65
);
float movement_falloff = 1.0 - pixel_uv.y * 0.75;
float depth_displacement = (
(broad_wave * 0.65 + secondary_wave * 0.35)
* wave_strength
* movement_falloff
);
float continuous_depth = clamp(
pixel_uv.y
+ depth_displacement,
0.0,
1.0
);
float continuous_depth = pixel_uv.y;
float caustic_level = 0.0;
if (animation_enabled) {
float motion = TIME * wave_speed;
float broad_wave = sin(
pixel_uv.x * wave_scale + motion
);
float secondary_wave = sin(
pixel_uv.x * 1.1 + pixel_uv.y * 1.6 - motion * 0.65
);
float movement_falloff = 1.0 - pixel_uv.y * 0.75;
float depth_displacement = (
(broad_wave * 0.65 + secondary_wave * 0.35)
* wave_strength
* movement_falloff
);
continuous_depth = clamp(
pixel_uv.y
+ depth_displacement,
0.0,
1.0
);
float caustic_wave = clamp(
(
sin(
pixel_uv.x * 4.0
+ pixel_uv.y * 1.2
+ motion * 0.7
)
* sin(
pixel_uv.x * 1.7
- pixel_uv.y * 2.2
- motion * 0.55
)
- 0.25
) / 0.75,
0.0,
1.0
);
caustic_level = floor(caustic_wave * 3.0) / 3.0;
}
float depth_steps = max(2.0, floor(color_step_count));
float band_index = floor(
continuous_depth * (depth_steps - 1.0) + 0.5
@ -60,26 +82,6 @@ void fragment() {
);
}
float caustic_wave = clamp(
(
sin(
pixel_uv.x * 4.0
+ pixel_uv.y * 1.2
+ motion * 0.7
)
* sin(
pixel_uv.x * 1.7
- pixel_uv.y * 2.2
- motion * 0.55
)
- 0.25
) / 0.75,
0.0,
1.0
);
float caustic_level = floor(
caustic_wave * 3.0
) / 3.0;
float upper_water_mask = 1.0 - smoothstep(
0.18,
0.34,