UI scaling & bugfixes

This commit is contained in:
Rob Kelly 2024-11-21 00:21:11 -07:00
parent fbbc58ae83
commit d129a410b8
3 changed files with 53 additions and 64 deletions

View File

@ -235,6 +235,7 @@ func take_shot() -> void:
print_debug("Shot impulse: ", impulse, "; ", impulse.length(), " N*s") print_debug("Shot impulse: ", impulse, "; ", impulse.length(), " N*s")
if game_ball: if game_ball:
game_ball.iron_ball = club == Club.Type.IRON
game_ball.freeze = false game_ball.freeze = false
game_ball.apply_central_impulse(impulse) game_ball.apply_central_impulse(impulse)
@ -354,8 +355,6 @@ func _on_club_change(new_club_type: Club.Type) -> void:
wedge_arrow.hide() wedge_arrow.hide()
iron_arrow.hide() iron_arrow.hide()
putt_arrow.hide() putt_arrow.hide()
if game_ball:
game_ball.iron_ball = false
hud.club_selector.value = new_club_type hud.club_selector.value = new_club_type
# TODO club change animation # TODO club change animation
character.hold_right(new_club.get_model()) character.hold_right(new_club.get_model())
@ -372,8 +371,6 @@ func _on_club_change(new_club_type: Club.Type) -> void:
Club.Type.IRON: Club.Type.IRON:
shot_ref = iron_ref shot_ref = iron_ref
iron_arrow.show() iron_arrow.show()
if game_ball:
game_ball.iron_ball = true
Club.Type.SPECIAL: Club.Type.SPECIAL:
# TODO figure this out # TODO figure this out
shot_ref = drive_ref shot_ref = drive_ref
@ -426,7 +423,6 @@ func _on_phase_change(new_phase: Phase) -> void:
func _on_game_ball_changed(ball: GameBall) -> void: func _on_game_ball_changed(ball: GameBall) -> void:
if ball: if ball:
ball.iron_ball = (club == Club.Type.IRON)
ball.entered_water.connect(_on_ball_entered_water) ball.entered_water.connect(_on_ball_entered_water)
ball.sleeping_state_changed.connect(_on_ball_sleeping_state_changed) ball.sleeping_state_changed.connect(_on_ball_sleeping_state_changed)

View File

@ -43,18 +43,10 @@ texture = SubResource("GradientTexture2D_tm61r")
[node name="BallList" type="VBoxContainer" parent="GradientMask"] [node name="BallList" type="VBoxContainer" parent="GradientMask"]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(120, 0) custom_minimum_size = Vector2(120, 0)
layout_mode = 1 layout_mode = 0
anchors_preset = 8 offset_top = 50.0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -120.0
offset_top = 18.0
offset_right = 120.0 offset_right = 120.0
offset_bottom = 146.0 offset_bottom = 109.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 5 theme_override_constants/separation = 5
[node name="BasicIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")] [node name="BasicIcon" parent="GradientMask/BallList" instance=ExtResource("1_1v8xg")]

View File

@ -441,26 +441,26 @@ length = 0.001
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("SouthWest:position") tracks/0/path = NodePath("SouthWest:visible")
tracks/0/interp = 1 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
"times": PackedFloat32Array(0), "times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1), "transitions": PackedFloat32Array(1),
"update": 0, "update": 1,
"values": [Vector2(0, 982)] "values": [true]
} }
tracks/1/type = "value" tracks/1/type = "value"
tracks/1/imported = false tracks/1/imported = false
tracks/1/enabled = true tracks/1/enabled = true
tracks/1/path = NodePath("SouthWest:visible") tracks/1/path = NodePath("SouthWest:offset_top")
tracks/1/interp = 1 tracks/1/interp = 2
tracks/1/loop_wrap = true tracks/1/loop_wrap = true
tracks/1/keys = { tracks/1/keys = {
"times": PackedFloat32Array(0), "times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1), "transitions": PackedFloat32Array(1),
"update": 1, "update": 0,
"values": [true] "values": [-98.0]
} }
[sub_resource type="Animation" id="Animation_yis4x"] [sub_resource type="Animation" id="Animation_yis4x"]
@ -470,27 +470,27 @@ step = 0.02
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("SouthWest:position") tracks/0/path = NodePath("SouthWest:visible")
tracks/0/interp = 2 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.4),
"transitions": PackedFloat32Array(1.618, 1.618, 1),
"update": 0,
"values": [Vector2(0, 982), Vector2(0, 960), Vector2(0, 1100)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SouthWest:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.4), "times": PackedFloat32Array(0.4),
"transitions": PackedFloat32Array(1), "transitions": PackedFloat32Array(1),
"update": 1, "update": 1,
"values": [false] "values": [false]
} }
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SouthWest:offset_top")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1, 0.4),
"transitions": PackedFloat32Array(1.618, 1.618, 1),
"update": 0,
"values": [-98.0, -120.0, 20.0]
}
[sub_resource type="Animation" id="Animation_jugqx"] [sub_resource type="Animation" id="Animation_jugqx"]
resource_name = "peek" resource_name = "peek"
@ -499,27 +499,27 @@ step = 0.02
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("SouthWest:position") tracks/0/path = NodePath("SouthWest:visible")
tracks/0/interp = 1 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 2.3, 2.4),
"transitions": PackedFloat32Array(1.618, 1, 1.618, 1),
"update": 0,
"values": [Vector2(0, 1100), Vector2(0, 982), Vector2(0, 982), Vector2(0, 1100)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SouthWest:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 2.4), "times": PackedFloat32Array(0, 2.4),
"transitions": PackedFloat32Array(1, 1), "transitions": PackedFloat32Array(1, 1),
"update": 1, "update": 1,
"values": [true, false] "values": [true, false]
} }
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SouthWest:offset_top")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1, 2.3, 2.4),
"transitions": PackedFloat32Array(1.618, 1, 1.618, 1),
"update": 0,
"values": [20.0, -98.0, -98.0, 20.0]
}
[sub_resource type="Animation" id="Animation_nicro"] [sub_resource type="Animation" id="Animation_nicro"]
resource_name = "show_life_bar" resource_name = "show_life_bar"
@ -528,27 +528,27 @@ step = 0.02
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("SouthWest:position") tracks/0/path = NodePath("SouthWest:visible")
tracks/0/interp = 2 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
"times": PackedFloat32Array(0, 0.34, 0.4),
"transitions": PackedFloat32Array(1.618, 1.618, 1),
"update": 0,
"values": [Vector2(0, 1100), Vector2(0, 960), Vector2(0, 982)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SouthWest:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0), "times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1), "transitions": PackedFloat32Array(1),
"update": 1, "update": 1,
"values": [true] "values": [true]
} }
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SouthWest:offset_top")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.34, 0.4),
"transitions": PackedFloat32Array(1.618, 1.618, 1),
"update": 0,
"values": [20.0, -120.0, -98.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_c3i4w"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_c3i4w"]
_data = { _data = {
@ -782,6 +782,7 @@ anchor_right = 0.333
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_top = -98.0 offset_top = -98.0
offset_right = 40.0 offset_right = 40.0
offset_bottom = 278.665
grow_vertical = 0 grow_vertical = 0
theme_override_constants/margin_left = 16 theme_override_constants/margin_left = 16
theme_override_constants/margin_bottom = 16 theme_override_constants/margin_bottom = 16