Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for different things #753

Merged
merged 6 commits into from
Jan 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/dialogic/Editor/CharacterEditor/CharacterEditor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ func _on_dir_selected(path, target):

func _on_MirrorPortraitsCheckBox_toggled(button_pressed):
nodes['portrait_preview_full'].flip_h = button_pressed
nodes['portrait_preview_real'].flip_h = button_pressed


func _on_Scale_value_changed(value):
Expand Down
3 changes: 1 addition & 2 deletions addons/dialogic/Editor/MasterTree/MasterTree.gd
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,7 @@ func _on_ThemePopupMenu_id_pressed(id):
OS.shell_open(ProjectSettings.globalize_path(DialogicResources.get_path('THEME_DIR')))
if id == 1:
var filename = editor_reference.get_node('MainPanel/MasterTreeContainer/MasterTree').get_selected().get_metadata(0)['file']
if (filename.begins_with('theme-')):
theme_editor.duplicate_theme(filename)
theme_editor.duplicate_theme(filename)
if id == 2:
editor_reference.popup_remove_confirmation('Theme')

Expand Down
5 changes: 5 additions & 0 deletions addons/dialogic/Nodes/Background.gd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func fade_out(time = 1):
else:
_on_tween_over()

func remove_with_delay(time =1):
var timer = Timer.new()
timer.connect("timeout", self, "queue_free")
add_child(timer)
timer.start(time+0.1)

func _on_tween_over():
queue_free()
11 changes: 7 additions & 4 deletions addons/dialogic/Nodes/DialogNode.gd
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func _on_text_completed():
waiting_time = $"FX/CharacterVoice".remaining_time()
else:
waiting_time = float(waiting_time)
print("Waiting time: " + String(waiting_time))
#print("Waiting time: " + String(waiting_time))
#Remove these comments once replaced with proper code.
# - KvaGram
#original line
Expand Down Expand Up @@ -612,7 +612,7 @@ func event_handler(event: Dictionary):
grab_portrait_focus(character_data, event)
if character_data.get('data', {}).get('theme', '') and current_theme_file_name != character_data.get('data', {}).get('theme', ''):
current_theme = load_theme(character_data.get('data', {}).get('theme', ''))
elif current_default_theme and current_theme_file_name != current_default_theme:
elif !character_data.get('data', {}).get('theme', '') and current_default_theme and current_theme_file_name != current_default_theme:
current_theme = load_theme(current_default_theme)

#voice
Expand Down Expand Up @@ -686,7 +686,7 @@ func event_handler(event: Dictionary):

if character_data.get('data', {}).get('theme', '') and current_theme_file_name != character_data.get('data', {}).get('theme', ''):
current_theme = load_theme(character_data.get('data', {}).get('theme', ''))
elif current_default_theme and current_theme_file_name != current_default_theme:
elif !character_data.get('data', {}).get('theme', '') and current_default_theme and current_theme_file_name != current_default_theme:
current_theme = load_theme(current_default_theme)
#voice
handle_voice(event)
Expand Down Expand Up @@ -759,7 +759,10 @@ func event_handler(event: Dictionary):
current_background = event['background']
if background != null:
background.name = "BackgroundFadingOut"
background.fade_out(fade_time)
if !value:
background.fade_out(fade_time)
else:
background.remove_with_delay(fade_time)
background = null

if value != '':
Expand Down
1 change: 1 addition & 0 deletions addons/dialogic/Nodes/TextBubble.gd
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func load_theme(theme: ConfigFile):
name_style.set('content_margin_left', name_padding.x)
name_style.set('content_margin_right', name_padding.x)
name_style.set('content_margin_bottom', name_padding.y)
name_style.set('content_margin_top', name_padding.y)

var name_shadow_offset = theme.get_value('name', 'shadow_offset', Vector2(2,2))
if theme.get_value('name', 'shadow_visible', true):
Expand Down