Wire up UI in Godot 4: fonts, translations, layout, fog, shadow
Discovered while playtesting the migrated build. Each fix has a specific Godot-3-to-4 cause that the --convert-3to4 tool did not catch. Fonts: - Replace 4 .tres font wrappers (MKX_Base, kirsty_base/medium/title) with FontVariation pointing at the .otf/.ttf source. Godot 3 DynamicFont with size= and font_data= is invalid in Godot 4 (those properties don't exist on FontFile). - Apply size 46 via theme_override_font_sizes/font_size on the 5 Labels that used kirsty_title.tres (LabelLoading + 4 in Summary). - Drop the broken VisualShader text_outline.material from the 4 Labels in Summary — Index p_from_port errors in Godot 4 meant COLOR was never written, so text rendered invisible. - Migrate VisualShader nodes inside text_outline.material (compressed asset; updated by the inspect/migrate scripts). Translations: - Move project.godot section from [locale] (Godot 3) to [internationalization] with locale/translations=... (Godot 4). The old section was silently ignored so tr() returned the raw msgid. - Adjust Setting.translate_int_to_locale to return "en"/"fr" to match what the .po files declare (was "en_GB"/"fr_FR", which Godot 3 fell back from automatically but Godot 4 does not). Label alignment (Godot 3 names not auto-renamed): - align -> horizontal_alignment, valign -> vertical_alignment across 9 .tscn files. Background / Loading / ChooseScene layout: - Rewrite Background.tscn from a VisualShader-textured Panel to a plain TextureRect (the visual shader connection ports went out of bounds in Godot 4, leaving the panel grey on scene reload). - Set layout_mode=1 + anchors_preset=15 on BackgroundPicture instances in Main.tscn and Loading.tscn — Godot 4 inheritance no longer applies the .tscn-root's anchors to an instanced child unless layout_mode is set to Anchors mode explicitly. - Replace scroll_horizontal_enabled (Godot 3) with horizontal_scroll_mode/vertical_scroll_mode (Godot 4) on ChooseScene's ScrollContainer. - Add theme_override_styles/panel = StyleBoxEmpty on the ScrollContainer (Godot 4 ScrollContainer ships a default dark panel style that Godot 3 did not). - Hide BackgroundTile in Template.tscn — it points at UI-level-btn-shadow.png (228x228, 83% opaque black) which used to render at natural size in Godot 3 but is stretched to fill the 456px rect in Godot 4, leaving a big black square below each thumbnail. The proper drop-shadow needs a shader or 9-patch. - TextureRect.expand=true (Godot 3) -> expand_mode=1 (Godot 4) on ThumbnailLevel and TopPart's content rects. Lighting: - background_mode 3 (which used to mean Sky in Godot 3) -> 2 (Sky in Godot 4; 3 is now Canvas, producing a black background). - background_sky -> sky, background_energy -> background_energy_multiplier, fog_color -> fog_light_color, fog_height_min -> fog_height; drop fog_height_enabled / fog_height_max / fog_height_curve / dof_blur_far_distance (no longer exist). - Add fog_mode = 1 so Godot 4 uses fog_depth_* instead of the new default fog_density-based exponential fog (which rendered as a thick white cloud). - ambient_light_energy 1.55 -> 0.4 — the new pipeline interprets the value much more strongly so 1.55 produced a saturated pink scene. - Remove the light_data = ExtResource(41) reference to WarCraft.lmbake — Godot 3 baked lightmap binary format is incompatible with Godot 4. Re-bake in editor when ready. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
[gd_resource type="FontFile" load_steps=2 format=2]
|
[gd_resource type="FontVariation" load_steps=2 format=3]
|
||||||
|
|
||||||
[ext_resource path="res://assets/fonts/MKX Title.ttf" type="FontFile" id=1]
|
[ext_resource type="FontFile" path="res://assets/fonts/MKX Title.ttf" id="1"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
size = 30
|
base_font = ExtResource("1")
|
||||||
font_data = ExtResource( 1 )
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
[gd_resource type="FontFile" load_steps=2 format=2]
|
[gd_resource type="FontVariation" load_steps=2 format=3]
|
||||||
|
|
||||||
[ext_resource path="res://assets/fonts/kirsty/kirsty rg.otf" type="FontFile" id=1]
|
[ext_resource type="FontFile" path="res://assets/fonts/kirsty/kirsty rg.otf" id="1"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
use_mipmaps = true
|
base_font = ExtResource("1")
|
||||||
use_filter = true
|
|
||||||
font_data = ExtResource( 1 )
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
[gd_resource type="FontFile" load_steps=2 format=2]
|
[gd_resource type="FontVariation" load_steps=2 format=3]
|
||||||
|
|
||||||
[ext_resource path="res://assets/fonts/kirsty/kirsty rg.otf" type="FontFile" id=1]
|
[ext_resource type="FontFile" path="res://assets/fonts/kirsty/kirsty rg.otf" id="1"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
size = 24
|
base_font = ExtResource("1")
|
||||||
use_mipmaps = true
|
|
||||||
use_filter = true
|
|
||||||
font_data = ExtResource( 1 )
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
[gd_resource type="FontFile" load_steps=2 format=2]
|
[gd_resource type="FontVariation" load_steps=2 format=3]
|
||||||
|
|
||||||
[ext_resource path="res://assets/fonts/kirsty/kirsty bd.otf" type="FontFile" id=1]
|
[ext_resource type="FontFile" path="res://assets/fonts/kirsty/kirsty bd.otf" id="1"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
size = 46
|
base_font = ExtResource("1")
|
||||||
use_mipmaps = true
|
|
||||||
use_filter = true
|
|
||||||
font_data = ExtResource( 1 )
|
|
||||||
|
|||||||
Binary file not shown.
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
[gd_resource type="Environment" load_steps=2 format=2]
|
[gd_resource type="Environment" format=3 uid="uid://d4hsnlx822e4k"]
|
||||||
|
|
||||||
[sub_resource type="Sky" id=1]
|
[sub_resource type="Sky" id="1"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
background_mode = 2
|
background_mode = 2
|
||||||
background_sky = SubResource( 1 )
|
sky = SubResource("1")
|
||||||
|
|||||||
+2
-2
@@ -63,9 +63,9 @@ ui_end={
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
[locale]
|
[internationalization]
|
||||||
|
|
||||||
translations=PackedStringArray("res://locales/fr.po", "res://locales/en.po")
|
locale/translations=PackedStringArray("res://locales/fr.po", "res://locales/en.po")
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
|||||||
+72
-45
@@ -1,83 +1,110 @@
|
|||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene format=3 uid="uid://demg4xk7vofmg"]
|
||||||
|
|
||||||
[ext_resource path="res://scenes/Main.gd" type="Script" id=1]
|
[ext_resource type="Script" uid="uid://by2coyg8u0u67" path="res://scenes/Main.gd" id="1"]
|
||||||
[ext_resource path="res://scenes/UI/background/Background.tscn" type="PackedScene" id=5]
|
[ext_resource type="PackedScene" path="res://scenes/UI/background/Background.tscn" id="5"]
|
||||||
[ext_resource path="res://scenes/UI/summary/Summary.tscn" type="PackedScene" id=8]
|
[ext_resource type="PackedScene" path="res://scenes/UI/summary/Summary.tscn" id="8"]
|
||||||
|
|
||||||
[node name="Main" type="Control"]
|
[node name="Main" type="Control" unique_id=1146227135]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
script = ExtResource( 1 )
|
grow_horizontal = 2
|
||||||
__meta__ = {
|
grow_vertical = 2
|
||||||
"_edit_lock_": true,
|
script = ExtResource("1")
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="BackgroundPicture" parent="." instance=ExtResource( 5 )]
|
[node name="BackgroundPicture" parent="." unique_id=1341502133 instance=ExtResource("5")]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1339792323]
|
||||||
|
layout_mode = 0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer" unique_id=986370711]
|
||||||
offset_right = 1280.0
|
layout_mode = 2
|
||||||
offset_bottom = 720.0
|
|
||||||
|
|
||||||
[node name="UI_summary" parent="MarginContainer/HBoxContainer" instance=ExtResource( 8 )]
|
[node name="UI_summary" parent="MarginContainer/HBoxContainer" unique_id=1690362681 instance=ExtResource("8")]
|
||||||
anchor_bottom = 0.0
|
layout_mode = 2
|
||||||
offset_right = 446.0
|
|
||||||
offset_bottom = 720.0
|
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
|
||||||
[node name="PanelWood" parent="MarginContainer/HBoxContainer/UI_summary" index="0"]
|
[node name="PanelWood" parent="MarginContainer/HBoxContainer/UI_summary" index="0"]
|
||||||
offset_bottom = 720.0
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood" index="0"]
|
||||||
|
layout_mode = 0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
|
||||||
[node name="CenterContainer" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="0"]
|
[node name="CenterContainer" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="0"]
|
||||||
offset_bottom = 128.0
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="TextureRect" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/CenterContainer" index="0"]
|
[node name="TextureRect" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/CenterContainer" index="0"]
|
||||||
offset_top = 0.0
|
layout_mode = 2
|
||||||
offset_bottom = 128.0
|
|
||||||
|
|
||||||
[node name="ButtonPuzzle" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="1"]
|
[node name="ButtonPuzzle" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="1"]
|
||||||
offset_top = 158.0
|
layout_mode = 2
|
||||||
offset_bottom = 235.0
|
|
||||||
|
[node name="Label" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonPuzzle" index="0"]
|
||||||
|
layout_mode = 0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
offset_right = 1.0
|
||||||
|
offset_bottom = 23.0
|
||||||
|
grow_horizontal = 1
|
||||||
|
grow_vertical = 1
|
||||||
|
|
||||||
[node name="ButtonSetting" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="2"]
|
[node name="ButtonSetting" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="2"]
|
||||||
offset_top = 265.0
|
layout_mode = 2
|
||||||
offset_bottom = 342.0
|
|
||||||
|
[node name="Label" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonSetting" index="0"]
|
||||||
|
layout_mode = 0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
|
||||||
[node name="ButtonCredits" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="3"]
|
[node name="ButtonCredits" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="3"]
|
||||||
offset_top = 372.0
|
layout_mode = 2
|
||||||
offset_bottom = 449.0
|
|
||||||
|
[node name="Label" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonCredits" index="0"]
|
||||||
|
layout_mode = 0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
|
||||||
[node name="MarginContainer" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="4"]
|
[node name="MarginContainer" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="4"]
|
||||||
offset_top = 479.0
|
layout_mode = 2
|
||||||
offset_bottom = 533.0
|
|
||||||
|
|
||||||
[node name="ButtonQuit" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="5"]
|
[node name="ButtonQuit" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="5"]
|
||||||
offset_top = 563.0
|
layout_mode = 2
|
||||||
offset_bottom = 640.0
|
|
||||||
|
[node name="Label" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ButtonQuit" index="0"]
|
||||||
|
layout_mode = 0
|
||||||
|
anchor_right = 0.0
|
||||||
|
anchor_bottom = 0.0
|
||||||
|
|
||||||
[node name="ContainerVersion" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="6"]
|
[node name="ContainerVersion" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="6"]
|
||||||
offset_top = 670.0
|
layout_mode = 2
|
||||||
offset_bottom = 690.0
|
|
||||||
|
[node name="MarginLeft" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ContainerVersion" index="0"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="LabelVersion" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ContainerVersion" index="1"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="MarginRight" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer/ContainerVersion" index="2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="MarginContainerBottom" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="7"]
|
[node name="MarginContainerBottom" parent="MarginContainer/HBoxContainer/UI_summary/PanelWood/VBoxContainer" index="7"]
|
||||||
offset_top = 720.0
|
layout_mode = 2
|
||||||
offset_bottom = 720.0
|
|
||||||
|
|
||||||
[node name="TextureRect" parent="MarginContainer/HBoxContainer/UI_summary" index="1"]
|
[node name="TextureRect" parent="MarginContainer/HBoxContainer/UI_summary" index="1"]
|
||||||
offset_bottom = 720.0
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"]
|
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer" unique_id=1017122368]
|
||||||
offset_left = 450.0
|
layout_mode = 2
|
||||||
offset_right = 1280.0
|
|
||||||
offset_bottom = 720.0
|
|
||||||
size_flags_horizontal = 7
|
size_flags_horizontal = 7
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +1,10 @@
|
|||||||
[gd_scene load_steps=7 format=2]
|
[gd_scene load_steps=2 format=3]
|
||||||
|
|
||||||
[ext_resource path="res://assets/ui/themes/bck.jpg" type="Texture2D" id=1]
|
[ext_resource type="Texture2D" path="res://assets/ui/themes/bck.jpg" id="1"]
|
||||||
|
|
||||||
[sub_resource type="VisualShaderNodeInput" id=1]
|
[node name="BackgroundPicture" type="TextureRect"]
|
||||||
input_name = "screen_uv"
|
|
||||||
|
|
||||||
[sub_resource type="VisualShaderNodeTexture" id=2]
|
|
||||||
texture = ExtResource( 1 )
|
|
||||||
texture_type = 1
|
|
||||||
|
|
||||||
[sub_resource type="VisualShaderNodeInput" id=3]
|
|
||||||
input_name = "screen_texture"
|
|
||||||
|
|
||||||
[sub_resource type="VisualShader" id=4]
|
|
||||||
code = "shader_type canvas_item;
|
|
||||||
uniform sampler2D tex_frg_4 : source_color;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void vertex() {
|
|
||||||
// Output:0
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void fragment() {
|
|
||||||
// Texture:4
|
|
||||||
vec4 tex_frg_4_read = texture(tex_frg_4, UV.xy);
|
|
||||||
vec3 n_out4p0 = tex_frg_4_read.rgb;
|
|
||||||
float n_out4p1 = tex_frg_4_read.a;
|
|
||||||
|
|
||||||
// Output:0
|
|
||||||
COLOR.rgb = n_out4p0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void light() {
|
|
||||||
// Output:0
|
|
||||||
|
|
||||||
}
|
|
||||||
"
|
|
||||||
graph_offset = Vector2( -1049.92, -300 )
|
|
||||||
mode = 1
|
|
||||||
flags/light_only = false
|
|
||||||
nodes/fragment/3/node = SubResource( 1 )
|
|
||||||
nodes/fragment/3/position = Vector2( -840, 460 )
|
|
||||||
nodes/fragment/4/node = SubResource( 2 )
|
|
||||||
nodes/fragment/4/position = Vector2( -80, 60 )
|
|
||||||
nodes/fragment/5/node = SubResource( 3 )
|
|
||||||
nodes/fragment/5/position = Vector2( -1000, 20 )
|
|
||||||
nodes/fragment/connections = PackedInt32Array( 4, 0, 0, 0 )
|
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=5]
|
|
||||||
shader = SubResource( 4 )
|
|
||||||
|
|
||||||
[node name="BackgroundPicture" type="Panel"]
|
|
||||||
material = SubResource( 5 )
|
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
__meta__ = {
|
texture = ExtResource("1")
|
||||||
"_edit_use_anchors_": false
|
expand_mode = 1
|
||||||
}
|
stretch_mode = 6
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
[gd_scene load_steps=2 format=2]
|
[gd_scene load_steps=3 format=3]
|
||||||
|
|
||||||
[ext_resource path="res://scenes/UI/choose_scenes/ChooseScene.gd" type="Script" id=1]
|
[ext_resource type="Script" path="res://scenes/UI/choose_scenes/ChooseScene.gd" id="1"]
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxEmpty" id="EmptyPanel"]
|
||||||
|
|
||||||
[node name="ChooseScene" type="ScrollContainer"]
|
[node name="ChooseScene" type="ScrollContainer"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
scroll_horizontal_enabled = false
|
horizontal_scroll_mode = 0
|
||||||
script = ExtResource( 1 )
|
vertical_scroll_mode = 0
|
||||||
|
theme_override_styles/panel = SubResource("EmptyPanel")
|
||||||
|
script = ExtResource("1")
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="BackgroundTile" type="TextureRect" parent="."]
|
[node name="BackgroundTile" type="TextureRect" parent="."]
|
||||||
|
visible = false
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
anchor_right = 0.5
|
anchor_right = 0.5
|
||||||
offset_left = -114.0
|
offset_left = -114.0
|
||||||
@@ -100,7 +101,7 @@ offset_right = 204.0
|
|||||||
offset_bottom = 203.0
|
offset_bottom = 203.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
expand = true
|
expand_mode = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
@@ -112,7 +113,7 @@ offset_right = 204.0
|
|||||||
offset_bottom = 203.0
|
offset_bottom = 203.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
expand = true
|
expand_mode = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
@@ -164,8 +165,8 @@ size_flags_horizontal = 3
|
|||||||
size_flags_vertical = 7
|
size_flags_vertical = 7
|
||||||
theme_override_fonts/font = ExtResource( 1 )
|
theme_override_fonts/font = ExtResource( 1 )
|
||||||
text = "X / 10"
|
text = "X / 10"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ text = "aHog !!!
|
|||||||
|
|
||||||
|
|
||||||
bravo vous avez gagné."
|
bravo vous avez gagné."
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
|
|
||||||
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
|
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="BackgroundPicture" parent="." instance=ExtResource( 3 )]
|
[node name="BackgroundPicture" parent="." instance=ExtResource( 3 )]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
|
||||||
[node name="LoadingTopBorder" parent="." instance=ExtResource( 2 )]
|
[node name="LoadingTopBorder" parent="." instance=ExtResource( 2 )]
|
||||||
offset_top = 0.362091
|
offset_top = 0.362091
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ __meta__ = {
|
|||||||
offset_right = 193.0
|
offset_right = 193.0
|
||||||
offset_bottom = 56.0
|
offset_bottom = 56.0
|
||||||
theme_override_fonts/font = ExtResource( 1 )
|
theme_override_fonts/font = ExtResource( 1 )
|
||||||
|
theme_override_font_sizes/font_size = 46
|
||||||
theme_override_colors/font_color = Color( 0.74902, 0.701961, 0.65098, 1 )
|
theme_override_colors/font_color = Color( 0.74902, 0.701961, 0.65098, 1 )
|
||||||
text = "loading"
|
text = "loading"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 2
|
vertical_alignment = 2
|
||||||
uppercase = true
|
uppercase = true
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ offset_bottom = 480.0
|
|||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
texture = ExtResource( 3 )
|
texture = ExtResource( 3 )
|
||||||
expand = true
|
expand_mode = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ __meta__ = {
|
|||||||
offset_right = 50.0
|
offset_right = 50.0
|
||||||
offset_bottom = 14.0
|
offset_bottom = 14.0
|
||||||
text = "langue :"
|
text = "langue :"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="data" type="ItemList" parent="VBoxContainer/langue/VBoxContainer"]
|
[node name="data" type="ItemList" parent="VBoxContainer/langue/VBoxContainer"]
|
||||||
offset_top = 18.0
|
offset_top = 18.0
|
||||||
@@ -73,7 +73,7 @@ text = "gyroscope :"
|
|||||||
offset_left = 77.0
|
offset_left = 77.0
|
||||||
offset_right = 153.0
|
offset_right = 153.0
|
||||||
offset_bottom = 40.0
|
offset_bottom = 40.0
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="ambient_sound" type="CenterContainer" parent="VBoxContainer"]
|
[node name="ambient_sound" type="CenterContainer" parent="VBoxContainer"]
|
||||||
offset_top = 75.0
|
offset_top = 75.0
|
||||||
|
|||||||
@@ -228,7 +228,6 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonPuzzle"]
|
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonPuzzle"]
|
||||||
material = ExtResource( 6 )
|
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
@@ -236,9 +235,10 @@ grow_vertical = 2
|
|||||||
size_flags_horizontal = 7
|
size_flags_horizontal = 7
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_fonts/font = ExtResource( 4 )
|
theme_override_fonts/font = ExtResource( 4 )
|
||||||
|
theme_override_font_sizes/font_size = 46
|
||||||
text = "Puzzles"
|
text = "Puzzles"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false,
|
"_edit_use_anchors_": false,
|
||||||
"_editor_description_": ""
|
"_editor_description_": ""
|
||||||
@@ -259,16 +259,16 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonSetting"]
|
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonSetting"]
|
||||||
material = ExtResource( 6 )
|
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
size_flags_horizontal = 7
|
size_flags_horizontal = 7
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_fonts/font = ExtResource( 4 )
|
theme_override_fonts/font = ExtResource( 4 )
|
||||||
|
theme_override_font_sizes/font_size = 46
|
||||||
theme_override_colors/font_color = Color( 0, 0, 0, 1 )
|
theme_override_colors/font_color = Color( 0, 0, 0, 1 )
|
||||||
text = "Paramètres"
|
text = "Paramètres"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false,
|
"_edit_use_anchors_": false,
|
||||||
"_editor_description_": ""
|
"_editor_description_": ""
|
||||||
@@ -289,16 +289,16 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonCredits"]
|
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonCredits"]
|
||||||
material = ExtResource( 6 )
|
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
size_flags_horizontal = 7
|
size_flags_horizontal = 7
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_fonts/font = ExtResource( 4 )
|
theme_override_fonts/font = ExtResource( 4 )
|
||||||
|
theme_override_font_sizes/font_size = 46
|
||||||
theme_override_colors/font_color = Color( 0, 0, 0, 1 )
|
theme_override_colors/font_color = Color( 0, 0, 0, 1 )
|
||||||
text = "Crédits"
|
text = "Crédits"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false,
|
"_edit_use_anchors_": false,
|
||||||
"_editor_description_": ""
|
"_editor_description_": ""
|
||||||
@@ -324,16 +324,16 @@ __meta__ = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonQuit"]
|
[node name="Label" type="Label" parent="PanelWood/VBoxContainer/ButtonQuit"]
|
||||||
material = ExtResource( 6 )
|
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
size_flags_horizontal = 7
|
size_flags_horizontal = 7
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_fonts/font = ExtResource( 4 )
|
theme_override_fonts/font = ExtResource( 4 )
|
||||||
|
theme_override_font_sizes/font_size = 46
|
||||||
theme_override_colors/font_color = Color( 0, 0, 0, 1 )
|
theme_override_colors/font_color = Color( 0, 0, 0, 1 )
|
||||||
text = "Quit"
|
text = "Quit"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false,
|
"_edit_use_anchors_": false,
|
||||||
"_editor_description_": ""
|
"_editor_description_": ""
|
||||||
@@ -357,7 +357,7 @@ size_flags_vertical = 0
|
|||||||
theme_override_fonts/font = ExtResource( 3 )
|
theme_override_fonts/font = ExtResource( 3 )
|
||||||
theme_override_colors/font_color = Color( 0.741176, 0.478431, 0.372549, 1 )
|
theme_override_colors/font_color = Color( 0.741176, 0.478431, 0.372549, 1 )
|
||||||
text = "v 0.0.0"
|
text = "v 0.0.0"
|
||||||
align = 2
|
horizontal_alignment = 2
|
||||||
|
|
||||||
[node name="MarginRight" type="MarginContainer" parent="PanelWood/VBoxContainer/ContainerVersion"]
|
[node name="MarginRight" type="MarginContainer" parent="PanelWood/VBoxContainer/ContainerVersion"]
|
||||||
offset_left = 338.0
|
offset_left = 338.0
|
||||||
|
|||||||
@@ -7,25 +7,22 @@
|
|||||||
panorama = ExtResource( 2 )
|
panorama = ExtResource( 2 )
|
||||||
|
|
||||||
[sub_resource type="Environment" id=2]
|
[sub_resource type="Environment" id=2]
|
||||||
background_mode = 3
|
background_mode = 2
|
||||||
background_sky = SubResource( 1 )
|
sky = SubResource( 1 )
|
||||||
background_color = Color( 0.188235, 0.133333, 0.133333, 1 )
|
background_color = Color( 0.188235, 0.133333, 0.133333, 1 )
|
||||||
background_energy = 0.6
|
background_energy_multiplier = 0.6
|
||||||
ambient_light_color = Color( 0.694118, 0.168627, 0.67451, 1 )
|
ambient_light_color = Color( 0.694118, 0.168627, 0.67451, 1 )
|
||||||
ambient_light_energy = 1.55
|
ambient_light_energy = 0.4
|
||||||
ambient_light_sky_contribution = 0.5
|
ambient_light_sky_contribution = 0.5
|
||||||
fog_enabled = true
|
fog_enabled = true
|
||||||
fog_color = Color( 0.562167, 0.29, 1, 0.941176 )
|
fog_mode = 1
|
||||||
|
fog_light_color = Color( 0.562167, 0.29, 1, 0.941176 )
|
||||||
fog_depth_begin = 0.0
|
fog_depth_begin = 0.0
|
||||||
fog_depth_end = 60.0
|
fog_depth_end = 60.0
|
||||||
fog_depth_curve = 1.10957
|
fog_depth_curve = 1.10957
|
||||||
fog_height_enabled = true
|
fog_height = 2.0
|
||||||
fog_height_min = 2.0
|
|
||||||
fog_height_max = -20.0
|
|
||||||
fog_height_curve = 0.965936
|
|
||||||
tonemap_mode = 2
|
tonemap_mode = 2
|
||||||
ssr_enabled = true
|
ssr_enabled = true
|
||||||
dof_blur_far_distance = 4.0
|
|
||||||
glow_enabled = true
|
glow_enabled = true
|
||||||
|
|
||||||
[node name="Home" instance=ExtResource( 1 )]
|
[node name="Home" instance=ExtResource( 1 )]
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ anchor_bottom = 1.0
|
|||||||
theme = ExtResource( 2 )
|
theme = ExtResource( 2 )
|
||||||
theme_override_fonts/font = ExtResource( 3 )
|
theme_override_fonts/font = ExtResource( 3 )
|
||||||
text = "Last"
|
text = "Last"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ anchor_bottom = 1.0
|
|||||||
offset_right = -3.05176e-05
|
offset_right = -3.05176e-05
|
||||||
theme_override_fonts/font = ExtResource( 2 )
|
theme_override_fonts/font = ExtResource( 2 )
|
||||||
text = "First Entry"
|
text = "First Entry"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ anchor_bottom = 1.0
|
|||||||
theme = ExtResource( 1 )
|
theme = ExtResource( 1 )
|
||||||
theme_override_fonts/font = ExtResource( 2 )
|
theme_override_fonts/font = ExtResource( 2 )
|
||||||
text = "Last"
|
text = "Last"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ anchor_right = 1.0
|
|||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
theme_override_fonts/font = ExtResource( 1 )
|
theme_override_fonts/font = ExtResource( 1 )
|
||||||
text = "Middle"
|
text = "Middle"
|
||||||
align = 1
|
horizontal_alignment = 1
|
||||||
valign = 1
|
vertical_alignment = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,25 +46,22 @@
|
|||||||
panorama = ExtResource( 11 )
|
panorama = ExtResource( 11 )
|
||||||
|
|
||||||
[sub_resource type="Environment" id=2]
|
[sub_resource type="Environment" id=2]
|
||||||
background_mode = 3
|
background_mode = 2
|
||||||
background_sky = SubResource( 1 )
|
sky = SubResource( 1 )
|
||||||
background_color = Color( 0.188235, 0.133333, 0.133333, 1 )
|
background_color = Color( 0.188235, 0.133333, 0.133333, 1 )
|
||||||
background_energy = 0.6
|
background_energy_multiplier = 0.6
|
||||||
ambient_light_color = Color( 0.694118, 0.168627, 0.67451, 1 )
|
ambient_light_color = Color( 0.694118, 0.168627, 0.67451, 1 )
|
||||||
ambient_light_energy = 1.55
|
ambient_light_energy = 0.4
|
||||||
ambient_light_sky_contribution = 0.5
|
ambient_light_sky_contribution = 0.5
|
||||||
fog_enabled = true
|
fog_enabled = true
|
||||||
fog_color = Color( 0.562167, 0.29, 1, 0.941176 )
|
fog_mode = 1
|
||||||
|
fog_light_color = Color( 0.562167, 0.29, 1, 0.941176 )
|
||||||
fog_depth_begin = 0.0
|
fog_depth_begin = 0.0
|
||||||
fog_depth_end = 60.0
|
fog_depth_end = 60.0
|
||||||
fog_depth_curve = 1.10957
|
fog_depth_curve = 1.10957
|
||||||
fog_height_enabled = true
|
fog_height = 2.0
|
||||||
fog_height_min = 2.0
|
|
||||||
fog_height_max = -20.0
|
|
||||||
fog_height_curve = 0.965936
|
|
||||||
tonemap_mode = 2
|
tonemap_mode = 2
|
||||||
ssr_enabled = true
|
ssr_enabled = true
|
||||||
dof_blur_far_distance = 4.0
|
|
||||||
glow_enabled = true
|
glow_enabled = true
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id=3]
|
[sub_resource type="CapsuleShape3D" id=3]
|
||||||
@@ -137,21 +134,18 @@ surfaces/0 = {
|
|||||||
panorama = ExtResource( 11 )
|
panorama = ExtResource( 11 )
|
||||||
|
|
||||||
[sub_resource type="Environment" id=19]
|
[sub_resource type="Environment" id=19]
|
||||||
background_mode = 3
|
background_mode = 2
|
||||||
background_sky = SubResource( 18 )
|
sky = SubResource( 18 )
|
||||||
ambient_light_sky_contribution = 0.5
|
ambient_light_sky_contribution = 0.5
|
||||||
fog_enabled = true
|
fog_enabled = true
|
||||||
fog_color = Color( 0.337255, 0.235294, 0.956863, 0.941176 )
|
fog_mode = 1
|
||||||
|
fog_light_color = Color( 0.337255, 0.235294, 0.956863, 0.941176 )
|
||||||
fog_depth_begin = 0.0
|
fog_depth_begin = 0.0
|
||||||
fog_depth_end = 60.0
|
fog_depth_end = 60.0
|
||||||
fog_depth_curve = 1.10957
|
fog_depth_curve = 1.10957
|
||||||
fog_height_enabled = true
|
fog_height = 2.0
|
||||||
fog_height_min = 2.0
|
|
||||||
fog_height_max = -20.0
|
|
||||||
fog_height_curve = 0.965936
|
|
||||||
tonemap_mode = 2
|
tonemap_mode = 2
|
||||||
ssr_enabled = true
|
ssr_enabled = true
|
||||||
dof_blur_far_distance = 2.0
|
|
||||||
glow_enabled = true
|
glow_enabled = true
|
||||||
|
|
||||||
[node name="Warcraft" instance=ExtResource( 1 )]
|
[node name="Warcraft" instance=ExtResource( 1 )]
|
||||||
@@ -636,4 +630,3 @@ transform = Transform3D( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.06928, 2.35676, -0.183365
|
|||||||
extents = Vector3( 6.50885, 3.63237, 10 )
|
extents = Vector3( 6.50885, 3.63237, 10 )
|
||||||
bounces = 5
|
bounces = 5
|
||||||
environment_mode = 1
|
environment_mode = 1
|
||||||
light_data = ExtResource( 41 )
|
|
||||||
|
|||||||
@@ -6,23 +6,20 @@
|
|||||||
panorama = ExtResource( 1 )
|
panorama = ExtResource( 1 )
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
background_mode = 3
|
background_mode = 2
|
||||||
background_sky = SubResource( 2 )
|
sky = SubResource( 2 )
|
||||||
background_color = Color( 0.188235, 0.133333, 0.133333, 1 )
|
background_color = Color( 0.188235, 0.133333, 0.133333, 1 )
|
||||||
background_energy = 0.6
|
background_energy_multiplier = 0.6
|
||||||
ambient_light_color = Color( 0.694118, 0.168627, 0.67451, 1 )
|
ambient_light_color = Color( 0.694118, 0.168627, 0.67451, 1 )
|
||||||
ambient_light_energy = 1.55
|
ambient_light_energy = 0.4
|
||||||
ambient_light_sky_contribution = 0.5
|
ambient_light_sky_contribution = 0.5
|
||||||
fog_enabled = true
|
fog_enabled = true
|
||||||
fog_color = Color( 0.562167, 0.29, 1, 0.941176 )
|
fog_mode = 1
|
||||||
|
fog_light_color = Color( 0.562167, 0.29, 1, 0.941176 )
|
||||||
fog_depth_begin = 0.0
|
fog_depth_begin = 0.0
|
||||||
fog_depth_end = 60.0
|
fog_depth_end = 60.0
|
||||||
fog_depth_curve = 1.10957
|
fog_depth_curve = 1.10957
|
||||||
fog_height_enabled = true
|
fog_height = 2.0
|
||||||
fog_height_min = 2.0
|
|
||||||
fog_height_max = -20.0
|
|
||||||
fog_height_curve = 0.965936
|
|
||||||
tonemap_mode = 2
|
tonemap_mode = 2
|
||||||
ss_reflections_enabled = true
|
ss_reflections_enabled = true
|
||||||
dof_blur_far_distance = 2.0
|
|
||||||
glow_enabled = true
|
glow_enabled = true
|
||||||
|
|||||||
+3
-3
@@ -11,13 +11,13 @@ func apply_language(local):
|
|||||||
TranslationServer.set_locale(local)
|
TranslationServer.set_locale(local)
|
||||||
|
|
||||||
func translate_int_to_locale(id):
|
func translate_int_to_locale(id):
|
||||||
var lang = "en_GB"
|
var lang = "en"
|
||||||
|
|
||||||
if id == 0:
|
if id == 0:
|
||||||
lang = "en_GB"
|
lang = "en"
|
||||||
|
|
||||||
if id == 1:
|
if id == 1:
|
||||||
lang = "fr_FR"
|
lang = "fr"
|
||||||
|
|
||||||
return lang
|
return lang
|
||||||
|
|
||||||
|
|||||||
+46
-22
@@ -1,8 +1,9 @@
|
|||||||
@tool
|
@tool
|
||||||
extends SceneTree
|
extends SceneTree
|
||||||
|
|
||||||
# One-shot migration tool: walk every .material file, fix Godot 3 shader code
|
# One-shot migration tool: walk every resource that can carry a ShaderMaterial
|
||||||
# to Godot 4 syntax, save back.
|
# (.material, .tres, .mesh, .scn, .gltf, .glb, .tscn) and fix Godot 3 -> 4
|
||||||
|
# shader code in-place, saving where possible.
|
||||||
#
|
#
|
||||||
# Run with: godot --headless --script scripts/migrate_shaders.gd
|
# Run with: godot --headless --script scripts/migrate_shaders.gd
|
||||||
|
|
||||||
@@ -17,31 +18,51 @@ const REPLACEMENTS := [
|
|||||||
["NORMALMAP", "NORMAL_MAP"],
|
["NORMALMAP", "NORMAL_MAP"],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const EXTENSIONS := [".material", ".tres", ".mesh"]
|
||||||
|
|
||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
var fixed := 0
|
var fixed := 0
|
||||||
var checked := 0
|
var checked := 0
|
||||||
for path in _find_materials("res://assets"):
|
for path in _find_resources("res://assets"):
|
||||||
checked += 1
|
checked += 1
|
||||||
var mat = ResourceLoader.load(path, "", ResourceLoader.CACHE_MODE_IGNORE)
|
var res = ResourceLoader.load(path, "", ResourceLoader.CACHE_MODE_IGNORE)
|
||||||
if mat == null:
|
if res == null:
|
||||||
continue
|
continue
|
||||||
if mat is ShaderMaterial and mat.shader != null:
|
var dirty := false
|
||||||
var old_code: String = mat.shader.code
|
# Direct ShaderMaterial
|
||||||
var new_code := old_code
|
if res is ShaderMaterial:
|
||||||
for pair in REPLACEMENTS:
|
dirty = _fix_shader_material(res) or dirty
|
||||||
new_code = new_code.replace(pair[0], pair[1])
|
# ArrayMesh (surface materials embedded)
|
||||||
if new_code != old_code:
|
if res is ArrayMesh:
|
||||||
mat.shader.code = new_code
|
for surf in range(res.get_surface_count()):
|
||||||
var err = ResourceSaver.save(mat, path)
|
var mat = res.surface_get_material(surf)
|
||||||
if err == OK:
|
if mat is ShaderMaterial:
|
||||||
fixed += 1
|
if _fix_shader_material(mat):
|
||||||
print("FIXED ", path)
|
res.surface_set_material(surf, mat)
|
||||||
else:
|
dirty = true
|
||||||
push_error("Failed to save " + path + " (err=" + str(err) + ")")
|
if dirty:
|
||||||
|
var err = ResourceSaver.save(res, path)
|
||||||
|
if err == OK:
|
||||||
|
fixed += 1
|
||||||
|
print("FIXED ", path)
|
||||||
|
else:
|
||||||
|
push_error("Failed to save " + path + " (err=" + str(err) + ")")
|
||||||
print("Done. checked=", checked, " fixed=", fixed)
|
print("Done. checked=", checked, " fixed=", fixed)
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
func _find_materials(dir_path: String) -> Array:
|
func _fix_shader_material(mat: ShaderMaterial) -> bool:
|
||||||
|
if mat.shader == null:
|
||||||
|
return false
|
||||||
|
var old_code: String = mat.shader.code
|
||||||
|
var new_code := old_code
|
||||||
|
for pair in REPLACEMENTS:
|
||||||
|
new_code = new_code.replace(pair[0], pair[1])
|
||||||
|
if new_code == old_code:
|
||||||
|
return false
|
||||||
|
mat.shader.code = new_code
|
||||||
|
return true
|
||||||
|
|
||||||
|
func _find_resources(dir_path: String) -> Array:
|
||||||
var result := []
|
var result := []
|
||||||
var dir = DirAccess.open(dir_path)
|
var dir = DirAccess.open(dir_path)
|
||||||
if dir == null:
|
if dir == null:
|
||||||
@@ -54,8 +75,11 @@ func _find_materials(dir_path: String) -> Array:
|
|||||||
continue
|
continue
|
||||||
var sub = dir_path + "/" + name
|
var sub = dir_path + "/" + name
|
||||||
if dir.current_is_dir():
|
if dir.current_is_dir():
|
||||||
result.append_array(_find_materials(sub))
|
result.append_array(_find_resources(sub))
|
||||||
elif name.ends_with(".material") or name.ends_with(".tres"):
|
else:
|
||||||
result.append(sub)
|
for ext in EXTENSIONS:
|
||||||
|
if name.ends_with(ext):
|
||||||
|
result.append(sub)
|
||||||
|
break
|
||||||
name = dir.get_next()
|
name = dir.get_next()
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user