Zmniejszenia skali

This commit is contained in:
Tomasz Boruc 2026-10-09 18:38:58 +02:00
parent be5de281c0
commit 021d347312
9 changed files with 44 additions and 37 deletions

View File

@ -67,8 +67,8 @@ mouse_filter = 2
[node name="DebugToggle" type="Button" parent="HUD/HUDRoot"]
offset_left = 18.0
offset_top = 16.0
offset_right = 120.0
offset_bottom = 44.0
offset_right = 110.0
offset_bottom = 42.0
flat = true
theme_override_colors/font_color = Color(0.72, 0.88, 0.98, 1)
text = "DEBUG [−]"
@ -76,10 +76,10 @@ text = "DEBUG [−]"
[node name="DebugInfo" type="Label" parent="HUD/HUDRoot"]
offset_left = 22.0
offset_top = 48.0
offset_right = 340.0
offset_bottom = 470.0
offset_right = 295.0
offset_bottom = 420.0
theme_override_colors/font_color = Color(0.72, 0.88, 0.98, 1)
theme_override_font_sizes/font_size = 15
theme_override_font_sizes/font_size = 11
text = "STATEK\nKADŁUB: 100 / 100\nTARCZE: 100 / 100\nENERGIA: 100 / 100"
[node name="ShipEquipmentPanel" parent="HUD/HUDRoot" instance=ExtResource("5_equipment")]

View File

@ -5,7 +5,7 @@
[ext_resource type="Script" path="res://scripts/game/weapon_controller.gd" id="3_weapons"]
[sub_resource type="CircleShape2D" id="ShipCollision"]
radius = 24.0
radius = 18.0
[node name="PlayerShip" type="CharacterBody2D"]
collision_layer = 2

View File

@ -4,7 +4,7 @@
[ext_resource type="Texture2D" path="res://assets/Ships/Spaceship_0.png" id="2_texture"]
[sub_resource type="CircleShape2D" id="TargetCollision"]
radius = 34.0
radius = 27.0
[node name="WeaponTestTarget" type="StaticBody2D"]
collision_layer = 4
@ -13,19 +13,19 @@ script = ExtResource("1_script")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_texture")
scale = Vector2(0.25, 0.25)
scale = Vector2(0.18, 0.18)
texture_filter = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("TargetCollision")
[node name="NameLabel" type="Label" parent="."]
offset_left = -90.0
offset_top = 42.0
offset_right = 90.0
offset_bottom = 66.0
offset_left = -70.0
offset_top = 32.0
offset_right = 70.0
offset_bottom = 52.0
theme_override_colors/font_color = Color(0.65, 0.9, 1, 1)
theme_override_font_sizes/font_size = 16
theme_override_font_sizes/font_size = 12
text = "CEL TESTOWY"
horizontal_alignment = 1
mouse_filter = 2

View File

@ -3,14 +3,14 @@
[ext_resource type="Script" path="res://scripts/ui/equipment_slot_view.gd" id="1_slot"]
[node name="InventorySlot" type="PanelContainer"]
custom_minimum_size = Vector2(86, 62)
custom_minimum_size = Vector2(72, 48)
script = ExtResource("1_slot")
[node name="SlotLabel" type="Label" parent="."]
layout_mode = 2
mouse_filter = 2
theme_override_colors/font_color = Color(0.82, 0.86, 0.9, 1)
theme_override_font_sizes/font_size = 12
theme_override_font_sizes/font_size = 9
text = "PUSTY"
horizontal_alignment = 1
vertical_alignment = 1

View File

