Skip to content

Commit

Permalink
Add missing void return types (#2264)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohq authored Jun 5, 2024
1 parent 363ff26 commit 8cf718c
Show file tree
Hide file tree
Showing 80 changed files with 133 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func _get_title() -> String:
return "Settings"


func _init():
func _init() -> void:
hint_text = "The settings here are @export variables from the used scene."


Expand All @@ -33,7 +33,7 @@ func _recheck(data:Dictionary):
load_portrait_scene_export_variables()


func load_portrait_scene_export_variables():
func load_portrait_scene_export_variables() -> void:
var scene = null
if !current_portrait_data.get('scene', '').is_empty():
scene = load(current_portrait_data.get('scene'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extends DialogicCharacterEditorPortraitSection
func _get_title() -> String:
return "Scene"

func _init():
func _init() -> void:
hint_text = "You can use a custom scene for this portrait."

func _ready() -> void:
Expand All @@ -30,7 +30,7 @@ func _on_scene_picker_value_changed(prop_name:String, value:String) -> void:
%OpenSceneButton.visible = !data.get('scene', '').is_empty()


func _on_open_scene_button_pressed():
func _on_open_scene_button_pressed() -> void:
if !%ScenePicker.current_value.is_empty() and ResourceLoader.exists(%ScenePicker.current_value):
DialogicUtil.get_dialogic_plugin().get_editor_interface().open_scene_from_path(%ScenePicker.current_value)
EditorInterface.set_main_screen_editor("2D")
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func _load_portrait_data(data:Dictionary) -> void:
current_portrait_data = data
load_portrait_scene_export_variables()

func load_portrait_scene_export_variables():
func load_portrait_scene_export_variables() -> void:
for child in $Grid.get_children():
child.queue_free()

Expand Down
6 changes: 3 additions & 3 deletions addons/dialogic/Editor/CharacterEditor/character_editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,12 @@ func _on_some_resource_saved(file:Variant) -> void:
update_preview(true)


func _on_full_preview_available_rect_resized():
func _on_full_preview_available_rect_resized() -> void:
if %FitPreview_Toggle.button_pressed:
update_preview()


func _on_create_character_button_pressed():
func _on_create_character_button_pressed() -> void:
editors_manager.show_add_resource_dialog(
new_character,
'*.dch; DialogicCharacter',
Expand All @@ -670,7 +670,7 @@ func _on_fit_preview_toggle_toggled(button_pressed):
#endregion

## Open the reference manager
func _on_reference_manger_button_pressed():
func _on_reference_manger_button_pressed() -> void:
editors_manager.reference_manager.open()
%PortraitChangeInfo.hide()

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func get_character_suggestions(search_text:String) -> Dictionary:
return suggestions


func save():
func save() -> void:
if %Old.text.is_empty() or %New.text.is_empty():
return
if %Where.selected == 1 and %Character.current_value == null:
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Common/hint_tooltip_icon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extends TextureRect

@export_multiline var hint_text = ""

func _ready():
func _ready() -> void:
texture = get_theme_icon("NodeInfo", "EditorIcons")
modulate = get_theme_color("contrast_color_1", "Editor")
tooltip_text = hint_text
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Common/reference_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func tab_changed(enabled:bool, index:int) -> void:
child.set_pressed_no_signal(index-1 == child.get_index())


func open():
func open() -> void:
show()
$Tabs/BrokenReferences.update_indicator()

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Common/sidebar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ signal content_item_activated(item_name)
@onready var editors_manager = get_parent().get_parent()


func _ready():
func _ready() -> void:
if owner.get_parent() is SubViewport:
return

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Common/toolbar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extends HBoxContainer
################################################################################
## EDITOR BUTTONS/LABELS
################################################################################
func _ready():
func _ready() -> void:
if owner.get_parent() is SubViewport:
return
%CustomButtons.custom_minimum_size.y = 33 * DialogicUtil.get_editor_scale()
Expand Down
16 changes: 8 additions & 8 deletions addons/dialogic/Editor/Common/update_install_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var current_info : Dictionary = {}
@onready var editor_view := find_parent('EditorView')


func _ready():
func _ready() -> void:
await editor_view.ready
theme = editor_view.theme

Expand All @@ -16,7 +16,7 @@ func _ready():
DialogicUtil.get_dialogic_plugin().get_editor_interface().get_resource_filesystem().resources_reimported.connect(_on_resources_reimported)


func open():
func open() -> void:
get_parent().popup_centered_ratio(0.5)
get_parent().mode = Window.MODE_WINDOWED
get_parent().move_to_foreground()
Expand Down Expand Up @@ -76,19 +76,19 @@ func load_info(info:Dictionary, update_type:int) -> void:
else:
%Reactions.hide()

func _on_window_close_requested():
func _on_window_close_requested() -> void:
get_parent().visible = false


func _on_install_pressed():
func _on_install_pressed() -> void:
find_parent('UpdateManager').request_update_download()

%InfoLabel.text = "Downloading. This can take a moment."
%Loading.show()
%LoadingIcon.create_tween().set_loops().tween_property(%LoadingIcon, 'rotation', 2*PI, 1).from(0)


func _on_refresh_pressed():
func _on_refresh_pressed() -> void:
find_parent('UpdateManager').request_update_check()


Expand Down Expand Up @@ -163,14 +163,14 @@ func _on_content_meta_clicked(meta:Variant) -> void:
OS.shell_open(str(meta))


func _on_install_mouse_entered():
func _on_install_mouse_entered() -> void:
if not %Install.disabled:
%InstallWarning.show()


func _on_install_mouse_exited():
func _on_install_mouse_exited() -> void:
%InstallWarning.hide()


func _on_restart_pressed():
func _on_restart_pressed() -> void:
DialogicUtil.get_dialogic_plugin().get_editor_interface().restart_editor(true)
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Common/update_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func _on_DownloadRequest_completed(result:int, response_code:int, headers:Packed
###################### SOME UI MANAGEMENT #####################################
################################################################################

func setup_version_indicator():
func setup_version_indicator() -> void:
version_indicator = %Sidebar.get_node('%CurrentVersion')
version_indicator.pressed.connect($Window/UpdateInstallWindow.open)
version_indicator.text = get_current_version()
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Events/EventBlock/event_block.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var current_indent_level := 1
#region UI AND LOGIC INITIALIZATION
################################################################################

func _ready():
func _ready() -> void:
if get_parent() is SubViewport:
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extends PopupMenu

var current_event : Node = null

func _ready():
func _ready() -> void:
clear()
add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), "Duplicate")
add_separator()
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Events/Fields/field_array.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extends DialogicVisualEditorField
const ArrayValue := "res://addons/dialogic/Editor/Events/Fields/array_part.tscn"


func _ready():
func _ready() -> void:
%Add.icon = get_theme_icon("Add", "EditorIcons")
%Add.pressed.connect(_on_AddButton_pressed)

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Events/Fields/field_condition.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func _set_value(value:Variant) -> void:



func _autofocus():
func _autofocus() -> void:
%Value1Variable.grab_focus()

#endregion
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Events/Fields/field_dictionary.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends DialogicVisualEditorField

const PairValue = "res://addons/dialogic/Editor/Events/Fields/dictionary_part.tscn"

func _ready():
func _ready() -> void:
%Add.icon = get_theme_icon("Add", "EditorIcons")


Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Events/Fields/field_number.gd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func _set_value(new_value: Variant) -> void:
%Value.tooltip_text = tooltip_text


func _autofocus():
func _autofocus() -> void:
%Value.grab_focus()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func _set_value(value:Variant) -> void:
self.text = str(value)


func _autofocus():
func _autofocus() -> void:
grab_focus()

#endregion
Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Editor/HomePage/home_page.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func _get_icon() -> Texture:
return load("res://addons/dialogic/Editor/Images/plugin-icon.svg")


func _ready():
func _ready() -> void:
self_modulate = get_theme_color("font_color", "Editor")
self_modulate.a = 0.2

Expand All @@ -30,7 +30,7 @@ func _ready():



func _register():
func _register() -> void:
editors_manager.register_simple_editor(self)

self.alternative_text = "Welcome to dialogic!"
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Settings/HintLabelStylingScript.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extends Label

# Called when the node enters the scene tree for the first time.
func _ready():
func _ready() -> void:
# don't load the label settings when opening as a scene
# prevents HUGE diffs
if owner.get_parent() is SubViewport:
Expand Down
8 changes: 4 additions & 4 deletions addons/dialogic/Editor/Settings/settings_editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ func _get_icon() -> Texture:
return get_theme_icon("PluginScript", "EditorIcons")


func _register():
func _register() -> void:
editors_manager.register_simple_editor(self)
self.alternative_text = "Customize dialogic and it's behaviour"


func _ready():
func _ready() -> void:
if get_parent() is SubViewport:
return

Expand Down Expand Up @@ -156,13 +156,13 @@ func _open(extra_information:Variant = null) -> void:
open_tab(%SettingsContent.get_node(extra_information))


func _close():
func _close() -> void:
for child in %SettingsContent.get_children():
if child.get_meta('section').has_method('_about_to_close'):
child.get_meta('section')._about_to_close()


func refresh():
func refresh() -> void:
for child in %SettingsContent.get_children():
if child.get_meta('section').has_method('_refresh'):
child.get_meta('section')._refresh()
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Settings/settings_modules.gd
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func _on_tree_item_selected() -> void:
%GeneralInfo.text = ""


func _on_external_link_pressed():
func _on_external_link_pressed() -> void:
if %ExternalLink.has_meta('url'):
OS.shell_open(%ExternalLink.get_meta('url'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var shortcode_events := {}
var custom_syntax_events := []
var text_event :DialogicTextEvent = null

func _ready():
func _ready() -> void:
# Compile RegEx's
completion_word_regex.compile("(?<s>(\\W)|^)(?<word>\\w*)\\x{FFFF}")
completion_shortcode_getter_regex.compile("\\[(?<code>\\w*)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var custom_syntax_events := []
var text_event :DialogicTextEvent = null


func _init():
func _init() -> void:
# Load colors from editor settings
if DialogicUtil.get_dialogic_plugin():
var editor_settings = DialogicUtil.get_dialogic_plugin().get_editor_interface().get_editor_settings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ extends CodeEdit

var label_regex := RegEx.create_from_string('label +(?<name>[^\n]+)')

func _ready():
func _ready() -> void:
await find_parent('EditorView').ready
syntax_highlighter = code_completion_helper.syntax_highlighter
timeline_editor.editors_manager.sidebar.content_item_activated.connect(_on_content_item_clicked)


func _on_text_editor_text_changed():
func _on_text_editor_text_changed() -> void:
timeline_editor.current_resource_state = DialogicEditor.ResourceStates.UNSAVED
request_code_completion(true)
$UpdateTimer.start()


func clear_timeline():
func clear_timeline() -> void:
text = ''
update_content_list()

Expand All @@ -37,7 +37,7 @@ func load_timeline(timeline:DialogicTimeline) -> void:
update_content_list()


func save_timeline():
func save_timeline() -> void:
if !timeline_editor.current_resource:
return

Expand Down Expand Up @@ -183,11 +183,11 @@ func _drop_data(at_position:Vector2, data:Variant) -> void:
insert_text_at_caret(result)


func _on_update_timer_timeout():
func _on_update_timer_timeout() -> void:
update_content_list()


func update_content_list():
func update_content_list() -> void:
var labels :PackedStringArray = []
for i in label_regex.search_all(text):
labels.append(i.get_string('name'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ func toggle_name(on:= false) -> void:
apply_base_button_style()


func _on_button_down():
func _on_button_down() -> void:
find_parent('VisualEditor').get_node('%TimelineArea').start_dragging(1, resource)
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func _process(delta:float) -> void:
queue_redraw()


func finish_dragging():
func finish_dragging() -> void:
dragging = false
if get_global_rect().has_point(get_global_mouse_position()):
drag_completed.emit(drag_type, drag_to_position, drag_data)
Expand Down
Loading

0 comments on commit 8cf718c

Please sign in to comment.