Skip to content

Commit

Permalink
Revert "Merge branch 'dialogic-1' into dialogic-1x-speedups"
Browse files Browse the repository at this point in the history
This reverts commit 0e8df0b, reversing
changes made to d4ca70b.
  • Loading branch information
ii4y-studios committed Jan 11, 2023
1 parent 0e8df0b commit 588c3c8
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 78 deletions.
6 changes: 0 additions & 6 deletions addons/dialogic/Documentation/Content/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# Changelog
## v1.4.6
* timeline_end and timeline_start properly return name of timelines when a Change Timeline Event occurs [[zaknafean](https://github.com/zaknafean)]
* timeline_changed signal added. Emitted during a Change Timeline Event, returns old_timeline_name and new_timeline_name
* Name Label aligns properly when name sizes vary
*


## v1.4.5
* Added focus style options for themes [[CptFubar](https://github.com/CptFubar)]
Expand Down
3 changes: 0 additions & 3 deletions addons/dialogic/Example Assets/History/HistoryRow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ func _ready():


func add_history(historyString, newAudio=''):
var regex = RegEx.new()
regex.compile("\\[\\s{0,}speed\\s{0,}\\=\\s{0,}\\d{0,}\\s{0,}\\]")
historyString = regex.sub(historyString, "")
TextLabel.append_bbcode(historyString)
audioPath = newAudio
if newAudio != '':
Expand Down
3 changes: 0 additions & 3 deletions addons/dialogic/Nodes/DialogNode.gd
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ signal event_end(type)
signal text_complete(text_data)
# Timeline end/start
signal timeline_start(timeline_name)
signal timeline_changed(old_timeline_name, new_timeline_name)
signal timeline_end(timeline_name)
# Custom user signal
signal dialogic_signal(value)
Expand Down Expand Up @@ -1031,8 +1030,6 @@ func event_handler(event: Dictionary):

func change_timeline(timeline):
dialog_script = set_current_dialog(timeline)
emit_signal("timeline_changed", timeline_name, dialog_script['metadata']['name'])
timeline_name = dialog_script['metadata']['name']
_init_dialog()


Expand Down
2 changes: 0 additions & 2 deletions addons/dialogic/Nodes/DialogProxy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ var _signals_to_copy = [
'text_complete',
'timeline_start',
'timeline_end',
'timeline_changed',
'dialogic_signal',
'letter_displayed',
'auto_advance_toggled',
Expand All @@ -49,7 +48,6 @@ signal text_complete(text_data)
# Timeline end/start
signal timeline_start(timeline_name)
signal timeline_end(timeline_name)
signal timeline_changed(old_timeline_name, new_timeline_name)
# Custom user signal
signal dialogic_signal(value)
signal letter_displayed(lastLetter)
Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Nodes/History.gd
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ func add_history_row_event(eventData):


# event logging handled here
# Text Events, replacing br with linebreaks
# Text Events
if eventData.event_id == 'dialogic_001':
newHistoryRow.add_history(str(characterPrefix, eventData.text.replace('[br]', '\n')), audioData)
newHistoryRow.add_history(str(characterPrefix, eventData.text), audioData)
# Character Arrivals
elif eventData.event_id == 'dialogic_002':
var logText = get_parent().settings.get_value('history', 'text_arrivals', 'has arrived')
Expand Down
7 changes: 1 addition & 6 deletions addons/dialogic/Nodes/TextBubble.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,11 @@ func update_name(name: String, color: Color = Color.white, autocolor: bool=false
return

if not name.empty():

# Hack to reset the size
name_label.rect_min_size = Vector2(0, 0)
name_label.rect_size = Vector2(-1, 40)

# Setting the color and text
name_label.text = name

name_label.rect_size = name_label.get_font("font").get_string_size(name_label.text)
name_label.rect_min_size = name_label.get_font("font").get_string_size(name_label.text)
# Alignment
call_deferred('align_name_label')
if autocolor:
Expand Down Expand Up @@ -324,7 +319,7 @@ func align_name_label():
name_label.rect_global_position.x = rect_global_position.x + (rect_size.x / 2) - (label_size / 2) + horizontal_offset
elif name_label_position == 2: # Right
name_label.rect_global_position.x = rect_global_position.x + rect_size.x - label_size + horizontal_offset

## *****************************************************************************
## OVERRIDES
## *****************************************************************************
Expand Down
7 changes: 0 additions & 7 deletions addons/dialogic/Nodes/canvas_dialog_node.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ signal event_end(type)
# Timeline end/start
signal timeline_start(timeline_name)
signal timeline_end(timeline_name)
signal timeline_changed(old_timeline_name, new_timeline_name)
signal text_complete(text_event)
# Custom user signal
signal dialogic_signal(value)
Expand All @@ -34,8 +33,6 @@ func set_dialog_node_scene(scene) -> void:
assert(_err == OK)
_err = dialog_node.connect("timeline_end", self, "_on_timeline_end")
assert(_err == OK)
_err = dialog_node.connect("timeline_changed", self, "_on_timeline_changed")
assert(_err == OK)
_err = dialog_node.connect("text_complete", self, "_on_text_complete")
assert(_err == OK)
_err = dialog_node.connect("dialogic_signal", self, "_on_dialogic_signal")
Expand Down Expand Up @@ -70,10 +67,6 @@ func _on_event_end(type) -> void:
emit_signal("event_end", type)


func _on_timeline_changed(old_timeline_name, new_timeline_name) -> void:
emit_signal("timeline_changed", old_timeline_name, new_timeline_name)


func _on_timeline_start(timeline_name) -> void:
emit_signal("timeline_start", timeline_name)

Expand Down
50 changes: 1 addition & 49 deletions addons/dialogic/Other/DialogicResources.gd
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,6 @@ static func delete_default_definition(id: String):
static func get_saves_folders() -> Array:
var save_folders = []
var directory := Directory.new()
if (OS.get_name() == "HTML5"):
if (OS.has_feature("JavaScript")):
directory.make_dir(WORKING_DIR)
print("get saves fold func: got working dir ", WORKING_DIR)
else:
printerr("JavaScript not enabled")
if directory.open(WORKING_DIR) != OK:
print("[D] Error: Failed to access working directory.")
return []
Expand Down Expand Up @@ -422,51 +416,9 @@ static func get_saved_definitions(save_name: String = '') -> Dictionary:
print("[D] Wasn't able to find save '"+save_name+"'. Loaded the default definitions.")
return get_default_definitions()

# return load_json(WORKING_DIR+"/"+save_name+"/definitions.json", {})

var default_definitions : Dictionary = get_default_definitions()

var saved_definitions : Dictionary = {}

if save_name == '':
saved_definitions = load_json(get_config_files_paths()['DEFINITIONS_DEFAULT_SAVE'], default_definitions)
print("empty save slot, loaded saved definition from default save definitions")

else:
saved_definitions = load_json(WORKING_DIR+"/"+save_name+"/definitions.json", {})
print("saved user definitions on ''user://'' loaded")

# Store variables in arrays from saved and default data
var base_def_var = default_definitions.variables
var saved_user_def_var = saved_definitions.variables

#filler out depreciated variables
var distilled_saved_data: Array = []
for sd in saved_user_def_var:
var sd_id = sd.id
var bd_id
for bd in base_def_var:
bd_id = bd.id
if sd_id == bd_id:
distilled_saved_data.append (sd)

#adds missing new variables not in saved game
for dd in base_def_var:
var dd_id = dd.id
var sd_id
for sd in distilled_saved_data:
var sd_keys = sd.id
if dd_id == sd_keys:
sd_id = sd_keys
if dd_id == sd_id:
pass
else:
distilled_saved_data.append (dd)
return load_json(WORKING_DIR+"/"+save_name+"/definitions.json", {})

#adds it back distilled data into main Saved Definitions
saved_definitions.variables = distilled_saved_data

return saved_definitions

## *****************************************************************************
## FOLDER STRUCTURE
Expand Down

0 comments on commit 588c3c8

Please sign in to comment.