Added translations
This commit is contained in:
parent
6eef2c781c
commit
6963cab2af
7 changed files with 59 additions and 20 deletions
|
|
@ -15,7 +15,7 @@ resource_name = "money_counter"
|
|||
script/source = "extends Label
|
||||
|
||||
## Text with placeholder
|
||||
@onready var unformatted_text: String = text
|
||||
@onready var unformatted_text: String = tr(text) + \" %d\"
|
||||
## Shortcut to get_parent().get_parent()
|
||||
@onready var ship: PlayerShip = get_parent().get_parent()
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ resource_name = "velocity_counter"
|
|||
script/source = "extends Label
|
||||
|
||||
## Text with placeholder
|
||||
@onready var unformatted_text: String = text
|
||||
@onready var unformatted_text: String = tr(text) + \" %d px/s\"
|
||||
## Shortcut to get_parent().get_parent()
|
||||
@onready var ship: PlayerShip = get_parent().get_parent()
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ resource_name = "health_counter"
|
|||
script/source = "extends Label
|
||||
|
||||
## Text with placeholder
|
||||
@onready var unformatted_text: String = text
|
||||
@onready var unformatted_text: String = tr(text) + \" {0} / {1}\"
|
||||
## Shortcut to get_parent().get_parent()
|
||||
@onready var ship: PlayerShip = get_parent().get_parent()
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ resource_name = "shield_counter"
|
|||
script/source = "extends Label
|
||||
|
||||
## Text with placeholder
|
||||
@onready var unformatted_text: String = text
|
||||
@onready var unformatted_text: String = tr(text) + \" {0} / {1}\"
|
||||
## Shortcut to get_parent().get_parent()
|
||||
@onready var ship: PlayerShip = get_parent().get_parent()
|
||||
|
||||
|
|
@ -73,10 +73,18 @@ resource_name = "ammunition_counter"
|
|||
script/source = "extends Label
|
||||
|
||||
## Text with placeholder
|
||||
@onready var unformatted_text: String = text
|
||||
@onready var unformatted_text: PackedStringArray = text.split(\"\\n\")
|
||||
## Shortcut to get_parent().get_parent()
|
||||
@onready var ship: PlayerShip = get_parent().get_parent()
|
||||
|
||||
func _ready():
|
||||
for i in range(len(unformatted_text)):
|
||||
unformatted_text[i] = tr(unformatted_text[i])
|
||||
unformatted_text[1] += \" {0} / {1}\"
|
||||
unformatted_text[2] += \" {2} / {3}\"
|
||||
for i in range(len(unformatted_text) - 1):
|
||||
unformatted_text[i] += \"\\n\"
|
||||
|
||||
func _process(_delta):
|
||||
var format = [
|
||||
round(ship.hull.ammunition[\"Laser Energy\"] * 100) / 100.0,
|
||||
|
|
@ -84,7 +92,7 @@ func _process(_delta):
|
|||
ship.hull.ammunition[\"Rockets\"],
|
||||
ship.hull.max_ammunition[\"Rockets\"]
|
||||
]
|
||||
text = unformatted_text.format(format)
|
||||
text = \"\".join(unformatted_text).format(format)
|
||||
"
|
||||
|
||||
[node name="PlayerShip" type="Node2D"]
|
||||
|
|
@ -120,7 +128,7 @@ offset_top = 611.0
|
|||
offset_right = 92.0
|
||||
offset_bottom = 634.0
|
||||
theme = ExtResource("8_8lpnq")
|
||||
text = "Money: %d"
|
||||
text = "PLAYER_GUI_MONEY"
|
||||
script = SubResource("GDScript_ry4sc")
|
||||
|
||||
[node name="Velocity" type="Label" parent="ColorableGUI"]
|
||||
|
|
@ -129,7 +137,7 @@ offset_top = 688.0
|
|||
offset_right = 137.0
|
||||
offset_bottom = 711.0
|
||||
theme = ExtResource("8_8lpnq")
|
||||
text = "Velocity: %d px/s"
|
||||
text = "PLAYER_GUI_VELOCITY"
|
||||
script = SubResource("GDScript_vko7a")
|
||||
|
||||
[node name="Health" type="Label" parent="ColorableGUI"]
|
||||
|
|
@ -138,7 +146,7 @@ offset_top = 663.0
|
|||
offset_right = 168.0
|
||||
offset_bottom = 686.0
|
||||
theme = ExtResource("8_8lpnq")
|
||||
text = "Health: {0} / {1} units"
|
||||
text = "PLAYER_GUI_HEALTH"
|
||||
script = SubResource("GDScript_uoaip")
|
||||
|
||||
[node name="Shield" type="Label" parent="ColorableGUI"]
|
||||
|
|
@ -147,18 +155,18 @@ offset_top = 638.0
|
|||
offset_right = 164.0
|
||||
offset_bottom = 661.0
|
||||
theme = ExtResource("8_8lpnq")
|
||||
text = "Shield: {0} / {1} units"
|
||||
text = "PLAYER_GUI_SHIELD"
|
||||
script = SubResource("GDScript_q1sx2")
|
||||
|
||||
[node name="Ammunition" type="Label" parent="ColorableGUI"]
|
||||
offset_left = 1060.0
|
||||
offset_top = 638.0
|
||||
offset_right = 1273.0
|
||||
offset_bottom = 713.0
|
||||
offset_left = 849.0
|
||||
offset_top = 641.0
|
||||
offset_right = 1276.0
|
||||
offset_bottom = 716.0
|
||||
theme = ExtResource("8_8lpnq")
|
||||
text = "Ammunition:
|
||||
Laser Energy: {0} / {1}
|
||||
Rockets: {2} / {3}"
|
||||
text = "PLAYER_GUI_AMMUNITION
|
||||
PLAYER_GUI_AMMUNITION_LASER
|
||||
PLAYER_GUI_AMMUNITION_ROCKETS"
|
||||
horizontal_alignment = 2
|
||||
script = SubResource("GDScript_rrgab")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue