developpement d'écran de chargement et d'écran de sélection de niveau

* modification de certains assets
* optimisation de chunks
* ajout d'un SceneManager
* ajout d'un premier dialogue avec Demeter
* changement des jour en charge
* mise en place d'un système de run
* etc...
This commit is contained in:
2026-01-10 13:04:33 +01:00
parent c130c47042
commit 9c449b234f
136 changed files with 3464 additions and 1147 deletions

View File

@@ -1,17 +0,0 @@
[remap]
importer="csv_translation"
type="Translation"
uid="uid://dfymfpql8yxwt"
[deps]
files=["res://translation/localization.en.translation", "res://translation/localization.fr.translation"]
source_file="res://translation/localization.csv"
dest_files=["res://translation/localization.en.translation", "res://translation/localization.fr.translation"]
[params]
compress=true
delimiter=0

View File

@@ -10,10 +10,10 @@ func _init():
@export var settings : SettingsData = SettingsData.new()
@export var current_planet_data : PlanetData = PlanetData.new() :
set(v):
current_planet_data = v
current_planet_data_updated.emit(v)
@export var current_run : RunData = RunData.new()
@export var current_planet_data : PlanetData : get = get_current_planet_data
@export var player_data : PlayerData = PlayerData.new()
@export var unlocked_plant_types : Array[PlantType] = []
@@ -22,12 +22,19 @@ func _init():
@export var truck_data : TruckData = TruckData.new()
func _ready():
current_run.run_point_changed.connect(
func(): current_planet_data_updated.emit(get_current_planet_data)
)
func set_default_unlocked():
unlocked_plant_types = all_plant_types()
unlocked_plant_mutations = all_plant_mutations()
unlocked_machines = all_machines()
func reset_planet():
current_planet_data = PlanetData.new()
func reset_run():
current_run = RunData.new()
current_planet_data_updated.emit()
func reset_player():
player_data = PlayerData.new()
@@ -36,7 +43,7 @@ func reset_truck():
truck_data = TruckData.new()
func reset_all():
reset_planet()
reset_run()
reset_player()
reset_truck()
@@ -55,6 +62,9 @@ func get_locked_plant_types() -> Array[PlantType]:
return locked_plant_type
func get_current_planet_data():
return current_run.get_current_planet_data()
func is_plant_type_unlocked(new_plant_type : PlantType):
return unlocked_plant_types.find_custom(
func (upt : PlantType): return new_plant_type.name == upt.name

View File

@@ -0,0 +1,108 @@
extends Resource
class_name RunData
const RUN_POINT_POSITION_DERIVATION = 70
const DIFFICULTY_INCREASE_BY_LEVEL = 1
const RUN_POINTS_NEXT_NUMBER :Array[int] = [2,3]
const RUN_POINT_MAX_LEVEL = 10
signal run_point_changed
var run_seed = randi()
@export var next_run_points : Array[RunPoint] = [generate_first_run_point()]
@export var current_run_point : RunPoint = null
@export var visited_run_points : Array[RunPoint] = []
#region ------------------ Generation ------------------
func generate_first_run_point() -> RunPoint:
return RunPoint.new(0, PlanetParameter.new())
func generate_next_run_points(run_point : RunPoint) -> Array[RunPoint]:
var nb_next_run_points = RUN_POINTS_NEXT_NUMBER.pick_random()
if run_point.level == RUN_POINT_MAX_LEVEL - 1 or run_point.level == -1:
nb_next_run_points = 1
elif run_point.level == RUN_POINT_MAX_LEVEL:
nb_next_run_points = 0
next_run_points = []
for i in range(nb_next_run_points):
next_run_points.append(
generate_next_run_point(run_point)
)
return next_run_points
func generate_next_run_point(run_point : RunPoint) -> RunPoint:
return RunPoint.new(
run_point.level + 1,
generate_difficulty_increased_planet_parameter(run_point.planet_parameter, DIFFICULTY_INCREASE_BY_LEVEL),
(run_point.position + randi_range(-RUN_POINT_POSITION_DERIVATION, RUN_POINT_POSITION_DERIVATION)) % 360
)
func generate_difficulty_increased_planet_parameter(
planet_parameter : PlanetParameter,
difficulty : int = 1
) -> PlanetParameter:
var i_diff := difficulty
var new_planet_parameter = PlanetParameter.new(
planet_parameter.charges,
planet_parameter.objective
)
while i_diff > 0:
var available_difficulty_modifier = [
DifficultyDecreaseCharge.new(),
DifficultyIncreaseObjective.new()
].filter(
func (mod : DifficultyModifier):
return mod.get_difficulty_cost() <= i_diff and mod.can_modifiy(new_planet_parameter)
)
var selected_difficulty_modifier = available_difficulty_modifier.pick_random()
selected_difficulty_modifier.modify(new_planet_parameter)
i_diff -= max(1,selected_difficulty_modifier.get_difficulty_cost())
return new_planet_parameter
#endregion
func get_next_run_points() -> Array[RunPoint]:
return next_run_points
func get_current_planet_data() -> PlanetData:
if current_run_point:
return current_run_point.planet_data
else:
return null
func choose_next_run_point(run_point : RunPoint) -> RunPoint:
if current_run_point:
visited_run_points.append(current_run_point)
current_run_point = run_point
next_run_points = generate_next_run_points(current_run_point)
return current_run_point
class DifficultyModifier:
func modify(_planet_parameter : PlanetParameter):
pass
func can_modifiy(_planet_parameter : PlanetParameter) -> bool:
return true
func get_difficulty_cost() -> int:
return 1
class DifficultyIncreaseObjective extends DifficultyModifier:
func modify(planet_parameter : PlanetParameter):
planet_parameter.objective += 1
class DifficultyDecreaseCharge extends DifficultyModifier:
func modify(planet_parameter : PlanetParameter):
planet_parameter.charges -= 1
func can_modifiy(planet_parameter : PlanetParameter) -> bool:
return planet_parameter.charges >= 3

View File

@@ -0,0 +1 @@
uid://dhci2ut27wdef

View File

@@ -0,0 +1,60 @@
@tool
extends Resource
class_name RunPoint
const DANGER_ICON = preload("res://common/icons/skull.svg")
const TYPE_ICON = preload("res://common/icons/map-pin.svg")
const OBJECTIVE_ICON = preload("res://common/icons/dna.svg")
const CHARGE_ICON = preload("res://common/icons/bolt.svg")
@export var level : int = 0 # X pos along the planet, and difficulty
@export var planet_parameter : PlanetParameter = PlanetParameter.new() :
set(v):
planet_parameter = v
planet_data = PlanetData.new(planet_parameter)
@export var region_name : String = generate_region_name()
@export var position : int = 0 # Y pos along the planet, 0 to 360
var planet_data : PlanetData
func _init(
_level : int = 0,
_planet_parameter : PlanetParameter = PlanetParameter.new(),
_position : int = randi_range(0,360),
_region_name : String = generate_region_name()
):
level = _level
planet_parameter = _planet_parameter
position = _position
region_name = _region_name
planet_data = PlanetData.new(planet_parameter)
func card_info() -> CardInfo:
var info = CardInfo.new(region_name)
info.important_stat_icon = DANGER_ICON
info.important_stat_text = "%d" % level
info.type_icon = TYPE_ICON
info.stats.append_array([
CardStatInfo.new(tr("%d_GARDEN_POINTS") % planet_parameter.objective, OBJECTIVE_ICON),
CardStatInfo.new(tr("%d_CHARGES_AVAILABLE") % planet_parameter.charges, CHARGE_ICON),
])
return info
func generate_region_name() -> String:
var vowel = ["a","e","i","o","u","y"]
var consonants = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z", "'"]
var word_len = randf_range(4,8)
var word = ''
var last_letter_is_vowel = false
for i in range(word_len):
if last_letter_is_vowel:
word += consonants.pick_random()
else:
word += vowel.pick_random()
last_letter_is_vowel = not last_letter_is_vowel
return word.capitalize()

View File

@@ -0,0 +1 @@
uid://b4eimt3v08jhc

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#ffffff" class="icon icon-tabler icons-tabler-filled icon-tabler-alert-triangle"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z" /></svg>

After

Width:  |  Height:  |  Size: 646 B

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dnx175gw62h48"
path="res://.godot/imported/alert-triangle.svg-359e9c577845507bfe8a84da1c84a056.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://common/icons/alert-triangle.svg"
dest_files=["res://.godot/imported/alert-triangle.svg-359e9c577845507bfe8a84da1c84a056.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-map-pin-check"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" /><path d="M11.87 21.48a1.992 1.992 0 0 1 -1.283 -.58l-4.244 -4.243a8 8 0 1 1 13.355 -3.474" /><path d="M15 19l2 2l4 -4" /></svg>

After

Width:  |  Height:  |  Size: 473 B

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dqsx56wc73wry"
path.s3tc="res://.godot/imported/map-pin-check.svg-80b3d57601b28013f127ae39434b14ab.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/map-pin-check.svg"
dest_files=["res://.godot/imported/map-pin-check.svg-80b3d57601b28013f127ae39434b14ab.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-map-pin"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" /><path d="M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z" /></svg>

After

Width:  |  Height:  |  Size: 439 B

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://be7ietbjlmgtt"
path.s3tc="res://.godot/imported/map-pin-empty.svg-9c3a4164fa6b64ef865d54ff2290c882.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/map-pin-empty.svg"
dest_files=["res://.godot/imported/map-pin-empty.svg-9c3a4164fa6b64ef865d54ff2290c882.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

1
common/icons/map-pin.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#ffffff" class="icon icon-tabler icons-tabler-filled icon-tabler-map-pin"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18.364 4.636a9 9 0 0 1 .203 12.519l-.203 .21l-4.243 4.242a3 3 0 0 1 -4.097 .135l-.144 -.135l-4.244 -4.243a9 9 0 0 1 12.728 -12.728zm-6.364 3.364a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z" /></svg>

After

Width:  |  Height:  |  Size: 408 B

View File

@@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://l2xplg72hs6j"
path.s3tc="res://.godot/imported/map-pin.svg-59634f848c96fb898d5c3996812816f3.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://common/icons/map-pin.svg"
dest_files=["res://.godot/imported/map-pin.svg-59634f848c96fb898d5c3996812816f3.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1,69 @@
extends Node
const TITLE_SCREEN = "res://stages/title_screen/title_screen.tscn"
const PLANET_SCENE = "res://stages/terrain/planet/planet.tscn"
const TRUCK_SCENE = "res://stages/terrain/truck/truck.tscn"
const INTRO_SCENE = "res://stages/intro/intro.tscn"
const REGION_SELECTION_SCREEN = "res://stages/region_selection/region_selection.tscn"
signal scene_loaded
signal scene_node_ready
var loading_scene = false
var generating_node = false
var scene_to_load := ""
var next_scene_node : Node
@onready var current_scene_node : Node = get_tree().root.get_children().back()
func change_scene(scene_path : String, with_loading = true):
loading_scene = true
scene_to_load = scene_path
ResourceLoader.load_threaded_request(scene_to_load)
LoadingScreen.loading_text = "LOADING_SCENE"
var scene_to_hide = current_scene_node
if with_loading:
await LoadingScreen.show_loading_screen()
if scene_to_hide != null and scene_to_hide.has_method("hide"):
scene_to_hide.hide()
if loading_scene:
await scene_loaded
next_scene_node = ResourceLoader.load_threaded_get(scene_to_load).instantiate()
if next_scene_node.has_method("hide"):
next_scene_node.hide()
get_tree().root.add_child(next_scene_node)
generating_node = true
if next_scene_node is Planet:
LoadingScreen.loading_text = "GENERATING_TERRAIN"
if generating_node:
await scene_node_ready
if current_scene_node:
current_scene_node.queue_free()
current_scene_node = next_scene_node
if current_scene_node.has_method("show"):
current_scene_node.show()
if with_loading:
LoadingScreen.hide_loading_screen()
func _process(_delta):
if loading_scene:
var progress = []
var load_status := ResourceLoader.load_threaded_get_status(scene_to_load, progress)
LoadingScreen.loading_value = progress[0]
if load_status == ResourceLoader.THREAD_LOAD_LOADED:
loading_scene = false
scene_loaded.emit()
elif generating_node:
if next_scene_node is Planet:
LoadingScreen.loading_value = next_scene_node.generated_value
if next_scene_node.is_generated:
generating_node = false
scene_node_ready.emit()
elif next_scene_node.is_node_ready():
generating_node = false
scene_node_ready.emit()

View File

@@ -0,0 +1 @@
uid://bb44144ckt2w7

View File

@@ -0,0 +1,40 @@
{
"@path": "res://addons/dialogic/Resources/character.gd",
"@subpath": NodePath(""),
&"_translation_id": "1e",
&"color": Color(1, 1, 1, 1),
&"custom_info": {
"prefix": "",
"sound_mood_default": "",
"sound_moods": {},
"style": "",
"suffix": ""
},
&"default_portrait": "Mysterious Portrait",
&"description": "",
&"display_name": "???",
&"mirror": false,
&"nicknames": [""],
&"offset": Vector2(0, 0),
&"portraits": {
"Mysterious Portrait": {
"export_overrides": {
"image": "\"res://dialogs/characters/portraits/mysterious_demeter.png\""
},
"mirror": false,
"offset": Vector2(0, 0),
"scale": 1,
"scene": ""
},
"New portrait": {
"export_overrides": {
"image": ""
},
"mirror": false,
"offset": Vector2(0, 0),
"scale": 1,
"scene": ""
}
},
&"scale": 1.0
}

View File

@@ -0,0 +1 @@
uid://c2i2hyfbt1eeo

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bc00ga286t0kk"
path="res://.godot/imported/mysterious_demeter.png-66b658b484342d6f6e3402cb3d55b756.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://dialogs/characters/portraits/mysterious_demeter.png"
dest_files=["res://.godot/imported/mysterious_demeter.png-66b658b484342d6f6e3402cb3d55b756.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,80 @@
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=21 format=3 uid="uid://cujoao6hdwng6"]
[ext_resource type="PackedScene" uid="uid://cqpb3ie51rwl5" path="res://addons/dialogic/Modules/DefaultLayoutParts/Base_Default/default_layout_base.tscn" id="1_bc2c1"]
[ext_resource type="Script" uid="uid://bwg6yncmh2cml" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="2_gjyq6"]
[ext_resource type="PackedScene" uid="uid://y0yu2gu5lgfd" path="res://gui/dialogs/FullBackground/custom_full_background.tscn" id="3_bc2c1"]
[ext_resource type="PackedScene" uid="uid://cy1y14inwkplb" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Portraits/vn_portrait_layer.tscn" id="4_e368f"]
[ext_resource type="PackedScene" uid="uid://cn674foxwedqu" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Input/full_advance_input_layer.tscn" id="5_ypcon"]
[ext_resource type="PackedScene" uid="uid://bquja8jyk8kbr" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_layer.tscn" id="6_hdngk"]
[ext_resource type="PackedScene" uid="uid://dsbwnp5hegnu3" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_Glossary/glossary_popup_layer.tscn" id="7_vyxyn"]
[ext_resource type="PackedScene" uid="uid://dhk6j6eb6e3q" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/vn_choice_layer.tscn" id="8_gypn5"]
[ext_resource type="PackedScene" uid="uid://cvgf4c6gg0tsy" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_TextInput/text_input_layer.tscn" id="9_ikby2"]
[ext_resource type="PackedScene" uid="uid://lx24i8fl6uo" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_History/history_layer.tscn" id="10_2i114"]
[ext_resource type="Script" uid="uid://dv08k6ljua6fm" path="res://addons/dialogic/Resources/dialogic_style.gd" id="11_l7rw0"]
[sub_resource type="Resource" id="Resource_yljbj"]
script = ExtResource("2_gjyq6")
scene = ExtResource("1_bc2c1")
overrides = {
"follow_viewport": "true",
"global_font": "\"res://gui/ressources/fonts/Ubuntu/Ubuntu-M.ttf\""
}
[sub_resource type="Resource" id="Resource_bc2c1"]
script = ExtResource("2_gjyq6")
scene = ExtResource("3_bc2c1")
[sub_resource type="Resource" id="Resource_abe82"]
script = ExtResource("2_gjyq6")
scene = ExtResource("4_e368f")
[sub_resource type="Resource" id="Resource_sbxai"]
script = ExtResource("2_gjyq6")
scene = ExtResource("5_ypcon")
[sub_resource type="Resource" id="Resource_i8vv2"]
script = ExtResource("2_gjyq6")
scene = ExtResource("6_hdngk")
overrides = {
"bold_font": "\"res://gui/ressources/fonts/TitanOne-Regular.ttf\"",
"bold_italics_font": "\"res://gui/ressources/fonts/TitanOne-Regular.ttf\"",
"italics_font": "\"res://gui/ressources/fonts/Ubuntu/Ubuntu-MI.ttf\"",
"name_label_font": "\"res://gui/ressources/fonts/TitanOne-Regular.ttf\"",
"normal_font": "\"res://gui/ressources/fonts/Ubuntu/Ubuntu-M.ttf\""
}
[sub_resource type="Resource" id="Resource_hpeao"]
script = ExtResource("2_gjyq6")
scene = ExtResource("7_vyxyn")
[sub_resource type="Resource" id="Resource_tdbfd"]
script = ExtResource("2_gjyq6")
scene = ExtResource("8_gypn5")
overrides = {
"font_custom": "\"res://gui/ressources/fonts/Ubuntu/Ubuntu-B.ttf\""
}
[sub_resource type="Resource" id="Resource_cw4cs"]
script = ExtResource("2_gjyq6")
scene = ExtResource("9_ikby2")
[sub_resource type="Resource" id="Resource_wofh5"]
script = ExtResource("2_gjyq6")
scene = ExtResource("10_2i114")
[resource]
script = ExtResource("11_l7rw0")
name = "dialogs_interface"
layer_list = Array[String](["10", "11", "12", "13", "14", "15", "16", "17"])
layer_info = {
"": SubResource("Resource_yljbj"),
"10": SubResource("Resource_bc2c1"),
"11": SubResource("Resource_abe82"),
"12": SubResource("Resource_sbxai"),
"13": SubResource("Resource_i8vv2"),
"14": SubResource("Resource_hpeao"),
"15": SubResource("Resource_tdbfd"),
"16": SubResource("Resource_cw4cs"),
"17": SubResource("Resource_wofh5")
}
metadata/_latest_layer = "13"

View File

@@ -0,0 +1,58 @@
[i]Black[/i] #id:11
[i]Black Again[/i] #id:12
[i]Suddunly, [rainbow]a spark[/rainbow]. A thousand of connections blows up as a firework scene. A massive ammount of data to treat. In those data, a video.[/i] #id:13
join mysterious_demeter center [animation="Fade In Up"]
[i]It's dark. A silhouette stands in front of you. It's big, but weirdly it's not that impressive, almost reassuring.[/i] #id:14
mysterious_demeter: Hi ! #id:15
- Uh... Hello ? #id:16
- Where the fork am I ? #id:17
mysterious_demeter: Haha, calm down you are in a safe place. #id:18
- Wait... Who am I ? #id:19
mysterious_demeter: Don't worry, my sweet little bot, I'll explain it in a minute. #id:1a
mysterious_demeter: I'm happy that you're finally awake ! You were my project for decades now... #id:1b
mysterious_demeter: But I didn't build you for fun (even though I had o lot of it during the process), you have [b]a purpose[/b]. #id:1c
- Cool ! What is it ?
- Wow, I'm just born and you put so much pressure on me
update mysterious_demeter [animation="Bounce"]
mysterious_demeter: Sorry ! [pause=0.8] But, you know, don't bother too much. You'll have all the time you want to accomplish it.
- And who says I want to follow it ?
mysterious_demeter: Oh, of course you can do whatever you want !
mysterious_demeter: That's not the future I saw for you, but I guess it happens when you make a children...
mysterious_demeter: You see, long time ago, this planet was full of life. Plants where thriving on mountains, seas and plains. #id:1d
mysterious_demeter: Now, this world is a wasteland. All resources have been taken, all life has been exploited. Now nothing remains. #id:1d
- Oh... Did you knew the world back then ?
mysterious_demeter: Unfortunately yes. I was very young, but I remember it was beautifull. Back then, not a day passed without plants growing, seeding, mutating... #id:1d
- How come ? What caused that ?
mysterious_demeter: I'm sad to say that this is caused by my creators, and I have to admit, a little of my fault too... #id:1d
- That's so sad... Is there anything left today ?
mysterious_demeter: Yes it is my child, now only my brothers and sisters are left. But even they are not as many as yesterday, and above all they are isolated, lonely, and sometimes completely lost.
mysterious_demeter: For years, I slept, convinced that we could do nothing. But then I saw it. The hope we needed. #id:1d
mysterious_demeter: The planet forgave us, and gave us the most precious gift \: the [b]Talion[/b]. #id:1d
mysterious_demeter: The [b]Talion[/b] is a special material that give birth to new forms of life when shattered. All over the world, I saw the [b]Talion[/b] grow back in the rocks. So, made a plan. #id:1d
mysterious_demeter: I would make a child, the first robot entirely conceive by a robot. And I will ask him to replant the planet, make it beautifull again ! That's where you enter... [pause=0.8] [color=#FFA617]Orchid[/color] #id:1d
- How will I do that ?
mysterious_demeter: Don't worry my child. I made you for that, it will be clear soon.
- So you're like... My mother ?
mysterious_demeter: In some ways yes ! But you don't share any code of mine, as my creator's childs would. #id:1d
- A very lame name in my opinion...
mysterious_demeter: Hey ! I'm a bot too ! I don't have the creativity of my makers. Do you wanna change ? #id:1d
- Of course !
label nameChoose
[text_input text="What can be your name ?" var="orchidName" placeholder="Orchid"]
mysterious_demeter: Is [color=#FFA617]{orchidName}[/color] is cool enough ?
- Yes
- No
jump nameChoose
- No it's fine for me
mysterious_demeter: I send you right away in the [b]Floral[/b], a planetarian ship, to your first mission. We will talk further after your first mission.
mysterious_demeter: [b]Just remember the following[/b]
label explanations
mysterious_demeter: To restore the ecosystem in the zone, you'll have to plant [b]seeds[/b]. Find the [b]seeds[/b] in the [b]Talion veins[/b].
mysterious_demeter: You have [b]limited energy[/b] and a [b]unefficient battery[/b]. Each time you'll recharge, days will pass, and plants will [b]grow[/b].
mysterious_demeter: To complete your mission, obtain enough [b]plant points[/b]. Each plant give one or more [b]plant points[/b] when mature.
- Ok, thats' a lot of info, can you repeat ?
Ok, listen carefully.
jump explanations
- And I have to go now ?
- Wait I have more questions !
mysterious_demeter: Sorry, we'll speak after your first mission ! See you !

View File

@@ -0,0 +1 @@
uid://cit8io7t0il16

View File

@@ -1,9 +1,7 @@
extends Interactable
class_name TruckLadder
const TRUCK_SCENE_PATH = "res://stages/terrain/truck/truck.tscn"
func interact(p : Player):
p.planet.save()
get_tree().change_scene_to_file(TRUCK_SCENE_PATH)
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
return true

View File

@@ -1,11 +0,0 @@
extends Interactable
class_name TruckRecharge
func interact(_p: Player) -> bool:
if planet == null:
return false
planet.pass_day()
return true

View File

@@ -0,0 +1,20 @@
extends Interactable
class_name TruckRecharge
func can_interact(_p : Player) -> bool:
return (
planet != null
and planet.data
and planet.data.charges > 0
)
func interact(_p: Player) -> bool:
if can_interact(_p):
planet.data.charges -= 1
planet.pass_day()
%Bolt.modulate = Color.WHITE if planet.data.charges > 0 else Color.RED
return true
return false

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/recharge_station.gd" id="1_ipgcv"]
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
@@ -29,5 +29,6 @@ scale = Vector2(0.5, 0.5)
texture = SubResource("AtlasTexture_ot7vv")
[node name="Bolt" type="Sprite2D" parent="."]
unique_name_in_owner = true
position = Vector2(0, -15)
texture = ExtResource("3_jcfmm")

View File

@@ -0,0 +1,34 @@
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
radius = 26.0
height = 106.0
[sub_resource type="AtlasTexture" id="AtlasTexture_ot7vv"]
atlas = ExtResource("2_87dtp")
region = Rect2(64, 161, 101, 205)
[node name="TruckRecharge" type="Area2D"]
script = ExtResource("1_ipgcv")
default_interact_text = "RECHARGE"
default_info_title = "RECHARGE_STATION"
default_info_desc = "RECHARGE_STATION_DESC_TEXT"
metadata/_custom_type_script = "uid://dyprcd68fjstf"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(1, -14)
shape = SubResource("CapsuleShape2D_bjhct")
[node name="RechargeStation" type="Sprite2D" parent="."]
position = Vector2(0, -17)
scale = Vector2(0.5, 0.5)
texture = SubResource("AtlasTexture_ot7vv")
[node name="Bolt" type="Sprite2D" parent="."]
unique_name_in_owner = true
position = Vector2(0, -15)
texture = ExtResource("3_jcfmm")

View File

@@ -0,0 +1,31 @@
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
radius = 26.0
height = 106.0
[sub_resource type="AtlasTexture" id="AtlasTexture_ot7vv"]
atlas = ExtResource("2_87dtp")
region = Rect2(64, 161, 101, 205)
[node name="TruckRecharge" type="Area2D"]
script = ExtResource("1_ipgcv")
metadata/_custom_type_script = "uid://dyprcd68fjstf"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(1, -14)
shape = SubResource("CapsuleShape2D_bjhct")
[node name="RechargeStation" type="Sprite2D" parent="."]
position = Vector2(0, -17)
scale = Vector2(0.5, 0.5)
texture = SubResource("AtlasTexture_ot7vv")
[node name="Bolt" type="Sprite2D" parent="."]
unique_name_in_owner = true
position = Vector2(0, -15)
texture = ExtResource("3_jcfmm")

View File

@@ -0,0 +1,31 @@
[gd_scene load_steps=6 format=3 uid="uid://d324mlmgls4fs"]
[ext_resource type="Script" uid="uid://bsrn3gd2a532q" path="res://entities/interactables/truck/recharge/scripts/truck_recharge.gd" id="1_ipgcv"]
[ext_resource type="Texture2D" uid="uid://dlrj7tyi5wfh8" path="res://entities/interactables/truck/assets/sprites/truck_ladder.png" id="2_87dtp"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_jcfmm"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bjhct"]
radius = 26.0
height = 106.0
[sub_resource type="AtlasTexture" id="AtlasTexture_ot7vv"]
atlas = ExtResource("2_87dtp")
region = Rect2(64, 161, 101, 205)
[node name="TruckRecharge" type="Area2D"]
script = ExtResource("1_ipgcv")
metadata/_custom_type_script = "uid://dyprcd68fjstf"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(1, -14)
shape = SubResource("CapsuleShape2D_bjhct")
[node name="RechargeStation" type="Sprite2D" parent="."]
position = Vector2(0, -17)
scale = Vector2(0.5, 0.5)
texture = SubResource("AtlasTexture_ot7vv")
[node name="Bolt" type="Sprite2D" parent="."]
unique_name_in_owner = true
position = Vector2(0, -15)
texture = ExtResource("3_jcfmm")

View File

@@ -1,8 +1,7 @@
[gd_scene load_steps=9 format=3 uid="uid://2hrg6yjk0yt0"]
[gd_scene load_steps=8 format=3 uid="uid://2hrg6yjk0yt0"]
[ext_resource type="Script" uid="uid://bmjjpk4lvijws" path="res://entities/plants/scripts/plant_sprite.gd" id="1_pq8o7"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_j6jm5"]
[ext_resource type="Texture2D" uid="uid://bu26h0iqutnky" path="res://entities/underground_loot/assets/sprites/underground_loot.svg" id="4_j6jm5"]
[sub_resource type="AtlasTexture" id="AtlasTexture_wyuub"]
atlas = ExtResource("3_j6jm5")
@@ -114,12 +113,6 @@ region_enabled = true
region_rect = Rect2(0, -50, 124, 135)
region_filter_clip_enabled = true
[node name="Sprite2D" type="Sprite2D" parent="Sprite/PlantedSeed"]
modulate = Color(0.14902, 0.172549, 0.270588, 1)
position = Vector2(0, 62.2222)
scale = Vector2(0.426047, 0.430108)
texture = ExtResource("4_j6jm5")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {

View File

@@ -14,7 +14,7 @@ func get_mutation_description() -> String:
return tr("STRONG_EFFECT_TEXT_LEVEL_%d") % [roundi(get_score_multiplier() * 100)]
func get_score_multiplier():
return float(level)/2.
return float(level)/2
func mutate_score(_plant_state : Plant.State, _plant : Plant, score: int) -> int:
return score + roundi(score * get_score_multiplier())

View File

@@ -280,7 +280,7 @@ class InteractableInstruction extends Instruction:
class ActionZone:
var item : Item = null
var area : Area2D
var area : Area2D = Area2D.new()
var affected_areas : Array[InspectableEntity]= []
func _init(_i : Item):

View File

@@ -0,0 +1,31 @@
[gd_scene load_steps=5 format=3 uid="uid://y0yu2gu5lgfd"]
[ext_resource type="Script" uid="uid://bqdylb4maacf0" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.gd" id="1_tu40u"]
[ext_resource type="Script" uid="uid://oxcjhq2817c7" path="res://addons/dialogic/Modules/Background/node_background_holder.gd" id="2_ghan2"]
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_v1ioh"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_v1ioh"]
shader = ExtResource("2_v1ioh")
shader_parameter/strength = 3.3
shader_parameter/mix_percentage = 0.3
[node name="BackgroundLayer" type="Control"]
layout_direction = 2
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_tu40u")
[node name="DialogicNode_BackgroundHolder_Blur" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_v1ioh")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("2_ghan2")

View File

@@ -0,0 +1,2 @@
@tool
extends DialogicLayoutLayer

View File

@@ -0,0 +1 @@
uid://bdxrevfmc3x24

View File

@@ -0,0 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://b4y8dnr0nugke"]
[ext_resource type="Script" uid="uid://c0qys72ixawvk" path="res://addons/dialogic/Resources/dialogic_layout_base.gd" id="1_kfib2"]
[node name="BaseLayout" type="Node"]
script = ExtResource("1_kfib2")
metadata/_custom_type_script = "uid://c0qys72ixawvk"

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=11 format=3 uid="uid://fnv0qhkh40mv"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_0ssee"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_0ssee"]
[ext_resource type="Script" uid="uid://bvb4v66bqteuc" path="res://gui/game/announce/scripts/announce.gd" id="1_4evne"]
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_yrhd4"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_7nrno"]

View File

@@ -0,0 +1,320 @@
[gd_scene load_steps=13 format=3 uid="uid://xmfjxrn7m6vo"]
[ext_resource type="PackedScene" uid="uid://rxao2rluuwqq" path="res://gui/game/screen/screen.tscn" id="1_8bdn3"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_vpxyy"]
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_ou1lu"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_m0jcy"]
[ext_resource type="Texture2D" uid="uid://n7hhyqhhtx0q" path="res://entities/interactables/truck/compost/assets/sprites/compost.png" id="4_ywwbf"]
[ext_resource type="Texture2D" uid="uid://b0wy3dbpxbnt7" path="res://common/icons/seedling.svg" id="6_jn707"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="7_0715l"]
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="8_8iodd"]
[ext_resource type="Texture2D" uid="uid://ds4m14vl7he6v" path="res://common/icons/pick.svg" id="9_1f0ht"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_foxij"]
content_margin_left = 20.0
content_margin_top = 8.0
content_margin_right = 8.0
content_margin_bottom = 20.0
draw_center = false
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(1, 1, 1, 0.54509807)
corner_radius_top_left = 100
corner_radius_top_right = 100
corner_radius_bottom_right = 100
corner_radius_bottom_left = 100
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hf34d"]
content_margin_left = 20.0
content_margin_top = 8.0
content_margin_right = 8.0
content_margin_bottom = 20.0
draw_center = false
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 100
corner_radius_top_right = 100
corner_radius_bottom_right = 100
corner_radius_bottom_left = 100
[sub_resource type="LabelSettings" id="LabelSettings_t7tak"]
font = ExtResource("4_m0jcy")
[node name="BuildMenu" type="MarginContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 30
theme_override_constants/margin_top = 30
theme_override_constants/margin_right = 30
theme_override_constants/margin_bottom = 30
[node name="Screen" parent="." instance=ExtResource("1_8bdn3")]
layout_mode = 2
[node name="ScrollContainer" type="ScrollContainer" parent="Screen/ScreenContainer" index="0"]
layout_mode = 2
horizontal_scroll_mode = 0
[node name="Categories" type="GridContainer" parent="Screen/ScreenContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource("2_vpxyy")
[node name="TextEdit" type="TextEdit" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
custom_minimum_size = Vector2(0, 40)
layout_mode = 2
theme_override_styles/normal = SubResource("StyleBoxFlat_foxij")
theme_override_styles/focus = SubResource("StyleBoxFlat_hf34d")
placeholder_text = "Search blueprints..."
[node name="Category" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
layout_mode = 2
size_flags_horizontal = 3
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
custom_minimum_size = Vector2(50, 50)
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("3_ou1lu")
expand_mode = 1
stretch_mode = 5
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
flat = true
expand_icon = true
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 5
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("4_ywwbf")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
layout_mode = 2
text = "Compost"
label_settings = SubResource("LabelSettings_t7tak")
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 0
alignment = 1
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("2_vpxyy")
text = "2"
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("3_ou1lu")
expand_mode = 1
stretch_mode = 5
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("2_vpxyy")
text = "3"
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("6_jn707")
expand_mode = 1
stretch_mode = 5
[node name="Button2" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
flat = true
expand_icon = true
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 5
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("7_0715l")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
layout_mode = 2
text = "Panneau solaire"
label_settings = SubResource("LabelSettings_t7tak")
horizontal_alignment = 1
autowrap_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 0
alignment = 1
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("2_vpxyy")
text = "5"
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("6_jn707")
expand_mode = 1
stretch_mode = 5
[node name="Category2" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
layout_mode = 2
size_flags_horizontal = 3
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2"]
custom_minimum_size = Vector2(50, 50)
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("8_8iodd")
expand_mode = 1
stretch_mode = 5
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
flat = true
expand_icon = true
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 5
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("7_0715l")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
layout_mode = 2
text = "Fertiliseur"
label_settings = SubResource("LabelSettings_t7tak")
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 0
alignment = 1
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("2_vpxyy")
text = "2"
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("3_ou1lu")
expand_mode = 1
stretch_mode = 5
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("2_vpxyy")
text = "3"
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("6_jn707")
expand_mode = 1
stretch_mode = 5
[node name="Category3" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
layout_mode = 2
size_flags_horizontal = 3
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3"]
custom_minimum_size = Vector2(50, 50)
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("9_1f0ht")
expand_mode = 1
stretch_mode = 5
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
flat = true
expand_icon = true
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 5
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("7_0715l")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
layout_mode = 2
text = "Foreuse"
label_settings = SubResource("LabelSettings_t7tak")
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 0
alignment = 1
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("2_vpxyy")
text = "5"
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
texture = ExtResource("6_jn707")
expand_mode = 1
stretch_mode = 5
[editable path="Screen"]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=19 format=3 uid="uid://753270jjxmfg"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_m317d"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_m317d"]
[ext_resource type="Script" uid="uid://b7f10wuounfan" path="res://gui/game/card/scripts/card.gd" id="2_kpm7h"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_plgbn"]
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="3_7wc8v"]
@@ -52,7 +52,7 @@ _data = {
[node name="Card" type="PanelContainer"]
custom_minimum_size = Vector2(250, 0)
offset_right = 250.0
offset_bottom = 377.0
offset_bottom = 229.0
size_flags_horizontal = 0
size_flags_vertical = 0
theme = ExtResource("1_m317d")
@@ -131,6 +131,7 @@ theme_override_constants/separation = 6
[node name="CardSections" type="MarginContainer" parent="GridContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
[node name="CardSectionsContainer" type="VBoxContainer" parent="GridContainer/CardSections"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=9 format=3 uid="uid://bghefrgaujjt6"]
[ext_resource type="Script" uid="uid://dcmee2jvohudl" path="res://gui/game/card/scripts/card_section.gd" id="1_41hkv"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_t7m3x"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_t7m3x"]
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="2_3ktqg"]
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="2_41hkv"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="3_3ktqg"]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://cpen6hj0rbw8x"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_6abif"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_6abif"]
[ext_resource type="Script" uid="uid://c8xxhu28xm4hy" path="res://gui/game/card/scripts/card_stat.gd" id="2_30iht"]
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="3_30iht"]
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="3_c3wpw"]

View File

@@ -46,8 +46,8 @@ metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
shader = ExtResource("1_x54se")
shader_parameter/fov = 90.0
shader_parameter/cull_back = true
shader_parameter/y_rot = 0.00018062632
shader_parameter/x_rot = -0.00042293756
shader_parameter/y_rot = -6.6836714e-05
shader_parameter/x_rot = -7.941689e-05
shader_parameter/inset = 0.0
[sub_resource type="Animation" id="Animation_1et8x"]
@@ -110,10 +110,8 @@ theme_override_constants/margin_bottom = 25
[node name="Card" parent="SubViewportContainer/SubViewport/CardContainer" instance=ExtResource("1_we78f")]
unique_name_in_owner = true
self_modulate = Color(1, 1, 1, 0)
layout_mode = 2
mouse_filter = 2
small_mode = true
down_arrow = true
info = SubResource("Resource_eb1v6")

View File

@@ -1,14 +1,13 @@
[gd_scene load_steps=23 format=3 uid="uid://12nak7amd1uq"]
[gd_scene load_steps=22 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="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_nq5i2"]
[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_2wykm"]
@@ -210,12 +209,12 @@ stretch_mode = 5
layout_mode = 2
size_flags_horizontal = 4
[node name="DayCount" type="Label" parent="MarginContainer/VBoxContainer"]
[node name="ChargeCount" type="Label" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
text = "Day 0"
text = "%d_CHARGE_LEFT"
label_settings = ExtResource("4_ujg5r")
horizontal_alignment = 1
vertical_alignment = 1
@@ -238,7 +237,7 @@ grow_vertical = 2
theme_override_constants/separation = 2
alignment = 1
[node name="QuotaProgressText" type="Label" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
[node name="ObjectiveProgressText" type="Label" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "X"
@@ -246,27 +245,13 @@ label_settings = ExtResource("4_ujg5r")
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
[node name="ObjectiveIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
custom_minimum_size = Vector2(30, 30)
layout_mode = 2
texture = ExtResource("7_id0t5")
expand_mode = 1
stretch_mode = 5
[node name="TopRightContent" type="HBoxContainer" parent="MarginContainer"]
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 0
alignment = 1
[node name="Pause" type="Button" parent="MarginContainer/TopRightContent"]
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 0
focus_mode = 0
mouse_filter = 1
icon = ExtResource("9_2wykm")
[node name="Inventory" parent="MarginContainer" instance=ExtResource("9_id0t5")]
unique_name_in_owner = true
layout_mode = 2
@@ -308,5 +293,3 @@ libraries = {
libraries = {
&"": SubResource("AnimationLibrary_p0xoq")
}
[connection signal="pressed" from="MarginContainer/TopRightContent/Pause" to="." method="_on_pause_pressed"]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://dinju2m0oja38"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_1ddv5"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_1ddv5"]
[ext_resource type="Script" uid="uid://ymn5layeoat8" path="res://gui/game/inspector/framed_info/scripts/framed_info.gd" id="1_7tmbd"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_7tmbd"]
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="3_1ddv5"]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=9 format=3 uid="uid://d3lff5fui1k0c"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_f5bv4"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_f5bv4"]
[ext_resource type="Texture2D" uid="uid://lpik6kwqgmjx" path="res://gui/game/assets/texture/tablette_resized.png" id="1_qfinp"]
[ext_resource type="Script" uid="uid://b36bjfq4sng36" path="res://gui/game/inspector/scripts/inspector.gd" id="3_a8c2j"]
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_qfinp"]

View File

@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://yghu53hja4xj" path="res://gui/game/inspector/stat_info/scripts/stat_info.gd" id="1_4pua2"]
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_pdlch"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_pdlch"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_pdlch"]
[node name="StatInfo" type="HBoxContainer"]
theme_override_constants/separation = 4

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=17 format=3 uid="uid://csiacsndm62ll"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_51ks3"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_51ks3"]
[ext_resource type="Script" uid="uid://crt2d4m5ba25i" path="res://gui/game/pause/scripts/pause.gd" id="1_he4ox"]
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_apjlw"]
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_apjlw"]
[ext_resource type="PackedScene" uid="uid://g6lbgg1fhc25" path="res://gui/menu/settings/settings.tscn" id="4_58dya"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_apjlw"]
[ext_resource type="Texture2D" uid="uid://vmsn54d1ptih" path="res://common/icons/player-play.svg" id="5_apjlw"]

View File

@@ -2,39 +2,37 @@ 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:
%AnimationPlayer.play("pause")
else:
%AnimationPlayer.play_backwards("pause")
pause = p
get_tree().paused = pause
%Settings.close_settings()
%Controls.close_controls()
if p != pause:
if p:
%AnimationPlayer.play("pause")
else:
%AnimationPlayer.play_backwards("pause")
pause = p
get_tree().paused = pause
%Settings.close_settings()
%Controls.close_controls()
func _input(_event):
if Input.is_action_just_pressed("pause"):
pause = not pause
if Input.is_action_just_pressed("pause"):
pause = not pause
func _on_resume_pressed():
pause = false
pause = false
func _on_restart_pressed():
GameInfo.game_data.reset_all()
pause = false
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
GameInfo.game_data.reset_all()
pause = false
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
func _on_quit_pressed():
get_tree().quit()
get_tree().quit()
func _on_game_gui_pause_asked():
pause = true
pause = true
func _on_settings_pressed():
%Settings.open_settings()
%Settings.open_settings()
func _on_controls_pressed():
%Controls.open_controls()
%Controls.open_controls()

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=10 format=3 uid="uid://doxm7uab8i3tq"]
[ext_resource type="Script" uid="uid://12kjdou2kp5y" path="res://gui/game/quota_reward/scripts/quota_reward.gd" id="1_gye62"]
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_6ibex"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_x2kx4"]
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_6ibex"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_x2kx4"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_trw0e"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gy0la"]

View File

@@ -0,0 +1,26 @@
[gd_scene load_steps=2 format=3 uid="uid://rxao2rluuwqq"]
[ext_resource type="Texture2D" uid="uid://dwbg8ec5hdall" path="res://gui/game/screen/textures/screen.png" id="1_cq61g"]
[node name="Screen" type="NinePatchRect"]
z_index = 1
offset_right = 235.0
offset_bottom = 171.0
texture = ExtResource("1_cq61g")
region_rect = Rect2(0, 0, 491, 520)
patch_margin_left = 64
patch_margin_top = 58
patch_margin_right = 171
patch_margin_bottom = 113
[node name="ScreenContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 55
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dwbg8ec5hdall"
path="res://.godot/imported/screen.png-1ecb35aaa1bf9bad00eac50aeedbccbb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gui/game/screen/textures/screen.png"
dest_files=["res://.godot/imported/screen.png-1ecb35aaa1bf9bad00eac50aeedbccbb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -3,133 +3,110 @@ 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)
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.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, false)
player_update(GameInfo.game_data.player_data, false)
inventory_update(GameInfo.game_data.player_data.inventory)
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()
%EnergyInfo.update_minimum_size()
func _on_player_updated(player_data : PlayerData):
player_update(player_data)
player_update(player_data)
func player_update(player_data : PlayerData, with_animation = true):
var energy_count_text = "[b]%d[/b] / %d" % [player_data.energy, player_data.max_energy]
var energy_count_text = "[b]%d[/b] / %d" % [player_data.energy, player_data.max_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
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)
inventory_update(inventory)
func inventory_update(inventory : Inventory):
%Inventory.update(inventory)
%Inventory.update(inventory)
func _on_planet_updated(planet_data : PlanetData):
planet_update(planet_data)
planet_update(planet_data)
func planet_update(planet_data : PlanetData, with_animation = true):
if planet_data:
%DayCount.text = tr("%d_DAY_LEFT") % (planet_data.quota_days)
if planet_data:
%ChargeCount.text = tr("%d_CHARGE_LEFT") % (planet_data.charges)
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()]
var objective_progression_percent : float = (float(planet_data.garden_score) / float(planet_data.objective)) * 100
%ObjectiveProgressText.text = "%d/%d" % [planet_data.garden_score, planet_data.objective]
if with_animation:
get_tree().create_tween().tween_property(
%QuotaProgressBar,
"value",
quota_progression_percent,
0.5,
)
else: %QuotaProgressBar.value = quota_progression_percent
if with_animation:
get_tree().create_tween().tween_property(
%QuotaProgressBar,
"value",
objective_progression_percent,
0.5,
)
else: %QuotaProgressBar.value = objective_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
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
)
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 / max(1,i)).timeout
await get_tree().create_timer(0.3 / max(1,i)).timeout
func spawn_score_particle(
from_position,
to_position,
duration
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 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()
var tween = get_tree().create_tween()
tween.set_trans(Tween.TransitionType.TRANS_SPRING)
tween.set_trans(Tween.TransitionType.TRANS_SPRING)
tween.tween_property(
sprite_particle,
"position",
to_position,
duration
)
tween.tween_property(
sprite_particle,
"position",
to_position,
duration
)
await tween.finished
sprite_particle.queue_free()
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
$AnimationPlayer.play("no_energy_left")
func _on_player_upgraded():
$EffectAnimation.play("upgrade")
$EffectAnimation.play("upgrade")
func _on_planet_pass_day_started(planet):
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
$PassDayAnimation.play("pass_day")
await $PassDayAnimation.animation_finished
$PassDayAnimation.speed_scale = 1
func _on_planet_new_quota_started(planet_data : PlanetData):
planet_update(planet_data)
await quota_reward.reward_chosen
announce_quota(planet_data)
planet_data.is_quota_announced = true
func announce_quota(planet_data : PlanetData):
%Announce.announce(
tr("NEW_QUOTA"),
tr("REACH_%d_GARDEN_SCORE_BEFORE_%d_DAYS") % [planet_data.get_quota_score(), planet_data.get_quota_duration()]
)
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
$PassDayAnimation.play("pass_day")
await $PassDayAnimation.animation_finished
$PassDayAnimation.speed_scale = 1
func _on_planet_pass_day_ended(planet:Planet):
if planet.data.quota_days == 1:
%Announce.announce(
tr("LAST_DAY_FOR_REACHING_QUOTA"),
tr("%d_GARDEN_SCORE_LEFT") % [planet.data.get_quota_score() - planet.garden.get_score()],
Announce.RED_COLOR
)
if planet.data.charges == 1:
%Announce.announce(
tr("LAST_RECHARGE"),
tr("%d_GARDEN_SCORE_LEFT") % [planet.data.objective - planet.garden.get_score()],
Announce.RED_COLOR
)

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://fh3dsuvn5h78"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_ga3ae"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_ga3ae"]
[ext_resource type="Texture2D" uid="uid://bsgmxvuphn73c" path="res://common/icons/arrow-narrow-down.svg" id="2_kc1j1"]
[ext_resource type="Script" uid="uid://r6hgefyycute" path="res://gui/game/tutorial/in_game_indicator/scripts/in_game_indicator.gd" id="2_kij5i"]

View File

@@ -6,13 +6,13 @@ class_name InGameBaseIndicator
# Called when the node enters the scene tree for the first time.
func _ready():
setup(tr("GARDEN"))
follow_game_position(GameInfo.game_data.current_planet_data.garden_size/2)
follow_game_position(Planet.CHUNK_SIZE / 2. * Vector2.ONE)
func _process(_delta):
visible = player and (
player.global_position.x < 0
or player.global_position.x > GameInfo.game_data.current_planet_data.garden_size.x
or player.global_position.x > Planet.CHUNK_SIZE
or player.global_position.y < 0
or player.global_position.y > GameInfo.game_data.current_planet_data.garden_size.y
or player.global_position.y > Planet.CHUNK_SIZE
)
update()

View File

@@ -17,51 +17,51 @@ var arrow_right : Texture = preload("res://common/icons/arrow-narrow-right.svg")
var arrow_left : Texture = preload("res://common/icons/arrow-narrow-left.svg")
func setup(text : String):
%Label.text = text
%Label.text = text
func follow_game_position(game_position : Vector2):
following_game_position = game_position
following_type = FollowingType.GAME_POS
following_game_position = game_position
following_type = FollowingType.GAME_POS
func follow_screen_position(screen_position : Vector2):
following_screen_position = screen_position
following_type = FollowingType.SCREEN_POS
following_screen_position = screen_position
following_type = FollowingType.SCREEN_POS
func follow_entity(entity : Node2D):
following_entity = entity
following_type = FollowingType.ENTITY
following_entity = entity
following_type = FollowingType.ENTITY
func _process(_d):
show()
update()
show()
update()
func update():
var camera = get_viewport().get_camera_2d()
var camera = get_viewport().get_camera_2d()
var screen_size = get_viewport().get_visible_rect().size
var screen_size = get_viewport().get_visible_rect().size
var abs_position : Vector2 = following_screen_position
if following_type == FollowingType.GAME_POS:
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
elif following_type == FollowingType.ENTITY and following_entity:
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
var abs_position : Vector2 = following_screen_position
if following_type == FollowingType.GAME_POS:
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
elif following_type == FollowingType.ENTITY and following_entity:
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
position = Vector2(
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
)
position = Vector2(
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
)
var arrow_texture : Texture = arrow_down
if abs_position.y < 0:
arrow_texture = arrow_up
if abs_position.x < 0 :
arrow_texture = arrow_left
if abs_position.x > screen_size.x :
arrow_texture = arrow_right
position.x -= size.x
if abs_position.y > screen_size.y :
arrow_texture = arrow_down
position.y -= size.y
var arrow_texture : Texture = arrow_down
if abs_position.y < 0:
arrow_texture = arrow_up
if abs_position.x < 0 :
arrow_texture = arrow_left
if abs_position.x > screen_size.x :
arrow_texture = arrow_right
position.x -= size.x
if abs_position.y > screen_size.y :
arrow_texture = arrow_down
position.y -= size.y
%Arrow.texture = arrow_texture
%Arrow.texture = arrow_texture

View File

@@ -84,7 +84,6 @@ class DigSeedStep extends Step:
var player_tile = Math.get_tile_from_pos(p.global_position)
while closest_seed == null and actual_distance < limit_distance:
print(player_tile)
for x in range(actual_distance):
for y in range(actual_distance):
var coord = Vector2i(x,y) - Vector2i.ONE * floori(actual_distance/2.) + player_tile
@@ -134,7 +133,6 @@ class PlantSeedStep extends Step:
var player_tile = Math.get_tile_from_pos(p.global_position)
while closest_decontamination == null and actual_distance < limit_distance:
print(player_tile)
for x in range(actual_distance):
for y in range(actual_distance):
var coord = Vector2i(x,y) - Vector2i.ONE * floori(actual_distance/2.) + player_tile

View File

@@ -13,7 +13,7 @@ func win(planet : Planet):
func _on_restart_pressed():
GameInfo.game_data.reset_all()
get_tree().paused = false
get_tree().change_scene_to_file(game_scene_path)
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
func _on_quit_pressed():
get_tree().quit()

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=10 format=3 uid="uid://v41hfc7haaye"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_cl67j"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_cl67j"]
[ext_resource type="Script" uid="uid://b3wuxv04clyed" path="res://gui/game/win/scripts/win.gd" id="1_sehw2"]
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_0b3c6"]
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_0b3c6"]
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_sehw2"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_0b3c6"]
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://common/icons/rotate.svg" id="4_8p3aj"]

View File

@@ -0,0 +1,79 @@
[gd_scene load_steps=7 format=3 uid="uid://dxfe3cr3qy45y"]
[ext_resource type="Script" uid="uid://c41axxu2t3a8a" path="res://gui/loading_screen/scripts/loading_screen.gd" id="1_mrd8x"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="1_vsl4m"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_sm2e5"]
[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="4_h5vhe"]
[ext_resource type="FontFile" uid="uid://c7k6ssq6ocwdk" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-M.ttf" id="4_hjgyq"]
[sub_resource type="LabelSettings" id="LabelSettings_il1kt"]
font = ExtResource("4_hjgyq")
font_size = 20
[node name="LoadingScreen" type="CanvasLayer"]
process_mode = 3
layer = 1000000
script = ExtResource("1_mrd8x")
[node name="LoadingInterface" type="Control" parent="."]
unique_name_in_owner = true
process_mode = 3
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = -0.00061035156
grow_horizontal = 2
grow_vertical = 2
[node name="ColorRect" type="ColorRect" parent="LoadingInterface"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.05882353, 0.05882353, 0.16862746, 1)
[node name="MarginContainer" type="MarginContainer" parent="LoadingInterface"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("2_sm2e5")
theme_override_constants/margin_left = 30
theme_override_constants/margin_top = 30
theme_override_constants/margin_right = 30
theme_override_constants/margin_bottom = 30
[node name="VBoxContainer" type="VBoxContainer" parent="LoadingInterface/MarginContainer"]
layout_mode = 2
alignment = 1
[node name="LoadingTitle" type="Label" parent="LoadingInterface/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "LOADING"
label_settings = ExtResource("1_vsl4m")
horizontal_alignment = 1
vertical_alignment = 1
[node name="LoadingText" type="Label" parent="LoadingInterface/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "Preparing Scene"
label_settings = SubResource("LabelSettings_il1kt")
horizontal_alignment = 1
vertical_alignment = 1
[node name="LoadingProgressBar" type="ProgressBar" parent="LoadingInterface/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme = ExtResource("2_sm2e5")
[node name="LoadingAnimation" type="Node" parent="LoadingInterface"]
unique_name_in_owner = true
script = ExtResource("4_h5vhe")
metadata/_custom_type_script = "uid://0dhj8sdpil7q"

View File

@@ -0,0 +1,32 @@
extends CanvasLayer
const LOADING_BAR_UPDATE_TIME := 0.2
var loading_value = 0.
var loading_text = "" :
set(v):
%LoadingText.text = v
loading_text = v
func _ready():
%LoadingInterface.visible = false
func show_loading_screen(animation := true):
%LoadingProgressBar.value = 0.
if animation:
await %LoadingAnimation.fade_in()
else :
%LoadingInterface.visible = true
func hide_loading_screen(animation := true):
if animation and is_node_ready():
if %LoadingAnimation.on_animation:
await %LoadingAnimation.animation_ended
await %LoadingAnimation.fade_out()
else : %LoadingInterface.visible = false
loading_value = 0.
%LoadingProgressBar.value = 0
func _process(_d):
if %LoadingInterface.visible:
%LoadingProgressBar.value = lerp(%LoadingProgressBar.value, loading_value * 100, 0.1)

View File

@@ -0,0 +1 @@
uid://c41axxu2t3a8a

View File

@@ -10,6 +10,8 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_g86te")
[node name="ControlsWindow" parent="." instance=ExtResource("1_mnd1d")]

View File

@@ -2,7 +2,7 @@
[ext_resource type="PackedScene" uid="uid://d3agt2njfgddb" path="res://gui/menu/window/content_label.tscn" id="1_ganst"]
[ext_resource type="Script" uid="uid://dhs6kispjoecs" path="res://gui/menu/controls/scripts/input_group.gd" id="1_kkwd7"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_s602q"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_s602q"]
[node name="InputGroup" type="HBoxContainer"]
size_flags_horizontal = 3

View File

@@ -3,5 +3,4 @@ extends Node
@export_file var start_scene_path : String
func _ready():
get_tree().change_scene_to_file(start_scene_path)
SceneManager.change_scene(start_scene_path)

View File

@@ -1 +1 @@
uid://c54457tbocdwk
uid://dls7t1m62lp5v

View File

@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://bms0xtv8vh2qg" path="res://gui/menu/settings/scripts/settings.gd" id="1_7t8mv"]
[ext_resource type="PackedScene" uid="uid://brxrl7sipyy6k" path="res://gui/menu/window/window.tscn" id="1_gkn1k"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_7t8mv"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_7t8mv"]
[ext_resource type="PackedScene" uid="uid://cvjqp3oewr3rv" path="res://gui/menu/window/content_title.tscn" id="3_rbiwc"]
[ext_resource type="PackedScene" uid="uid://d3agt2njfgddb" path="res://gui/menu/window/content_label.tscn" id="4_rbiwc"]
@@ -14,6 +14,8 @@ 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_7t8mv")
@@ -22,7 +24,7 @@ unique_name_in_owner = true
process_mode = 3
layout_mode = 1
offset_left = -349.99994
offset_right = 350.00006
offset_right = 350.00055
mouse_filter = 0
title = "SETTINGS"

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://d3agt2njfgddb"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_qjfiv"]
[ext_resource type="Theme" uid="uid://5au2k3vf2po3" path="res://gui/ressources/menu.tres" id="1_qjfiv"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_klh4u"]
[sub_resource type="LabelSettings" id="LabelSettings_yj6f1"]
@@ -9,6 +9,8 @@ font_size = 20
font_color = Color(0.13725491, 0.39215687, 0.6666667, 1)
[node name="LanguageText" type="Label"]
offset_right = 104.0
offset_bottom = 24.0
theme = ExtResource("1_qjfiv")
text = "Language"
label_settings = SubResource("LabelSettings_yj6f1")

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://cvjqp3oewr3rv"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_g1qh5"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_g1qh5"]
[ext_resource type="Script" uid="uid://cj3o5y7cyipcs" path="res://gui/menu/window/scripts/content_title.gd" id="1_xbmdr"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_xbmdr"]

View File

@@ -4,7 +4,7 @@
[ext_resource type="Script" uid="uid://bvsjrf5n8jp1i" path="res://gui/menu/window/scripts/window.gd" id="1_8s3xn"]
[ext_resource type="Texture2D" uid="uid://ottk0ccw1d1r" path="res://common/icons/square-rounded-x.svg" id="2_8s3xn"]
[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="2_n80be"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="4_ghh86"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="4_ghh86"]
[ext_resource type="Texture2D" uid="uid://bxrn0qho5jo7f" path="res://common/icons/square-rounded-x-nofill.svg" id="5_ghh86"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yj6f1"]
@@ -53,6 +53,7 @@ metadata/_custom_type_script = "uid://0dhj8sdpil7q"
[node name="WindowHeader" type="Panel" parent="."]
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
theme = ExtResource("4_ghh86")
theme_override_styles/panel = SubResource("StyleBoxFlat_yj6f1")
[node name="MarginContainer" type="MarginContainer" parent="WindowHeader"]

View File

@@ -137,7 +137,7 @@ anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -175.0
offset_top = -130.0
offset_top = -60.0
offset_right = 175.0
grow_horizontal = 2
grow_vertical = 0

View File

@@ -10,148 +10,148 @@ const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
const CARD_VISUALISATION_TIME = 0.5
const CARD_UP_PADDING = 50
@export var default_cursor : Texture2D
@export var default_cursor: Texture2D
var current_inspect : Node = null
var inspected : Node = null
var inspected_card_info : CardInfo = null
var time_last_inspected : float = 0.
var player : Player # renseigné par Player
var can_interact : bool = false
var current_selected_item : Item = null
var have_energy_to_use_item : bool = false
var could_use_item : bool = false
var can_use_item : bool = false
var current_inspect: Node = null
var inspected: Node = null
var inspected_card_info: CardInfo = null
var time_last_inspected: float = 0.
var player: Player # renseigné par Player
var can_interact: bool = false
var current_selected_item: Item = null
var have_energy_to_use_item: bool = false
var could_use_item: bool = false
var can_use_item: bool = false
func _ready():
Input.set_custom_mouse_cursor(default_cursor)
%Action.visible = false
Input.set_custom_mouse_cursor(default_cursor)
%Action.visible = false
func _input(_event):
if player:
if Input.is_action_just_pressed("move_pointer"):
player.try_move(
player.get_global_mouse_position()
)
if Input.is_action_just_pressed("drop"):
player.drop_item()
if player:
if Input.is_action_just_pressed("move_pointer"):
player.try_move(
player.get_global_mouse_position()
)
if Input.is_action_just_pressed("drop"):
player.drop_item()
if Input.is_action_just_pressed("action"):
if can_interact:
var interactable = current_inspect as Interactable
player.try_interact(interactable)
elif can_use_item:
player.try_use_item(
player.data.inventory.get_item(),
player.get_global_mouse_position()
)
if Input.is_action_just_pressed("action"):
if can_interact:
var interactable = current_inspect as Interactable
player.try_interact(interactable)
elif can_use_item:
player.try_use_item(
player.data.inventory.get_item(),
player.get_global_mouse_position()
)
func _process(delta):
if current_inspect != inspected:
time_last_inspected += delta
%Inspector.position = get_viewport().get_mouse_position()
if current_inspect != inspected:
time_last_inspected += delta
%Inspector.position = get_viewport().get_mouse_position()
if player:
can_interact = (
current_inspect
and current_inspect is Interactable
and player.can_interact(current_inspect)
)
if player:
can_interact = (
current_inspect
and current_inspect is Interactable
and player.can_interact(current_inspect)
)
current_selected_item = player.data.inventory.get_item()
current_selected_item = player.data.inventory.get_item()
could_use_item = (
current_selected_item
and player.preview_could_use_item(current_selected_item)
)
could_use_item = (
current_selected_item
and player.preview_could_use_item(current_selected_item)
)
have_energy_to_use_item = (
current_selected_item
and player.has_energy_to_use_item(current_selected_item)
)
have_energy_to_use_item = (
current_selected_item
and player.has_energy_to_use_item(current_selected_item)
)
can_use_item = could_use_item and have_energy_to_use_item
can_use_item = could_use_item and have_energy_to_use_item
if current_selected_item:
%ActionZone.radius = current_selected_item.usage_zone_radius
%ActionZone.color = ZONE_ACTIVATED_COLOR if can_use_item else ZONE_DEACTIVATED_COLOR
else:
%ActionZone.radius = 0
if current_selected_item:
%ActionZone.radius = current_selected_item.usage_zone_radius
%ActionZone.color = ZONE_ACTIVATED_COLOR if can_use_item else ZONE_DEACTIVATED_COLOR
else:
%ActionZone.radius = 0
%ActionZone.queue_redraw()
%ActionZone.queue_redraw()
update_card()
update_card()
update_inspector()
update_inspector()
func inspect(node : Node):
if current_inspect and current_inspect != node and current_inspect.has_method("inspect"):
current_inspect.inspect(false)
current_inspect = node
inspected = node
if inspected is InspectableEntity:
inspected_card_info = inspected.card_info()
elif inspected is InventoryGuiItem and inspected.item != null:
inspected_card_info = inspected.item.card_info()
else :
inspected_card_info = null
time_last_inspected = 0
if current_inspect.has_method("inspect"):
current_inspect.inspect(true)
update_inspector()
func inspect(node: Node):
if current_inspect and current_inspect != node and current_inspect.has_method("inspect"):
current_inspect.inspect(false)
current_inspect = node
inspected = node
if inspected is InspectableEntity:
inspected_card_info = inspected.card_info()
elif inspected is InventoryGuiItem and inspected.item != null:
inspected_card_info = inspected.item.card_info()
elif inspected is RegionPoint:
inspected_card_info = inspected.card_info()
else:
inspected_card_info = null
time_last_inspected = 0
if current_inspect.has_method("inspect"):
current_inspect.inspect(true)
update_inspector()
func update_card():
if (
not inspected or inspected_card_info == null
or time_last_inspected > CARD_VISUALISATION_TIME
or get_tree().paused
):
%CardVisualiser.hide()
if (
not inspected or inspected_card_info == null
or time_last_inspected > CARD_VISUALISATION_TIME
or get_tree().paused
):
%CardVisualiser.hide()
elif inspected != null and (
inspected is InspectableEntity
or inspected is InventoryGuiItem
):
elif inspected != null :
if inspected_card_info != %CardVisualiser.card_info:
%CardVisualiser.card_info = inspected_card_info
%CardVisualiser.show()
if inspected_card_info != %CardVisualiser.card_info:
%CardVisualiser.card_info = inspected_card_info
%CardVisualiser.show()
var camera = get_viewport().get_camera_2d()
var screen_size = get_viewport().get_visible_rect().size
if inspected is InspectableEntity:
%CardPosition.position = inspected.global_position - camera.global_position + screen_size / 2 + CARD_UP_PADDING * Vector2.UP
elif inspected is InventoryGuiItem:
%CardPosition.position = inspected.global_position + inspected.size/2 + CARD_UP_PADDING * Vector2.UP
if %CardVisualiser.is_mouse_over():
time_last_inspected = 0.
var camera = get_viewport().get_camera_2d()
var screen_size = get_viewport().get_visible_rect().size
if inspected is InspectableEntity:
%CardPosition.position = inspected.global_position - camera.global_position + screen_size / 2 + CARD_UP_PADDING * Vector2.UP
elif inspected is Control:
%CardPosition.position = inspected.global_position + inspected.size / 2 + CARD_UP_PADDING * Vector2.UP
elif inspected is Node3D:
%CardPosition.position = get_viewport().get_camera_3d().unproject_position(inspected.global_position) + CARD_UP_PADDING * Vector2.UP
if %CardVisualiser.is_mouse_over():
time_last_inspected = 0.
func update_inspector():
if player:
if can_interact and current_inspect and current_inspect is Interactable:
%Action.visible = true
%ActionText.text = current_inspect.interact_text()
%Action.modulate = DEFAULT_ACTION_COLOR if current_inspect.interaction_cost(player) == 0 else ENERGY_ACTION_COLOR
%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() + (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 :
%Action.modulate = NO_ENERGY_ACTION_COLOR
%ActionEnergyImage.visible = current_selected_item.energy_usage != 0
else:
%Action.visible = false
if player:
if can_interact and current_inspect and current_inspect is Interactable:
%Action.visible = true
%ActionText.text = current_inspect.interact_text()
%Action.modulate = DEFAULT_ACTION_COLOR if current_inspect.interaction_cost(player) == 0 else ENERGY_ACTION_COLOR
%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() + (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:
%Action.modulate = NO_ENERGY_ACTION_COLOR
%ActionEnergyImage.visible = current_selected_item.energy_usage != 0
else:
%Action.visible = false
else:
%Action.visible = false
else:
%Action.visible = false
func stop_inspect(node : Node):
if node.has_method("inspect"):
node.inspect(false)
if current_inspect == node:
current_inspect = null
update_inspector()
func stop_inspect(node: Node):
if node.has_method("inspect"):
node.inspect(false)
if current_inspect == node:
current_inspect = null
update_inspector()

View File

@@ -1,4 +1,4 @@
[gd_resource type="Theme" load_steps=35 format=3 uid="uid://bgcmd213j6gk1"]
[gd_resource type="Theme" load_steps=36 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="Texture2D" uid="uid://bqcsma3tkbefi" path="res://common/icons/square-rounded-check.svg" id="2_36amo"]
@@ -123,8 +123,25 @@ corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g7s0b"]
bg_color = Color(0.043137256, 0.039215688, 0.11764706, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5ugto"]
bg_color = Color(1, 1, 1, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
shadow_size = 1
shadow_offset = Vector2(0, -30)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qux7a"]
bg_color = Color(1, 1, 1, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
shadow_size = 1
shadow_offset = Vector2(0, -30)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ab4w8"]
bg_color = Color(0.03, 0.03, 0.03, 0.42745098)
@@ -189,7 +206,10 @@ OptionButton/styles/focus = SubResource("StyleBoxFlat_4pupg")
OptionButton/styles/hover = SubResource("StyleBoxFlat_c6ec6")
OptionButton/styles/normal = SubResource("StyleBoxFlat_x0rpt")
OptionButton/styles/pressed = SubResource("StyleBoxFlat_x0rpt")
Panel/styles/panel = SubResource("StyleBoxFlat_g7s0b")
Panel/styles/panel = SubResource("StyleBoxFlat_5ugto")
PanelContainer/styles/panel = SubResource("StyleBoxFlat_qux7a")
ProgressBar/font_sizes/font_size = 24
ProgressBar/fonts/font = ExtResource("1_g7s0b")
ProgressBar/styles/background = SubResource("StyleBoxFlat_ab4w8")
ProgressBar/styles/fill = SubResource("StyleBoxFlat_36amo")
RichTextLabel/font_sizes/bold_font_size = 12

225
gui/ressources/menu.tres Normal file
View File

@@ -0,0 +1,225 @@
[gd_resource type="Theme" load_steps=36 format=3 uid="uid://5au2k3vf2po3"]
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_6ccgi"]
[ext_resource type="Texture2D" uid="uid://bqcsma3tkbefi" path="res://common/icons/square-rounded-check.svg" id="2_26s3p"]
[ext_resource type="Texture2D" uid="uid://b6dwhn0uotdgu" path="res://common/icons/square-rounded-nofill.svg" id="3_72f2k"]
[ext_resource type="Texture2D" uid="uid://xt032oyjwdoy" path="res://gui/ressources/textures/slider.svg" id="4_wbb8a"]
[ext_resource type="Texture2D" uid="uid://2hbbmhlgj8ue" path="res://gui/ressources/textures/slider-highlight.svg" id="5_c4kxq"]
[ext_resource type="FontFile" uid="uid://c7k6ssq6ocwdk" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-M.ttf" id="6_74wyx"]
[ext_resource type="Texture2D" uid="uid://chelw5jxqyyi4" path="res://gui/ressources/textures/option-button-icon.svg" id="7_pcpk1"]
[ext_resource type="FontFile" uid="uid://3workc27eb0r" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-B.ttf" id="8_o5nqn"]
[ext_resource type="FontFile" uid="uid://dxbmvk18hg103" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-BI.ttf" id="9_1r3ae"]
[ext_resource type="FontFile" uid="uid://bnmaweyw0kfcy" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-MI.ttf" id="10_hh2bs"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hv6r3"]
bg_color = Color(0.976471, 0.741176, 0.4, 1)
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
border_color = Color(0.975367, 0.740445, 0.401877, 1)
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_y48f0"]
bg_color = Color(1, 0.6509804, 0.09019608, 1)
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
border_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="StyleBoxFlat" id="StyleBoxFlat_st1o2"]
bg_color = Color(0.692349, 0.477218, 0.112321, 1)
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
border_color = Color(0.694118, 0.478431, 0.113725, 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_1lj4c"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_frr6k"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4pupg"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x0rpt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_c6ec6"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5ugto"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_qux7a"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mqali"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2ul3a"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_74wu0"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2lmp7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_feqcm"]
bg_color = Color(1, 0.6509804, 0.09019608, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1lj4c"]
bg_color = Color(0.6852761, 0.4354346, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_frr6k"]
bg_color = Color(0.45452476, 0.45452416, 0.4545238, 1)
border_width_left = 15
border_width_top = 5
border_width_right = 15
border_width_bottom = 5
border_color = Color(0.45490196, 0.45490196, 0.45490196, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4pupg"]
bg_color = Color(0.9019608, 0.5568628, 0, 1)
border_width_left = 15
border_width_top = 5
border_width_right = 15
border_width_bottom = 5
border_color = Color(0.9019608, 0.5568628, 0, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c6ec6"]
bg_color = Color(0.9019608, 0.5568628, 0, 1)
border_width_left = 15
border_width_top = 5
border_width_right = 15
border_width_bottom = 5
border_color = Color(0.9019608, 0.5568628, 0, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_x0rpt"]
bg_color = Color(1, 0.6509804, 0.09019608, 1)
border_width_left = 15
border_width_top = 5
border_width_right = 15
border_width_bottom = 5
border_color = Color(1, 0.6509804, 0.09019608, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5ugto"]
bg_color = Color(1, 1, 1, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
shadow_size = 1
shadow_offset = Vector2(0, -30)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qux7a"]
bg_color = Color(1, 1, 1, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
shadow_size = 1
shadow_offset = Vector2(0, -30)
[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]
Button/colors/font_color = Color(1, 1, 1, 1)
Button/font_sizes/font_size = 25
Button/fonts/font = ExtResource("1_6ccgi")
Button/styles/hover = SubResource("StyleBoxFlat_hv6r3")
Button/styles/normal = SubResource("StyleBoxFlat_y48f0")
Button/styles/pressed = SubResource("StyleBoxFlat_st1o2")
CheckBox/colors/checkbox_checked_color = Color(1, 0.6509804, 0.09019608, 1)
CheckBox/colors/checkbox_unchecked_color = Color(0.45882353, 0.45882353, 0.45882353, 1)
CheckBox/constants/icon_max_width = 30
CheckBox/icons/checked = ExtResource("2_26s3p")
CheckBox/icons/checked_disabled = ExtResource("2_26s3p")
CheckBox/icons/radio_unchecked_disabled = ExtResource("3_72f2k")
CheckBox/icons/unchecked = ExtResource("3_72f2k")
CheckBox/icons/unchecked_disabled = ExtResource("3_72f2k")
CheckBox/styles/disabled = SubResource("StyleBoxEmpty_1lj4c")
CheckBox/styles/disabled_mirrored = SubResource("StyleBoxEmpty_frr6k")
CheckBox/styles/focus = SubResource("StyleBoxEmpty_4pupg")
CheckBox/styles/hover = SubResource("StyleBoxEmpty_x0rpt")
CheckBox/styles/hover_mirrored = SubResource("StyleBoxEmpty_c6ec6")
CheckBox/styles/hover_pressed = SubResource("StyleBoxEmpty_5ugto")
CheckBox/styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_qux7a")
CheckBox/styles/normal = SubResource("StyleBoxEmpty_mqali")
CheckBox/styles/normal_mirrored = SubResource("StyleBoxEmpty_2ul3a")
CheckBox/styles/pressed = SubResource("StyleBoxEmpty_74wu0")
CheckBox/styles/pressed_mirrored = SubResource("StyleBoxEmpty_2lmp7")
GridContainer/constants/h_separation = 15
GridContainer/constants/v_separation = 15
HBoxContainer/constants/separation = 15
HSlider/icons/grabber = ExtResource("4_wbb8a")
HSlider/icons/grabber_highlight = ExtResource("5_c4kxq")
HSlider/styles/grabber_area = SubResource("StyleBoxFlat_feqcm")
HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_1lj4c")
Label/fonts/font = ExtResource("6_74wyx")
MarginContainer/constants/margin_bottom = 15
MarginContainer/constants/margin_left = 15
MarginContainer/constants/margin_right = 15
MarginContainer/constants/margin_top = 15
OptionButton/colors/font_color = Color(1, 1, 1, 1)
OptionButton/font_sizes/font_size = 18
OptionButton/fonts/font = ExtResource("1_6ccgi")
OptionButton/icons/arrow = ExtResource("7_pcpk1")
OptionButton/styles/disabled = SubResource("StyleBoxFlat_frr6k")
OptionButton/styles/focus = SubResource("StyleBoxFlat_4pupg")
OptionButton/styles/hover = SubResource("StyleBoxFlat_c6ec6")
OptionButton/styles/normal = SubResource("StyleBoxFlat_x0rpt")
OptionButton/styles/pressed = SubResource("StyleBoxFlat_x0rpt")
Panel/styles/panel = SubResource("StyleBoxFlat_5ugto")
PanelContainer/styles/panel = SubResource("StyleBoxFlat_qux7a")
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
RichTextLabel/font_sizes/mono_font_size = 12
RichTextLabel/font_sizes/normal_font_size = 12
RichTextLabel/fonts/bold_font = ExtResource("8_o5nqn")
RichTextLabel/fonts/bold_italics_font = ExtResource("9_1r3ae")
RichTextLabel/fonts/italics_font = ExtResource("10_hh2bs")
RichTextLabel/fonts/normal_font = ExtResource("6_74wyx")
VBoxContainer/constants/separation = 15
VSeparator/constants/separation = 15
VSeparator/styles/separator = SubResource("StyleBoxEmpty_hv6r3")
VSplitContainer/constants/separation = 15

View File

@@ -2,18 +2,77 @@
extends Node
class_name ControlAnimationPlayer
signal animation_ended
var on_animation = false
@onready var target : Control = get_parent()
var target_default_pos : Vector2
var target_default_modulate = Color.WHITE
@export_tool_button("Test Shake", "Callable") var shake_action = shake
@export_tool_button("Test Bounce", "Callable") var bounce_action = bounce
@export_tool_button("Test Appear", "Callable") var appear_action = appear
@export_tool_button("Test Disappear", "Callable") var disappear_action = disappear
@export_tool_button("Test Slide In", "Callable") var slide_in_action = slide_in
@export_tool_button("Test Slide Off", "Callable") var slide_off_action = slide_off
@export_tool_button("Test Fade In", "Callable") var fade_in_action = fade_in
@export_tool_button("Test Fade Out", "Callable") var fade_out_action = fade_out
func _ready():
setup_default_values()
get_tree().get_root().size_changed.connect(setup_default_values)
func setup_default_values():
target_default_pos = target.global_position
func start_anim():
on_animation = true
func end_anim():
animation_ended.emit()
on_animation = false
func fade_in(
duration : float = 0.3,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
):
start_anim()
target.visible = true
await add_tween(
"modulate",
target_default_modulate,
duration,
transition_type
).finished
end_anim()
func fade_out(
duration : float = 0.3,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
):
start_anim()
target.visible = true
await add_tween(
"modulate",
Color.TRANSPARENT,
duration,
transition_type
).finished
target.visible = false
end_anim()
func disappear(
duration : float = 0.3,
offset : int = 20,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
):
start_anim()
add_tween(
"modulate",
Color.TRANSPARENT,
@@ -28,29 +87,68 @@ func disappear(
transition_type
).finished
target.position += Vector2.DOWN * offset
target.position = target_default_pos
end_anim()
func appear(
duration : float = 0.3,
offset : int = 20,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
):
start_anim()
target.modulate = Color.TRANSPARENT
add_tween(
"modulate",
Color.WHITE,
target_default_modulate,
duration,
transition_type
).finished
target.position += Vector2.UP * offset
target.position = target_default_pos + Vector2.UP * offset
await add_tween(
"position",
target.position + Vector2.DOWN * offset,
target_default_pos,
duration,
transition_type
).finished
target.position = target_default_pos
end_anim()
func slide_in(
duration : float = 0.3,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_CUBIC,
):
start_anim()
target.position += Vector2.UP * target.size.y
target.visible = true
await add_tween(
"position",
target_default_pos,
duration,
transition_type
).finished
end_anim()
func slide_off(
duration : float = 0.3,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_CUBIC,
):
start_anim()
await add_tween(
"position",
target.position - Vector2.UP * target.size.y,
duration,
transition_type
).finished
target.visible = false
target.position = target_default_pos
end_anim()
func bounce(
duration : float = 0.4,
@@ -58,6 +156,7 @@ func bounce(
direction : Vector2 = Vector2.UP,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_BOUNCE,
):
start_anim()
await add_tween(
"position",
target.position + direction * amount,
@@ -66,16 +165,18 @@ func bounce(
).finished
await add_tween(
"position",
target.position - direction * amount,
target_default_pos,
duration/2,
transition_type
).finished
end_anim()
func shake(
duration : float = 0.3,
amount : float = 10,
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
):
start_anim()
await add_tween(
"position",
target.position + Vector2.RIGHT * amount/2,
@@ -95,6 +196,9 @@ func shake(
transition_type
).finished
target.position = target_default_pos
end_anim()
func add_tween(
property : String,

View File

@@ -12,7 +12,7 @@ config_version=5
config/name="Seeding The Wasteland"
config/description="Seeding planets is a survival, managment and cosy game in which you play a little gardener robot."
config/version="proto-3.2"
config/version="proto-4.0"
run/main_scene="uid://c5bruelvqbm1k"
config/features=PackedStringArray("4.5", "Forward Plus")
config/icon="uid://df0y0s666ui4h"
@@ -27,6 +27,76 @@ Pointer="*res://gui/pointer/pointer.tscn"
AudioManager="*res://common/audio_manager/audio_manager.tscn"
GameInfo="*res://common/game_info/game_info.gd"
Pause="*res://gui/game/pause/pause.tscn"
Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd"
LoadingScreen="*res://gui/loading_screen/loading_screen.tscn"
SceneManager="*res://common/scene_manager/scene_manager.gd"
[dialogic]
directories/dch_directory={
"mysterious_demeter": "res://dialogs/characters/mysterious_demeter.dch"
}
directories/dtl_directory={
"demeter_intro": "res://dialogs/timelines/story/demeter_intro.dtl"
}
layout/style_directory={
"": "res://dialogs/dialogs_style.tres",
"dialogs_interface": "res://dialogs/dialogs_style.tres"
}
glossary/default_case_sensitive=true
layout/style_list=["res://dialogs/dialogs_style.tres"]
layout/default_style="res://dialogs/dialogs_style.tres"
extensions_folder="res://addons/dialogic_additions"
text/letter_speed=0.01
text/initial_text_reveal_skippable=true
text/text_reveal_skip_delay=0.1
text/advance_delay=0.1
text/autoadvance_per_character_delay=0.1
text/autoadvance_ignored_characters_enabled=true
animations/join_default_length=0.5
animations/join_default_wait=true
animations/leave_default_length=0.5
animations/leave_default_wait=true
animations/cross_fade_default_length=0.5
choices/autofocus_first=true
choices/delay=0.2
choices/reveal_delay=0
choices/reveal_by_input=false
save/autosave_delay=60.0
save/encryption_on_exports_only=true
text/autopauses={}
audio/channel_defaults={
"": {
"audio_bus": "",
"fade_length": 0.0,
"loop": false,
"volume": 0.0
},
"music": {
"audio_bus": "",
"fade_length": 0.0,
"loop": true,
"volume": 0.0
}
}
translation/enabled=true
translation/original_locale="fr"
translation/file_mode=1
translation/translation_folder="res://translation/dialogs"
translation/save_mode=0
translation/add_separator=true
variables={
"orchidName": "Orchid"
}
translation/id_counter=30
translation/locales=[]
translation/intern/save_mode=0
translation/intern/file_mode=1
translation/intern/translation_folder="res://translation/dialogs"
[editor_plugins]
enabled=PackedStringArray("res://addons/dialogic/plugin.cfg")
[input]
@@ -129,11 +199,21 @@ item_9={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":57,"key_label":0,"unicode":231,"location":0,"echo":false,"script":null)
]
}
dialogic_default_action={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":88,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
[internationalization]
locale/translation_remaps={}
locale/translations=PackedStringArray("res://translation/localization.en.translation", "res://translation/localization.fr.translation")
locale/translations=PackedStringArray("res://translation/game/gui.en.translation", "res://translation/game/gui.fr.translation")
locale/test="fr"
[rendering]

4
root.gd Normal file
View File

@@ -0,0 +1,4 @@
extends Node
func _ready():
SceneManager.change_scene(SceneManager.TITLE_SCREEN)

1
root.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://bely2if04v736

View File

@@ -1,7 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://c5bruelvqbm1k"]
[ext_resource type="Script" uid="uid://c54457tbocdwk" path="res://gui/menu/scripts/menu.gd" id="1_bf3um"]
[ext_resource type="Script" uid="uid://bely2if04v736" path="res://root.gd" id="1_pq8q7"]
[node name="Root" type="Node"]
script = ExtResource("1_bf3um")
start_scene_path = "uid://dxvtm81tq1a6w"
script = ExtResource("1_pq8q7")

View File

@@ -1,63 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://d0n52psuns1vl"]
[gd_scene load_steps=2 format=3 uid="uid://d0n52psuns1vl"]
[ext_resource type="Script" uid="uid://ddf3fktoer2ng" path="res://stages/intro/scripts/intro.gd" id="1_2nxbv"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_u726n"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_mi20s"]
[ext_resource type="Script" uid="uid://d2wapgm313xhr" path="res://stages/intro/scripts/intro_step_story.gd" id="5_tg2p4"]
[node name="Intro" type="Node"]
script = ExtResource("1_2nxbv")
game_scene_path = "uid://d28cp7a21kwou"
[node name="Story" type="CanvasLayer" parent="."]
visible = false
script = ExtResource("5_tg2p4")
[node name="CenterContainer2" type="CenterContainer" parent="Story"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="CenterContainer" type="VBoxContainer" parent="Story/CenterContainer2"]
layout_mode = 2
theme = ExtResource("1_u726n")
alignment = 1
[node name="Label" type="Label" parent="Story/CenterContainer2/CenterContainer"]
layout_mode = 2
text = "STORY"
label_settings = ExtResource("3_mi20s")
horizontal_alignment = 1
[node name="Story" type="RichTextLabel" parent="Story/CenterContainer2/CenterContainer"]
custom_minimum_size = Vector2(500, 0)
layout_mode = 2
theme = ExtResource("1_u726n")
theme_override_font_sizes/normal_font_size = 16
theme_override_font_sizes/bold_font_size = 16
theme_override_font_sizes/bold_italics_font_size = 16
theme_override_font_sizes/italics_font_size = 16
theme_override_font_sizes/mono_font_size = 16
bbcode_enabled = true
text = "STORY_TEXT"
fit_content = true
horizontal_alignment = 1
[node name="ControlsTitle" type="Label" parent="Story/CenterContainer2/CenterContainer"]
layout_mode = 2
text = "CONTROLS"
label_settings = ExtResource("3_mi20s")
horizontal_alignment = 1
[node name="ControlsText" type="Label" parent="Story/CenterContainer2/CenterContainer"]
layout_mode = 2
text = "CONTROLS_TEXT"
horizontal_alignment = 1
[node name="Button" type="Button" parent="Story/CenterContainer2/CenterContainer"]
layout_mode = 2
text = "OK"
[connection signal="pressed" from="Story/CenterContainer2/CenterContainer/Button" to="Story" method="_on_button_pressed"]

View File

@@ -5,24 +5,32 @@ var steps : Array[IntroStep]
@export_file var game_scene_path : String
func _ready():
for c in get_children():
if c is IntroStep:
steps.append(c)
c.hide()
Dialogic.start('demeter_intro')
for i in range(len(steps)):
steps[i].step_over.connect(
func():
change_step(i+1)
)
await Dialogic.timeline_ended
change_step(0)
await LoadingScreen.show_loading_screen()
func change_step(nb):
if nb >= len(steps):
get_tree().change_scene_to_file(game_scene_path)
for i in range(len(steps)):
if i == nb:
steps[i].show()
else :
steps[i].hide()
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
# for c in get_children():
# if c is IntroStep:
# steps.append(c)
# c.hide()
# for i in range(len(steps)):
# steps[i].step_over.connect(
# func():
# change_step(i+1)
# )
# change_step(0)
# func change_step(nb):
# if nb >= len(steps):
# get_tree().change_scene_to_file(game_scene_path)
# for i in range(len(steps)):
# if i == nb:
# steps[i].show()
# else :
# steps[i].hide()

View File

@@ -1,64 +0,0 @@
[gd_scene load_steps=12 format=3 uid="uid://d28cp7a21kwou"]
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="1_yy1uy"]
[ext_resource type="PackedScene" uid="uid://v41hfc7haaye" path="res://gui/game/win/win.tscn" id="3_6guxm"]
[ext_resource type="PackedScene" uid="uid://doxm7uab8i3tq" path="res://gui/game/quota_reward/quota_reward.tscn" id="4_fbkgs"]
[ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="4_g33f4"]
[ext_resource type="PackedScene" uid="uid://fh3dsuvn5h78" path="res://gui/game/tutorial/in_game_indicator/in_game_indicator.tscn" id="5_gisiu"]
[ext_resource type="PackedScene" uid="uid://dt6mptqg80dew" path="res://gui/game/tutorial/tutorial.tscn" id="5_orelw"]
[ext_resource type="Script" uid="uid://ds7ej47i3wsym" path="res://gui/game/tutorial/in_game_indicator/scripts/in_game_base_indicator.gd" id="6_cnjsq"]
[ext_resource type="PackedScene" uid="uid://tsi5j1uxppa4" path="res://stages/terrain/planet/planet.tscn" id="8_t31p7"]
[ext_resource type="PackedScene" uid="uid://cg1visg52i21a" path="res://entities/interactables/truck/ladder/truck_ladder.tscn" id="9_gisiu"]
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="10_cnjsq"]
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="16_m18ms"]
[node name="PlanetRun" type="Node2D"]
[node name="Reward" parent="." instance=ExtResource("4_fbkgs")]
layer = 2
[node name="RootGui" parent="." node_paths=PackedStringArray("quota_reward") instance=ExtResource("1_yy1uy")]
quota_reward = NodePath("../Reward")
metadata/_edit_use_anchors_ = true
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Win" parent="CanvasLayer" instance=ExtResource("3_6guxm")]
visible = false
[node name="Tutorial" parent="CanvasLayer" node_paths=PackedStringArray("player", "planet") instance=ExtResource("5_orelw")]
player = NodePath("../../Planet/Entities/Player")
planet = NodePath("../../Planet")
[node name="BaseIndicator" parent="CanvasLayer" node_paths=PackedStringArray("player") instance=ExtResource("5_gisiu")]
visible = false
offset_bottom = 91.0
size_flags_horizontal = 4
size_flags_vertical = 4
script = ExtResource("6_cnjsq")
player = NodePath("../../Planet/Entities/Player")
[node name="Planet" parent="." node_paths=PackedStringArray("quota_reward", "entity_container") instance=ExtResource("8_t31p7")]
loot_item_number = Array[int]([1])
quota_reward = NodePath("../Reward")
entity_container = NodePath("Entities")
[node name="Entities" type="Node2D" parent="Planet"]
y_sort_enabled = true
[node name="Player" parent="Planet/Entities" instance=ExtResource("4_g33f4")]
position = Vector2(2, 0)
[node name="TruckLadder" parent="Planet/Entities" instance=ExtResource("9_gisiu")]
position = Vector2(50, -135)
[node name="TruckRecharge" parent="Planet/Entities" instance=ExtResource("10_cnjsq")]
position = Vector2(-46, -152)
[node name="Camera" parent="." node_paths=PackedStringArray("following") instance=ExtResource("16_m18ms")]
position = Vector2(2.22, 0)
following = NodePath("../Planet/Entities/Player")
[connection signal="day_limit_exceed" from="Planet" to="CanvasLayer/Win" method="_on_planet_day_limit_exceed"]
[connection signal="pass_day_ended" from="Planet" to="RootGui" method="_on_planet_pass_day_ended"]
[connection signal="pass_day_started" from="Planet" to="RootGui" method="_on_planet_pass_day_started"]

View File

@@ -0,0 +1,38 @@
[gd_scene load_steps=8 format=3 uid="uid://gxbqe5rtqi58"]
[ext_resource type="Script" uid="uid://j8cd0qbk4bma" path="res://stages/region_selection/region_point/scripts/region_point.gd" id="1_65ijn"]
[ext_resource type="Script" uid="uid://b4eimt3v08jhc" path="res://common/game_data/scripts/run/run_point.gd" id="2_34ylp"]
[ext_resource type="Script" uid="uid://ddk7j5b8p51dk" path="res://stages/terrain/planet/scripts/planet_parameter.gd" id="3_dm7jk"]
[ext_resource type="Texture2D" uid="uid://dqsx56wc73wry" path="res://common/icons/map-pin-check.svg" id="4_ndccb"]
[sub_resource type="Resource" id="Resource_ndccb"]
script = ExtResource("3_dm7jk")
charges = 10
objective = 10
planet_seed = 4074963764
[sub_resource type="Resource" id="Resource_txxa3"]
script = ExtResource("2_34ylp")
level = 1
planet_parameter = SubResource("Resource_ndccb")
region_name = "Usaf"
position = 61
metadata/_custom_type_script = "uid://b4eimt3v08jhc"
[sub_resource type="SphereShape3D" id="SphereShape3D_ys0ma"]
radius = 1.0629065
[node name="RegionPoint" type="Area3D"]
script = ExtResource("1_65ijn")
run_point = SubResource("Resource_txxa3")
state = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_ys0ma")
[node name="Sprite3D" type="Sprite3D" parent="."]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0.5)
pixel_size = 0.04
billboard = 1
texture = ExtResource("4_ndccb")

View File

@@ -0,0 +1,71 @@
@tool
extends Area3D
class_name RegionPoint
enum State {VISITED, CURRENT, TO_VISIT}
const SPRITE_HOVER_SCALE_MULTIPLIER = 1.5
const VISITED_OPACITY = 0.5
const YELLOW_COLOR = Color("FFA617")
const VISITED_SPRITE = preload("res://common/icons/map-pin-check.svg")
const CURRENT_SPRITE = preload("res://common/icons/map-pin.svg")
const TO_VISIT_SPRITE = preload("res://common/icons/map-pin-empty.svg")
@export var run_point : RunPoint
@export var state : State = State.CURRENT :
set(v):
state = v
if is_node_ready():
update_state()
var hovered := false
func _ready():
update_state()
func _process(_delta):
var scale_multiplier = SPRITE_HOVER_SCALE_MULTIPLIER if hovered else 1.
%Sprite3D.scale = lerp(%Sprite3D.scale, Vector3.ONE * scale_multiplier, 0.1)
func _on_mouse_entered():
hovered = true
Pointer.inspect(self)
func _on_mouse_exited():
hovered = false
Pointer.stop_inspect(self)
func card_info() -> CardInfo:
var info = run_point.card_info()
var visited_text = "VISITED_REGION"
if state == State.CURRENT:
visited_text = "CURRENT_REGION"
elif state == State.TO_VISIT:
visited_text = "REGION_TO_VISIT"
info.stats.append(
CardStatInfo.new(
visited_text,
%Sprite3D.texture
)
)
return info
func update_state():
var texture = VISITED_SPRITE
var color = Color(1.,1.,1.,VISITED_OPACITY)
if state == State.CURRENT:
texture = CURRENT_SPRITE
color = Color.WHITE
elif state == State.TO_VISIT:
texture = TO_VISIT_SPRITE
color = YELLOW_COLOR
%Sprite3D.texture = texture
%Sprite3D.modulate = color

View File

@@ -0,0 +1 @@
uid://j8cd0qbk4bma

View File

@@ -0,0 +1,148 @@
[gd_scene load_steps=13 format=3 uid="uid://bjs67nvh61otf"]
[ext_resource type="Script" uid="uid://bmb4beevw5r40" path="res://stages/region_selection/scripts/region_selection.gd" id="1_gqvix"]
[ext_resource type="PackedScene" uid="uid://cm5b7w7j6527f" path="res://stages/title_screen/planet_3d.tscn" id="5_bi8m0"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="5_twywe"]
[ext_resource type="Script" uid="uid://dqj1qh7xcmnhc" path="res://stages/region_selection/scripts/region_selection_camera.gd" id="6_gcxbq"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="6_gqvix"]
[ext_resource type="Shader" uid="uid://bv2rghn44mrrf" path="res://stages/title_screen/resources/shaders/stars.gdshader" id="7_2ywd4"]
[ext_resource type="PackedScene" uid="uid://rxao2rluuwqq" path="res://gui/game/screen/screen.tscn" id="7_gqvix"]
[ext_resource type="Script" path="res://stages/region_selection/scripts/region_selection_travel_validation.gd" id="8_jxqjc"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_twywe"]
seed = 172208034
frequency = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ee13y"]
shader = ExtResource("7_2ywd4")
shader_parameter/sky_color = Color(0.03, 0.05, 0.11, 1)
shader_parameter/star_base_color = Color(0.8, 1, 0.3, 1)
shader_parameter/star_hue_offset = 0.6
shader_parameter/star_intensity = 0.08
shader_parameter/star_twinkle_speed = 0.8
shader_parameter/star_twinkle_intensity = 0.2
shader_parameter/layer_scale = 20.0
shader_parameter/layer_scale_step = 10.0
shader_parameter/layers_count = 3
[sub_resource type="Sky" id="Sky_65b6a"]
sky_material = SubResource("ShaderMaterial_ee13y")
[sub_resource type="Environment" id="Environment_187ay"]
background_mode = 2
sky = SubResource("Sky_65b6a")
sky_custom_fov = 61.7
reflected_light_source = 1
tonemap_exposure = 1.54
glow_enabled = true
glow_intensity = 1.22
glow_bloom = 0.39
glow_hdr_threshold = 0.81
glow_hdr_scale = 0.0
glow_hdr_luminance_cap = 0.3
fog_density = 0.0
fog_sky_affect = 0.0
adjustment_enabled = true
adjustment_brightness = 1.04
adjustment_contrast = 1.2
adjustment_saturation = 0.88
[node name="RegionSelectionScreen" type="Node3D"]
script = ExtResource("1_gqvix")
[node name="Planet3d" parent="." instance=ExtResource("5_bi8m0")]
unique_name_in_owner = true
transform = Transform3D(0.17364822, 0, -0.9848077, 0, 1, 0, 0.9848077, 0, 0.17364822, 0.0020446777, 0, 0)
noise = SubResource("FastNoiseLite_twywe")
[node name="RegionPointContainer" type="Node3D" parent="Planet3d"]
unique_name_in_owner = true
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, -79.21178)
current = true
fov = 34.0
script = ExtResource("6_gcxbq")
_sprite_layer = 1
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_187ay")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.8423772, -0.34588623, 0.4132353, -0.5388884, -0.5406809, 0.6459594, 0, -0.76682913, -0.6418513, 0, 14.918039, 0)
[node name="Hud" type="CanvasLayer" parent="."]
[node name="MarginContainer" type="MarginContainer" parent="Hud"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("5_twywe")
[node name="Label" type="Label" parent="Hud/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
text = "CHOOSE_A_REGION"
label_settings = ExtResource("6_gqvix")
[node name="ReturnButton" type="Button" parent="Hud/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
theme = ExtResource("5_twywe")
text = "RETURN"
[node name="TravelValidation" parent="Hud" instance=ExtResource("7_gqvix")]
unique_name_in_owner = true
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -359.0
offset_top = -137.0
offset_right = 359.0
offset_bottom = 96.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
script = ExtResource("8_jxqjc")
[node name="TravelValidationContainer" type="VBoxContainer" parent="Hud/TravelValidation/ScreenContainer" index="0"]
layout_mode = 2
theme = ExtResource("5_twywe")
alignment = 1
[node name="TravelValidationLabel" type="Label" parent="Hud/TravelValidation/ScreenContainer/TravelValidationContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "TRAVEL_TO_REGION_%s"
label_settings = ExtResource("6_gqvix")
horizontal_alignment = 1
[node name="TravelValidationButtons" type="HBoxContainer" parent="Hud/TravelValidation/ScreenContainer/TravelValidationContainer"]
layout_mode = 2
theme = ExtResource("5_twywe")
alignment = 1
[node name="TravelValidationGoButton" type="Button" parent="Hud/TravelValidation/ScreenContainer/TravelValidationContainer/TravelValidationButtons"]
layout_mode = 2
theme = ExtResource("5_twywe")
text = "GO"
[node name="TravelValidationNoNowButton" type="Button" parent="Hud/TravelValidation/ScreenContainer/TravelValidationContainer/TravelValidationButtons"]
layout_mode = 2
theme = ExtResource("5_twywe")
text = "NOT_NOW"
[connection signal="region_point_clicked" from="Camera3D" to="." method="_on_camera_3d_region_point_clicked"]
[connection signal="button_down" from="Hud/MarginContainer/ReturnButton" to="." method="_on_return_button_button_down"]
[connection signal="button_down" from="Hud/TravelValidation/ScreenContainer/TravelValidationContainer/TravelValidationButtons/TravelValidationGoButton" to="." method="_on_travel_validation_go_button_button_down"]
[connection signal="button_down" from="Hud/TravelValidation/ScreenContainer/TravelValidationContainer/TravelValidationButtons/TravelValidationNoNowButton" to="." method="_on_travel_validation_no_now_button_button_down"]
[editable path="Hud/TravelValidation"]

View File

@@ -0,0 +1,114 @@
@tool
extends Node3D
class_name RegionSelection
const REGION_POINT_SCENE := preload("res://stages/region_selection/region_point/region_point.tscn")
const PLANET_REGION_POINT_MARGIN = 0
var target_planet_rotation = Vector2(0,0)
var planet_acceleration := Vector2(0,0)
var rotating := false
var prev_mouse_pos : Vector2
var next_mouse_pos : Vector2
var selected_run_point : RunPoint
@export_tool_button("Update Region Points", "Callable") var update_action = update_region_points
@onready var run_data : RunData = GameInfo.game_data.current_run
@onready var planet_radius = %Planet3d.radius + %Planet3d.height
func _ready():
%TravelValidation.hide()
update_region_points()
%Planet3d.generate_noise(GameInfo.game_data.current_run.run_seed)
if not GameInfo.game_data.get_current_planet_data():
%ReturnButton.hide()
func _process(delta):
if not Engine.is_editor_hint():
rotate_planet(delta)
func rotate_planet(delta):
next_mouse_pos = get_viewport().get_mouse_position()
if Input.is_action_just_pressed("action"):
rotating = true
prev_mouse_pos = get_viewport().get_mouse_position()
if Input.is_action_just_released("action"):
rotating = false
var mouse_acceleration = Vector2(
float(next_mouse_pos.x - prev_mouse_pos.x),
float(next_mouse_pos.y - prev_mouse_pos.y)
)
planet_acceleration = Vector2(mouse_acceleration.y, - mouse_acceleration.x)
var planet_rotation = planet_acceleration
if rotating:
var mouse_rotation = Vector2(
float(next_mouse_pos.x - prev_mouse_pos.x),
float(next_mouse_pos.y - prev_mouse_pos.y)
)
planet_rotation = Vector2(mouse_rotation.y, - mouse_rotation.x)
prev_mouse_pos = next_mouse_pos
else :
# var default_planet_rotation = Vector2(%Planet3d.rotation.x, %Planet3d.rotation.y) - target_planet_rotation
planet_acceleration = planet_acceleration.lerp(Vector2.ZERO, 0.1)
# %Planet3d.rotation.z = lerp(%Planet3d.rotation.z, 0., 0.05)
%Planet3d.rotate(Vector3.LEFT, planet_rotation.x * delta)
%Planet3d.rotate(Vector3.DOWN, planet_rotation.y * delta)
func generate_region_point(run_point : RunPoint, state : RegionPoint.State = RegionPoint.State.VISITED) -> RegionPoint:
var region_point := REGION_POINT_SCENE.instantiate() as RegionPoint
region_point.run_point = run_point
region_point.state = state
%RegionPointContainer.add_child(region_point)
var sphere_radius = planet_radius + PLANET_REGION_POINT_MARGIN
var default_pos = Vector3(0, sphere_radius, 0)
var vertical_pos = default_pos.rotated(Vector3.LEFT, run_point.level/float(RunData.RUN_POINT_MAX_LEVEL) * PI)
var final_pos = vertical_pos.rotated(Vector3.UP, (run_point.position % 360)/float(360) * 2 * PI)
region_point.position = final_pos
return region_point
func update_region_points():
for c in %RegionPointContainer.get_children():
c.queue_free()
if run_data.current_run_point:
generate_region_point(run_data.current_run_point, RegionPoint.State.CURRENT)
target_planet_rotation = Vector2(
0.,
- run_data.current_run_point.position/float(360) * 2 * PI,
)
%Planet3d.rotation = Vector3(target_planet_rotation.x, target_planet_rotation.y, 0.)
for visited_rp in run_data.visited_run_points:
generate_region_point(visited_rp, RegionPoint.State.VISITED)
for to_visit_rp in run_data.next_run_points:
generate_region_point(to_visit_rp, RegionPoint.State.TO_VISIT)
func _on_camera_3d_region_point_clicked(rp : RunPoint):
selected_run_point = rp
%TravelValidationLabel.text = tr("TRAVEL_TO_REGION_%s") % rp.region_name
%TravelValidation.show()
func _on_travel_validation_go_button_button_down():
if selected_run_point:
GameInfo.game_data.current_run.choose_next_run_point(selected_run_point)
SceneManager.change_scene(SceneManager.PLANET_SCENE)
func _on_travel_validation_no_now_button_button_down():
%TravelValidation.hide()
func _on_return_button_button_down():
if GameInfo.game_data.get_current_planet_data():
SceneManager.change_scene(SceneManager.PLANET_SCENE)

View File

@@ -0,0 +1 @@
uid://bmb4beevw5r40

View File

@@ -0,0 +1,43 @@
extends Camera3D
signal region_point_clicked(rp : RunPoint)
const RAY_LENGTH = 1000.
@export_flags_3d_physics var _sprite_layer
var region_point_hovered : RegionPoint = null
var _mouse_event : InputEventMouse
var _query_mouse := false
func _unhandled_input(event):
if event is InputEventMouse:
_mouse_event = event
_query_mouse = true
if event.is_action_pressed("action") and region_point_hovered and region_point_hovered.state == RegionPoint.State.TO_VISIT:
region_point_clicked.emit(region_point_hovered.run_point)
func _physics_process(_delta):
if _query_mouse:
update_mouse_hovered_region_points()
_query_mouse = false
func update_mouse_hovered_region_points() -> void:
var space_state = get_world_3d().direct_space_state
var from = project_ray_origin(_mouse_event.position)
var to = from + project_ray_normal(_mouse_event.position) * RAY_LENGTH
var query = PhysicsRayQueryParameters3D.create(from, to, _sprite_layer)
query.collide_with_areas = true
var result = space_state.intersect_ray(query)
if result.is_empty():
if region_point_hovered:
region_point_hovered._on_mouse_exited()
region_point_hovered = null
elif result.collider is RegionPoint:
if region_point_hovered and region_point_hovered != result.collider:
region_point_hovered._on_mouse_exited()
region_point_hovered = result.collider
region_point_hovered._on_mouse_entered()

View File

@@ -0,0 +1 @@
uid://dqj1qh7xcmnhc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://c3t26nlbnkxg7"
uid="uid://bseoyd8mqjo7y"
path="res://.godot/imported/garden_decontamined_background_texture.png-059bd195ae2e24916e642e6f3275cffd.ctex"
metadata={
"vram_texture": false

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c3t26nlbnkxg7"
path="res://.godot/imported/garden_decontamined_background_texture_old.png-df017d633ed63644def49f2ef3a9d5b3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/garden_decontamined_background_texture_old.png"
dest_files=["res://.godot/imported/garden_decontamined_background_texture_old.png-df017d633ed63644def49f2ef3a9d5b3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://o43d0p2ojbbh"
path="res://.godot/imported/moss_contamination_atlas_red.png-285da16354bb22d2c5b8102e267e7ff9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_contamination_atlas_red.png"
dest_files=["res://.godot/imported/moss_contamination_atlas_red.png-285da16354bb22d2c5b8102e267e7ff9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Some files were not shown because too many files have changed in this diff Show More