Compare commits
2 commits
5ffb0e7431
...
5c9f5a000a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c9f5a000a | ||
|
|
a2213dcce5 |
38 changed files with 726 additions and 687 deletions
|
|
@ -3,7 +3,7 @@ extends Node
|
||||||
|
|
||||||
#Emitter : TowerButton.gd
|
#Emitter : TowerButton.gd
|
||||||
#Subscriber : World.gd
|
#Subscriber : World.gd
|
||||||
signal tower_selected(tower : PackedScene)
|
signal tower_selected(towerType : Tower.TYPES)
|
||||||
|
|
||||||
|
|
||||||
#Emitter :
|
#Emitter :
|
||||||
|
|
@ -59,7 +59,7 @@ signal money_spent(_value : int)
|
||||||
#Subscriber : cube.gd
|
#Subscriber : cube.gd
|
||||||
signal player_has_won()
|
signal player_has_won()
|
||||||
|
|
||||||
#Emitter : spawner.gd
|
#Emitter : WaveManger.gd
|
||||||
#Subscriber : cube.gd
|
#Subscriber : cube.gd
|
||||||
signal player_defeated()
|
signal player_defeated()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
extends Node3D
|
extends Node3D
|
||||||
class_name PlayerManager
|
class_name PlayerManager
|
||||||
|
|
||||||
|
const towerListResource := preload("res://Towers/towers.tres")
|
||||||
|
|
||||||
enum STATE { IDLE, PLACING }
|
enum STATE { IDLE, PLACING }
|
||||||
var _state := STATE.IDLE
|
var _state := STATE.IDLE
|
||||||
|
|
||||||
|
|
@ -12,15 +14,8 @@ var selected_tower_type : Tower.TYPES = Tower.TYPES.NONE
|
||||||
@onready var selection_icon : Sprite3D = $Sprite3DSelection
|
@onready var selection_icon : Sprite3D = $Sprite3DSelection
|
||||||
|
|
||||||
var towers : Dictionary
|
var towers : Dictionary
|
||||||
|
|
||||||
var selected_collider : CollisionObject3D
|
var selected_collider : CollisionObject3D
|
||||||
|
|
||||||
static func getResourceTowerByType(towerId : Tower.TYPES) -> PackedScene:
|
|
||||||
match towerId:
|
|
||||||
Tower.TYPES.PIERRE: return load("res://Towers/Pierre/pierre.tscn")
|
|
||||||
Tower.TYPES.ALINE: return load("res://Towers/Aline/aline.tscn")
|
|
||||||
_: return null
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
EventBus.tower_selected.connect(selectTower)
|
EventBus.tower_selected.connect(selectTower)
|
||||||
#$AnimationPlayer.play("arrow_bobbing")
|
#$AnimationPlayer.play("arrow_bobbing")
|
||||||
|
|
@ -79,13 +74,7 @@ func handle_player_controls() -> void:
|
||||||
func place_tower() -> void:
|
func place_tower() -> void:
|
||||||
_state = STATE.PLACING
|
_state = STATE.PLACING
|
||||||
|
|
||||||
var towerBlueprint = getResourceTowerByType(selected_tower_type)
|
selected_tower = towerListResource.getTowerSceneById(selected_tower_type).instantiate()
|
||||||
if !towerBlueprint:
|
|
||||||
selected_tower = null
|
|
||||||
selected_tower_type = Tower.TYPES.NONE
|
|
||||||
return
|
|
||||||
|
|
||||||
selected_tower = towerBlueprint.instantiate()
|
|
||||||
towers.set(selected_tower_type, selected_tower)
|
towers.set(selected_tower_type, selected_tower)
|
||||||
add_child(selected_tower)
|
add_child(selected_tower)
|
||||||
selected_tower.can_shoot = false
|
selected_tower.can_shoot = false
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
[gd_scene load_steps=4 format=3 uid="uid://ck1qryleu80s"]
|
[gd_scene load_steps=5 format=3 uid="uid://ck1qryleu80s"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://trg7ag3dqr2l" path="res://Towers/tower.tscn" id="1_gvvig"]
|
[ext_resource type="PackedScene" uid="uid://trg7ag3dqr2l" path="res://Towers/tower.tscn" id="1_gvvig"]
|
||||||
[ext_resource type="Script" uid="uid://16hafh01iv" path="res://Towers/Aline/aline.gd" id="2_6sjqq"]
|
[ext_resource type="Script" uid="uid://16hafh01iv" path="res://Towers/Aline/aline.gd" id="2_6sjqq"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cob1lydkirn20" path="res://Assets/Icones/raccoon-head.svg" id="3_6h033"]
|
||||||
[ext_resource type="Script" uid="uid://bg0x4egeu17qb" path="res://Scripts/Upgrades/TowerUpgrade.gd" id="3_p2nb1"]
|
[ext_resource type="Script" uid="uid://bg0x4egeu17qb" path="res://Scripts/Upgrades/TowerUpgrade.gd" id="3_p2nb1"]
|
||||||
|
|
||||||
[node name="Aline" instance=ExtResource("1_gvvig")]
|
[node name="Aline" instance=ExtResource("1_gvvig")]
|
||||||
script = ExtResource("2_6sjqq")
|
script = ExtResource("2_6sjqq")
|
||||||
tower_name = "Aline"
|
tower_name = "Aline"
|
||||||
tower_type = 2
|
tower_type = 2
|
||||||
icone = null
|
icone = ExtResource("3_6h033")
|
||||||
bio = ""
|
bio = ""
|
||||||
price = 150
|
price = 150
|
||||||
bullet_damage = 1
|
bullet_damage = 1
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,19 @@
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://trg7ag3dqr2l" path="res://Towers/tower.tscn" id="1_7f7qx"]
|
[ext_resource type="PackedScene" uid="uid://trg7ag3dqr2l" path="res://Towers/tower.tscn" id="1_7f7qx"]
|
||||||
[ext_resource type="Script" uid="uid://q4o384wv3ijj" path="res://Towers/Pierre/pierre.gd" id="1_v16mf"]
|
[ext_resource type="Script" uid="uid://q4o384wv3ijj" path="res://Towers/Pierre/pierre.gd" id="1_v16mf"]
|
||||||
[ext_resource type="Script" uid="uid://bg0x4egeu17qb" path="res://Scripts/Upgrades/TowerUpgrade.gd" id="3_v16mf"]
|
[ext_resource type="Texture2D" uid="uid://bb4wihq1n1wm7" path="res://Assets/Icones/labrador-head.svg" id="3_odfqx"]
|
||||||
|
|
||||||
[node name="Pierre" instance=ExtResource("1_7f7qx")]
|
[node name="Pierre" instance=ExtResource("1_7f7qx")]
|
||||||
script = ExtResource("1_v16mf")
|
script = ExtResource("1_v16mf")
|
||||||
|
tower_name = null
|
||||||
tower_type = 1
|
tower_type = 1
|
||||||
icone = null
|
icone = ExtResource("3_odfqx")
|
||||||
bio = ""
|
bio = null
|
||||||
bullet_damage = 1
|
price = null
|
||||||
tower_shop = Array[ExtResource("3_v16mf")]([])
|
bullet_damage = null
|
||||||
|
action_cooldown = null
|
||||||
|
max_energy = null
|
||||||
|
energy_regen = null
|
||||||
|
energy_cost = null
|
||||||
|
buttonTooltip = null
|
||||||
|
tower_shop = null
|
||||||
|
|
|
||||||
23
Towers/TowerListResource.gd
Normal file
23
Towers/TowerListResource.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
@tool
|
||||||
|
extends Resource
|
||||||
|
class_name TowerListResource
|
||||||
|
|
||||||
|
@export var towers : Array[TowerResource] : set = towersHasChanged
|
||||||
|
|
||||||
|
func getTowerSceneById(towerType : Tower.TYPES) -> PackedScene :
|
||||||
|
var towerIndex := towers.find_custom(func(towerResource): return towerResource.towerType == towerType)
|
||||||
|
return towers[towerIndex].towerScene
|
||||||
|
|
||||||
|
|
||||||
|
func towersHasChanged(value : Array) -> void:
|
||||||
|
if not Engine.is_editor_hint():
|
||||||
|
return
|
||||||
|
|
||||||
|
if value.back() == null:
|
||||||
|
value.pop_back()
|
||||||
|
value.append(TowerResource.new())
|
||||||
|
towers = value
|
||||||
|
for towerResource in towers:
|
||||||
|
if not towerResource.changed.is_connected(emit_changed):
|
||||||
|
towerResource.changed.connect(emit_changed)
|
||||||
|
emit_changed()
|
||||||
1
Towers/TowerListResource.gd.uid
Normal file
1
Towers/TowerListResource.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://clm4xbebbeqgj
|
||||||
14
Towers/TowerResource.gd
Normal file
14
Towers/TowerResource.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
@tool
|
||||||
|
extends Resource
|
||||||
|
class_name TowerResource
|
||||||
|
|
||||||
|
@export var towerScene : PackedScene : set = towerSceneHasChanged
|
||||||
|
var towerType : Tower.TYPES
|
||||||
|
|
||||||
|
func towerSceneHasChanged(value) -> void :
|
||||||
|
towerScene = value
|
||||||
|
if value:
|
||||||
|
var tower : Tower = towerScene.instantiate()
|
||||||
|
towerType = tower.tower_type
|
||||||
|
tower.queue_free()
|
||||||
|
emit_changed()
|
||||||
1
Towers/TowerResource.gd.uid
Normal file
1
Towers/TowerResource.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://lvkeejppvv2c
|
||||||
|
|
@ -24,6 +24,11 @@ var bullet : PackedScene = preload("res://Bullets/bullet.tscn")
|
||||||
max_energy = value
|
max_energy = value
|
||||||
@export var energy_regen : float = 10.0
|
@export var energy_regen : float = 10.0
|
||||||
@export var energy_cost : float = 50.0
|
@export var energy_cost : float = 50.0
|
||||||
|
|
||||||
|
@export_group("Button")
|
||||||
|
@export var buttonTooltip : String
|
||||||
|
|
||||||
|
|
||||||
@onready var energy_bar : EnergyBar3D = $EnergyBar3D
|
@onready var energy_bar : EnergyBar3D = $EnergyBar3D
|
||||||
@onready var sprite : Sprite3D = $Sprite3D
|
@onready var sprite : Sprite3D = $Sprite3D
|
||||||
|
|
||||||
|
|
|
||||||
20
Towers/towers.tres
Normal file
20
Towers/towers.tres
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
[gd_resource type="Resource" script_class="TowerListResource" load_steps=7 format=3 uid="uid://jd8bdhpyl0pw"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://clm4xbebbeqgj" path="res://Towers/TowerListResource.gd" id="1_yjmnm"]
|
||||||
|
[ext_resource type="Script" uid="uid://lvkeejppvv2c" path="res://Towers/TowerResource.gd" id="2_mwakf"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bj6srer7ghf7p" path="res://Towers/Pierre/pierre.tscn" id="3_mwakf"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ck1qryleu80s" path="res://Towers/Aline/aline.tscn" id="4_mwakf"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_mwakf"]
|
||||||
|
script = ExtResource("2_mwakf")
|
||||||
|
towerScene = ExtResource("3_mwakf")
|
||||||
|
metadata/_custom_type_script = "uid://lvkeejppvv2c"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_dlgx8"]
|
||||||
|
script = ExtResource("2_mwakf")
|
||||||
|
towerScene = ExtResource("4_mwakf")
|
||||||
|
metadata/_custom_type_script = "uid://lvkeejppvv2c"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_yjmnm")
|
||||||
|
towers = Array[ExtResource("2_mwakf")]([SubResource("Resource_mwakf"), SubResource("Resource_dlgx8")])
|
||||||
37
UI/gui.gd
37
UI/gui.gd
|
|
@ -1,9 +1,18 @@
|
||||||
|
@tool
|
||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
@onready var player_manager : PlayerManager = $"../../PlayerManager"
|
const BUTTON_QTY = 12
|
||||||
|
|
||||||
|
const towerButton := preload("res://UI/tower_button.tscn")
|
||||||
|
var towerListResource := preload("res://Towers/towers.tres")
|
||||||
|
|
||||||
|
@onready var buttonContainer = $HBoxContainer/ControlPanelBase/MarginContainer/GridContainer
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
pass
|
addTowerButtonNodes()
|
||||||
|
if Engine.is_editor_hint():
|
||||||
|
towerListResource.changed.connect(addTowerButtonNodes)
|
||||||
|
|
||||||
|
|
||||||
func _on_button_cube_pressed() -> void:
|
func _on_button_cube_pressed() -> void:
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
@ -15,3 +24,27 @@ func _on_button_quit_level_pressed() -> void:
|
||||||
|
|
||||||
func _on_button_quit_game_pressed() -> void:
|
func _on_button_quit_game_pressed() -> void:
|
||||||
get_tree().quit()
|
get_tree().quit()
|
||||||
|
|
||||||
|
func addTowerButtonNodes() -> void:
|
||||||
|
for node in buttonContainer.get_children():
|
||||||
|
if node.has_meta("dynamicButton"):
|
||||||
|
node.queue_free()
|
||||||
|
|
||||||
|
for towerResource in towerListResource.towers:
|
||||||
|
if !towerResource || towerResource.towerType == Tower.TYPES.NONE:
|
||||||
|
continue
|
||||||
|
|
||||||
|
var towerBtn := towerButton.instantiate()
|
||||||
|
var tower : Tower = towerResource.towerScene.instantiate()
|
||||||
|
towerBtn.towerType = tower.tower_type
|
||||||
|
towerBtn.tooltip_text = tower.name
|
||||||
|
towerBtn.setButtonTexture(tower.icone)
|
||||||
|
towerBtn.set_meta("dynamicButton", true)
|
||||||
|
tower.queue_free()
|
||||||
|
buttonContainer.add_child(towerBtn)
|
||||||
|
|
||||||
|
for i in BUTTON_QTY - towerListResource.towers.size():
|
||||||
|
var placeholderBtn := Button.new()
|
||||||
|
placeholderBtn.set_meta("dynamicButton", true)
|
||||||
|
placeholderBtn.custom_minimum_size = Vector2(80, 80)
|
||||||
|
buttonContainer.add_child(placeholderBtn)
|
||||||
|
|
|
||||||
88
UI/gui.tscn
88
UI/gui.tscn
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=22 format=3 uid="uid://p6a6rb7sgeqd"]
|
[gd_scene load_steps=15 format=3 uid="uid://p6a6rb7sgeqd"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://d2x8oy4os7ysn" path="res://UI/label_money.gd" id="1_cwd3r"]
|
[ext_resource type="Script" uid="uid://d2x8oy4os7ysn" path="res://UI/label_money.gd" id="1_cwd3r"]
|
||||||
[ext_resource type="Script" uid="uid://c350dletl5pde" path="res://UI/label_tower_in_cube.gd" id="2_6ujs1"]
|
[ext_resource type="Script" uid="uid://c350dletl5pde" path="res://UI/label_tower_in_cube.gd" id="2_6ujs1"]
|
||||||
|
|
@ -9,14 +9,7 @@
|
||||||
[ext_resource type="Texture2D" uid="uid://csl43eb7qjhe4" path="res://Assets/Icones/dog-house.svg" id="7_fffne"]
|
[ext_resource type="Texture2D" uid="uid://csl43eb7qjhe4" path="res://Assets/Icones/dog-house.svg" id="7_fffne"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dfnf26suc8yb6" path="res://Assets/Icones/sideswipe.svg" id="8_ay13l"]
|
[ext_resource type="Texture2D" uid="uid://dfnf26suc8yb6" path="res://Assets/Icones/sideswipe.svg" id="8_ay13l"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dootdihg7gkoj" path="res://Assets/Icones/exit-door.svg" id="8_decjp"]
|
[ext_resource type="Texture2D" uid="uid://dootdihg7gkoj" path="res://Assets/Icones/exit-door.svg" id="8_decjp"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bb4wihq1n1wm7" path="res://Assets/Icones/labrador-head.svg" id="9_decjp"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://b4m5ejfdrm8s0" path="res://Assets/Icones/power-button.svg" id="9_reygo"]
|
[ext_resource type="Texture2D" uid="uid://b4m5ejfdrm8s0" path="res://Assets/Icones/power-button.svg" id="9_reygo"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cob1lydkirn20" path="res://Assets/Icones/raccoon-head.svg" id="10_reygo"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://boxdrq4nrq7hv" path="res://Assets/Icones/flamingo.svg" id="11_76b7g"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dqb5o8w7u50hc" path="res://UI/tower_button-v2.tscn" id="11_ay13l"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://m6jwakrus50v" path="res://Assets/Icones/sea-star.svg" id="12_ih1k6"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dwwgho6f8f4kj" path="res://Assets/Icones/penguin.svg" id="13_ryolu"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c4ir6y45pchpl" path="res://Assets/Icones/seahorse.svg" id="14_hndjt"]
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_h4fn5"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_h4fn5"]
|
||||||
bg_color = Color(0.933333, 0.933333, 0.933333, 1)
|
bg_color = Color(0.933333, 0.933333, 0.933333, 1)
|
||||||
|
|
@ -206,85 +199,6 @@ grow_vertical = 2
|
||||||
texture = ExtResource("8_ay13l")
|
texture = ExtResource("8_ay13l")
|
||||||
expand_mode = 1
|
expand_mode = 1
|
||||||
|
|
||||||
[node name="ButtonPierre" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer" instance=ExtResource("11_ay13l")]
|
|
||||||
layout_mode = 2
|
|
||||||
towerType = 1
|
|
||||||
|
|
||||||
[node name="TextureRect" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonPierre" index="0"]
|
|
||||||
texture = ExtResource("9_decjp")
|
|
||||||
|
|
||||||
[node name="ButtonAline" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer" instance=ExtResource("11_ay13l")]
|
|
||||||
layout_mode = 2
|
|
||||||
towerType = 2
|
|
||||||
|
|
||||||
[node name="TextureRect" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonAline" index="0"]
|
|
||||||
texture = ExtResource("10_reygo")
|
|
||||||
|
|
||||||
[node name="ButtonMaxcence2" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer" instance=ExtResource("11_ay13l")]
|
|
||||||
layout_mode = 2
|
|
||||||
towerType = 3
|
|
||||||
|
|
||||||
[node name="TextureRect" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonMaxcence2" index="0"]
|
|
||||||
texture = ExtResource("11_76b7g")
|
|
||||||
|
|
||||||
[node name="ButtonVictoria" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer" instance=ExtResource("11_ay13l")]
|
|
||||||
layout_mode = 2
|
|
||||||
towerType = 4
|
|
||||||
|
|
||||||
[node name="TextureRect" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonVictoria" index="0"]
|
|
||||||
texture = ExtResource("12_ih1k6")
|
|
||||||
|
|
||||||
[node name="ButtonEvan" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer" instance=ExtResource("11_ay13l")]
|
|
||||||
layout_mode = 2
|
|
||||||
towerType = 5
|
|
||||||
|
|
||||||
[node name="TextureRect" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonEvan" index="0"]
|
|
||||||
texture = ExtResource("13_ryolu")
|
|
||||||
|
|
||||||
[node name="ButtonAlex" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer" instance=ExtResource("11_ay13l")]
|
|
||||||
layout_mode = 2
|
|
||||||
towerType = 6
|
|
||||||
|
|
||||||
[node name="TextureRect" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonAlex" index="0"]
|
|
||||||
texture = ExtResource("14_hndjt")
|
|
||||||
|
|
||||||
[node name="Button11" type="Button" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer"]
|
|
||||||
custom_minimum_size = Vector2(80, 80)
|
|
||||||
layout_mode = 2
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
|
|
||||||
[node name="Button12" type="Button" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer"]
|
|
||||||
custom_minimum_size = Vector2(80, 80)
|
|
||||||
layout_mode = 2
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
|
|
||||||
[node name="Button13" type="Button" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer"]
|
|
||||||
custom_minimum_size = Vector2(80, 80)
|
|
||||||
layout_mode = 2
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
|
|
||||||
[node name="Button14" type="Button" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer"]
|
|
||||||
custom_minimum_size = Vector2(80, 80)
|
|
||||||
layout_mode = 2
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
|
|
||||||
[node name="Button15" type="Button" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer"]
|
|
||||||
custom_minimum_size = Vector2(80, 80)
|
|
||||||
layout_mode = 2
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
|
|
||||||
[node name="Button16" type="Button" parent="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer"]
|
|
||||||
custom_minimum_size = Vector2(80, 80)
|
|
||||||
layout_mode = 2
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
|
|
||||||
[connection signal="pressed" from="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonCube" to="." method="_on_button_cube_pressed"]
|
[connection signal="pressed" from="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonCube" to="." method="_on_button_cube_pressed"]
|
||||||
[connection signal="pressed" from="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonQuitLevel" to="." method="_on_button_quit_level_pressed"]
|
[connection signal="pressed" from="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonQuitLevel" to="." method="_on_button_quit_level_pressed"]
|
||||||
[connection signal="pressed" from="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonQuitGame" to="." method="_on_button_quit_game_pressed"]
|
[connection signal="pressed" from="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonQuitGame" to="." method="_on_button_quit_game_pressed"]
|
||||||
|
|
||||||
[editable path="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonPierre"]
|
|
||||||
[editable path="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonAline"]
|
|
||||||
[editable path="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonMaxcence2"]
|
|
||||||
[editable path="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonVictoria"]
|
|
||||||
[editable path="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonEvan"]
|
|
||||||
[editable path="HBoxContainer/ControlPanelBase/MarginContainer/GridContainer/ButtonAlex"]
|
|
||||||
|
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://he31g7f3ru1c"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bqpeu50pgsdfk" path="res://UI/tower_button.tscn" id="1_txsyf"]
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_oxe32"]
|
|
||||||
bg_color = Color(0.921569, 0.890196, 0.415686, 1)
|
|
||||||
|
|
||||||
[node name="ShopPanel" type="Panel"]
|
|
||||||
custom_minimum_size = Vector2(300, 0)
|
|
||||||
anchors_preset = 11
|
|
||||||
anchor_left = 1.0
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
grow_vertical = 2
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
|
|
||||||
[node name="PierreButton" parent="VBoxContainer" instance=ExtResource("1_txsyf")]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="EnergyBar" type="ProgressBar" parent="VBoxContainer/PierreButton"]
|
|
||||||
custom_minimum_size = Vector2(0, 5)
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 12
|
|
||||||
anchor_top = 1.0
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
offset_top = -4.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 0
|
|
||||||
theme_override_styles/fill = SubResource("StyleBoxFlat_oxe32")
|
|
||||||
show_percentage = false
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_vertical = 3
|
|
||||||
|
|
||||||
[node name="CancelButton" type="Button" parent="VBoxContainer"]
|
|
||||||
custom_minimum_size = Vector2(0, 50)
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Cancel
|
|
||||||
"
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://dqb5o8w7u50hc"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dyhtr6g7kd1g2" path="res://UI/tower_button.gd" id="1_3542o"]
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_decjp"]
|
|
||||||
bg_color = Color(1, 0.878431, 0, 1)
|
|
||||||
|
|
||||||
[node name="TowerButton" type="Button"]
|
|
||||||
custom_minimum_size = Vector2(80, 80)
|
|
||||||
offset_right = 80.0
|
|
||||||
offset_bottom = 80.0
|
|
||||||
tooltip_text = "Sélectionner Pierre"
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
script = ExtResource("1_3542o")
|
|
||||||
metadata/_custom_type_script = "uid://dyhtr6g7kd1g2"
|
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
expand_mode = 1
|
|
||||||
|
|
||||||
[node name="ProgressBar" type="ProgressBar" parent="."]
|
|
||||||
layout_mode = 0
|
|
||||||
offset_left = 1.0
|
|
||||||
offset_top = 71.0
|
|
||||||
offset_right = 79.0
|
|
||||||
offset_bottom = 78.0
|
|
||||||
mouse_filter = 1
|
|
||||||
theme_override_styles/fill = SubResource("StyleBoxFlat_decjp")
|
|
||||||
show_percentage = false
|
|
||||||
|
|
@ -1,14 +1,20 @@
|
||||||
|
@tool
|
||||||
extends Button
|
extends Button
|
||||||
class_name TowerButton
|
class_name TowerButton
|
||||||
|
|
||||||
@export var towerType : Tower.TYPES
|
var towerType : Tower.TYPES
|
||||||
|
|
||||||
func _init() -> void:
|
func _ready() -> void:
|
||||||
#font_outline_color = Color.YELLOW
|
#font_outline_color = Color.YELLOW
|
||||||
EventBus.energy_has_changed.connect(changeEnergy)
|
if not Engine.is_editor_hint():
|
||||||
pressed.connect(func(): EventBus.tower_selected.emit(towerType))
|
pressed.connect(EventBus.tower_selected.emit.bind(towerType))
|
||||||
|
EventBus.energy_has_changed.connect(changeEnergy)
|
||||||
|
|
||||||
|
|
||||||
func changeEnergy(tower : Tower) -> void:
|
func changeEnergy(tower : Tower) -> void:
|
||||||
if tower.tower_type == towerType:
|
if tower.tower_type == towerType:
|
||||||
$ProgressBar.value = tower.energy
|
$ProgressBar.value = tower.energy
|
||||||
|
|
||||||
|
|
||||||
|
func setButtonTexture(texture : Texture2D) -> void:
|
||||||
|
$TextureRect.texture = texture
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,34 @@
|
||||||
[gd_scene load_steps=4 format=3 uid="uid://bqpeu50pgsdfk"]
|
[gd_scene load_steps=3 format=3 uid="uid://dqb5o8w7u50hc"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dqyhhvxpwtpsy" path="res://Assets/Emotes/emote_star.png" id="1_88p3s"]
|
[ext_resource type="Script" uid="uid://dyhtr6g7kd1g2" path="res://UI/tower_button.gd" id="1_3542o"]
|
||||||
[ext_resource type="Script" uid="uid://dyhtr6g7kd1g2" path="res://UI/tower_button.gd" id="1_i47ne"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://trg7ag3dqr2l" path="res://Towers/tower.tscn" id="2_4qiv5"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_decjp"]
|
||||||
|
bg_color = Color(1, 0.878431, 0, 1)
|
||||||
|
|
||||||
[node name="TowerButton" type="Button"]
|
[node name="TowerButton" type="Button"]
|
||||||
custom_minimum_size = Vector2(300, 50)
|
custom_minimum_size = Vector2(80, 80)
|
||||||
text = "Pierre
|
offset_right = 80.0
|
||||||
250 Trucs"
|
offset_bottom = 80.0
|
||||||
script = ExtResource("1_i47ne")
|
tooltip_text = "Sélectionner Pierre"
|
||||||
tower = ExtResource("2_4qiv5")
|
mouse_default_cursor_shape = 2
|
||||||
|
script = ExtResource("1_3542o")
|
||||||
|
metadata/_custom_type_script = "uid://dyhtr6g7kd1g2"
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="."]
|
[node name="TextureRect" type="TextureRect" parent="."]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 4
|
anchors_preset = 15
|
||||||
anchor_top = 0.5
|
anchor_right = 1.0
|
||||||
anchor_bottom = 0.5
|
anchor_bottom = 1.0
|
||||||
offset_top = -20.0
|
grow_horizontal = 2
|
||||||
offset_right = 40.0
|
|
||||||
offset_bottom = 20.0
|
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
texture = ExtResource("1_88p3s")
|
expand_mode = 1
|
||||||
|
|
||||||
[connection signal="pressed" from="." to="." method="_on_pressed"]
|
[node name="ProgressBar" type="ProgressBar" parent="."]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 1.0
|
||||||
|
offset_top = 71.0
|
||||||
|
offset_right = 79.0
|
||||||
|
offset_bottom = 78.0
|
||||||
|
mouse_filter = 1
|
||||||
|
theme_override_styles/fill = SubResource("StyleBoxFlat_decjp")
|
||||||
|
show_percentage = false
|
||||||
|
|
|
||||||
14
UI/ui.tscn
14
UI/ui.tscn
|
|
@ -1,14 +0,0 @@
|
||||||
[gd_scene load_steps=2 format=3 uid="uid://dbx8ow3v45k4k"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://he31g7f3ru1c" path="res://UI/shop_panel.tscn" id="1_2fwl4"]
|
|
||||||
|
|
||||||
[node name="UI" type="Control"]
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
|
|
||||||
[node name="ShopPanel" parent="." instance=ExtResource("1_2fwl4")]
|
|
||||||
layout_mode = 1
|
|
||||||
1
addons/LevelEditor/Draggable.gd
Normal file
1
addons/LevelEditor/Draggable.gd
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
extends Node
|
||||||
1
addons/LevelEditor/Draggable.gd.uid
Normal file
1
addons/LevelEditor/Draggable.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dno7nph2s6ad0
|
||||||
32
addons/LevelEditor/LevelEditor.gd
Normal file
32
addons/LevelEditor/LevelEditor.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
@tool
|
||||||
|
extends EditorPlugin
|
||||||
|
|
||||||
|
# Replace this value with a PascalCase autoload name, as per the GDScript style guide.
|
||||||
|
#const AUTOLOAD_NAME = "LevelEditorAutoload"
|
||||||
|
const ui = preload("res://addons/LevelEditor/wave_maker.tscn")
|
||||||
|
|
||||||
|
var main_panel_instance
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
main_panel_instance = ui.instantiate()
|
||||||
|
# Add the main panel to the editor's main viewport.
|
||||||
|
EditorInterface.get_editor_main_screen().add_child(main_panel_instance)
|
||||||
|
# Hide the main panel. Very much required.
|
||||||
|
_make_visible(false)
|
||||||
|
|
||||||
|
|
||||||
|
func _has_main_screen():
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
func _make_visible(visible):
|
||||||
|
if main_panel_instance:
|
||||||
|
main_panel_instance.visible = visible
|
||||||
|
|
||||||
|
|
||||||
|
func _get_plugin_name():
|
||||||
|
return "Level Editor"
|
||||||
|
|
||||||
|
|
||||||
|
func _get_plugin_icon():
|
||||||
|
return EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")
|
||||||
1
addons/LevelEditor/LevelEditor.gd.uid
Normal file
1
addons/LevelEditor/LevelEditor.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://ppf3jmjydns0
|
||||||
51
addons/LevelEditor/UI/CustomLineEdit.gd
Normal file
51
addons/LevelEditor/UI/CustomLineEdit.gd
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
@tool
|
||||||
|
extends LineEdit
|
||||||
|
|
||||||
|
class_name CustomLineEdit
|
||||||
|
|
||||||
|
enum TYPE { INT, TEXT, FLOAT }
|
||||||
|
|
||||||
|
@export var inputType : TYPE
|
||||||
|
@export var step : float = 1
|
||||||
|
var oldValue : String = ""
|
||||||
|
|
||||||
|
var value:
|
||||||
|
get:
|
||||||
|
return getTypedValue(text)
|
||||||
|
|
||||||
|
func _init() -> void:
|
||||||
|
text_changed.connect(valueUpdated)
|
||||||
|
|
||||||
|
|
||||||
|
func _input(event : InputEvent) -> void:
|
||||||
|
if !has_focus() || event is not InputEventKey || !event.pressed:
|
||||||
|
return
|
||||||
|
|
||||||
|
processKeyInput(event)
|
||||||
|
|
||||||
|
|
||||||
|
func processKeyInput(event : InputEventKey) -> void:
|
||||||
|
if inputType in [TYPE.INT, TYPE.FLOAT]:
|
||||||
|
if event.keycode == KEY_UP:
|
||||||
|
text = str(getTypedValue(str(value + step)))
|
||||||
|
valueUpdated(text)
|
||||||
|
elif event.keycode == KEY_DOWN:
|
||||||
|
text = str(getTypedValue(str(value - step)))
|
||||||
|
valueUpdated(text)
|
||||||
|
|
||||||
|
|
||||||
|
func valueUpdated(newText : String) -> void:
|
||||||
|
valueHasChanged.emit(value)
|
||||||
|
|
||||||
|
|
||||||
|
func setValue(value) -> void:
|
||||||
|
text = str(getTypedValue(str(value)))
|
||||||
|
|
||||||
|
|
||||||
|
func getTypedValue(valueToType: String):
|
||||||
|
match inputType:
|
||||||
|
TYPE.INT: return int(valueToType)
|
||||||
|
TYPE.FLOAT: return float(valueToType)
|
||||||
|
_: return valueToType
|
||||||
|
|
||||||
|
signal valueHasChanged(newValue)
|
||||||
1
addons/LevelEditor/UI/CustomLineEdit.gd.uid
Normal file
1
addons/LevelEditor/UI/CustomLineEdit.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bpv75ucqoy446
|
||||||
47
addons/LevelEditor/UI/CustomOptionButton.gd
Normal file
47
addons/LevelEditor/UI/CustomOptionButton.gd
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
@tool
|
||||||
|
extends OptionButton
|
||||||
|
class_name CustomOptionButton
|
||||||
|
|
||||||
|
@export_dir var resourcePath : String
|
||||||
|
@export var regexPattern : String
|
||||||
|
@export var reloadOnOpen : bool = false
|
||||||
|
|
||||||
|
var selectedValue : String
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
loadData(true)
|
||||||
|
item_selected.connect(itemHasBeenSelected)
|
||||||
|
pressed.connect(loadData)
|
||||||
|
allow_reselect = true
|
||||||
|
|
||||||
|
func loadData(force : bool = false) -> void:
|
||||||
|
if !force && !reloadOnOpen:
|
||||||
|
return
|
||||||
|
|
||||||
|
var regex := RegEx.create_from_string(regexPattern)
|
||||||
|
var dir := DirAccess.open(resourcePath)
|
||||||
|
clear()
|
||||||
|
for file in dir.get_files():
|
||||||
|
var fileMatch := regex.search(file)
|
||||||
|
if fileMatch:
|
||||||
|
add_item(fileMatch.strings[1])
|
||||||
|
if selectedValue == fileMatch.strings[1]:
|
||||||
|
selected = item_count - 1
|
||||||
|
|
||||||
|
if !selectedValue && item_count > 0:
|
||||||
|
selected = 0
|
||||||
|
|
||||||
|
func itemHasBeenSelected(index : int) -> void:
|
||||||
|
if selectedValue != get_item_text(index):
|
||||||
|
selectedValue = get_item_text(index)
|
||||||
|
onValueChanged.emit(selectedValue)
|
||||||
|
|
||||||
|
|
||||||
|
func selectItemByName(name : String) -> void:
|
||||||
|
for i in item_count:
|
||||||
|
if get_item_text(i) == name:
|
||||||
|
selected = i
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
signal onValueChanged(value : String)
|
||||||
1
addons/LevelEditor/UI/CustomOptionButton.gd.uid
Normal file
1
addons/LevelEditor/UI/CustomOptionButton.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://b47p2u458hsn0
|
||||||
7
addons/LevelEditor/UI/baseLabel.tres
Normal file
7
addons/LevelEditor/UI/baseLabel.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://s1lfc81j20la"]
|
||||||
|
|
||||||
|
[ext_resource type="FontFile" uid="uid://dv7ow5e7jj355" path="res://Assets/Fonts/Grandstander/static/Grandstander-Light.ttf" id="1_r6cgw"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
font = ExtResource("1_r6cgw")
|
||||||
|
font_size = 24
|
||||||
4
addons/LevelEditor/UI/theme.tres
Normal file
4
addons/LevelEditor/UI/theme.tres
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
[gd_resource type="Theme" format=3 uid="uid://bvji8e8p2d72y"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
default_font_size = 20
|
||||||
7
addons/LevelEditor/UI/troopLabel.tres
Normal file
7
addons/LevelEditor/UI/troopLabel.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://bee458c1kc0j7"]
|
||||||
|
|
||||||
|
[ext_resource type="FontFile" uid="uid://ctmfgwv1dwdyg" path="res://Assets/Fonts/Grandstander/static/Grandstander-BoldItalic.ttf" id="1_kyxue"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
font = ExtResource("1_kyxue")
|
||||||
|
font_size = 24
|
||||||
7
addons/LevelEditor/UI/waveLabel.tres
Normal file
7
addons/LevelEditor/UI/waveLabel.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://cafoo04y1t31t"]
|
||||||
|
|
||||||
|
[ext_resource type="FontFile" uid="uid://byqqml5g6dwil" path="res://Assets/Fonts/Grandstander/static/Grandstander-BlackItalic.ttf" id="1_m52f8"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
font = ExtResource("1_m52f8")
|
||||||
|
font_size = 32
|
||||||
237
addons/LevelEditor/WaveMaker.gd
Normal file
237
addons/LevelEditor/WaveMaker.gd
Normal file
|
|
@ -0,0 +1,237 @@
|
||||||
|
@tool
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
const LEVEL_PATH : String = "res://Levels"
|
||||||
|
const LEVEL_NAME_PATERN : String = "level_{id}.tres"
|
||||||
|
const LEVEL_NAME_PATH_PATERN : String = LEVEL_PATH + "/{name}.tres"
|
||||||
|
|
||||||
|
const ENEMY_PATH : String = "res://enemies"
|
||||||
|
const ENEMY_REGEX_PATERN : String = "(enemy.*)\\.tscn"
|
||||||
|
|
||||||
|
const BASE_LABEL_SETTINGS = preload("res://addons/LevelEditor/UI/baseLabel.tres")
|
||||||
|
const WAVE_LABEL_SETTINGS = preload("res://addons/LevelEditor/UI/waveLabel.tres")
|
||||||
|
const TROOP_LABEL_SETTINGS = preload("res://addons/LevelEditor/UI/troopLabel.tres")
|
||||||
|
|
||||||
|
const space_multiplicator : int = 10
|
||||||
|
enum DIRECTION { UP, DOWN, TOP, LEFT, VERTICAL, HORIZONTAL}
|
||||||
|
|
||||||
|
|
||||||
|
@onready var autoLaunchLevel := $VBoxContainer2/ButtonContainer2/AutoLaunchLevel
|
||||||
|
@onready var levelSelect := $VBoxContainer2/HBoxContainer/LevelSelect
|
||||||
|
@onready var waveTabContainer := $VBoxContainer2/ScrollContainer/WaveContainer
|
||||||
|
@onready var waveTimerInput := $VBoxContainer2/ButtonContainer3/WaveTimer
|
||||||
|
var level : Level
|
||||||
|
var currentWave : int = -1
|
||||||
|
|
||||||
|
|
||||||
|
func _input(event: InputEvent) -> void:
|
||||||
|
if !has_focus() || event is not InputEventKey || !event.pressed:
|
||||||
|
return
|
||||||
|
|
||||||
|
if event.keycode == KEY_RIGHT && waveTabContainer.get_tab_count() > waveTabContainer.current_tab:
|
||||||
|
waveTabContainer.current_tab += 1
|
||||||
|
elif event.keycode == KEY_LEFT && waveTabContainer.current_tab > 0:
|
||||||
|
waveTabContainer.current_tab -= 1
|
||||||
|
|
||||||
|
|
||||||
|
func buildTree() -> void:
|
||||||
|
if !level:
|
||||||
|
return
|
||||||
|
|
||||||
|
autoLaunchLevel.button_pressed = level.auto_start
|
||||||
|
for i in level.waves.size():
|
||||||
|
var troopContainer := VBoxContainer.new()
|
||||||
|
buildWave(level.waves[i], troopContainer)
|
||||||
|
waveTabContainer.add_child(troopContainer)
|
||||||
|
waveTabContainer.set_tab_title(i, "Vague N°" + str(i + 1))
|
||||||
|
|
||||||
|
|
||||||
|
func buildWave(wave : Wave, troopContainer : VBoxContainer) -> void:
|
||||||
|
for i in wave.troops.size():
|
||||||
|
var troop : Troop = wave.troops[i]
|
||||||
|
|
||||||
|
if i > 0 && !troopContainer.get_child(troopContainer.get_child_count() - 1).has_meta("troop_group") \
|
||||||
|
|| troop.spawn_delay > 0:
|
||||||
|
troopContainer.add_child(HSeparator.new())
|
||||||
|
|
||||||
|
if troop.spawn_delay:
|
||||||
|
var timeSeparator := buildInputLabel(
|
||||||
|
func(newValue):
|
||||||
|
troop.spawn_delay = newValue
|
||||||
|
if newValue == 0:
|
||||||
|
cleanAndBuildMenu(),
|
||||||
|
troop.spawn_delay,
|
||||||
|
CustomLineEdit.TYPE.FLOAT,
|
||||||
|
"sec."
|
||||||
|
)
|
||||||
|
troopContainer.add_child(timeSeparator)
|
||||||
|
|
||||||
|
var nodeToAppend : BoxContainer = troopContainer
|
||||||
|
if i < wave.troops.size() -1 && wave.troops[i + 1].spawn_delay == 0:
|
||||||
|
if i == 0 || !troopContainer.get_child(troopContainer.get_child_count() - 1).has_meta("troop_group"):
|
||||||
|
nodeToAppend = HBoxContainer.new()
|
||||||
|
nodeToAppend.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||||
|
nodeToAppend.set_meta("troop_group", true)
|
||||||
|
troopContainer.add_child(nodeToAppend)
|
||||||
|
|
||||||
|
if i > 0 && troop.spawn_delay == 0:
|
||||||
|
nodeToAppend = troopContainer.get_child(troopContainer.get_child_count() - 1)
|
||||||
|
nodeToAppend.add_child(VSeparator.new())
|
||||||
|
|
||||||
|
var ennemyContainer := VBoxContainer.new()
|
||||||
|
ennemyContainer.add_child(createSection("Troop N°" + str(i + 1), removeTroop.bind(troop, wave), TROOP_LABEL_SETTINGS))
|
||||||
|
|
||||||
|
if troop.spawn_delay == 0:
|
||||||
|
var button := Button.new()
|
||||||
|
button.text = "Séparer"
|
||||||
|
button.pressed.connect(
|
||||||
|
func():
|
||||||
|
troop.spawn_delay = 1
|
||||||
|
cleanAndBuildMenu()
|
||||||
|
)
|
||||||
|
ennemyContainer.add_child(button)
|
||||||
|
|
||||||
|
buildTroop(troop, ennemyContainer)
|
||||||
|
nodeToAppend.add_child(ennemyContainer)
|
||||||
|
|
||||||
|
var addTroopBtn := Button.new()
|
||||||
|
addTroopBtn.text = "Ajouter une troupe"
|
||||||
|
addTroopBtn.pressed.connect(addTroop.bind(wave))
|
||||||
|
troopContainer.add_child(addTroopBtn)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func buildTroop(troop : Troop, ennemyContainer : VBoxContainer) -> void:
|
||||||
|
var qtyEdit := buildInputLabel(
|
||||||
|
func(newValue): troop.number_to_spawn = newValue,
|
||||||
|
troop.number_to_spawn,
|
||||||
|
CustomLineEdit.TYPE.INT,
|
||||||
|
"x"
|
||||||
|
)
|
||||||
|
|
||||||
|
var enemySelector := CustomOptionButton.new()
|
||||||
|
enemySelector.resourcePath = ENEMY_PATH
|
||||||
|
enemySelector.regexPattern = ENEMY_REGEX_PATERN
|
||||||
|
var regex = RegEx.create_from_string(ENEMY_REGEX_PATERN)
|
||||||
|
enemySelector.onValueChanged.connect(func(enemyFileName): addEnemy(troop, enemyFileName))
|
||||||
|
if troop.enemy:
|
||||||
|
enemySelector.selectItemByName(regex.search(troop.enemy.resource_path).strings[0])
|
||||||
|
|
||||||
|
qtyEdit.add_child(enemySelector)
|
||||||
|
ennemyContainer.add_child(qtyEdit)
|
||||||
|
|
||||||
|
|
||||||
|
func buildInputLabel(updateCallback : Callable, delay : float, type : CustomLineEdit.TYPE, text : String = "") -> HBoxContainer:
|
||||||
|
var container := HBoxContainer.new()
|
||||||
|
container.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||||
|
container.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||||
|
|
||||||
|
var timeEdit := CustomLineEdit.new()
|
||||||
|
timeEdit.inputType = type
|
||||||
|
timeEdit.setValue(delay)
|
||||||
|
timeEdit.valueHasChanged.connect(updateCallback)
|
||||||
|
container.add_child(timeEdit)
|
||||||
|
|
||||||
|
if text:
|
||||||
|
var label := Label.new()
|
||||||
|
label.text = text
|
||||||
|
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
|
label.label_settings = BASE_LABEL_SETTINGS
|
||||||
|
container.add_child(label)
|
||||||
|
|
||||||
|
return container
|
||||||
|
|
||||||
|
func createSection(sectionName : String, BtnCallback : Callable, settings : LabelSettings = BASE_LABEL_SETTINGS) -> HSplitContainer :
|
||||||
|
var container := HSplitContainer.new()
|
||||||
|
|
||||||
|
var label := Label.new()
|
||||||
|
label.text = sectionName
|
||||||
|
label.label_settings = settings
|
||||||
|
|
||||||
|
var button := Button.new()
|
||||||
|
button.text = "Supprimer"
|
||||||
|
button.pressed.connect(BtnCallback)
|
||||||
|
|
||||||
|
container.add_child(label)
|
||||||
|
container.add_child(button)
|
||||||
|
|
||||||
|
return container
|
||||||
|
|
||||||
|
|
||||||
|
func cleanMenu() -> void:
|
||||||
|
if waveTabContainer.get_child_count() > 0:
|
||||||
|
for child in waveTabContainer.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
|
||||||
|
|
||||||
|
func removeWave() -> void:
|
||||||
|
level.waves.remove_at(currentWave)
|
||||||
|
waveTabContainer.get_child(currentWave).queue_free()
|
||||||
|
|
||||||
|
|
||||||
|
func addWave() -> void:
|
||||||
|
level.waves.append(Wave.new())
|
||||||
|
cleanAndBuildMenu()
|
||||||
|
|
||||||
|
|
||||||
|
func changeWaveOrder(newPos : int) -> void:
|
||||||
|
var newWaveOrder : Array[Wave]
|
||||||
|
var waveToMove = level.waves[currentWave]
|
||||||
|
for i in level.waves.size():
|
||||||
|
if i == 0 && newPos == 0:
|
||||||
|
newWaveOrder.append(waveToMove)
|
||||||
|
if i != currentWave:
|
||||||
|
newWaveOrder.append(level.waves[i])
|
||||||
|
if i == newPos && newPos != 0:
|
||||||
|
newWaveOrder.append(waveToMove)
|
||||||
|
currentWave = newPos
|
||||||
|
level.waves = newWaveOrder
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func addTroop(toWave : Wave) -> void:
|
||||||
|
toWave.troops.append(Troop.new())
|
||||||
|
cleanAndBuildMenu()
|
||||||
|
|
||||||
|
|
||||||
|
func addEnemy(toTroop : Troop, enemyResourcePath : String) -> void:
|
||||||
|
var enemy = load(enemyResourcePath)
|
||||||
|
toTroop.enemy = enemy
|
||||||
|
|
||||||
|
|
||||||
|
func removeTroop(troop : Troop, fromWave : Wave) -> void:
|
||||||
|
fromWave.troops.erase(troop)
|
||||||
|
cleanAndBuildMenu()
|
||||||
|
|
||||||
|
|
||||||
|
func selectLevel(levelName : String) -> void :
|
||||||
|
level = load(LEVEL_NAME_PATH_PATERN.format([["name", levelName]]))
|
||||||
|
|
||||||
|
|
||||||
|
func changeWaveCooldown(duration : float) -> void:
|
||||||
|
level.waves[currentWave].wait_time_before_launch_wave = duration
|
||||||
|
|
||||||
|
|
||||||
|
func tabFocusHaschanged(idx : int) -> void:
|
||||||
|
waveTimerInput.setValue(level.waves[idx].wait_time_before_launch_wave)
|
||||||
|
currentWave = idx
|
||||||
|
|
||||||
|
|
||||||
|
func cleanAndBuildMenu() -> void:
|
||||||
|
cleanMenu()
|
||||||
|
buildTree()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_auto_launch_wave_toggled(toggled_on: bool) -> void:
|
||||||
|
level.auto_start = toggled_on
|
||||||
|
|
||||||
|
|
||||||
|
func _on_new_level_pressed() -> void:
|
||||||
|
level = Level.new()
|
||||||
|
levelSelect.add_item(LEVEL_NAME_PATERN.format([["id", levelSelect.item_count + 1]]))
|
||||||
|
levelSelect.select(levelSelect.item_count - 1)
|
||||||
|
_on_save_pressed()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_save_pressed() -> void:
|
||||||
|
ResourceSaver.save(level, LEVEL_PATH + "/" + levelSelect.selectedValue, ResourceSaver.FLAG_BUNDLE_RESOURCES)
|
||||||
1
addons/LevelEditor/WaveMaker.gd.uid
Normal file
1
addons/LevelEditor/WaveMaker.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://27y0jliv6ckx
|
||||||
7
addons/LevelEditor/plugin.cfg
Normal file
7
addons/LevelEditor/plugin.cfg
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[plugin]
|
||||||
|
|
||||||
|
name="LevelEditor"
|
||||||
|
description=""
|
||||||
|
author="Varylios"
|
||||||
|
version="0.3"
|
||||||
|
script="LevelEditor.gd"
|
||||||
132
addons/LevelEditor/wave_maker.tscn
Normal file
132
addons/LevelEditor/wave_maker.tscn
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://dh24t8804isms"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://27y0jliv6ckx" path="res://addons/LevelEditor/WaveMaker.gd" id="1_usfft"]
|
||||||
|
[ext_resource type="Script" uid="uid://b47p2u458hsn0" path="res://addons/LevelEditor/UI/CustomOptionButton.gd" id="2_xjxpq"]
|
||||||
|
[ext_resource type="Script" uid="uid://bpv75ucqoy446" path="res://addons/LevelEditor/UI/CustomLineEdit.gd" id="3_qw7ts"]
|
||||||
|
|
||||||
|
[node name="Menu" type="HBoxContainer"]
|
||||||
|
offset_right = 885.0
|
||||||
|
offset_bottom = 574.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
script = ExtResource("1_usfft")
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||||
|
custom_minimum_size = Vector2(20, 0)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer2"]
|
||||||
|
custom_minimum_size = Vector2(0, 20)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="LevelSelect" type="OptionButton" parent="VBoxContainer2/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
selected = 0
|
||||||
|
item_count = 2
|
||||||
|
popup/item_0/text = "level_1"
|
||||||
|
popup/item_0/id = 0
|
||||||
|
popup/item_1/text = "level_2"
|
||||||
|
popup/item_1/id = 1
|
||||||
|
script = ExtResource("2_xjxpq")
|
||||||
|
resourcePath = "res://Levels"
|
||||||
|
regexPattern = "(level_.*)\\.tres"
|
||||||
|
reloadOnOpen = true
|
||||||
|
metadata/_custom_type_script = "uid://b47p2u458hsn0"
|
||||||
|
|
||||||
|
[node name="NewLevel" type="Button" parent="VBoxContainer2/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Nouveau Niveau"
|
||||||
|
|
||||||
|
[node name="Show" type="Button" parent="VBoxContainer2/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Afficher"
|
||||||
|
|
||||||
|
[node name="Clean" type="Button" parent="VBoxContainer2/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Effacer"
|
||||||
|
|
||||||
|
[node name="Save" type="Button" parent="VBoxContainer2/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Sauvegarder"
|
||||||
|
|
||||||
|
[node name="Test" type="Button" parent="VBoxContainer2/HBoxContainer"]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
text = "TESTER !!!!"
|
||||||
|
|
||||||
|
[node name="ButtonContainer" type="HBoxContainer" parent="VBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Add wave" type="Button" parent="VBoxContainer2/ButtonContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Ajouter une vague"
|
||||||
|
|
||||||
|
[node name="ButtonContainer2" type="HBoxContainer" parent="VBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="AutoLaunchLevel" type="CheckButton" parent="VBoxContainer2/ButtonContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="VBoxContainer2/ButtonContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Lancer le niveau auto. "
|
||||||
|
|
||||||
|
[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer2/ButtonContainer2"]
|
||||||
|
custom_minimum_size = Vector2(20, 0)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="RemoveWave" type="Button" parent="VBoxContainer2/ButtonContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Suprimer la vague"
|
||||||
|
|
||||||
|
[node name="ButtonContainer3" type="HBoxContainer" parent="VBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="WaveTimer" type="LineEdit" parent="VBoxContainer2/ButtonContainer3"]
|
||||||
|
custom_minimum_size = Vector2(55, 55)
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("3_qw7ts")
|
||||||
|
inputType = 2
|
||||||
|
step = 0.2
|
||||||
|
metadata/_custom_type_script = "uid://bpv75ucqoy446"
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer2/ButtonContainer3"]
|
||||||
|
custom_minimum_size = Vector2(10, 0)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="VBoxContainer2/ButtonContainer3"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Timer avant lancement de la vague"
|
||||||
|
|
||||||
|
[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer2"]
|
||||||
|
custom_minimum_size = Vector2(0, 30)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
|
||||||
|
[node name="WaveContainer" type="TabContainer" parent="VBoxContainer2/ScrollContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
clip_tabs = false
|
||||||
|
drag_to_rearrange_enabled = true
|
||||||
|
|
||||||
|
[connection signal="onValueChanged" from="VBoxContainer2/HBoxContainer/LevelSelect" to="." method="selectLevel"]
|
||||||
|
[connection signal="pressed" from="VBoxContainer2/HBoxContainer/NewLevel" to="." method="_on_new_level_pressed"]
|
||||||
|
[connection signal="pressed" from="VBoxContainer2/HBoxContainer/Show" to="." method="cleanAndBuildMenu"]
|
||||||
|
[connection signal="pressed" from="VBoxContainer2/HBoxContainer/Clean" to="." method="cleanMenu"]
|
||||||
|
[connection signal="pressed" from="VBoxContainer2/HBoxContainer/Save" to="." method="_on_save_pressed"]
|
||||||
|
[connection signal="pressed" from="VBoxContainer2/ButtonContainer/Add wave" to="." method="addWave"]
|
||||||
|
[connection signal="toggled" from="VBoxContainer2/ButtonContainer2/AutoLaunchLevel" to="." method="_on_auto_launch_wave_toggled"]
|
||||||
|
[connection signal="pressed" from="VBoxContainer2/ButtonContainer2/RemoveWave" to="." method="removeWave"]
|
||||||
|
[connection signal="valueHasChanged" from="VBoxContainer2/ButtonContainer3/WaveTimer" to="." method="changeWaveCooldown"]
|
||||||
|
[connection signal="active_tab_rearranged" from="VBoxContainer2/ScrollContainer/WaveContainer" to="." method="changeWaveOrder"]
|
||||||
|
[connection signal="tab_changed" from="VBoxContainer2/ScrollContainer/WaveContainer" to="." method="tabFocusHaschanged"]
|
||||||
|
|
@ -17,7 +17,7 @@ const DEFAULT_EMISSION_DURATION: float = 1.0
|
||||||
## TODO: This could be a user setting
|
## TODO: This could be a user setting
|
||||||
const DEFAULT_CONNECTION_OPACITY: float = 0.3
|
const DEFAULT_CONNECTION_OPACITY: float = 0.3
|
||||||
|
|
||||||
## This enum is used to set up the graph node's ports
|
## This enum is used to set up the graph node's ports
|
||||||
## in a way that provides more legibility in the code
|
## in a way that provides more legibility in the code
|
||||||
enum Direction {LEFT, RIGHT}
|
enum Direction {LEFT, RIGHT}
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ var block_new_inspections: bool = false
|
||||||
## If true, all incoming signal emissions will be drawn and won't fade out
|
## If true, all incoming signal emissions will be drawn and won't fade out
|
||||||
var keep_emissions: bool = false
|
var keep_emissions: bool = false
|
||||||
|
|
||||||
## Multiplier that increases or decreases emission drawing speed
|
## Multiplier that increases or decreases emission drawing speed
|
||||||
## Acquired from slider in scene
|
## Acquired from slider in scene
|
||||||
var emission_speed_multiplier: float = 1.0
|
var emission_speed_multiplier: float = 1.0
|
||||||
|
|
||||||
|
|
@ -61,10 +61,10 @@ var settings: Dictionary = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scene references
|
# Scene references
|
||||||
@export var graph_edit: GraphEdit
|
@export var graph_edit: GraphEdit
|
||||||
@export var logger_button: Button
|
@export var logger_button: Button
|
||||||
@export var node_path_line_edit: LineEdit
|
@export var node_path_line_edit: LineEdit
|
||||||
@export var refresh_button: Button
|
@export var refresh_button: Button
|
||||||
@export var options_button: MenuButton
|
@export var options_button: MenuButton
|
||||||
@onready var options_popup: PopupMenu = options_button.get_popup()
|
@onready var options_popup: PopupMenu = options_button.get_popup()
|
||||||
@export var clear_button: Button
|
@export var clear_button: Button
|
||||||
|
|
@ -96,7 +96,7 @@ func _ready() -> void:
|
||||||
graph_edit.get_menu_hbox().hide()
|
graph_edit.get_menu_hbox().hide()
|
||||||
#graph_edit.get_menu_hbox().hide()
|
#graph_edit.get_menu_hbox().hide()
|
||||||
repo_button.icon = EditorInterface.get_base_control().get_theme_icon("ExternalLink", "EditorIcons")
|
repo_button.icon = EditorInterface.get_base_control().get_theme_icon("ExternalLink", "EditorIcons")
|
||||||
|
|
||||||
@onready var repo_button: Button = $EditorPanel/MainButtonsContainer/HBoxContainer2/RepoButton
|
@onready var repo_button: Button = $EditorPanel/MainButtonsContainer/HBoxContainer2/RepoButton
|
||||||
|
|
||||||
@onready var panel_container: PanelContainer = $EditorPanel/PanelContainer
|
@onready var panel_container: PanelContainer = $EditorPanel/PanelContainer
|
||||||
|
|
@ -143,13 +143,13 @@ func stop_session():
|
||||||
func assign_node_path(target_node: NodePath):
|
func assign_node_path(target_node: NodePath):
|
||||||
# If locked button is toggled, don't change the current node
|
# If locked button is toggled, don't change the current node
|
||||||
if block_new_inspections: return
|
if block_new_inspections: return
|
||||||
|
|
||||||
# If incoming node is invalid, disable refreshing to avoid null nodes
|
# If incoming node is invalid, disable refreshing to avoid null nodes
|
||||||
refresh_button.disabled = target_node.is_empty()
|
refresh_button.disabled = target_node.is_empty()
|
||||||
|
|
||||||
# Assign incoming node as the current one
|
# Assign incoming node as the current one
|
||||||
current_node = target_node
|
current_node = target_node
|
||||||
|
|
||||||
# Update line edit
|
# Update line edit
|
||||||
node_path_line_edit.text = current_node
|
node_path_line_edit.text = current_node
|
||||||
node_path_line_edit.caret_column = node_path_line_edit.text.length()
|
node_path_line_edit.caret_column = node_path_line_edit.text.length()
|
||||||
|
|
@ -167,7 +167,7 @@ func clear_graph():
|
||||||
clean_connection_activity()
|
clean_connection_activity()
|
||||||
# Frees child nodes
|
# Frees child nodes
|
||||||
for child: Node in graph_edit.get_children():
|
for child: Node in graph_edit.get_children():
|
||||||
# This seems to be necessary as per Godot 4.3
|
# This seems to be necessary as per Godot 4.3
|
||||||
# because this child, despite being internal,
|
# because this child, despite being internal,
|
||||||
# is iterated in get_children() and if it is
|
# is iterated in get_children() and if it is
|
||||||
# destroyed, the editor crashed
|
# destroyed, the editor crashed
|
||||||
|
|
@ -187,20 +187,20 @@ func clear_graph():
|
||||||
func draw_node_data(data: Array):
|
func draw_node_data(data: Array):
|
||||||
# If lock button toggled on, don't draw incoming data
|
# If lock button toggled on, don't draw incoming data
|
||||||
if block_new_inspections: return
|
if block_new_inspections: return
|
||||||
|
|
||||||
# Clear graph to avoid drawing over old data
|
# Clear graph to avoid drawing over old data
|
||||||
clear_graph()
|
clear_graph()
|
||||||
logger.clear()
|
logger.clear()
|
||||||
|
|
||||||
# This line is super important to avoid random rendering errors
|
# This line is super important to avoid random rendering errors
|
||||||
# It seems we need to give a small breathing room for the graph edit
|
# It seems we need to give a small breathing room for the graph edit
|
||||||
# to fully cleanup, otherwise, artifacts from a previously rendered
|
# to fully cleanup, otherwise, artifacts from a previously rendered
|
||||||
# graph edit may appear and mess up the new drawing
|
# graph edit may appear and mess up the new drawing
|
||||||
await get_tree().create_timer(0.1).timeout
|
await get_tree().create_timer(0.1).timeout
|
||||||
|
|
||||||
# Retrieve the targeted node from the data array, which is always index 0
|
# Retrieve the targeted node from the data array, which is always index 0
|
||||||
var target_node_name = data[0]
|
var target_node_name = data[0]
|
||||||
|
|
||||||
# Handle root node inspection edge case
|
# Handle root node inspection edge case
|
||||||
if target_node_name == "Root":
|
if target_node_name == "Root":
|
||||||
warning_text.show()
|
warning_text.show()
|
||||||
|
|
@ -211,19 +211,19 @@ func draw_node_data(data: Array):
|
||||||
|
|
||||||
# Retrieve the targeted node signal data, which is always index 1
|
# Retrieve the targeted node signal data, which is always index 1
|
||||||
var target_node_signal_data: Array = data[1]
|
var target_node_signal_data: Array = data[1]
|
||||||
|
|
||||||
# Create main node from which connections will be created
|
# Create main node from which connections will be created
|
||||||
# and add it to the graph
|
# and add it to the graph
|
||||||
var target_node: SignalLensGraphNode = create_node(target_node_name, "(Signals)")
|
var target_node: SignalLensGraphNode = create_node(target_node_name, "(Signals)")
|
||||||
graph_edit.add_child(target_node)
|
graph_edit.add_child(target_node)
|
||||||
|
|
||||||
var current_signal_index = 0
|
var current_signal_index = 0
|
||||||
|
|
||||||
# Start iterating signal by signal
|
# Start iterating signal by signal
|
||||||
for signal_data in target_node_signal_data:
|
for signal_data in target_node_signal_data:
|
||||||
# Check signal connections and skip not connected signals (based on settings)
|
# Check signal connections and skip not connected signals (based on settings)
|
||||||
if settings[Options.HIDE_SIGNALS_WITHOUT_CONNECTIONS] and signal_data["callables"].size() == 0: continue
|
if settings[Options.HIDE_SIGNALS_WITHOUT_CONNECTIONS] and signal_data["callables"].size() == 0: continue
|
||||||
|
|
||||||
# Check signal connections and skip if signal is built-in (based on settings)
|
# Check signal connections and skip if signal is built-in (based on settings)
|
||||||
if settings[Options.HIDE_BUILT_IN_SIGNALS]:
|
if settings[Options.HIDE_BUILT_IN_SIGNALS]:
|
||||||
var class_signals: Array = []
|
var class_signals: Array = []
|
||||||
|
|
@ -231,13 +231,13 @@ func draw_node_data(data: Array):
|
||||||
class_signals.append(class_signal["name"])
|
class_signals.append(class_signal["name"])
|
||||||
if signal_data["signal"] in class_signals:
|
if signal_data["signal"] in class_signals:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Get the color based on the index so we can have the rainbow vibes
|
# Get the color based on the index so we can have the rainbow vibes
|
||||||
var slot_color = get_slot_color(current_signal_index, target_node_signal_data.size())
|
var slot_color = get_slot_color(current_signal_index, target_node_signal_data.size())
|
||||||
|
|
||||||
# Create the slot button with the signal's name
|
# Create the slot button with the signal's name
|
||||||
create_button_slot(signal_data["signal"], target_node, Direction.RIGHT, slot_color)
|
create_button_slot(signal_data["signal"], target_node, Direction.RIGHT, slot_color)
|
||||||
|
|
||||||
# Start iterating each callable in the signal
|
# Start iterating each callable in the signal
|
||||||
var callables_for_current_signal = signal_data["callables"]
|
var callables_for_current_signal = signal_data["callables"]
|
||||||
for callable_index in range(callables_for_current_signal.size()):
|
for callable_index in range(callables_for_current_signal.size()):
|
||||||
|
|
@ -306,8 +306,8 @@ func create_button_slot(button_text: String, parent_node: GraphNode, slot_direct
|
||||||
parent_node.set_slot(signal_button.get_index(), slot_direction == Direction.LEFT, 0, slot_color, slot_direction == Direction.RIGHT, 0, slot_color)
|
parent_node.set_slot(signal_button.get_index(), slot_direction == Direction.LEFT, 0, slot_color, slot_direction == Direction.RIGHT, 0, slot_color)
|
||||||
|
|
||||||
func get_slot_color(slot_index, signal_amount) -> Color:
|
func get_slot_color(slot_index, signal_amount) -> Color:
|
||||||
var hue = float(slot_index) / float(signal_amount)
|
var hue = float(slot_index) / float(signal_amount)
|
||||||
return Color.from_hsv(hue, 1.0, 0.5, connection_opacity)
|
return Color.from_hsv(hue, 1.0, 0.5, connection_opacity)
|
||||||
|
|
||||||
func clean_connection_activity():
|
func clean_connection_activity():
|
||||||
for connection in graph_edit.get_connection_list():
|
for connection in graph_edit.get_connection_list():
|
||||||
|
|
@ -331,13 +331,13 @@ func draw_signal_emission(data: Array):
|
||||||
|
|
||||||
func pulse_connection(connection: Dictionary) -> void:
|
func pulse_connection(connection: Dictionary) -> void:
|
||||||
if connection not in pulsing_connections: pulsing_connections.append(connection)
|
if connection not in pulsing_connections: pulsing_connections.append(connection)
|
||||||
|
|
||||||
var from_node = connection["from_node"]
|
var from_node = connection["from_node"]
|
||||||
var from_port = connection["from_port"]
|
var from_port = connection["from_port"]
|
||||||
var to_node = connection["to_node"]
|
var to_node = connection["to_node"]
|
||||||
var to_port = connection["to_port"]
|
var to_port = connection["to_port"]
|
||||||
|
|
||||||
if keep_emissions:
|
if keep_emissions:
|
||||||
graph_edit.set_connection_activity(from_node, from_port, to_node, to_port, 1.0)
|
graph_edit.set_connection_activity(from_node, from_port, to_node, to_port, 1.0)
|
||||||
else:
|
else:
|
||||||
fade_out_connection(connection)
|
fade_out_connection(connection)
|
||||||
|
|
@ -349,11 +349,11 @@ func fade_out_connection(connection: Dictionary):
|
||||||
var from_port = connection["from_port"]
|
var from_port = connection["from_port"]
|
||||||
var to_node = connection["to_node"]
|
var to_node = connection["to_node"]
|
||||||
var to_port = connection["to_port"]
|
var to_port = connection["to_port"]
|
||||||
|
|
||||||
tween.tween_method(
|
tween.tween_method(
|
||||||
func(value): graph_edit.set_connection_activity(from_node, from_port, to_node, to_port, value), 1.0, 0.0, fade_out_duration
|
func(value): graph_edit.set_connection_activity(from_node, from_port, to_node, to_port, value), 1.0, 0.0, fade_out_duration
|
||||||
).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
|
).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
|
||||||
|
|
||||||
tween.tween_callback(func(): pulsing_connections.erase(connection))
|
tween.tween_callback(func(): pulsing_connections.erase(connection))
|
||||||
|
|
||||||
func get_port_index_from_signal_name(signal_name: String):
|
func get_port_index_from_signal_name(signal_name: String):
|
||||||
|
|
@ -407,7 +407,7 @@ func _resize_panel(new_size: float):
|
||||||
func _can_resize_panel() -> bool:
|
func _can_resize_panel() -> bool:
|
||||||
# If user wants to resize panel on open
|
# If user wants to resize panel on open
|
||||||
if not ProjectSettings.get_setting("addons/Signal Lens/resize_panel_on_open"): return false
|
if not ProjectSettings.get_setting("addons/Signal Lens/resize_panel_on_open"): return false
|
||||||
|
|
||||||
# If editor dock reference has been acquired
|
# If editor dock reference has been acquired
|
||||||
if not _editor_dock: return false
|
if not _editor_dock: return false
|
||||||
return true
|
return true
|
||||||
|
|
@ -417,7 +417,7 @@ func _on_visibility_changed() -> void:
|
||||||
# Only resize bottom panel if both visible and visible in editor
|
# Only resize bottom panel if both visible and visible in editor
|
||||||
if visible and is_visible_in_tree():
|
if visible and is_visible_in_tree():
|
||||||
_resize_panel(-ProjectSettings.get_setting("addons/Signal Lens/height_to_resize_to"))
|
_resize_panel(-ProjectSettings.get_setting("addons/Signal Lens/height_to_resize_to"))
|
||||||
else:
|
else:
|
||||||
_resize_panel(_original_panel_size)
|
_resize_panel(_original_panel_size)
|
||||||
|
|
||||||
func _open_project_settings():
|
func _open_project_settings():
|
||||||
|
|
@ -517,12 +517,12 @@ func _on_keep_emissions_checkbox_toggled(toggled_on: bool) -> void:
|
||||||
|
|
||||||
func _on_logger_button_toggled(toggled_on: bool) -> void:
|
func _on_logger_button_toggled(toggled_on: bool) -> void:
|
||||||
logger.visible = toggled_on
|
logger.visible = toggled_on
|
||||||
|
|
||||||
func _on_options_index_pressed(option_index: int) -> void:
|
func _on_options_index_pressed(option_index: int) -> void:
|
||||||
if options_popup.is_item_checkable(option_index):
|
if options_popup.is_item_checkable(option_index):
|
||||||
settings[option_index] = not options_popup.is_item_checked(option_index) # Change state
|
settings[option_index] = not options_popup.is_item_checked(option_index) # Change state
|
||||||
options_popup.set_item_checked(option_index, settings[option_index]) # Apply state
|
options_popup.set_item_checked(option_index, settings[option_index]) # Apply state
|
||||||
|
|
||||||
if option_index in [Options.HIDE_SIGNALS_WITHOUT_CONNECTIONS, Options.HIDE_BUILT_IN_SIGNALS]:
|
if option_index in [Options.HIDE_SIGNALS_WITHOUT_CONNECTIONS, Options.HIDE_BUILT_IN_SIGNALS]:
|
||||||
refresh_button.pressed.emit()
|
refresh_button.pressed.emit()
|
||||||
elif option_index == Options.SHOW_GRAPH_TOOLBAR:
|
elif option_index == Options.SHOW_GRAPH_TOOLBAR:
|
||||||
|
|
|
||||||
30
game_menu.gd
30
game_menu.gd
|
|
@ -1,30 +0,0 @@
|
||||||
extends Control
|
|
||||||
|
|
||||||
var selected_tower
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
EventBus.tower_selected.connect(_on_EventBus_tower_selected)
|
|
||||||
EventBus.open_shop.connect(open_shop)
|
|
||||||
EventBus.close_shop.connect(close_shop)
|
|
||||||
|
|
||||||
func open_shop():
|
|
||||||
if visible:
|
|
||||||
close_shop()
|
|
||||||
return
|
|
||||||
|
|
||||||
visible = true
|
|
||||||
|
|
||||||
func close_shop():
|
|
||||||
visible = false
|
|
||||||
|
|
||||||
func _on_EventBus_tower_selected(tower : PackedScene):
|
|
||||||
selected_tower = tower
|
|
||||||
|
|
||||||
func _on_button_return_desktop_pressed() -> void:
|
|
||||||
get_tree().quit()
|
|
||||||
|
|
||||||
func _on_button_back_to_start_screen_pressed() -> void:
|
|
||||||
Transition.goto("res://UI/start_menu.tscn")
|
|
||||||
|
|
||||||
func _on_button_continue_pressed() -> void:
|
|
||||||
visible = false
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://jg5ny0u7buos
|
|
||||||
393
game_menu.tscn
393
game_menu.tscn
|
|
@ -1,393 +0,0 @@
|
||||||
[gd_scene load_steps=12 format=3 uid="uid://djyye2otjju2d"]
|
|
||||||
|
|
||||||
[ext_resource type="Theme" uid="uid://bbp4qcbwkeg7x" path="res://default_theme.tres" id="1_xxfb2"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bqpeu50pgsdfk" path="res://UI/tower_button.tscn" id="2_qus6b"]
|
|
||||||
[ext_resource type="Script" uid="uid://jg5ny0u7buos" path="res://game_menu.gd" id="2_wr0q8"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://cs24awnya7o5p" path="res://Assets/VFX/start_menu_vignette.png" id="3_3rcmp"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://uptdcefxlv4c" path="res://Assets/Icones/ppdf_bio_image_placeholder_2.png" id="3_wr0q8"]
|
|
||||||
[ext_resource type="Script" uid="uid://tn3qdhcyaxsg" path="res://UI/upgrade_button.gd" id="4_3rcmp"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dksohsrys0yy7" path="res://Assets/Icones/baby-face.svg" id="5_pbvm6"]
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pbvm6"]
|
|
||||||
bg_color = Color(0.933333, 0.933333, 0.933333, 1)
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yd342"]
|
|
||||||
bg_color = Color(0.2, 0.2, 0.2, 0.588235)
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tklej"]
|
|
||||||
bg_color = Color(0.2, 0.2, 0.2, 0.588235)
|
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_scae6"]
|
|
||||||
bg_color = Color(0.2, 0.2, 0.2, 0.588235)
|
|
||||||
|
|
||||||
[node name="GameMenu" type="Control"]
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
theme = ExtResource("1_xxfb2")
|
|
||||||
script = ExtResource("2_wr0q8")
|
|
||||||
|
|
||||||
[node name="Background" type="Panel" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_pbvm6")
|
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="Background"]
|
|
||||||
modulate = Color(1, 1, 1, 0.305882)
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
texture = ExtResource("3_3rcmp")
|
|
||||||
|
|
||||||
[node name="MenuHeader" type="HBoxContainer" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
offset_left = 304.0
|
|
||||||
offset_right = 1918.0
|
|
||||||
offset_bottom = 82.0
|
|
||||||
alignment = 1
|
|
||||||
|
|
||||||
[node name="ButtonContinue" type="Button" parent="MenuHeader"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "Continue"
|
|
||||||
|
|
||||||
[node name="ButtonSettings" type="Button" parent="MenuHeader"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "Settings"
|
|
||||||
|
|
||||||
[node name="ButtonBackToStartScreen" type="Button" parent="MenuHeader"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "Quitter partie"
|
|
||||||
|
|
||||||
[node name="ButtonReturnDesktop" type="Button" parent="MenuHeader"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "Retour bureau"
|
|
||||||
|
|
||||||
[node name="ButtonMoney" type="Button" parent="MenuHeader"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "Money"
|
|
||||||
|
|
||||||
[node name="Towers" type="VBoxContainer" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
offset_right = 300.0
|
|
||||||
offset_bottom = 722.0
|
|
||||||
|
|
||||||
[node name="ButtonCube" type="Button" parent="Towers"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Cube"
|
|
||||||
|
|
||||||
[node name="TowerButtonPierre" parent="Towers" instance=ExtResource("2_qus6b")]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="TowerButtonAline" parent="Towers" instance=ExtResource("2_qus6b")]
|
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="TowerButtonMaxence" parent="Towers" instance=ExtResource("2_qus6b")]
|
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="TowerButtonAlex" parent="Towers" instance=ExtResource("2_qus6b")]
|
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="TowerButtonGeraldine" parent="Towers" instance=ExtResource("2_qus6b")]
|
|
||||||
visible = false
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="CharacterSheet" type="Control" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
|
|
||||||
[node name="TowerStats" type="Panel" parent="CharacterSheet"]
|
|
||||||
custom_minimum_size = Vector2(800, 512)
|
|
||||||
layout_mode = 0
|
|
||||||
offset_left = 313.0
|
|
||||||
offset_top = 86.0
|
|
||||||
offset_right = 1113.0
|
|
||||||
offset_bottom = 598.0
|
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_yd342")
|
|
||||||
|
|
||||||
[node name="MarginContainer2" type="MarginContainer" parent="CharacterSheet/TowerStats"]
|
|
||||||
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 = 20
|
|
||||||
theme_override_constants/margin_right = 20
|
|
||||||
theme_override_constants/margin_bottom = 20
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="CharacterSheet/TowerStats/MarginContainer2"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
|
|
||||||
[node name="LabelCharacterSheet" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Fiche Perso :
|
|
||||||
FRIANDISE"
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer"]
|
|
||||||
custom_minimum_size = Vector2(0, 40)
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="StatDamage" type="HBoxContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="NameStat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatDamage"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Damage :"
|
|
||||||
|
|
||||||
[node name="Stat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatDamage"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "0"
|
|
||||||
horizontal_alignment = 2
|
|
||||||
|
|
||||||
[node name="StatCooldown" type="HBoxContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="NameStat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatCooldown"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Cooldown :"
|
|
||||||
|
|
||||||
[node name="Stat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatCooldown"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "0"
|
|
||||||
horizontal_alignment = 2
|
|
||||||
|
|
||||||
[node name="StatMaxEnergy" type="HBoxContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="NameStat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatMaxEnergy"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Max Energy :"
|
|
||||||
|
|
||||||
[node name="Stat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatMaxEnergy"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "0"
|
|
||||||
horizontal_alignment = 2
|
|
||||||
|
|
||||||
[node name="StatRegen" type="HBoxContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="NameStat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatRegen"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Energy Regen :"
|
|
||||||
|
|
||||||
[node name="Stat" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/VBoxContainer/StatRegen"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "0"
|
|
||||||
horizontal_alignment = 2
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer"]
|
|
||||||
custom_minimum_size = Vector2(20, 0)
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Bio" type="VBoxContainer" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="BioImage" type="TextureRect" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/Bio"]
|
|
||||||
custom_minimum_size = Vector2(300, 300)
|
|
||||||
layout_mode = 2
|
|
||||||
texture = ExtResource("3_wr0q8")
|
|
||||||
expand_mode = 1
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="CharacterSheet/TowerStats/MarginContainer2/HBoxContainer/Bio"]
|
|
||||||
custom_minimum_size = Vector2(300, 0)
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_vertical = 3
|
|
||||||
theme_override_font_sizes/font_size = 30
|
|
||||||
text = "Aime se promener dans l'herbe et manger des framboises. Sa petite bouille la rend trop mignonne."
|
|
||||||
horizontal_alignment = 1
|
|
||||||
autowrap_mode = 2
|
|
||||||
|
|
||||||
[node name="TowerUpgrades" type="Panel" parent="CharacterSheet"]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 3
|
|
||||||
anchor_left = 1.0
|
|
||||||
anchor_top = 1.0
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
offset_left = -786.0
|
|
||||||
offset_top = -990.0
|
|
||||||
offset_right = -19.0
|
|
||||||
offset_bottom = -28.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
grow_vertical = 0
|
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_tklej")
|
|
||||||
|
|
||||||
[node name="MarginContainer2" type="MarginContainer" parent="CharacterSheet/TowerUpgrades"]
|
|
||||||
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 = 20
|
|
||||||
theme_override_constants/margin_right = 20
|
|
||||||
theme_override_constants/margin_bottom = 20
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="CharacterSheet/TowerUpgrades/MarginContainer2"]
|
|
||||||
layout_mode = 2
|
|
||||||
theme_override_constants/separation = 10
|
|
||||||
|
|
||||||
[node name="Title" type="Label" parent="CharacterSheet/TowerUpgrades/MarginContainer2/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Boutique"
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerUpgrades/MarginContainer2/VBoxContainer"]
|
|
||||||
custom_minimum_size = Vector2(0, 40)
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="UpgradeButton" type="Button" parent="CharacterSheet/TowerUpgrades/MarginContainer2/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Upgrade 1"
|
|
||||||
script = ExtResource("4_3rcmp")
|
|
||||||
metadata/_custom_type_script = "uid://tn3qdhcyaxsg"
|
|
||||||
|
|
||||||
[node name="UpgradeButton2" type="Button" parent="CharacterSheet/TowerUpgrades/MarginContainer2/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Upgrade 2"
|
|
||||||
script = ExtResource("4_3rcmp")
|
|
||||||
metadata/_custom_type_script = "uid://tn3qdhcyaxsg"
|
|
||||||
|
|
||||||
[node name="UpgradeButton3" type="Button" parent="CharacterSheet/TowerUpgrades/MarginContainer2/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Upgrade 3"
|
|
||||||
script = ExtResource("4_3rcmp")
|
|
||||||
metadata/_custom_type_script = "uid://tn3qdhcyaxsg"
|
|
||||||
|
|
||||||
[node name="UpgradeButton4" type="Button" parent="CharacterSheet/TowerUpgrades/MarginContainer2/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Upgrade 4"
|
|
||||||
script = ExtResource("4_3rcmp")
|
|
||||||
metadata/_custom_type_script = "uid://tn3qdhcyaxsg"
|
|
||||||
|
|
||||||
[node name="UpgradeButton5" type="Button" parent="CharacterSheet/TowerUpgrades/MarginContainer2/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Upgrade 5"
|
|
||||||
script = ExtResource("4_3rcmp")
|
|
||||||
metadata/_custom_type_script = "uid://tn3qdhcyaxsg"
|
|
||||||
|
|
||||||
[node name="TowerSkills" type="Panel" parent="CharacterSheet"]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 7
|
|
||||||
anchor_left = 0.5
|
|
||||||
anchor_top = 1.0
|
|
||||||
anchor_right = 0.5
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
offset_left = -646.0
|
|
||||||
offset_top = -471.0
|
|
||||||
offset_right = 153.0
|
|
||||||
offset_bottom = -28.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 0
|
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_scae6")
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerSkills"]
|
|
||||||
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 = 20
|
|
||||||
theme_override_constants/margin_right = 20
|
|
||||||
theme_override_constants/margin_bottom = 20
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="CharacterSheet/TowerSkills/MarginContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Title" type="Label" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Capacités"
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="SkillUI" type="HBoxContainer" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Icone" type="TextureRect" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI"]
|
|
||||||
custom_minimum_size = Vector2(64, 64)
|
|
||||||
layout_mode = 2
|
|
||||||
texture = ExtResource("5_pbvm6")
|
|
||||||
expand_mode = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI"]
|
|
||||||
custom_minimum_size = Vector2(20, 0)
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Bonjour"
|
|
||||||
|
|
||||||
[node name="SkillUI2" type="HBoxContainer" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Icone" type="TextureRect" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI2"]
|
|
||||||
custom_minimum_size = Vector2(64, 64)
|
|
||||||
layout_mode = 2
|
|
||||||
texture = ExtResource("5_pbvm6")
|
|
||||||
expand_mode = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI2"]
|
|
||||||
custom_minimum_size = Vector2(20, 0)
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI2"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Compliments"
|
|
||||||
|
|
||||||
[node name="SkillUI3" type="HBoxContainer" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Icone" type="TextureRect" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI3"]
|
|
||||||
custom_minimum_size = Vector2(64, 64)
|
|
||||||
layout_mode = 2
|
|
||||||
texture = ExtResource("5_pbvm6")
|
|
||||||
expand_mode = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI3"]
|
|
||||||
custom_minimum_size = Vector2(20, 0)
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="CharacterSheet/TowerSkills/MarginContainer/VBoxContainer/SkillUI3"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Cinéphile"
|
|
||||||
|
|
||||||
[connection signal="pressed" from="MenuHeader/ButtonContinue" to="." method="_on_button_continue_pressed"]
|
|
||||||
[connection signal="pressed" from="MenuHeader/ButtonBackToStartScreen" to="." method="_on_button_back_to_start_screen_pressed"]
|
|
||||||
[connection signal="pressed" from="MenuHeader/ButtonReturnDesktop" to="." method="_on_button_return_desktop_pressed"]
|
|
||||||
|
|
@ -29,7 +29,7 @@ window/size/viewport_height=1080
|
||||||
|
|
||||||
[editor_plugins]
|
[editor_plugins]
|
||||||
|
|
||||||
enabled=PackedStringArray("res://addons/signal_lens/plugin.cfg")
|
enabled=PackedStringArray("res://addons/LevelEditor/plugin.cfg", "res://addons/signal_lens/plugin.cfg")
|
||||||
|
|
||||||
[file_customization]
|
[file_customization]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue