Skip to content

Commit

Permalink
minor fixes around helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
ninetailsrabbit committed Oct 21, 2024
1 parent 8aef365 commit 1ee8019
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions shaders/vhs/scanlines.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ uniform float scan_size = 2.0;
uniform float scanline_alpha = 0.9;
uniform float lines_velocity = 30.0;

vec2 distort(vec2 p)
vec2 distort(vec2 p)
{
float angle = p.y / p.x;
float theta = atan(p.y,p.x);
float radius = pow(length(p), BarrelPower);

p.x = radius * cos(theta);
p.y = radius * sin(theta);

return 0.5 * (p + vec2(1.0,1.0));
}

Expand All @@ -45,15 +45,15 @@ void fragment()
vec2 xy = SCREEN_UV * 2.0;
xy.x -= 1.0;
xy.y -= 1.0;

float d = length(xy);
if(d < 1.5){
xy = distort(xy);
}
else{
xy = SCREEN_UV;
}

float pixel_size_x = 1.0/screen_width*bleeding_range_x;
float pixel_size_y = 1.0/screen_height*bleeding_range_y;
vec4 color_left = texture(SCREEN_TEXTURE,xy - vec2(pixel_size_x, pixel_size_y));
Expand Down
2 changes: 1 addition & 1 deletion ui/content_warning/content_warning_displayer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class_name ContentWarnings extends Control
signal content_warning_displayed(content_warning: ContentWarning)
signal all_content_warnings_displayed

@export var input_actions_that_skip_warning := ["ui_accept"]
@export var input_actions_that_skip_warning: Array[String] = ["ui_accept"]
@export var content_warnings_to_display: Array[ContentWarning] = []

@onready var content_warning_title: Label = %ContentWarningTitle
Expand Down
8 changes: 4 additions & 4 deletions utilities/files/file_helper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ static func get_files_recursive(path: String, regex: RegEx = null) -> Array:

static func copy_directory_recursive(from_dir :String, to_dir :String) -> Error:
if not DirAccess.dir_exists_absolute(from_dir):
push_error("PluginUtilities->copy_directory_recursive: directory not found '%s'" % from_dir)
push_error("FileHelper->copy_directory_recursive: directory not found '%s'" % from_dir)
return ERR_DOES_NOT_EXIST

if not DirAccess.dir_exists_absolute(to_dir):

var err := DirAccess.make_dir_recursive_absolute(to_dir)
if err != OK:
push_error("PluginUtilities->copy_directory_recursive: Can't create directory '%s'. Error: %s" % [to_dir, error_string(err)])
push_error("FileHelper->copy_directory_recursive: Can't create directory '%s'. Error: %s" % [to_dir, error_string(err)])
return err

var source_dir := DirAccess.open(from_dir)
Expand All @@ -86,12 +86,12 @@ static func copy_directory_recursive(from_dir :String, to_dir :String) -> Error:
var err := source_dir.copy(source, dest)

if err != OK:
push_error("PluginUtilities->copy_directory_recursive: Error checked copy file '%s' to '%s'" % [source, dest])
push_error("FileHelper->copy_directory_recursive: Error checked copy file '%s' to '%s'" % [source, dest])
return err

return OK
else:
push_error("PluginUtilities->copy_directory_recursive: Directory not found: " + from_dir)
push_error("FileHelper->copy_directory_recursive: Directory not found: " + from_dir)
return ERR_DOES_NOT_EXIST


Expand Down
2 changes: 2 additions & 0 deletions utilities/structures/dictionary_helper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ static func reverse_key_value(source_dict: Dictionary) -> Dictionary:
static func merge_recursive(dest: Dictionary, source: Dictionary) -> void:
for key in source:
if source[key] is Dictionary:

if not dest.has(key):
dest[key] = {}

DictionaryHelper.merge_recursive(dest[key], source[key])
else:
dest[key] = source[key]

0 comments on commit 1ee8019

Please sign in to comment.