Skip to content

Commit

Permalink
Typo fix, error fix and Choice Layer offset (#2328)
Browse files Browse the repository at this point in the history
- fixes #2327
- fixes an error when typing a choice in the text editor
- adds an Offset parameter to the choice layer to fix #2280
  • Loading branch information
Jowan-Spooner committed Jul 4, 2024
1 parent 925b32f commit 0108a09
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/editors_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func _on_editors_tab_changed(tab:int) -> void:
func edit_resource(resource:Resource, save_previous:bool = true, silent:= false) -> void:
if not resource:
# The resource doesn't exists, show an error
print('[Dialogic] The resource you are trying to edit doesn\'t exists any more.')
print("[Dialogic] The resource you are trying to edit doesn't exist any more.")
return

if current_editor and save_previous:
Expand Down
3 changes: 3 additions & 0 deletions addons/dialogic/Modules/Choice/event_choice.gd
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, li

dict[0] = {'color':event_color}

if not result:
return dict

var condition_begin := result.get_start("condition")
var condition_end := result.get_end("condition")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extends DialogicLayoutLayer
@export var boxes_v_separation: int = 10
@export var boxes_fill_width: bool = true
@export var boxes_min_size: Vector2 = Vector2()
@export var boxes_offset: Vector2 = Vector2()

@export_group('Sounds')
@export_range(-80, 24, 0.01) var sounds_volume: float = -10
Expand Down Expand Up @@ -96,6 +97,7 @@ func _apply_export_overrides() -> void:
layer_theme.set_stylebox(&'focus', &'Button', load(boxes_stylebox_focused) as StyleBox)

get_choices().add_theme_constant_override(&"separation", boxes_v_separation)
self.position = boxes_offset

for child: Node in get_choices().get_children():
if not child is DialogicNode_ChoiceButton:
Expand All @@ -109,6 +111,7 @@ func _apply_export_overrides() -> void:

choice.custom_minimum_size = boxes_min_size


set(&'theme', layer_theme)

# apply sound settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -86.5
offset_top = -103.0
offset_right = 86.5
offset_bottom = 103.0
offset_left = -41.0
offset_top = -47.0
offset_right = 42.0
offset_bottom = 47.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
Expand Down

0 comments on commit 0108a09

Please sign in to comment.