@ -10,19 +10,19 @@ border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.12, 0.32, 0.4, 0.9)
content_margin_left = 10.0
content_margin_top = 8.0
content_margin_right = 10.0
content_margin_bottom = 8.0
content_margin_left = 7.0
content_margin_top = 6.0
content_margin_right = 7.0
content_margin_bottom = 6.0
[node name="ShipEquipmentPanel" type="PanelContainer"]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -310.0
offset_top = 18.0
offset_right = -18.0
offset_bottom = 558.0
offset_left = -248.0
offset_top = 14.0
offset_right = -14.0
offset_bottom = 454.0
grow_horizontal = 0
grow_vertical = 0
theme_override_styles/panel = SubResource("EquipmentPanelStyle")
@ -34,14 +34,14 @@ theme_override_constants/separation = 6
[node name="Title" type="Label" parent="Contents"]
layout_mode = 2
theme_override_colors/font_color = Color(0.72, 0.88, 0.98, 1)
theme_override_font_sizes/font_size = 16
theme_override_font_sizes/font_size = 12
text = "WYPOSAŻENIE STATKU"
horizontal_alignment = 1
[node name="WeaponLabel" type="Label" parent="Contents"]
layout_mode = 2
theme_override_colors/font_color = Color(0.98, 0.72, 0.38, 1)
theme_override_font_sizes/font_size = 13
theme_override_font_sizes/font_size = 10
text = "BROŃ PRZEDNIA"
horizontal_alignment = 1
@ -51,25 +51,25 @@ theme_override_constants/separation = 8
[node name="Weapon1" parent="Contents/WeaponSlots" instance=ExtResource("2_slot")]
layout_mode = 2
custom_minimum_size = Vector2(118, 48)
custom_minimum_size = Vector2(90, 38)
slot_kind = "weapon"
slot_index = 0
[node name="Weapon2" parent="Contents/WeaponSlots" instance=ExtResource("2_slot")]
layout_mode = 2
custom_minimum_size = Vector2(118, 48)
custom_minimum_size = Vector2(90, 38)
slot_kind = "weapon"
slot_index = 1
[node name="Schematic" type="Control" parent="Contents"]
custom_minimum_size = Vector2(0, 136)
custom_minimum_size = Vector2(0, 104)
layout_mode = 2
script = ExtResource("1_schematic")
[node name="ModuleLabel" type="Label" parent="Contents"]
layout_mode = 2
theme_override_colors/font_color = Color(0.72, 0.88, 0.98, 1)
theme_override_font_sizes/font_size = 13
theme_override_font_sizes/font_size = 10
text = "MODUŁY NIEBOJOWE (6)"
horizontal_alignment = 1

View File

@ -9,17 +9,17 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -245.0
offset_top = -208.0
offset_right = 245.0
offset_bottom = 208.0
offset_left = -195.0
offset_top = -165.0
offset_right = 195.0
offset_bottom = 165.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_inventory")
[node name="Contents" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 8
theme_override_constants/separation = 6
[node name="Header" type="HBoxContainer" parent="Contents"]
layout_mode = 2
@ -28,7 +28,7 @@ layout_mode = 2
layout_mode = 2
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.72, 0.88, 0.98, 1)
theme_override_font_sizes/font_size = 16
theme_override_font_sizes/font_size = 11
text = "MAGAZYN (0 / 20)"
[node name="CloseButton" type="Button" parent="Contents/Header"]

View File

@ -57,7 +57,7 @@ func _ready() -> void:
if ship_texture:
_sprite.texture = ship_texture
var largest_dimension := maxf(ship_texture.get_width(), ship_texture.get_height())
_sprite.scale = Vector2.ONE * (92.0 / largest_dimension)
_sprite.scale = Vector2.ONE * (64.0 / largest_dimension)
func _ensure_input_action(action_name: StringName, physical_key: Key) -> void:
if not InputMap.has_action(action_name):

View File

@ -11,7 +11,13 @@ func _ready() -> void:
_inventory = get_tree().get_first_node_in_group("ship_inventory") as ShipInventory
if _inventory:
_inventory.inventory_changed.connect(_refresh)
custom_minimum_size = Vector2(108, 52) if slot_kind != "cargo" else Vector2(86, 62)
match slot_kind:
"weapon":
custom_minimum_size = Vector2(90, 38)
"module":
custom_minimum_size = Vector2(72, 44)
_:
custom_minimum_size = Vector2(72, 48)
_refresh()
func _refresh() -> void:

View File

@ -2,6 +2,7 @@ extends Control
func _draw() -> void:
var center := size.x * 0.5
draw_set_transform(Vector2(center * 0.28, 0.0), 0.0, Vector2(0.72, 0.72))
var hull_color := Color(0.35, 0.72, 0.85, 1.0)
var hull_highlight := Color(0.72, 0.9, 0.96, 1.0)
var weapon_color := Color(0.98, 0.65, 0.28, 1.0)