ajout de la traduction #70

* Fix de l'inspection de l'inventaire
* Suppression des assets d'objectifs
This commit is contained in:
2025-11-07 17:36:18 +01:00
parent ed675ed532
commit a8bb09407e
91 changed files with 485 additions and 872 deletions

View File

@@ -8,29 +8,27 @@ signal item_clicked()
const MODULATE_INSPECTED_COLOR = Color.GRAY
var current_item : Item = null
var item : Item = null
var was_selected : bool = false
func _ready():
mouse_entered.connect(_on_mouse_entered)
mouse_exited.connect(_on_mouse_excited)
mouse_entered.connect(
func(): Pointer.inspect(self)
)
mouse_exited.connect(
func(): Pointer.stop_inspect(self)
)
update(null, false)
func inspect(is_inspected : bool = true):
modulate = MODULATE_INSPECTED_COLOR if is_inspected else Color.WHITE
func _on_mouse_entered():
if current_item:
Pointer.inspect(self)
func _on_mouse_excited():
if current_item:
Pointer.stop_inspect(self)
func _on_gui_input(_event: InputEvent) -> void:
if Input.is_action_just_pressed("action"):
emit_signal("item_clicked")
func update(item: Item, selected : bool):
func update(_item: Item, selected : bool):
item = _item
if selected and not was_selected:
%SelectedAnimation.play("selected")
elif not selected and was_selected:

View File

