From 1179e049566ef3330cc6978b5c41c210c1ac60fb Mon Sep 17 00:00:00 2001 From: Zacharie Guet Date: Sun, 9 Nov 2025 15:56:09 +0100 Subject: [PATCH] =?UTF-8?q?rework=20l'ui=20et=20=C3=A9quilibrage=20g=C3=A9?= =?UTF-8?q?n=C3=A9ral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Translation/localization.csv | 225 ++++++++------- .../machines/solar_pannel/solar_pannel.tres | 4 +- .../scripts/rewards/give_item_reward.gd | 2 +- .../inventory/scripts/items/blueprint.gd | 3 + .../scripts/underground_loot.gd | 2 +- .../underground_loot/underground_loot.tscn | 4 +- gui/game/game_gui.tscn | 273 +++++------------- gui/game/quota_reward/quota_reward.tscn | 4 +- gui/game/scripts/game_gui.gd | 85 ++++-- gui/game/win/scripts/win.gd | 2 +- gui/game/win/win.tscn | 10 +- gui/menu/scripts/menu.gd | 2 + gui/pointer/pointer.tscn | 24 +- gui/pointer/scripts/pointer.gd | 2 +- gui/ressources/default_theme.tres | 18 +- gui/tools/control_animation_player.gd | 63 ++++ gui/tools/control_animation_player.gd.uid | 1 + root.tscn | 8 +- stages/intro/intro.tscn | 3 +- stages/terrain/planet/scripts/garden.gd | 11 +- stages/terrain/planet/scripts/planet.gd | 2 + stages/terrain/planet/scripts/planet_data.gd | 13 +- stages/terrain/planet/scripts/terrain_data.gd | 2 +- stages/terrain/truck/truck_interior.tscn | 6 +- 24 files changed, 405 insertions(+), 364 deletions(-) create mode 100644 gui/tools/control_animation_player.gd create mode 100644 gui/tools/control_animation_player.gd.uid diff --git a/Translation/localization.csv b/Translation/localization.csv index 0ced8de..1284759 100644 --- a/Translation/localization.csv +++ b/Translation/localization.csv @@ -1,120 +1,135 @@ keys,en,fr -STORY_TEXT,"[b]You are a robot who was sended in a barren and contaminated planet.[/b] -Your job : plant seeds to repopulate this planet. Each seed has different effects and score,and [b]you’ll have to meet a garden score each 7 days to continue[/b]. -Be carefull, [b]you can only plant in decontamined zone[/b], but some plants can help decontaminate your garden. -[b]Good luck![/b]","[b]Vous êtes un robot envoyé sur une planète stérile et contaminée.[/b] -Votre mission : planter des graines pour repeupler cette planète. Chaque graine a des effets et un score différents, et [b]vous devrez atteindre un certain score de jardin tous les 7 jours pour continuer[/b]. -Attention, [b]vous ne pouvez planter que dans les zones décontaminées[/b], mais certaines plantes peuvent aider à décontaminer votre jardin. +STORY_TEXT,"[b]You are a lone robot, sent on a contaminated planet.[/b] +Your job : planting seeds to restore life on the planet. Each seed has different effects and grant you garden points, [b]you have to reach a certain garden score each 7 days to continue[/b]. +Be careful, [b]you can only plant in the decontamined zone[/b], but some plants can decontaminate your garden. +[b]Good luck![/b]","[b]Vous êtes un robot, envoyé seul sur une planète contaminée.[/b] +Votre mission : planter des graines pour redonner vie à cette planète. Chaque graine a des effets uniques et vous octroie des points de jardin, [b]vous devrez atteindre un certain score de jardin tous les 7 jours pour continuer[/b]. +Attention, [b]vous ne pouvez planter que dans la zone décontaminée[/b], mais certaines plantes peuvent décontaminer votre jardin. [b]Bonne chance ![/b]" CONTROLS_TEXT,"Directional Arrows/Right Click : Move -Left Click : Interact/Pickup Items -Mouse Wheel : Change current item +Left Click : Interact/Pick up +Mouse Wheel : Change held item X : Drop Item","Flèches directionnelles/Clic droit : Se déplacer Clic Gauche : Interagir/Ramasser -Molette : Changer l'item sélectionné -X : Lâcher l'item" +Molette : Changer l'objet en main +X : Lâcher l’objet" STORY,Story,Histoire OK,Ok,Ok -COMMA,", ", -OR," or ", +COMMA,", ","," +OR," or "," ou " PAUSE,Pause,Pause CONTROLS,Controls,Contrôles -RESUME_GAME,Resume Game, Reprendre +RESUME_GAME,Resume,Reprendre RESTART,Restart,Recommencer QUIT,Quit,Quitter -SEED,Seed, -TAKE,Take, -PACKAGE,Package, -DESCRIPTION, Description, -USE, Use, -ON_MATURE,"On mature", -WHEN_HARVESTED,"When harvested", -EACH_DAY_WHEN_MATURE,"Each day when mature", -COMMON,"Common", -RARE,"Rare", -VERY_RARE,"Very rare", -IMPOSSIBLE,"Impossible", -EFFECT,"Effect", -MATURE,"Mature", -GROWING,Growing, -DECONTAMINATE,"Decontaminate", +SEED,Seed,Graine +TAKE,Take,Prendre +PACKAGE,Crate,Caisse de matériel +DESCRIPTION,Description,Description +USE,Use,Utiliser +ON_MATURE,On maturation,Une fois mature +WHEN_HARVESTED,When harvested,A la récolte +EACH_DAY_WHEN_MATURE,"Each day, when mature,","Chaque jour, après maturation," +COMMON,Common,Commun +RARE,Rare,Rare +VERY_RARE,Very rare,Très rare +IMPOSSIBLE,Impossible,Impossible +EFFECT,Effect,Effet +MATURE,Mature,Mature +GROWING,Growing,En train de pousser +DECONTAMINATE,Decontaminate,Décontamine %d_DAY_LEFT,%d days left,%d jours restants NEW_QUOTA,New Quota,Nouveau Quota -REACH_%d_GARDEN_SCORE_BEFORE_%d_DAYS,Reach %d garden score before %d days, -LAST_DAY_FOR_REACHING_QUOTA,Last day for reaching quota, -RECHARGE_%d_ENERGY,Recharge %d energy, -%d_DAYS_BEFORE_CHARGE, %d days before charge, -1_DAY_BEFORE_CHARGE, 1 days before charge, -CHARGED, Charged, -WHEN_FILLED,"When filled", -GIVE_THE_FOLLOWING_ITEM_%s,"Give the following item : [b]%s[/b]", -UPGRADE_MAX_ENERGY,"Upgrade max energy", -UPGRADE_MAX_INVENTORY_SIZE,"Upgrade max inventory size", -DECONTAMINATE_%d_UNIT_AROUND_IT,"Decontaminate %d unit around it", -SEED_PRODUCTION,"Seed Production", -PRODUCE_%s_SEEDS,"Produce %s seeds", -DAY_%d,"Day [b]%d[/b]", -MATURE_ON_DAY_%d,"Mature on day [b]%d[/b]", -%d_SCORE_WHEN_MATURE,"[b]%d[/b] score when mature", -ABSURD,"[rainbow]Absurd[/rainbow]", -GROW_IN_%d,"Grow in [b]%d[/b]", -%s_SCORE_WHEN_MATURE,"[b]%d[/b] score when mature", -DISCOVER_%s,"Discover %s", -EVOLVE_%s,"Evolve %s", -%s_SEEDS_CAN_NOW_BE_FOUND,"%s seeds can now be found", -%s_SCORE_EVOLUTION,"%s score evolution", -ADD_%s_TO_THE_DEFAULT_SCORE_OF_THE_PLANT,"Add [b]%s[/b] to the default score of the plant", +REACH_%d_GARDEN_SCORE_BEFORE_%d_DAYS,Reach %d garden score before %d days,Atteins un score de jardin de %d avant %d jours +LAST_DAY_FOR_REACHING_QUOTA,Last day to reach the quota,Dernier jour pour atteindre le quota +RECHARGE_%d_ENERGY,Recharge %d energy,Recharge %d d’énergie +%d_DAYS_BEFORE_CHARGE,%d days before being charged,%d jours avant d’être chargé +1_DAY_BEFORE_CHARGE,1 day before being charged,1 jour avant avant d’être chargé +CHARGED,Charged,Chargé +WHEN_FILLED,When filled,Si rempli +GIVE_THE_FOLLOWING_ITEM_%s,Give the following item : [b]%s[/b],Donne l’objet suivant : [b]%s[/b] +UPGRADE_MAX_ENERGY,Increases maximum energy,Augmente l’énergie maximum +UPGRADE_MAX_INVENTORY_SIZE,Increases inventory size,Augmente la taille de l’inventaire +DECONTAMINATE_%d_UNIT_AROUND_IT,Decontaminate %d unit around it,Décontamine %d unités autour d’elle +SEED_PRODUCTION,Seed Production,Production de graines +PRODUCE_%s_SEEDS,Produce %s seeds,Produit %s graines +DAY_%d,Day [b]%d[/b],Jour [b]%d[/b] +MATURE_ON_DAY_%d,Mature on day [b]%d[/b],Mature au jour [b]%d[/b] +%d_SCORE_WHEN_MATURE,Grants [b]%d[/b] garden points when mature,Donne [b]%d[/b] points de jardin une fois mature +ABSURD,[rainbow]Absurd[/rainbow],[rainbow]Absurde[rainbow] +GROW_IN_%d,Grow in [b]%d[/b] days,Mature dans [b]%d[/b] jours +%s_SCORE_WHEN_MATURE,Grants [b]%s[/b] garden points when mature,Donne [b]%s[/b] points de jardin une fois mature +DISCOVER_%s,Discover %s,Découvre %s +EVOLVE_%s,Upgrade %s,Améliore %s +%s_SEEDS_CAN_NOW_BE_FOUND,%s seeds can now be found,Des graines de %s peuvent maintenant être trouvées +%s_SCORE_EVOLUTION,%s score evolution,Évolution de score de %s +ADD_%s_TO_THE_DEFAULT_SCORE_OF_THE_PLANT,Add [b]%s[/b] to the default score of the plant,Améliore le score de jardin de la plante de [b]%s[/b] %s_EVOLUTION,%s evolution,Évolution de %s UPGRADE_THE_LEVEL_OF_%s_EFFECT_OF_%d_LEVEL,Upgrade the level of %s effect of %d level,Améliore l'effet %s de %d niveau -ANCIENT,"Ancient", -ANCIENT_EFFECT_TEXT_LEVEL_%d,"When mature, add [b]1[/b] to the score for each [b]%d[/b] days passed", -ELITIST,"Elitist", -ELITIST_EFFECT_TEXT_LEVEL_%d,"When mature, add [b]%d[/b] to the score for each plant of the same species around, but score become 0 if none is around.", -ERMIT,"Ermit", -ERMIT_EFFECT_TEXT_LEVEL_%d,"Multiply the score by [b]%d[/b] if no plant is near, but set it to 0 otherwise.", -PRECOCIOUS,"Precocious", -PRECOCIOUS_EFFECT_TEXT_LEVEL_%d,"Add [b]%d[/b] to the score while the plant is growing", -QUALITY,"Quality", -QUALITY_EFFECT_TEXT_LEVEL_%d,"Add [b]%d[/b] to the score if the plant is mature.", -QUICK,"Quick", -QUICK_EFFECT_TEXT_LEVEL_%d,"Reduce the grow time by %d", -SOCIABLE,"Sociable", -SOCIABLE_EFFECT_TEXT_LEVEL_%d,"When mature, add [b]%d[/b] to the score if near %d other plants", -STRONG,"Strong", -STRONG_EFFECT_TEXT_LEVEL_%d,"Plus [b]%d[/b] percent of the score", -COST_%d_ENERGY,"Cost %d energy", -ONE_TIME_USE,"One time use", -BUILD_%s,"Build %s", -FORK,"Fork", -FORK_DESC_TEXT,"Use it to harvest mature plants.", -HARVEST,Harvest, -KNIFE,"Knife", -KNIFE_DESC_TEXT,"Use it to harvest mature plants. Do not cost energy.", -SHOVEL,"Shovel", -SHOVEL_DESC_TEXT,"Can dig up buried seeds and can be used to harvest mature plants.", -TROWEL, Trowel, -TROWEL_DESC_TEXT,"Use it to harvest mature plants, can get a [b]bonus seed[/b] from each plant.", -DIG, Dig, -OPEN,Open, -%s_SEED,"%s Seed", -PLANT_%s_MUST_BE_USED_IN_DECONTAMINATED_ZONE,"Plant [b]%s[/b]. Must be used in decontamined zone.", -PLANT_%s,"Plant [b]%s[/b]", -BURIED_LOOT,"Buried Loot", -TAKE_THE_SHOVEL,"Take the Shovel", -DIG_UNDERGROUND_LOOT,"Dig Underground Loot", -TAKE_A_SEED,"Take a seed", -PLANT_THE_SEED_IN_DECONTAMINED_ZONE,"Plant the seed in decontamined zone", -RECHARGE_TO_PASS_DAYS,"Recharge to pass days", -HARVEST_MATURE_PLANTS_WITH_SHOVEL,"Harvest mature plants with shovel", -SCORE_%d,"Score : %d", -SOLAR_PANNEL, Solar Panel, -SOLAR_PANNEL_DESCRIPTION_TEXT, "Can give energy when charged. Take several days to recharge", -TRUCK_ENTRANCE,Truck Entrance, -ENTER_TRUCK,Enter Truck, -LADDER_DESC_TEXT,A good old ladder, -RECHARGE_STATION,Recharge Station, -RECHARGE,Recharge, -RECHARGE_STATION_DESC_TEXT,"[b]You can recharge your robot here.[/b] When recharging, time will pass and plants may grow.", -COMPOST,Compost, -PLACE_SEED,Place Seed, -COMPOST_DESC_TEXT,This research station can provide some bonus if filled with seeds, \ No newline at end of file +ANCIENT,Ancient,Ancien +ANCIENT_EFFECT_TEXT_LEVEL_%d,"When mature, grants [b]1[/b] garden points each [b]%d[/b] days","Une fois mature, donne [b]1[/b] points de jardin tous les [b]%d[/b] jours" +ELITIST,Elitist,Élitiste +ELITIST_EFFECT_TEXT_LEVEL_%d,"When mature, grants [b]%d[/b] garden points for each plant of the same species around, but do not give any points if it is alone.","Une fois mature, donne [b]%d[/b] points de jardin pour chaque plante de la même espèce aux alentours, mais n’en donne aucun si elle est seule." +ERMIT,Hermit,Ermite +ERMIT_EFFECT_TEXT_LEVEL_%d,"Multiply the garden score by [b]%d[/b] if no plants are nearby, otherwise, set it to 0.","Multiplie le score de jardin par [b]%d[/b] si aucune plante n’est proche, sinon le score est nul." +PRECOCIOUS,Precocious,Précoce +PRECOCIOUS_EFFECT_TEXT_LEVEL_%d,Grants [b]%d[/b] garden points while the plant is growing,Donne [b]%d[/b] points de jardin pendant que la plante grandit +QUALITY,Quality,Qualité +QUALITY_EFFECT_TEXT_LEVEL_%d,Grants [b]%d[/b] garden points if the plant is mature.,Donne [b]%d[/b] points de jardin si la plante est mature. +QUICK,Quick,Rapide +QUICK_EFFECT_TEXT_LEVEL_%d,Reduce the growing time by %d,Réduit le temps de maturation de %d +SOCIABLE,Outgoing,Sociable +SOCIABLE_EFFECT_TEXT_LEVEL_%d,"When mature, grants [b]%d[/b] garden points if it is nearby %d other plants","Une fois mature, donne [b]%d[/b] points de jardin si elle est à côté de %d autres plantes" +STRONG,Strong,Fort +STRONG_EFFECT_TEXT_LEVEL_%d,Plus [b]%d[/b] % of the score,Augmente le score de [b]%d[/b] % +COST_%d_ENERGY,Cost %d energy,Coûte %d d’énergie +ONE_TIME_USE,Single use,Usage unique +BUILD_%s,Build %s,Construit %s +FORK,Fork,Fourche +FORK_DESC_TEXT,"Use it to [b]harvest mature plants[/b].","Utilise-la pour [b]récolter les plantes mature[/b]." +HARVEST,Harvest,Récolter +KNIFE,Knife,Couteau +KNIFE_DESC_TEXT,"Use it to [b]harvest mature plants[/b]. Does not consume energy.",Utilise-le pour [b]récolter les plantes mature[/b]. Ne consomme pas d’énergie. +SHOVEL,Shovel,Pelle +SHOVEL_DESC_TEXT,"Use it to [b]dig up seeds[/b] and [b]harvest mature plants[/b].","Utilise-la pour [b]déterrer les graines[/b] et pour [b]récolter les plantes mature[/b]." +TROWEL,Trowel,Truelle +TROWEL_DESC_TEXT,"Use it to [b]harvest mature plants[/b]. Can grant a [b]bonus seed[/b].","Utilise-la pour [b]récolter les plantes mature[/b]. Peut donner une [b]graine supplémentaire[/b]." +DIG,Dig,Creuser +OPEN,Open,Ouvrir +%s_SEED,%s Seed,Graine de %s +PLANT_%s_MUST_BE_USED_IN_DECONTAMINATED_ZONE,Plant [b]%s[/b]. Must be used in the decontamined zone.,Plante [b]%s[/b]. Doit être utilisée dans la zone décontaminée. +PLANT_%s,Plant [b]%s[/b],Planter [b]%s[/b] +BURIED_SEEDS,Buried seeds,Graines enterrées +BURIED_SEEDS_DESC_TEXT,"Contain some random seeds. [b]Dig it with a shovel.[/b]","Contient des graines enterrées. [b]Peuvent être déterrées avec une pelle[/b]" +TAKE_THE_SHOVEL,Take the shovel,Prend la pelle +DIG_UNDERGROUND_LOOT,Dig up the buried resources,Déterre les graines enterrées +TAKE_A_SEED,Take a seed,Prend une graine +PLANT_THE_SEED_IN_DECONTAMINED_ZONE,Plant the seed in the decontamined zone,Plante la graine dans la zone décontaminée +RECHARGE_TO_PASS_DAYS,Recharge to pass the day,Recharge-toi pour passer la journée +HARVEST_MATURE_PLANTS_WITH_SHOVEL,Harvest mature plants with the shovel,Récolte les plantes matures avec la pelle +SCORE_%d,Score : %d,Score : %d +SOLAR_PANNEL,Solar panel,Panneau solaire +SOLAR_PANNEL_DESCRIPTION_TEXT,Grants energy when charged. Take several days to recharge,Donne de l’énergie quand chargé. Prend plusieurs jours à se recharger +TRUCK_ENTRANCE,Truck entrance,Entrée du camion +ENTER_TRUCK,Enter truck,Entrer dans le camion +EXIT,Exit,Sortie +EXIT_TRUCK,Exit truck,Sortir du camion +LADDER_DESC_TEXT,A good old ladder,Une bonne vieille échelle +RECHARGE_STATION,Recharge station,Station de recharge +RECHARGE,Recharge,Recharger +RECHARGE_STATION_DESC_TEXT,"[b]You can recharge yourself here.[/b] When recharging, time pass and plants grow.","[b]Tu peux te recharger ici.[/b] Pendant la recharge, le temps passe et les plantes grandissent." +COMPOST,Compost,Compost +PLACE_SEED,Place seed,Placer la graine +COMPOST_DESC_TEXT,This research station can provide some bonuses when filled with seeds,Cette station de recherche peut offrir certains avantages une fois remplie de graines +CHOOSE_A_REWARD,Choose a reward,Choisis une récompense +REWARD_SCREEN_TEXT,Discover new plants or upgrade already discovered ones,Découvre de nouvelles plantes ou améliore celles déjà découvertes +THANKS_FOR_PLAYING,Thanks for playing !,Merci d’avoir joué ! +WIN_SCREEN_TEXT,We need your feedback ! Give us your thoughts on the game on our Discord or in the comments section of this page !,Nous avons besoin de ton retour ! Donne-le nous sur notre Discord ou dans la section commentaire de cette page ! +JOIN_OUR_DISCORD,Join our Discord,Rejoins-nous +ART,Art,Art +DEV_AND_GAME_DESIGN,Development and Game Design,Développement et Game Design +MUSIC,Music,Musique +START,Start,Commencer +CHOOSE_A_LANGUAGE,Choose a language,Choisissez une langue +NO_ENERGY_LEFT," (no energy left)", " (pas d'énergie restante)" +%d_GARDEN_SCORE_LEFT,"%d garden score left","%d score de jardin restant" \ No newline at end of file diff --git a/entities/interactables/machines/solar_pannel/solar_pannel.tres b/entities/interactables/machines/solar_pannel/solar_pannel.tres index 258718f..3803c89 100644 --- a/entities/interactables/machines/solar_pannel/solar_pannel.tres +++ b/entities/interactables/machines/solar_pannel/solar_pannel.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("1_ctita") -name = "Solar Pannel" +name = "SOLAR_PANNEL" scene = ExtResource("1_naexs") -description = "Charge every 2 days. When charged, can be used to recharge player energy." +description = "SOLAR_PANNEL_DESCRIPTION_TEXT" metadata/_custom_type_script = "uid://bepx311a3f0o" diff --git a/entities/interactables/truck/compost/scripts/rewards/give_item_reward.gd b/entities/interactables/truck/compost/scripts/rewards/give_item_reward.gd index ace34b3..1f31286 100644 --- a/entities/interactables/truck/compost/scripts/rewards/give_item_reward.gd +++ b/entities/interactables/truck/compost/scripts/rewards/give_item_reward.gd @@ -14,7 +14,7 @@ func reward(p: Player): p.pick_item(item) func desc() -> String: - return tr("GIVE_THE_FOLLOWING_ITEM_%s") % item.name + ". " + item.description + return tr("GIVE_THE_FOLLOWING_ITEM_%s") % tr(item.name) + ". " + tr(item.description) func icon() -> Texture: return item.icon \ No newline at end of file diff --git a/entities/player/inventory/scripts/items/blueprint.gd b/entities/player/inventory/scripts/items/blueprint.gd index 8653ea7..900fdaf 100644 --- a/entities/player/inventory/scripts/items/blueprint.gd +++ b/entities/player/inventory/scripts/items/blueprint.gd @@ -18,6 +18,9 @@ func get_description() -> String: return machine_type.description return "" +func get_energy_used() -> int: + return 0 + func get_icon() -> Texture2D: return preload("res://common/icons/cube-3d-sphere.svg") diff --git a/entities/underground_loot/scripts/underground_loot.gd b/entities/underground_loot/scripts/underground_loot.gd index 862d327..3a045cf 100644 --- a/entities/underground_loot/scripts/underground_loot.gd +++ b/entities/underground_loot/scripts/underground_loot.gd @@ -7,7 +7,7 @@ const LOOTED_ITEM_RANDOM_RANGE = 50 @export var item_number : int = 1 func pointer_text() -> String: - return tr("BURIED_LOOT") + return tr("BURIED_SEEDS") func generate_collision_shape() -> CollisionShape2D: var collision = CollisionShape2D.new() diff --git a/entities/underground_loot/underground_loot.tscn b/entities/underground_loot/underground_loot.tscn index 83ddb69..5b79e09 100644 --- a/entities/underground_loot/underground_loot.tscn +++ b/entities/underground_loot/underground_loot.tscn @@ -8,8 +8,8 @@ radius = 20.09975 [node name="UndergroundLootSprites" type="Area2D"] script = ExtResource("1_knus5") -default_info_title = "Buried Seeds" -default_info_desc = "Contain some random seeds. [b]Dig it with a shovel.[/b]" +default_info_title = "BURIED_SEEDS" +default_info_desc = "BURIED_SEEDS_DESC_TEXT" metadata/_custom_type_script = "uid://d3bk52402ylvl" [node name="Sprite2D" type="Sprite2D" parent="."] diff --git a/gui/game/game_gui.tscn b/gui/game/game_gui.tscn index 50ae681..d7c16a8 100644 --- a/gui/game/game_gui.tscn +++ b/gui/game/game_gui.tscn @@ -1,74 +1,16 @@ -[gd_scene load_steps=29 format=3 uid="uid://12nak7amd1uq"] +[gd_scene load_steps=23 format=3 uid="uid://12nak7amd1uq"] [ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/game/scripts/game_gui.gd" id="1_udau0"] [ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_nq5i2"] -[ext_resource type="Texture2D" uid="uid://cm3ehinvvj52i" path="res://gui/game/assets/texture/Interface sans boutons.png" id="3_n4kem"] [ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_h6540"] [ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="4_k4juk"] [ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_ujg5r"] +[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="5_2wykm"] +[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="6_id0t5"] [ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="7_id0t5"] [ext_resource type="Texture2D" uid="uid://b5cuxgisrsfgt" path="res://common/icons/player-pause.svg" id="9_2wykm"] [ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"] -[sub_resource type="Gradient" id="Gradient_id0t5"] -interpolation_mode = 1 -offsets = PackedFloat32Array(0, 0.115169, 0.41573, 0.620786, 0.924157) -colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_ykapk"] -gradient = SubResource("Gradient_id0t5") -fill_to = Vector2(1, 1) -repeat = 1 - -[sub_resource type="Animation" id="Animation_l73to"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(0.950568, 0, 0.346412, 1)] -} - -[sub_resource type="Animation" id="Animation_p6blc"] -resource_name = "default" -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.5, 1.03333), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Color(0.950568, 0, 0.346412, 1), Color(0.999996, 0.39403, 0.49625, 1), Color(0.950568, 0, 0.346412, 1)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_l3q4a"] -_data = { -&"RESET": SubResource("Animation_l73to"), -&"default": SubResource("Animation_p6blc") -} - -[sub_resource type="Gradient" id="Gradient_dr1y2"] -interpolation_mode = 1 -offsets = PackedFloat32Array(0, 0.697674) -colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_h6540"] -gradient = SubResource("Gradient_dr1y2") -width = 50 -height = 50 -fill = 1 -fill_from = Vector2(0.504274, 0.5) - [sub_resource type="Gradient" id="Gradient_2wykm"] offsets = PackedFloat32Array(0, 0.279476, 1) colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1) @@ -181,34 +123,10 @@ _data = { [sub_resource type="Animation" id="Animation_mbdxg"] length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("NoEnergyLeft:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector2(0, -100)] -} [sub_resource type="Animation" id="Animation_w16yr"] resource_name = "no_energy_left_appear" length = 0.5 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("NoEnergyLeft:position") -tracks/0/interp = 2 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0.0666667, 0.5), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Vector2(0, -100), Vector2(0, 0)] -} [sub_resource type="AnimationLibrary" id="AnimationLibrary_p0xoq"] _data = { @@ -216,58 +134,23 @@ _data = { &"no_energy_left_appear": SubResource("Animation_w16yr") } -[node name="GameGui" type="Control"] +[node name="GameGui" type="CanvasLayer"] +script = ExtResource("1_udau0") + +[node name="ScoreParticles" type="Control" parent="."] +unique_name_in_owner = true layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -mouse_filter = 1 -script = ExtResource("1_udau0") - -[node name="NoEnergyLeft" type="VBoxContainer" parent="."] -unique_name_in_owner = true -visible = false -modulate = Color(0.950568, 0, 0.346412, 1) -layout_mode = 1 -anchors_preset = 10 -anchor_right = 1.0 -offset_top = -100.0 -offset_bottom = 2.0 -grow_horizontal = 2 -theme = ExtResource("2_nq5i2") -theme_override_constants/separation = 12 - -[node name="TextureRect" type="TextureRect" parent="NoEnergyLeft"] -custom_minimum_size = Vector2(0, 40) -layout_mode = 2 -texture = SubResource("GradientTexture2D_ykapk") -expand_mode = 1 -stretch_mode = 1 - -[node name="Label" type="Label" parent="NoEnergyLeft"] -layout_mode = 2 -theme = ExtResource("2_nq5i2") -text = "No energy left" -label_settings = ExtResource("4_ujg5r") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="BlinkAnimation" type="AnimationPlayer" parent="NoEnergyLeft"] -libraries = { -&"": SubResource("AnimationLibrary_l3q4a") -} -autoplay = "default" +mouse_filter = 2 [node name="Announce" parent="." instance=ExtResource("4_h6540")] unique_name_in_owner = true -layout_mode = 1 [node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -276,75 +159,86 @@ grow_vertical = 2 mouse_filter = 2 theme = ExtResource("2_nq5i2") -[node name="PlayerInfo" type="Control" parent="MarginContainer"] -custom_minimum_size = Vector2(337, 160) +[node name="EnergyInfo" type="HBoxContainer" parent="MarginContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 0 +theme_override_constants/separation = 0 +metadata/_edit_use_anchors_ = true + +[node name="EnergyAnimationPlayer" type="Node" parent="MarginContainer/EnergyInfo"] +unique_name_in_owner = true +script = ExtResource("6_id0t5") +metadata/_custom_type_script = "uid://0dhj8sdpil7q" + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/EnergyInfo"] layout_mode = 2 size_flags_horizontal = 0 size_flags_vertical = 0 +theme_override_constants/margin_left = 0 +theme_override_constants/margin_top = -25 +theme_override_constants/margin_right = 0 +theme_override_constants/margin_bottom = -15 -[node name="Background" type="TextureRect" parent="MarginContainer/PlayerInfo"] +[node name="EnergyCount" type="RichTextLabel" parent="MarginContainer/EnergyInfo/MarginContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme = ExtResource("2_nq5i2") +theme_override_fonts/normal_font = ExtResource("5_2wykm") +theme_override_fonts/bold_font = ExtResource("5_2wykm") +theme_override_fonts/bold_italics_font = ExtResource("5_2wykm") +theme_override_fonts/italics_font = ExtResource("5_2wykm") +theme_override_font_sizes/normal_font_size = 30 +theme_override_font_sizes/bold_font_size = 100 +bbcode_enabled = true +text = "[b]X[/b] / X" +fit_content = true +autowrap_mode = 0 +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Icon" type="TextureRect" parent="MarginContainer/EnergyInfo"] +custom_minimum_size = Vector2(50, 50) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 8 +texture = ExtResource("4_k4juk") +expand_mode = 4 +stretch_mode = 5 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 4 + +[node name="DayCount" type="Label" parent="MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 0 +text = "Day 0" +label_settings = ExtResource("4_ujg5r") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="QuotaProgressBar" type="ProgressBar" parent="MarginContainer/VBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(400, 50) +layout_mode = 2 +theme = ExtResource("2_nq5i2") +rounded = true +show_percentage = false + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/QuotaProgressBar"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -texture = ExtResource("3_n4kem") -expand_mode = 2 -stretch_mode = 5 - -[node name="EnergyInfo" type="HBoxContainer" parent="MarginContainer/PlayerInfo"] -unique_name_in_owner = true -layout_mode = 1 -anchors_preset = -1 -anchor_left = 0.27299702 -anchor_top = 0.453125 -anchor_right = 0.27299702 -anchor_bottom = 0.496875 -offset_left = -44.0 -offset_top = -12.5 -offset_right = 44.0 -offset_bottom = 12.5 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_constants/separation = 0 -metadata/_edit_use_anchors_ = true - -[node name="Icon" type="TextureRect" parent="MarginContainer/PlayerInfo/EnergyInfo"] -custom_minimum_size = Vector2(36.64, 0) -layout_mode = 2 -texture = ExtResource("4_k4juk") -expand_mode = 2 -stretch_mode = 5 - -[node name="EnergyCount" type="Label" parent="MarginContainer/PlayerInfo/EnergyInfo"] -unique_name_in_owner = true -layout_mode = 2 -theme = ExtResource("2_nq5i2") -text = "X/X" -label_settings = ExtResource("4_ujg5r") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="QuotaInfo" type="CenterContainer" parent="MarginContainer/PlayerInfo"] -layout_mode = 0 -offset_left = 176.0 -offset_top = 83.0 -offset_right = 247.0 -offset_bottom = 133.0 - -[node name="QuotaProgressBar" type="TextureProgressBar" parent="MarginContainer/PlayerInfo/QuotaInfo"] -unique_name_in_owner = true -modulate = Color(0.1801, 0.349497, 0.456794, 1) -layout_mode = 2 -fill_mode = 4 -texture_progress = SubResource("GradientTexture2D_h6540") - -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PlayerInfo/QuotaInfo"] -layout_mode = 2 theme_override_constants/separation = 2 +alignment = 1 -[node name="QuotaProgressText" type="Label" parent="MarginContainer/PlayerInfo/QuotaInfo/HBoxContainer"] +[node name="QuotaProgressText" type="Label" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"] unique_name_in_owner = true layout_mode = 2 text = "X" @@ -352,7 +246,7 @@ label_settings = ExtResource("4_ujg5r") horizontal_alignment = 1 vertical_alignment = 1 -[node name="TextureRect" type="TextureRect" parent="MarginContainer/PlayerInfo/QuotaInfo/HBoxContainer"] +[node name="TextureRect" type="TextureRect" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"] custom_minimum_size = Vector2(30, 30) layout_mode = 2 texture = ExtResource("7_id0t5") @@ -365,15 +259,6 @@ size_flags_horizontal = 8 size_flags_vertical = 0 alignment = 1 -[node name="DayCount" type="Label" parent="MarginContainer/TopRightContent"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 8 -size_flags_vertical = 0 -text = "Day 0" -label_settings = ExtResource("4_ujg5r") -vertical_alignment = 1 - [node name="Pause" type="Button" parent="MarginContainer/TopRightContent"] layout_mode = 2 size_flags_horizontal = 8 @@ -390,7 +275,6 @@ size_flags_vertical = 8 [node name="PassDayFade" type="ColorRect" parent="."] physics_interpolation_mode = 0 -layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -401,7 +285,6 @@ color = Color(0.0627451, 0.0588235, 0.168627, 0) [node name="Effect" type="TextureRect" parent="."] modulate = Color(1, 1, 1, 0) -layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 diff --git a/gui/game/quota_reward/quota_reward.tscn b/gui/game/quota_reward/quota_reward.tscn index 0a95a81..2a28022 100644 --- a/gui/game/quota_reward/quota_reward.tscn +++ b/gui/game/quota_reward/quota_reward.tscn @@ -118,14 +118,14 @@ alignment = 1 [node name="Label" type="Label" parent="RewardChoiceContainer/Choice/VSplitContainer"] layout_mode = 2 theme = SubResource("Theme_7fpy7") -text = "Choose a reward" +text = "CHOOSE_A_REWARD" label_settings = ExtResource("4_trw0e") horizontal_alignment = 1 [node name="Label2" type="Label" parent="RewardChoiceContainer/Choice/VSplitContainer"] layout_mode = 2 theme = ExtResource("3_x2kx4") -text = "Discover new plants or evolve discovered ones" +text = "REWARD_SCREEN_TEXT" horizontal_alignment = 1 [node name="ChoicesContainer" type="HBoxContainer" parent="RewardChoiceContainer/Choice/VSplitContainer"] diff --git a/gui/game/scripts/game_gui.gd b/gui/game/scripts/game_gui.gd index 7b5326b..85af332 100644 --- a/gui/game/scripts/game_gui.gd +++ b/gui/game/scripts/game_gui.gd @@ -1,32 +1,38 @@ -extends Control +extends CanvasLayer class_name GameGui +const SCORE_ICON : Texture = preload("res://common/icons/growth.svg") + @export var quota_reward : QuotaReward func _ready(): GameInfo.game_data.current_planet_data.updated.connect(_on_planet_updated) + GameInfo.game_data.current_planet_data.plant_gaining_score.connect(_on_plant_gaining_score) GameInfo.game_data.current_planet_data.new_quota_started.connect(_on_planet_new_quota_started) GameInfo.game_data.player_data.updated.connect(_on_player_updated) GameInfo.game_data.player_data.inventory.updated.connect(_on_inventory_updated) - planet_update(GameInfo.game_data.current_planet_data) - player_update(GameInfo.game_data.player_data) + planet_update(GameInfo.game_data.current_planet_data, false) + player_update(GameInfo.game_data.player_data, false) inventory_update(GameInfo.game_data.player_data.inventory) if not GameInfo.game_data.current_planet_data.is_quota_announced: await quota_reward.reward_chosen announce_quota(GameInfo.game_data.current_planet_data) GameInfo.game_data.current_planet_data.is_quota_announced = true + %EnergyInfo.update_minimum_size() func _on_player_updated(player_data : PlayerData): player_update(player_data) -func player_update(player_data : PlayerData): - %EnergyCount.text = "%d/%d" % [player_data.energy, player_data.max_energy] - %EnergyInfo.modulate = Color.WHITE if player_data.energy > 0 else Color.RED +func player_update(player_data : PlayerData, with_animation = true): + var energy_count_text = "[b]%d[/b] / %d" % [player_data.energy, player_data.max_energy] - update_no_energy_left_info(player_data.energy) + if energy_count_text != %EnergyCount.text and with_animation: + %EnergyAnimationPlayer.bounce() + %EnergyCount.text = energy_count_text + %EnergyInfo.modulate = Color.WHITE if player_data.energy > 0 else Color.RED func _on_inventory_updated(inventory : Inventory): inventory_update(inventory) @@ -37,26 +43,67 @@ func inventory_update(inventory : Inventory): func _on_planet_updated(planet_data : PlanetData): planet_update(planet_data) -func planet_update(planet_data : PlanetData): +func planet_update(planet_data : PlanetData, with_animation = true): if planet_data: %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()] - get_tree().create_tween().tween_property( - %QuotaProgressBar, - "value", - quota_progression_percent, - 0.5, + + if with_animation: + get_tree().create_tween().tween_property( + %QuotaProgressBar, + "value", + quota_progression_percent, + 0.5, + ) + else: %QuotaProgressBar.value = quota_progression_percent + +func _on_plant_gaining_score(plant: Plant, amount : int): + for i in range(amount): + var camera = get_viewport().get_camera_2d() + var screen_size = get_viewport().get_visible_rect().size + + spawn_score_particle( + plant.global_position - camera.global_position + screen_size / 2, + %QuotaProgressBar.global_position + %QuotaProgressBar.size / 2, + 0.8 ) + await get_tree().create_timer(0.3).timeout + +func spawn_score_particle( + from_position, + to_position, + duration +): + var sprite_particle = Sprite2D.new() + sprite_particle.texture = SCORE_ICON + %ScoreParticles.add_child(sprite_particle) + sprite_particle.position = from_position + + var tween = get_tree().create_tween() + + tween.set_trans(Tween.TransitionType.TRANS_SPRING) + + tween.tween_property( + sprite_particle, + "position", + to_position, + duration + ) + + + await tween.finished + sprite_particle.queue_free() + + func _on_player_action_tried_without_energy(): $AnimationPlayer.play("no_energy_left") func _on_pause_pressed(): Pause.pause = true - func _on_player_upgraded(): $EffectAnimation.play("upgrade") @@ -66,14 +113,6 @@ func _on_planet_pass_day_started(planet): await $PassDayAnimation.animation_finished $PassDayAnimation.speed_scale = 1 -func update_no_energy_left_info(energy): - if energy == 0 and not %NoEnergyLeft.visible: - %NoEnergyLeft.visible = true - $NoEnergyLeftAnimation.play("no_energy_left_appear") - elif energy != 0 and %NoEnergyLeft.visible: - %NoEnergyLeft.visible = false - - func _on_planet_new_quota_started(planet_data : PlanetData): planet_update(planet_data) await quota_reward.reward_chosen @@ -91,6 +130,6 @@ func _on_planet_pass_day_ended(planet:Planet): if planet.data.quota_days == 1: %Announce.announce( tr("LAST_DAY_FOR_REACHING_QUOTA"), - str(roundi(planet.data.get_quota_score() - planet.garden.get_score())) + " garden score left", + tr("%d_GARDEN_SCORE_LEFT") % [planet.data.get_quota_score() - planet.garden.get_score()], Announce.RED_COLOR ) diff --git a/gui/game/win/scripts/win.gd b/gui/game/win/scripts/win.gd index 09659e2..955c93c 100644 --- a/gui/game/win/scripts/win.gd +++ b/gui/game/win/scripts/win.gd @@ -8,7 +8,7 @@ func _ready(): func win(planet : Planet): visible = true get_tree().paused = true - %WinTitle.text = tr("SCORE_%d") % str(roundi(planet.garden.get_score())) + %WinTitle.text = tr("SCORE_%d") % roundi(planet.garden.get_score()) func _on_restart_pressed(): GameInfo.game_data.reset_all() diff --git a/gui/game/win/win.tscn b/gui/game/win/win.tscn index 8ef02d5..010aa25 100644 --- a/gui/game/win/win.tscn +++ b/gui/game/win/win.tscn @@ -63,13 +63,13 @@ horizontal_alignment = 1 [node name="ThanksTitle" type="Label" parent="Tutorial/VBoxContainer"] layout_mode = 2 -text = "Thanks for playing" +text = "THANKS_FOR_PLAYING" label_settings = ExtResource("3_0b3c6") horizontal_alignment = 1 [node name="ThanksText" type="Label" parent="Tutorial/VBoxContainer"] layout_mode = 2 -text = "We need your feedback! Give us your thoughts on the game on our Discord or in the comments section of the Itch page." +text = "WIN_SCREEN_TEXT" horizontal_alignment = 1 [node name="HBoxContainer2" type="HBoxContainer" parent="Tutorial/VBoxContainer"] @@ -80,7 +80,7 @@ alignment = 1 layout_mode = 2 theme = ExtResource("1_cl67j") theme_override_font_sizes/font_size = 24 -text = "Join our Discord" +text = "JOIN_OUR_DISCORD" uri = "https://discord.gg/VTFKvEvgfz" [node name="HBoxContainer" type="HBoxContainer" parent="Tutorial/VBoxContainer"] @@ -89,12 +89,12 @@ alignment = 1 [node name="Restart" type="Button" parent="Tutorial/VBoxContainer/HBoxContainer"] layout_mode = 2 -text = "Restart" +text = "RESTART" icon = ExtResource("4_8p3aj") [node name="Quit" type="Button" parent="Tutorial/VBoxContainer/HBoxContainer"] layout_mode = 2 -text = "Quit" +text = "QUIT" icon = ExtResource("5_j3wid") [connection signal="pressed" from="Tutorial/VBoxContainer/HBoxContainer/Restart" to="." method="_on_restart_pressed"] diff --git a/gui/menu/scripts/menu.gd b/gui/menu/scripts/menu.gd index b848242..50488e7 100644 --- a/gui/menu/scripts/menu.gd +++ b/gui/menu/scripts/menu.gd @@ -7,4 +7,6 @@ func _ready(): func _on_start_pressed(): GameInfo.game_data.current_planet_data = PlanetData.new() + var preferred_language = OS.get_locale_language() + TranslationServer.set_locale(preferred_language) get_tree().change_scene_to_file(start_scene_path) diff --git a/gui/pointer/pointer.tscn b/gui/pointer/pointer.tscn index 78a52a5..e198ace 100644 --- a/gui/pointer/pointer.tscn +++ b/gui/pointer/pointer.tscn @@ -30,10 +30,10 @@ process_mode = 3 script = ExtResource("1_1pe2k") default_cursor = ExtResource("2_q4bvb") -[node name="CanvasLayer" type="CanvasLayer" parent="."] +[node name="InspectorCanvasLayer" type="CanvasLayer" parent="."] layer = 128 -[node name="Inspector" type="Control" parent="CanvasLayer"] +[node name="Inspector" type="Control" parent="InspectorCanvasLayer"] unique_name_in_owner = true layout_mode = 3 anchors_preset = 0 @@ -41,7 +41,7 @@ offset_right = 40.0 offset_bottom = 40.0 mouse_filter = 2 -[node name="Container" type="VBoxContainer" parent="CanvasLayer/Inspector"] +[node name="Container" type="VBoxContainer" parent="InspectorCanvasLayer/Inspector"] layout_mode = 0 offset_left = 28.0 offset_right = 134.0 @@ -50,25 +50,25 @@ size_flags_horizontal = 0 size_flags_vertical = 0 mouse_filter = 2 -[node name="Action" type="HBoxContainer" parent="CanvasLayer/Inspector/Container"] +[node name="Action" type="HBoxContainer" parent="InspectorCanvasLayer/Inspector/Container"] unique_name_in_owner = true custom_minimum_size = Vector2(0, 20) layout_mode = 2 -[node name="MouseImage" type="TextureRect" parent="CanvasLayer/Inspector/Container/Action"] +[node name="MouseImage" type="TextureRect" parent="InspectorCanvasLayer/Inspector/Container/Action"] layout_mode = 2 texture = ExtResource("3_pshoq") expand_mode = 2 stretch_mode = 5 -[node name="ActionEnergyImage" type="TextureRect" parent="CanvasLayer/Inspector/Container/Action"] +[node name="ActionEnergyImage" type="TextureRect" parent="InspectorCanvasLayer/Inspector/Container/Action"] unique_name_in_owner = true layout_mode = 2 texture = ExtResource("4_b4uwv") expand_mode = 2 stretch_mode = 5 -[node name="ActionText" type="RichTextLabel" parent="CanvasLayer/Inspector/Container/Action"] +[node name="ActionText" type="RichTextLabel" parent="InspectorCanvasLayer/Inspector/Container/Action"] unique_name_in_owner = true layout_mode = 2 bbcode_enabled = true @@ -77,17 +77,17 @@ fit_content = true scroll_active = false autowrap_mode = 0 -[node name="ActionZone" type="Sprite2D" parent="CanvasLayer/Inspector"] +[node name="ActionZone" type="Sprite2D" parent="InspectorCanvasLayer/Inspector"] unique_name_in_owner = true z_index = 4096 script = ExtResource("5_b4uwv") opacity = 0.4 metadata/_custom_type_script = "uid://c60a1bjcuj4hd" -[node name="CardsCanvasLayer" type="CanvasLayer" parent="."] +[node name="CardCanvasLayer" type="CanvasLayer" parent="."] layer = 2 -[node name="CardPosition" type="Control" parent="CardsCanvasLayer"] +[node name="CardPosition" type="Control" parent="CardCanvasLayer"] unique_name_in_owner = true layout_mode = 3 anchors_preset = 8 @@ -99,7 +99,7 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -[node name="MarginContainer" type="MarginContainer" parent="CardsCanvasLayer/CardPosition"] +[node name="MarginContainer" type="MarginContainer" parent="CardCanvasLayer/CardPosition"] layout_mode = 1 anchors_preset = 7 anchor_left = 0.5 @@ -117,7 +117,7 @@ theme_override_constants/margin_top = 0 theme_override_constants/margin_right = 0 theme_override_constants/margin_bottom = 0 -[node name="CardVisualiser" parent="CardsCanvasLayer/CardPosition/MarginContainer" instance=ExtResource("6_7j4mj")] +[node name="CardVisualiser" parent="CardCanvasLayer/CardPosition/MarginContainer" instance=ExtResource("6_7j4mj")] unique_name_in_owner = true modulate = Color(1, 1, 1, 0.5003133) material = SubResource("ShaderMaterial_6eft6") diff --git a/gui/pointer/scripts/pointer.gd b/gui/pointer/scripts/pointer.gd index c9e2672..7a74a29 100644 --- a/gui/pointer/scripts/pointer.gd +++ b/gui/pointer/scripts/pointer.gd @@ -133,7 +133,7 @@ func update_inspector(): %ActionEnergyImage.visible = current_inspect.interaction_cost(player) != 0 elif current_selected_item and current_selected_item.use_text() != "": %Action.visible = true - %ActionText.text = current_selected_item.use_text() + (" (no energy left)" if not have_energy_to_use_item else "") + %ActionText.text = current_selected_item.use_text() + (tr("NO_ENERGY_LEFT") if not have_energy_to_use_item else "") if can_use_item: %Action.modulate = DEFAULT_ACTION_COLOR if current_selected_item.energy_usage == 0 else ENERGY_ACTION_COLOR else : diff --git a/gui/ressources/default_theme.tres b/gui/ressources/default_theme.tres index 6abbfb8..a4d6e80 100644 --- a/gui/ressources/default_theme.tres +++ b/gui/ressources/default_theme.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=11 format=3 uid="uid://bgcmd213j6gk1"] +[gd_resource type="Theme" load_steps=13 format=3 uid="uid://bgcmd213j6gk1"] [ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_g7s0b"] [ext_resource type="FontFile" uid="uid://c7k6ssq6ocwdk" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-M.ttf" id="2_ab4w8"] @@ -45,6 +45,20 @@ corner_radius_bottom_left = 5 [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g7s0b"] bg_color = Color(0.0627451, 0.05882353, 0.16862746, 1) +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ab4w8"] +bg_color = Color(0.03, 0.03, 0.03, 0.42745098) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_36amo"] +bg_color = Color(1, 0.6509804, 0.09019608, 1) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hv6r3"] [resource] @@ -62,6 +76,8 @@ MarginContainer/constants/margin_left = 15 MarginContainer/constants/margin_right = 15 MarginContainer/constants/margin_top = 15 Panel/styles/panel = SubResource("StyleBoxFlat_g7s0b") +ProgressBar/styles/background = SubResource("StyleBoxFlat_ab4w8") +ProgressBar/styles/fill = SubResource("StyleBoxFlat_36amo") RichTextLabel/font_sizes/bold_font_size = 12 RichTextLabel/font_sizes/bold_italics_font_size = 12 RichTextLabel/font_sizes/italics_font_size = 12 diff --git a/gui/tools/control_animation_player.gd b/gui/tools/control_animation_player.gd new file mode 100644 index 0000000..9cd028f --- /dev/null +++ b/gui/tools/control_animation_player.gd @@ -0,0 +1,63 @@ +@tool +extends Node +class_name ControlAnimationPlayer + +@onready var target : Control = get_parent() + +@export_tool_button("Test Shake", "Callable") var shake_action = shake +@export_tool_button("Test Bounce", "Callable") var bounce_action = bounce + +func bounce( + duration : float = 0.4, + amount : float = 10, + direction : Vector2 = Vector2.UP, + transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_BOUNCE, +): + await add_tween( + "position", + target.position + direction * amount, + duration/2, + transition_type + ).finished + await add_tween( + "position", + target.position - direction * amount, + duration/2, + transition_type + ).finished + +func shake( + duration : float = 0.3, + amount : float = 10, + transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR, +): + await add_tween( + "position", + target.position + Vector2.RIGHT * amount/2, + duration/3, + transition_type + ).finished + await add_tween( + "position", + target.position + Vector2.LEFT * amount, + duration/3, + transition_type + ).finished + await add_tween( + "position", + target.position + Vector2.RIGHT * amount/2, + duration/3, + transition_type + ).finished + + +func add_tween( + property : String, + value : Variant, + seconds: float = 1., + transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR +) -> Tween: + var tween : Tween = get_tree().create_tween() + tween.set_trans(transition_type) + tween.tween_property(target, property, value, seconds) + return tween \ No newline at end of file diff --git a/gui/tools/control_animation_player.gd.uid b/gui/tools/control_animation_player.gd.uid new file mode 100644 index 0000000..3dabd40 --- /dev/null +++ b/gui/tools/control_animation_player.gd.uid @@ -0,0 +1 @@ +uid://0dhj8sdpil7q diff --git a/root.tscn b/root.tscn index 05b62bd..b9acf84 100644 --- a/root.tscn +++ b/root.tscn @@ -80,7 +80,7 @@ size_flags_horizontal = 4 size_flags_vertical = 4 theme = ExtResource("4_gd4vy") theme_override_font_sizes/font_size = 33 -text = "Start" +text = "START" icon = ExtResource("7_qwhpj") [node name="Credits" type="VBoxContainer" parent="CanvasLayer/MarginContainer/GridContainer"] @@ -92,7 +92,7 @@ size_flags_vertical = 4 layout_mode = 2 size_flags_horizontal = 3 theme = ExtResource("4_gd4vy") -text = "Art" +text = "ART" label_settings = ExtResource("8_bf3um") horizontal_alignment = 1 @@ -109,7 +109,7 @@ horizontal_alignment = 1 layout_mode = 2 size_flags_horizontal = 3 theme = ExtResource("4_gd4vy") -text = "Development / Game Design" +text = "DEV_AND_GAME_DESIGN" label_settings = ExtResource("8_bf3um") horizontal_alignment = 1 @@ -125,7 +125,7 @@ horizontal_alignment = 1 layout_mode = 2 size_flags_horizontal = 3 theme = ExtResource("4_gd4vy") -text = "Music" +text = "MUSIC" label_settings = ExtResource("8_bf3um") horizontal_alignment = 1 diff --git a/stages/intro/intro.tscn b/stages/intro/intro.tscn index 20fcac5..e3c0c9e 100644 --- a/stages/intro/intro.tscn +++ b/stages/intro/intro.tscn @@ -25,7 +25,7 @@ alignment = 1 [node name="Label" type="Label" parent="LanguageChoose/CenterContainer"] layout_mode = 2 -text = "Choose a language" +text = "CHOOSE_A_LANGUAGE" label_settings = ExtResource("3_mi20s") horizontal_alignment = 1 @@ -36,6 +36,7 @@ theme = ExtResource("1_u726n") alignment = 1 [node name="Story" type="CanvasLayer" parent="."] +visible = false script = ExtResource("5_tg2p4") [node name="CenterContainer2" type="CenterContainer" parent="Story"] diff --git a/stages/terrain/planet/scripts/garden.gd b/stages/terrain/planet/scripts/garden.gd index 1596e18..72e3f44 100644 --- a/stages/terrain/planet/scripts/garden.gd +++ b/stages/terrain/planet/scripts/garden.gd @@ -46,8 +46,14 @@ func generate_contamination_terrain_sprite() -> Polygon2D: func get_score(): var score = 0 - for p in plants: - score += p.calculate_plant_score() + planet_data.score_by_plant.resize(len(plants)) + for i in range(len(plants)): + var plant_score = plants[i].calculate_plant_score() + score += plant_score + var old_score = 0 if planet_data.score_by_plant[i] == null else planet_data.score_by_plant[i] + if old_score < plant_score: + planet_data.plant_has_gained_score(plants[i], plant_score - old_score) + planet_data.score_by_plant[i] = plant_score return score func plant( @@ -62,7 +68,6 @@ func plant( plants.append(new_plant) new_plant.harvested.connect(_on_plant_harvested) new_plant.state_changed.connect(_on_plant_state_changed) - update_garden_score() return new_plant func _on_plant_state_changed(_p: Plant): diff --git a/stages/terrain/planet/scripts/planet.gd b/stages/terrain/planet/scripts/planet.gd index ae5355f..31e8af8 100644 --- a/stages/terrain/planet/scripts/planet.gd +++ b/stages/terrain/planet/scripts/planet.gd @@ -116,6 +116,7 @@ func plant( if garden.is_in_garden(plant_position): var new_plant = garden.plant(type, plant_mutations) add_entity(new_plant, plant_position) + garden.update_garden_score() return true return false @@ -166,6 +167,7 @@ func reach_quota(): data.quota += 1 quota_reward.trigger_reward() await quota_reward.reward_chosen + garden.update_garden_score() if data.garden_score >= data.get_quota_score(): reach_quota() data.quota_days = data.get_quota_duration() diff --git a/stages/terrain/planet/scripts/planet_data.gd b/stages/terrain/planet/scripts/planet_data.gd index 4a90179..444e115 100644 --- a/stages/terrain/planet/scripts/planet_data.gd +++ b/stages/terrain/planet/scripts/planet_data.gd @@ -2,6 +2,7 @@ extends Resource class_name PlanetData signal new_quota_started(planet_data : PlanetData) +signal plant_gaining_score(p : Plant, amount : int) signal contamination_updated(decontamination_surface : float) signal updated(planet_data : PlanetData) @@ -27,6 +28,7 @@ const DEFAULT_GARDEN_SIZE = Vector2(1500,1500) quota_days = v updated.emit(self) @export var entities_saved_data : Array[EntityData] = [] +@export var score_by_plant : Array[int] = [] @export var generated_chunk_entities : Array[Vector2i] @export var tutorial_step : int = 0 @@ -41,7 +43,7 @@ func _init(_base_size : Vector2 = DEFAULT_GARDEN_SIZE): ) contamination_updated.emit(get_decontamination_surface()) - +#region ------------------ Contamination ------------------ func impact_contamination(position : Vector2, impact_radius : float, to_value : float = 1.): garden_contamination.draw_circle( position, @@ -66,6 +68,8 @@ func get_decontamination_coverage() -> float: func get_decontamination_surface() -> float: return garden_contamination.get_value_surface() +#endregion + #region ------------------ Quotas ------------------ func get_quota_score(q : int = quota) -> int: var first_quotas = [ @@ -85,4 +89,11 @@ func get_quota_duration(_q = quota) -> int: return 7 #endregion + +#region ------------------ Score ------------------ + +func plant_has_gained_score(plant : Plant, amount : int): + plant_gaining_score.emit(plant, amount) + +#endregion diff --git a/stages/terrain/planet/scripts/terrain_data.gd b/stages/terrain/planet/scripts/terrain_data.gd index 66bb7ad..f8c50fa 100644 --- a/stages/terrain/planet/scripts/terrain_data.gd +++ b/stages/terrain/planet/scripts/terrain_data.gd @@ -23,7 +23,7 @@ func draw_random_zone( var noise: Noise = FastNoiseLite.new() noise.seed = random_seed noise.noise_type = FastNoiseLite.TYPE_CELLULAR - noise.frequency = 0.3 + noise.frequency = 0.1 var noise_image_size : Vector2i = Vector2i.ONE * (image_size) var noise_image_center = noise_image_size / 2 diff --git a/stages/terrain/truck/truck_interior.tscn b/stages/terrain/truck/truck_interior.tscn index 52887f5..7ebd33a 100644 --- a/stages/terrain/truck/truck_interior.tscn +++ b/stages/terrain/truck/truck_interior.tscn @@ -39,9 +39,9 @@ scale = Vector2(0.5539248, 0.5539248) position = Vector2(47, 497.00003) scale = Vector2(0.5539248, 0.5539248) script = ExtResource("3_fk6sc") -default_interact_text = "Exit the truck" -default_info_title = "Exit" -default_info_desc = "A good old ladder." +default_interact_text = "EXIT_TRUCK" +default_info_title = "EXIT" +default_info_desc = "LADDER_DESC_TEXT" metadata/_custom_type_script = "uid://dyprcd68fjstf" [node name="Bolt" type="Sprite2D" parent="Exit"]