Browse Source

:beetle: Fix color mess when having multiple texts

Some data seems to collide. Fix : make local.
DricomDragon 2 years ago
parent
commit
f41fda7bd0

+ 1 - 0
godot/common/components/gdedit/GdScriptEdit.tscn

@@ -39,3 +39,4 @@ deselect_on_focus_loss_enabled = false
 virtual_keyboard_enabled = false
 syntax_highlighter = SubResource("CodeHighlighter_2654d")
 gutters_draw_line_numbers = true
+indent_use_spaces = true

+ 35 - 2
godot/slides/271/ScriptVar.tscn

@@ -3,12 +3,37 @@
 [ext_resource type="Script" path="res://projector/slide/Slide.gd" id="1_srvlz"]
 [ext_resource type="PackedScene" uid="uid://bvrtmyq4g1qes" path="res://common/components/title/title.tscn" id="3_gddvr"]
 [ext_resource type="Texture2D" uid="uid://dpbx5ghf6g5hr" path="res://slides/271/int.svg" id="4_i2xvr"]
-[ext_resource type="PackedScene" uid="uid://dogtm6fdbp3wl" path="res://common/components/gdedit/GdScriptEdit.tscn" id="4_uneks"]
 [ext_resource type="Texture2D" uid="uid://bpjnbtydn70jj" path="res://slides/271/float.svg" id="5_d7ofb"]
 [ext_resource type="Texture2D" uid="uid://bevxu72q6gx6o" path="res://slides/271/bool.svg" id="6_srauc"]
 [ext_resource type="Texture2D" uid="uid://dwlepb4saped1" path="res://slides/271/String.svg" id="7_6fbij"]
 [ext_resource type="Texture2D" uid="uid://by4l3q5rij0pt" path="res://slides/271/PackedStringArray.svg" id="8_ceq0u"]
 
+[sub_resource type="CodeHighlighter" id="CodeHighlighter_2654d"]
+number_color = Color(0.803922, 0, 0.803922, 1)
+symbol_color = Color(0, 0, 1, 1)
+function_color = Color(0, 0.615686, 0, 1)
+member_variable_color = Color(0.8, 0.5, 0, 1)
+keyword_colors = {
+"InputEvent": Color(0, 0.4, 0, 1),
+"RigidBody2D": Color(0, 0.4, 0, 1),
+"String": Color(0, 0.4, 0, 1),
+"Vector2": Color(0, 0.4, 0, 1),
+"and": Color(1, 0, 0, 1),
+"bool": Color(1, 0, 0, 1),
+"class": Color(1, 0, 0, 1),
+"class_name": Color(1, 0, 0, 1),
+"extends": Color(1, 0, 0, 1),
+"float": Color(1, 0, 0, 1),
+"for": Color(1, 0, 0, 1),
+"func": Color(1, 0, 0, 1),
+"if": Color(1, 0, 0, 1),
+"in": Color(1, 0, 0, 1),
+"int": Color(1, 0, 0, 1),
+"return": Color(1, 0, 0, 1),
+"signal": Color(1, 0, 0, 1),
+"var": Color(1, 0, 0, 1)
+}
+
 [node name="ScriptVar" type="Node2D"]
 script = ExtResource("1_srvlz")
 
@@ -19,13 +44,21 @@ offset_right = 1847.0
 offset_bottom = 194.0
 text = "Les variables"
 
-[node name="GdScriptEdit" parent="." instance=ExtResource("4_uneks")]
+[node name="GdScriptEdit" type="CodeEdit" parent="."]
 offset_left = 49.0
 offset_top = 406.0
 offset_right = 1837.0
 offset_bottom = 1063.0
+theme_override_colors/background_color = Color(1, 1, 1, 1)
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 46
 text = "var penguin_speed: float = 50.0
 penguin_speed = penguin_speed + 5"
+deselect_on_focus_loss_enabled = false
+virtual_keyboard_enabled = false
+syntax_highlighter = SubResource("CodeHighlighter_2654d")
+gutters_draw_line_numbers = true
+indent_use_spaces = true
 
 [node name="Int" type="Sprite2D" parent="."]
 position = Vector2(187, 283)

+ 35 - 2
godot/slides/272/ScriptFunc.tscn

@@ -3,9 +3,34 @@
 [ext_resource type="Script" path="res://projector/slide/Slide.gd" id="1_orknp"]
 [ext_resource type="Texture2D" uid="uid://3i6oj4q3qeam" path="res://slides/272/VisualShaderNodeFloatFunc.svg" id="2_kg7eu"]
 [ext_resource type="PackedScene" uid="uid://bvrtmyq4g1qes" path="res://common/components/title/title.tscn" id="3_erhoj"]
-[ext_resource type="PackedScene" uid="uid://dogtm6fdbp3wl" path="res://common/components/gdedit/GdScriptEdit.tscn" id="4_ai8iv"]
 [ext_resource type="PackedScene" uid="uid://b811jddpttnt4" path="res://common/components/subtitle/subtitle.tscn" id="5_g5ffp"]
 
+[sub_resource type="CodeHighlighter" id="CodeHighlighter_2654d"]
+number_color = Color(0.803922, 0, 0.803922, 1)
+symbol_color = Color(0, 0, 1, 1)
+function_color = Color(0, 0.615686, 0, 1)
+member_variable_color = Color(0.8, 0.5, 0, 1)
+keyword_colors = {
+"InputEvent": Color(0, 0.4, 0, 1),
+"RigidBody2D": Color(0, 0.4, 0, 1),
+"String": Color(0, 0.4, 0, 1),
+"Vector2": Color(0, 0.4, 0, 1),
+"and": Color(1, 0, 0, 1),
+"bool": Color(1, 0, 0, 1),
+"class": Color(1, 0, 0, 1),
+"class_name": Color(1, 0, 0, 1),
+"extends": Color(1, 0, 0, 1),
+"float": Color(1, 0, 0, 1),
+"for": Color(1, 0, 0, 1),
+"func": Color(1, 0, 0, 1),
+"if": Color(1, 0, 0, 1),
+"in": Color(1, 0, 0, 1),
+"int": Color(1, 0, 0, 1),
+"return": Color(1, 0, 0, 1),
+"signal": Color(1, 0, 0, 1),
+"var": Color(1, 0, 0, 1)
+}
+
 [node name="ScriptFunc" type="Node2D"]
 script = ExtResource("1_orknp")
 
@@ -21,11 +46,14 @@ offset_right = 1847.0
 offset_bottom = 194.0
 text = "Les fonctions"
 
-[node name="GdScriptEdit" parent="." instance=ExtResource("4_ai8iv")]
+[node name="GdScriptEdit" type="CodeEdit" parent="."]
 offset_left = 52.0
 offset_top = 207.0
 offset_right = 1346.0
 offset_bottom = 942.0
+theme_override_colors/background_color = Color(1, 1, 1, 1)
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 46
 text = "func _ready():
 	var penguin_speed: float = 40.0 # km/h
 	penguin_speed = accelerate(penguin_speed)
@@ -35,6 +63,11 @@ text = "func _ready():
 func accelerate(initial_speed: float) -> float:
 	var new_speed: float = initial_speed + 2.0
 	return new_speed"
+deselect_on_focus_loss_enabled = false
+virtual_keyboard_enabled = false
+syntax_highlighter = SubResource("CodeHighlighter_2654d")
+gutters_draw_line_numbers = true
+indent_use_spaces = true
 
 [node name="Subtitle" parent="." instance=ExtResource("5_g5ffp")]
 offset_left = 57.0

+ 35 - 2
godot/slides/273/ScriptControl.tscn

@@ -3,7 +3,32 @@
 [ext_resource type="Script" path="res://projector/slide/Slide.gd" id="1_kycmz"]
 [ext_resource type="Texture2D" uid="uid://b3s3m808k1wij" path="res://slides/273/Loop.svg" id="2_lqnb1"]
 [ext_resource type="PackedScene" uid="uid://bvrtmyq4g1qes" path="res://common/components/title/title.tscn" id="3_lmauo"]
-[ext_resource type="PackedScene" uid="uid://dogtm6fdbp3wl" path="res://common/components/gdedit/GdScriptEdit.tscn" id="4_ia6x0"]
+
+[sub_resource type="CodeHighlighter" id="CodeHighlighter_2654d"]
+number_color = Color(0.803922, 0, 0.803922, 1)
+symbol_color = Color(0, 0, 1, 1)
+function_color = Color(0, 0.615686, 0, 1)
+member_variable_color = Color(0.8, 0.5, 0, 1)
+keyword_colors = {
+"InputEvent": Color(0, 0.4, 0, 1),
+"RigidBody2D": Color(0, 0.4, 0, 1),
+"String": Color(0, 0.4, 0, 1),
+"Vector2": Color(0, 0.4, 0, 1),
+"and": Color(1, 0, 0, 1),
+"bool": Color(1, 0, 0, 1),
+"class": Color(1, 0, 0, 1),
+"class_name": Color(1, 0, 0, 1),
+"extends": Color(1, 0, 0, 1),
+"float": Color(1, 0, 0, 1),
+"for": Color(1, 0, 0, 1),
+"func": Color(1, 0, 0, 1),
+"if": Color(1, 0, 0, 1),
+"in": Color(1, 0, 0, 1),
+"int": Color(1, 0, 0, 1),
+"return": Color(1, 0, 0, 1),
+"signal": Color(1, 0, 0, 1),
+"var": Color(1, 0, 0, 1)
+}
 
 [node name="ScriptControl" type="Node2D"]
 script = ExtResource("1_kycmz")
@@ -21,11 +46,14 @@ offset_right = 1847.0
 offset_bottom = 194.0
 text = "Les structures de contrôle"
 
-[node name="GdScriptEdit" parent="." instance=ExtResource("4_ia6x0")]
+[node name="GdScriptEdit" type="CodeEdit" parent="."]
 offset_left = 58.0
 offset_top = 268.0
 offset_right = 1435.0
 offset_bottom = 1050.0
+theme_override_colors/background_color = Color(1, 1, 1, 1)
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 46
 text = "func _ready():
 	var penguin_speed: float = 40.0 # km/h
 	for increment in range(4):
@@ -36,3 +64,8 @@ text = "func _ready():
 func accelerate(initial_speed: float) -> float:
 	var new_speed: float = initial_speed + 2.0
 	return new_speed"
+deselect_on_focus_loss_enabled = false
+virtual_keyboard_enabled = false
+syntax_highlighter = SubResource("CodeHighlighter_2654d")
+gutters_draw_line_numbers = true
+indent_use_spaces = true

+ 35 - 2
godot/slides/274/ScriptOOP.tscn

@@ -3,9 +3,34 @@
 [ext_resource type="Script" path="res://projector/slide/Slide.gd" id="1_wmeyv"]
 [ext_resource type="Texture2D" uid="uid://ow45ugvbarxo" path="res://slides/274/ResourcePreloader.svg" id="2_uose8"]
 [ext_resource type="PackedScene" uid="uid://bvrtmyq4g1qes" path="res://common/components/title/title.tscn" id="3_corcb"]
-[ext_resource type="PackedScene" uid="uid://dogtm6fdbp3wl" path="res://common/components/gdedit/GdScriptEdit.tscn" id="4_t16pa"]
 [ext_resource type="Texture2D" uid="uid://bo1tq5h0gwnik" path="res://slides/274/editor_gd4_inheritance_rigidbody.png" id="5_sq1r2"]
 
+[sub_resource type="CodeHighlighter" id="CodeHighlighter_2654d"]
+number_color = Color(0.803922, 0, 0.803922, 1)
+symbol_color = Color(0, 0, 1, 1)
+function_color = Color(0, 0.615686, 0, 1)
+member_variable_color = Color(0.8, 0.5, 0, 1)
+keyword_colors = {
+"InputEvent": Color(0, 0.4, 0, 1),
+"RigidBody2D": Color(0, 0.4, 0, 1),
+"String": Color(0, 0.4, 0, 1),
+"Vector2": Color(0, 0.4, 0, 1),
+"and": Color(1, 0, 0, 1),
+"bool": Color(1, 0, 0, 1),
+"class": Color(1, 0, 0, 1),
+"class_name": Color(1, 0, 0, 1),
+"extends": Color(1, 0, 0, 1),
+"float": Color(1, 0, 0, 1),
+"for": Color(1, 0, 0, 1),
+"func": Color(1, 0, 0, 1),
+"if": Color(1, 0, 0, 1),
+"in": Color(1, 0, 0, 1),
+"int": Color(1, 0, 0, 1),
+"return": Color(1, 0, 0, 1),
+"signal": Color(1, 0, 0, 1),
+"var": Color(1, 0, 0, 1)
+}
+
 [node name="ScriptOOP" type="Node2D"]
 script = ExtResource("1_wmeyv")
 
@@ -21,11 +46,14 @@ offset_right = 860.0
 offset_bottom = 196.0
 text = "Orienté objet"
 
-[node name="GdScriptEdit" parent="." instance=ExtResource("4_t16pa")]
+[node name="GdScriptEdit" type="CodeEdit" parent="."]
 offset_left = 1011.0
 offset_top = 18.0
 offset_right = 1895.0
 offset_bottom = 1064.0
+theme_override_colors/background_color = Color(1, 1, 1, 1)
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 46
 text = "class_name Penguin
 extends RigidBody2D
 # My amazing main character
@@ -41,6 +69,11 @@ func _ready():
 
 func accelerate() -> void:
 	speed = speed + 2.0"
+deselect_on_focus_loss_enabled = false
+virtual_keyboard_enabled = false
+syntax_highlighter = SubResource("CodeHighlighter_2654d")
+gutters_draw_line_numbers = true
+indent_use_spaces = true
 
 [node name="Inheritance" type="Sprite2D" parent="."]
 position = Vector2(447.5, 641.8)

+ 35 - 2
godot/slides/282/ParaCallback.tscn

@@ -3,7 +3,32 @@
 [ext_resource type="Script" path="res://projector/slide/Slide.gd" id="1_tzxtk"]
 [ext_resource type="Texture2D" uid="uid://1tra3dik14uq" path="res://slides/282/AudioListener2D.svg" id="2_xo4iv"]
 [ext_resource type="PackedScene" uid="uid://bvrtmyq4g1qes" path="res://common/components/title/title.tscn" id="3_aevos"]
-[ext_resource type="PackedScene" uid="uid://dogtm6fdbp3wl" path="res://common/components/gdedit/GdScriptEdit.tscn" id="4_h8f6o"]
+
+[sub_resource type="CodeHighlighter" id="CodeHighlighter_2654d"]
+number_color = Color(0.803922, 0, 0.803922, 1)
+symbol_color = Color(0, 0, 1, 1)
+function_color = Color(0, 0.615686, 0, 1)
+member_variable_color = Color(0.8, 0.5, 0, 1)
+keyword_colors = {
+"InputEvent": Color(0, 0.4, 0, 1),
+"RigidBody2D": Color(0, 0.4, 0, 1),
+"String": Color(0, 0.4, 0, 1),
+"Vector2": Color(0, 0.4, 0, 1),
+"and": Color(1, 0, 0, 1),
+"bool": Color(1, 0, 0, 1),
+"class": Color(1, 0, 0, 1),
+"class_name": Color(1, 0, 0, 1),
+"extends": Color(1, 0, 0, 1),
+"float": Color(1, 0, 0, 1),
+"for": Color(1, 0, 0, 1),
+"func": Color(1, 0, 0, 1),
+"if": Color(1, 0, 0, 1),
+"in": Color(1, 0, 0, 1),
+"int": Color(1, 0, 0, 1),
+"return": Color(1, 0, 0, 1),
+"signal": Color(1, 0, 0, 1),
+"var": Color(1, 0, 0, 1)
+}
 
 [node name="ParaCallback" type="Node2D"]
 script = ExtResource("1_tzxtk")
@@ -20,11 +45,14 @@ offset_right = 1847.0
 offset_bottom = 194.0
 text = "Écoutez votre moteur"
 
-[node name="GdScriptEdit" parent="." instance=ExtResource("4_h8f6o")]
+[node name="GdScriptEdit" type="CodeEdit" parent="."]
 offset_left = 45.0
 offset_top = 289.0
 offset_right = 1469.0
 offset_bottom = 1036.0
+theme_override_colors/background_color = Color(1, 1, 1, 1)
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 46
 text = "func _ready() -> void:
 	speed = 0
 
@@ -35,3 +63,8 @@ func _unhandled_key_input(event: InputEvent) -> void:
 	if event.is_action(\"ui_accept\") and event.is_pressed():
 		apply_impulse(Vector2.UP)
 		get_viewport().set_input_as_handled()"
+deselect_on_focus_loss_enabled = false
+virtual_keyboard_enabled = false
+syntax_highlighter = SubResource("CodeHighlighter_2654d")
+gutters_draw_line_numbers = true
+indent_use_spaces = true

+ 36 - 2
godot/slides/283/ParaSignal.tscn

@@ -1,4 +1,4 @@
-[gd_scene load_steps=7 format=3 uid="uid://drh3sqivyydkj"]
+[gd_scene load_steps=8 format=3 uid="uid://drh3sqivyydkj"]
 
 [ext_resource type="Script" path="res://projector/slide/Slide.gd" id="1_pgpic"]
 [ext_resource type="PackedScene" uid="uid://dogtm6fdbp3wl" path="res://common/components/gdedit/GdScriptEdit.tscn" id="3_3pelu"]
@@ -7,6 +7,32 @@
 [ext_resource type="Texture2D" uid="uid://cs0ev7fsrh2wd" path="res://slides/283/Signal.svg" id="5_15k1w"]
 [ext_resource type="PackedScene" uid="uid://b811jddpttnt4" path="res://common/components/subtitle/subtitle.tscn" id="6_t25x4"]
 
+[sub_resource type="CodeHighlighter" id="CodeHighlighter_2654d"]
+number_color = Color(0.803922, 0, 0.803922, 1)
+symbol_color = Color(0, 0, 1, 1)
+function_color = Color(0, 0.615686, 0, 1)
+member_variable_color = Color(0.8, 0.5, 0, 1)
+keyword_colors = {
+"InputEvent": Color(0, 0.4, 0, 1),
+"RigidBody2D": Color(0, 0.4, 0, 1),
+"String": Color(0, 0.4, 0, 1),
+"Vector2": Color(0, 0.4, 0, 1),
+"and": Color(1, 0, 0, 1),
+"bool": Color(1, 0, 0, 1),
+"class": Color(1, 0, 0, 1),
+"class_name": Color(1, 0, 0, 1),
+"extends": Color(1, 0, 0, 1),
+"float": Color(1, 0, 0, 1),
+"for": Color(1, 0, 0, 1),
+"func": Color(1, 0, 0, 1),
+"if": Color(1, 0, 0, 1),
+"in": Color(1, 0, 0, 1),
+"int": Color(1, 0, 0, 1),
+"return": Color(1, 0, 0, 1),
+"signal": Color(1, 0, 0, 1),
+"var": Color(1, 0, 0, 1)
+}
+
 [node name="ParaSignal" type="Node2D"]
 script = ExtResource("1_pgpic")
 
@@ -17,11 +43,14 @@ offset_right = 1852.0
 offset_bottom = 186.0
 text = "Reliez vos nœuds"
 
-[node name="GdScriptSignalEmit" parent="." instance=ExtResource("3_3pelu")]
+[node name="GdScriptSignalEmit" type="CodeEdit" parent="."]
 offset_left = 31.0
 offset_top = 21.0
 offset_right = 771.0
 offset_bottom = 626.0
+theme_override_colors/background_color = Color(1, 1, 1, 1)
+theme_override_colors/font_color = Color(0, 0, 0, 1)
+theme_override_font_sizes/font_size = 46
 text = "class_name Penguin
 
 signal took_off
@@ -29,6 +58,11 @@ signal took_off
 func _process():
 	if linear_velocity.x > 42:
 		took_off.emit()"
+deselect_on_focus_loss_enabled = false
+virtual_keyboard_enabled = false
+syntax_highlighter = SubResource("CodeHighlighter_2654d")
+gutters_draw_line_numbers = true
+indent_use_spaces = true
 
 [node name="SignalSend" type="Sprite2D" parent="."]
 modulate = Color(0, 1, 0, 1)