Skip to content

Commit 5eaba2b

Browse files
committed
refactor: ♻️ updated for Godot 4.x
1 parent f203d80 commit 5eaba2b

31 files changed

+432
-407
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[remap]
2+
3+
importer="font_data_dynamic"
4+
type="FontFile"
5+
uid="uid://lkh6i14tjx60"
6+
path="res://.godot/imported/CascadiaCode.ttf-d75b14e3518505ea2866c064198eb4b8.fontdata"
7+
8+
[deps]
9+
10+
source_file="res://mods-unpacked/GodotModding-ModConfig/assets/fonts/CascadiaCode.ttf"
11+
dest_files=["res://.godot/imported/CascadiaCode.ttf-d75b14e3518505ea2866c064198eb4b8.fontdata"]
12+
13+
[params]
14+
15+
Rendering=null
16+
antialiasing=1
17+
generate_mipmaps=false
18+
multichannel_signed_distance_field=false
19+
msdf_pixel_range=8
20+
msdf_size=48
21+
allow_system_fallback=true
22+
force_autohinter=false
23+
hinting=1
24+
subpixel_positioning=1
25+
oversampling=0.0
26+
Fallbacks=null
27+
fallbacks=[]
28+
Compress=null
29+
compress=true
30+
preload=[]
31+
language_support={}
32+
script_support={}
33+
opentype_features={}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[gd_resource type="DynamicFont" load_steps=2 format=2]
1+
[gd_resource type="FontFile" load_steps=2 format=2]
22

3-
[ext_resource path="res://mods-unpacked/GodotModding-ModConfig/assets/fonts/CascadiaCode.ttf" type="DynamicFontData" id=1]
3+
[ext_resource path="res://mods-unpacked/GodotModding-ModConfig/assets/fonts/CascadiaCode.ttf" type="FontFile" id=1]
44

55
[resource]
66
font_data = ExtResource( 1 )

root/mods-unpacked/GodotModding-ModConfigEditor/assets/fonts/text.tres

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[gd_resource type="DynamicFont" load_steps=2 format=2]
1+
[gd_resource type="FontFile" load_steps=2 format=2]
22

3-
[ext_resource path="res://mods-unpacked/GodotModding-ModConfig/assets/fonts/CascadiaCode.ttf" type="DynamicFontData" id=1]
3+
[ext_resource path="res://mods-unpacked/GodotModding-ModConfig/assets/fonts/CascadiaCode.ttf" type="FontFile" id=1]
44

55
[resource]
66
size = 14

root/mods-unpacked/GodotModding-ModConfigEditor/assets/shader/blur.tres

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
1-
[gd_resource type="Shader" format=2]
1+
[gd_resource type="Shader" format=3 uid="uid://c7pkqaollpey"]
22

33
[resource]
44
code = "// https://godotshaders.com/shader/simple-blur-mixed-with-a-color/
55
// https://gist.github.com/rohanrhu/11ffd387e1cc228d15bcea56fad4f593
66

77
shader_type canvas_item;
88

9+
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
910
uniform float radius: hint_range(0., 1.) = 1;
1011
uniform bool animate = false;
1112
uniform float square_scale: hint_range(0., 1.) = 0.1;
1213
uniform float blur_amount : hint_range(-2.0, 10.0);
1314
uniform float mix_amount : hint_range(0.0, 1.0);
14-
uniform vec4 color_over : hint_color;
15+
uniform vec4 color_over : source_color;
1516

1617
void fragment() {
1718
float sc = square_scale + square_scale/2.;
1819
float r = square_scale + (1. - radius) * (square_scale/2.);
19-
20+
2021
float scax = 1. - square_scale;
21-
22+
2223
float dx;
2324
float dy;
2425
float d;
2526
float a;
26-
27+
2728
vec4 blurred = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount);
2829
vec4 fin = mix(blurred, color_over, mix_amount);
2930
COLOR = fin;
30-
31+
3132
if (UV.x < square_scale && UV.y > scax) {
3233
dx = square_scale - UV.x;
3334
dy = scax - UV.y;
3435
d = sqrt(pow(dx, 2.) + pow(dy, 2.));
3536
a = asin(d);
36-
37+
3738
if (a > r) {
3839
if (!animate) {
3940
COLOR.a = 0.;
@@ -42,13 +43,13 @@ void fragment() {
4243
}
4344
}
4445
}
45-
46+
4647
if (UV.x < square_scale && UV.y < square_scale) {
4748
dx = square_scale - UV.x;
4849
dy = square_scale - UV.y;
4950
d = sqrt(pow(dx, 2.) + pow(dy, 2.));
5051
a = asin(d);
51-
52+
5253
if (a > r) {
5354
if (!animate) {
5455
COLOR.a = 0.;
@@ -57,13 +58,13 @@ void fragment() {
5758
}
5859
}
5960
}
60-
61+
6162
if (UV.x > scax && UV.y < square_scale) {
6263
dx = scax - UV.x;
6364
dy = square_scale - UV.y;
6465
d = sqrt(pow(dx, 2.) + pow(dy, 2.));
6566
a = asin(d);
66-
67+
6768
if (a > r) {
6869
if (!animate) {
6970
COLOR.a = 0.;
@@ -78,7 +79,7 @@ void fragment() {
7879
dy = scax - UV.y;
7980
d = sqrt(pow(dx, 2.) + pow(dy, 2.));
8081
a = asin(d);
81-
82+
8283
if (a > r) {
8384
if (!animate) {
8485
COLOR.a = 0.;

root/mods-unpacked/GodotModding-ModConfigEditor/content/ModConfigEditor/ModConfigEditor.gd

+14-20
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
extends WindowDialog
1+
extends PanelContainer
22

33

4-
var mod_data: ModData setget _set_mod_data
5-
var selected_config: ModConfig setget _set_selected_config
4+
var mod_data: ModData: set = _set_mod_data
5+
var selected_config: ModConfig: set = _set_selected_config
66
var edited_config: ModConfig
77

8-
export(String) var error_text_add_config := "ERROR: Creating new config - check logs"
9-
export(String) var error_text_remove_config := "ERROR: Deleting config - check logs"
10-
export(String) var error_text_update_config := "ERROR: Updating config - check logs"
11-
export(String) var info_default_config := "INFO: The default config cannot be modified. \n Please create a new config instead."
8+
@export var error_text_add_config := "ERROR: Creating new config - check logs"
9+
@export var error_text_remove_config := "ERROR: Deleting config - check logs"
10+
@export var error_text_update_config := "ERROR: Updating config - check logs"
11+
@export var info_default_config := "INFO: The default config cannot be modified. \n Please create a new config instead."
1212

1313
const LABEL_CONFIG_FOR_TEXT := "Configs for"
1414

15-
onready var label_config_for := $"%LabelConfigFor"
16-
onready var config_selection := $"%ConfigSelection"
17-
onready var config_sections := $"%ConfigSections"
18-
onready var popup_new_config := $"%PopupNewConfig"
19-
onready var info_text := $"%InfoText"
20-
onready var button_save: Button = $"%ButtonSave"
15+
@onready var label_config_for := $"%LabelConfigFor"
16+
@onready var config_selection := $"%ConfigSelection"
17+
@onready var config_sections := $"%ConfigSections"
18+
@onready var popup_new_config := $"%PopupNewConfig"
19+
@onready var info_text := $"%InfoText"
20+
@onready var button_save: Button = $"%ButtonSave"
2121

2222

2323
func _set_mod_data(new_mod_data: ModData) -> void:
@@ -53,12 +53,6 @@ func update_ui() -> void:
5353
func apply_config(config: ModConfig) -> void:
5454
var material_settings: Dictionary = config.data.material_settings
5555

56-
material.set_shader_param("animate", material_settings.animate)
57-
material.set_shader_param("square_scale", material_settings.square_scale)
58-
material.set_shader_param("blur_amount", material_settings.blur_amount)
59-
material.set_shader_param("mix_amount", material_settings.mix_amount)
60-
material.set_shader_param("color_over", Color(material_settings.color))
61-
6256

6357
func _populate_config_sections() -> void:
6458
config_sections.config = edited_config
@@ -115,7 +109,7 @@ func _on_PopupNewConfig_pressed_submit(config_name: String) -> void:
115109

116110

117111
func _on_ConfigSections_config_data_changed(input_component) -> void:
118-
if input_component.parent.empty():
112+
if input_component.parent.is_empty():
119113
edited_config.data[input_component.key] = input_component.value
120114
return
121115

0 commit comments

Comments
 (0)