@@ -120,37 +120,19 @@ alignment = 1
[node name="PauseTitle" type="Label" parent="Container/Tutorial/VBoxContainer"]
layout_mode = 2
text = "Pause"
text = "PAUSE"
label_settings = SubResource("LabelSettings_apjlw")
horizontal_alignment = 1
[node name="StoryTitle" type="Label" parent="Container/Tutorial/VBoxContainer"]
layout_mode = 2
text = "Story"
label_settings = ExtResource("3_0pdto")
horizontal_alignment = 1
[node name="StoryText" type="Label" parent="Container/Tutorial/VBoxContainer"]
layout_mode = 2
text = "You are a robot who has recently arrived on a barren planet. Find and plant seeds to reduce the contamination.
You have limited energy, but can recharge when passing days.
Each 7 days, you have to meet a quota of decontaminted lands.
You get a machine to build each quota reached."
horizontal_alignment = 1
[node name="ControlsTitle" type="Label" parent="Container/Tutorial/VBoxContainer"]
layout_mode = 2
text = "Controls"
text = "CONTROLS"
label_settings = ExtResource("3_0pdto")
horizontal_alignment = 1
[node name="ControlsText" type="Label" parent="Container/Tutorial/VBoxContainer"]
layout_mode = 2
text = "Directional Arrows/Right Click : Move
Left Click : Interact/Pickup Items
Mouse Wheel : Change current item
X : Drop Item
"
text = "CONTROLS_TEXT"
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Container/Tutorial/VBoxContainer"]
@@ -159,17 +141,17 @@ alignment = 1
[node name="Resume" type="Button" parent="Container/Tutorial/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Resume Game"
text = "RESUME_GAME"
icon = ExtResource("5_apjlw")
[node name="Restart" type="Button" parent="Container/Tutorial/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Restart"
text = "RESTART"
icon = ExtResource("6_58dya")
[node name="Quit" type="Button" parent="Container/Tutorial/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Quit"
text = "QUIT"
icon = ExtResource("7_yj6f1")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]

View File

@@ -2,6 +2,8 @@ extends CanvasLayer
var pause = false : set = set_pause
const PLANET_RUN_SCENE = preload("res://stages/planet_run/planet_run.tscn")
func set_pause(p):
if p != pause:
if p:
@@ -22,7 +24,7 @@ func _on_resume_pressed():
func _on_restart_pressed():
GameInfo.game_data.reset_all()
pause = false
get_tree().reload_current_scene()
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
func _on_quit_pressed():
get_tree().quit()

View File

@@ -92,8 +92,8 @@ class DiscoverPlantReward extends RewardData:
func reward_info() -> QuotaRewardChoiceInfo:
var info = QuotaRewardChoiceInfo.new()
info.title = "Discover %s" % new_plant_type.name
info.text = "%s seeds can now be found" % new_plant_type.name
info.title = tr("DISCOVER_%s") % new_plant_type.name
info.text = tr("%s_SEEDS_CAN_NOW_BE_FOUND") % new_plant_type.name
info.card_info = new_plant_type.card_info()
return info
@@ -110,7 +110,7 @@ class EvolvePlantReward extends RewardData:
func reward_info() -> QuotaRewardChoiceInfo:
var info = QuotaRewardChoiceInfo.new()
info.title = "Evolve %s" % plant_evolution.plant_type.name
info.title = tr("EVOLVE_%s") % plant_evolution.plant_type.name
info.text = plant_evolution.get_description()
var preview_evolved_plant = plant_evolution.plant_type.duplicate_deep()
plant_evolution.evolve(preview_evolved_plant)

View File

@@ -39,7 +39,7 @@ func _on_planet_updated(planet_data : PlanetData):
func planet_update(planet_data : PlanetData):
if planet_data:
%DayCount.text = "%d days left" % (planet_data.quota_days)
%DayCount.text = tr("%d_DAY_LEFT") % (planet_data.quota_days)
var quota_progression_percent : float = (float(planet_data.garden_score) / float(planet_data.get_quota_score())) * 100
%QuotaProgressText.text = "%d/%d" % [planet_data.garden_score, planet_data.get_quota_score()]
@@ -83,14 +83,14 @@ func _on_planet_new_quota_started(planet_data : PlanetData):
func announce_quota(planet_data : PlanetData):
%Announce.announce(
"New Quota",
"Reach %d garden score before %d days" % [planet_data.get_quota_score(), planet_data.get_quota_duration()]
tr("NEW_QUOTA"),
tr("REACH_%d_GARDEN_SCORE_BEFORE_%d_DAYS") % [planet_data.get_quota_score(), planet_data.get_quota_duration()]
)
func _on_planet_pass_day_ended(planet:Planet):
if planet.data.quota_days == 1:
%Announce.announce(
"Last day for reaching quota",
tr("LAST_DAY_FOR_REACHING_QUOTA"),
str(roundi(planet.data.get_quota_score() - planet.garden.get_score())) + " garden score left",
Announce.RED_COLOR
)

View File

@@ -61,7 +61,7 @@ class TakeShovelStep extends Step:
func generate_indicators(_p: Player, planet : Planet) -> Array[InGameIndicator]:
for entity in planet.entity_container.get_children():
if entity is ItemObject and entity.item is Shovel:
var indicator = generate_indicator("Take the Shovel")
var indicator = generate_indicator(tr("TAKE_THE_SHOVEL"))
indicator.follow_entity(entity)
return [
indicator
@@ -88,7 +88,7 @@ class DigLootStep extends Step:
closest_loot = entity
if closest_loot:
var indicator = generate_indicator("Dig Underground Loot")
var indicator = generate_indicator(tr("DIG_UNDERGROUND_LOOT"))
indicator.follow_entity(closest_loot)
return [indicator]
return []
@@ -104,7 +104,7 @@ class TakeSeedStep extends Step:
var indicators : Array[InGameIndicator] = []
for entity in planet.entity_container.get_children():
if entity is ItemObject and entity.item is Seed:
var indicator = generate_indicator("Take a seed")
var indicator = generate_indicator(tr("TAKE_A_SEED"))
indicator.follow_entity(entity)
indicators.append(
indicator
@@ -119,7 +119,7 @@ class TakeSeedStep extends Step:
class PlantSeedStep extends Step:
func generate_indicators(_p: Player, planet : Planet) -> Array[InGameIndicator]:
var indicator = generate_indicator("Plant the seed in decontamined zone")
var indicator = generate_indicator(tr("PLANT_THE_SEED_IN_DECONTAMINED_ZONE"))
indicator.follow_game_position(Vector2(0,0) + planet.entity_container.global_position)
return [indicator]
@@ -132,7 +132,7 @@ class PlantSeedStep extends Step:
class RechargeStep extends Step:
func generate_indicators(_p: Player, planet : Planet) -> Array[InGameIndicator]:
for entity in planet.entity_container.get_children():
var indicator = generate_indicator("Recharge to pass days")
var indicator = generate_indicator(tr("RECHARGE_TO_PASS_DAYS"))
indicator.follow_entity(entity)
if entity is TruckRecharge:
return [
@@ -166,7 +166,7 @@ class HarvestMaturePlant extends Step:
var indicators : Array[InGameIndicator] = []
for entity in planet.entity_container.get_children():
if entity is Plant and entity.state == Plant.State.MATURE:
var indicator = generate_indicator("Harvest mature plants with shovel")
var indicator = generate_indicator(tr("HARVEST_MATURE_PLANTS_WITH_SHOVEL"))
indicator.follow_entity(entity)
indicators.append(
indicator

View File

@@ -1,17 +1,19 @@
extends Control
const PLANET_RUN_SCENE = preload("res://stages/planet_run/planet_run.tscn")
func _ready():
visible = false
func win(planet : Planet):
visible = true
get_tree().paused = true
%WinTitle.text = "Score : " + str(roundi(planet.garden.get_score()))
%WinTitle.text = tr("SCORE_%d") % str(roundi(planet.garden.get_score()))
func _on_restart_pressed():
GameInfo.game_data.reset_all()
get_tree().paused = false
get_tree().reload_current_scene()
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
func _on_quit_pressed():
get_tree().quit()