Skip to content

Commit

Permalink
Reverted some changes that were unnecessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlupugla committed Jan 4, 2024
1 parent a3ea87a commit 14f4fb7
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2
script = ExtResource("1_4mqm3")
font_use_global_size = null
font_custom_size = null
font_use_global_fonts = null
font_custom_normal = null
font_custom_bold = null
font_custom_italics = null
HistoryItem = ExtResource("2_x1xgk")
disabled = null

[node name="HistoryBox" type="ScrollContainer" parent="."]
unique_name_in_owner = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ anchor_bottom = 1.0
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
mode = 0
position_index = 0
portrait_prefix = ""
size_mode = 3
mirrored = false
origin_anchor = 7
origin_offset = Vector2(0, 0)
debug_character = null
debug_character_portrait = ""
metadata/_edit_use_anchors_ = true

[node name="DialogicNode_PortraitContainer2" type="Control" parent="Portraits"]
Expand All @@ -49,15 +40,7 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
mode = 0
position_index = 1
portrait_prefix = ""
size_mode = 3
mirrored = false
origin_anchor = 7
origin_offset = Vector2(0, 0)
debug_character = null
debug_character_portrait = ""
metadata/_edit_use_anchors_ = true

[node name="DialogicNode_PortraitContainer3" type="Control" parent="Portraits"]
Expand All @@ -69,15 +52,7 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
mode = 0
position_index = 2
portrait_prefix = ""
size_mode = 3
mirrored = false
origin_anchor = 7
origin_offset = Vector2(0, 0)
debug_character = null
debug_character_portrait = ""
metadata/_edit_use_anchors_ = true

[node name="DialogicNode_PortraitContainer4" type="Control" parent="Portraits"]
Expand All @@ -89,15 +64,7 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
mode = 0
position_index = 3
portrait_prefix = ""
size_mode = 3
mirrored = false
origin_anchor = 7
origin_offset = Vector2(0, 0)
debug_character = null
debug_character_portrait = ""
metadata/_edit_use_anchors_ = true

[node name="DialogicNode_PortraitContainer5" type="Control" parent="Portraits"]
Expand All @@ -110,13 +77,5 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_rxdcc")
mode = 0
position_index = 4
portrait_prefix = ""
size_mode = 3
mirrored = false
origin_anchor = 7
origin_offset = Vector2(0, 0)
debug_character = null
debug_character_portrait = ""
metadata/_edit_use_anchors_ = true
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,7 @@ textbox_root = NodePath("..")
[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="DialogicTextAnchor/DialogTextAnimationParent/Sizer/DialogTextPanel/DialogicNode_DialogText"]
unique_name_in_owner = true
script = ExtResource("4_ma5mw")
enabled = true
mode = 0
sounds = Array[AudioStream]([])
end_sound = null
play_every_character = 0
pitch_variance = 0.0
volume_variance = 0.0
ignore_characters = " .,"

[node name="NextIndicator" type="Control" parent="DialogicTextAnchor/DialogTextAnimationParent/Sizer/DialogTextPanel"]
unique_name_in_owner = true
Expand Down
10 changes: 5 additions & 5 deletions addons/dialogic/Modules/History/subsystem_history.gd
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func store_full_event(event:DialogicEvent) -> void:
## Takes the current timeline event and creates a unique key for it.
## Uses the timeline resource path as well.
func _current_event_key() -> String:
var resource_path : String = dialogic.current_timeline.resource_path
var event_idx : String = str(dialogic.current_event_idx)
var event_key : String = resource_path + event_idx
var resource_path = dialogic.current_timeline.resource_path
var event_idx = str(dialogic.current_event_idx)
var event_key = resource_path+event_idx

return event_key

Expand All @@ -89,7 +89,7 @@ func event_was_read(_event: DialogicEvent) -> void:
if !already_read_history_enabled:
return

var event_key : String = _current_event_key()
var event_key = _current_event_key()

already_read_history_content[event_key] = dialogic.current_event_idx

Expand All @@ -104,7 +104,7 @@ func check_already_read(event: DialogicEvent) -> void:
if event.event_name != "Text":
return

var event_key : String = _current_event_key()
var event_key = _current_event_key()

if event_key in already_read_history_content:
already_read_event_reached.emit()
Expand Down
24 changes: 12 additions & 12 deletions addons/dialogic/Other/DialogicGameHandler.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ var current_event_idx: int = 0
## relevant for the current situation
var current_state_info: Dictionary = {}
## Current state (see [States] enum)
var current_state : States = States.IDLE:
var current_state := States.IDLE:
get:
return current_state
set(new_state):
current_state = new_state
emit_signal('state_changed', new_state)
## Emitted when [current_state] change.
signal state_changed(new_state : States)
signal state_changed(new_state)

## When true, many dialogic process won't continue until it's false again.
var paused : bool = false:
var paused := false:
set(value):
paused = value
if paused:
for subsystem : Node in get_children():
if subsystem.has_method(&'pause'):
subsystem.call(&'pause')
for subsystem in get_children():
if subsystem.has_method('pause'):
subsystem.pause()
dialogic_paused.emit()
else:
for subsystem : Node in get_children():
if subsystem.has_method(&'resume'):
subsystem.call(&'resume')
for subsystem in get_children():
if subsystem.has_method('resume'):
subsystem.resume()
dialogic_resumed.emit()

## Emitted when [paused] changes to true.
Expand All @@ -66,12 +66,12 @@ signal dialogic_resumed

signal timeline_ended()
signal timeline_started()
signal event_handled(resource : Variant)
signal event_handled(resource)

## Emitted when the Signal event was reached
signal signal_event(argument : Variant)
signal signal_event(argument)
## Emitted when [signal] effect was reached in text.
signal text_signal(argument : Variant)
signal text_signal(argument)


## Autoloads are added first, so this happens REALLY early on game startup.
Expand Down
9 changes: 4 additions & 5 deletions addons/dialogic/Other/DialogicUtil.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ static func get_editor_scale() -> float:
## Although this does in fact always return a EditorPlugin node,
## that class is apparently not present in export and referencing it here creates a crash.
static func get_dialogic_plugin() -> Node:
for child : Node in Engine.get_main_loop().get_root().get_children():
for child in Engine.get_main_loop().get_root().get_children():
if child.get_class() == "EditorNode":
return child.get_node(^'DialogicPlugin')
return child.get_node('DialogicPlugin')
return null

#endregion
Expand All @@ -24,10 +24,9 @@ static func get_dialogic_plugin() -> Node:
static func autoload() -> DialogicGameHandler:
if Engine.is_editor_hint():
return null
if not Engine.get_main_loop().root.has_node(^"Dialogic"):
if not Engine.get_main_loop().root.has_node("Dialogic"):
return null
return Engine.get_main_loop().root.get_node(^"Dialogic")

return Engine.get_main_loop().root.get_node("Dialogic")

#region FILE SYSTEM
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Resources/dialogic_layout_layer.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@tool
class_name DialogicLayoutLayer
extends Control
extends Node

## Base class that should be extended by custom dialogic layout layers.

Expand Down
3 changes: 3 additions & 0 deletions addons/dialogic/Resources/dialogic_style.gd
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func move_layer(from_index:int, to_index:int) -> void:
if not has_layer(from_index) or not has_layer(to_index-1):
return

if from_index < to_index:
to_index -1

var info: DialogicLayoutLayer = layers.pop_at(from_index)
layers.insert(to_index, info)
changed.emit()
Expand Down

0 comments on commit 14f4fb7

Please sign in to comment.