fixed the stupid program
This commit is contained in:
parent
c65f5cc0ee
commit
1762880c9f
16 changed files with 172 additions and 146 deletions
|
@ -33,8 +33,14 @@ var dialogue_line: DialogueLine:
|
|||
if value:
|
||||
dialogue_line = value
|
||||
apply_dialogue_line()
|
||||
#RPG
|
||||
#%AnimationPlayer.play("newline")
|
||||
else:
|
||||
# The dialogue has finished so close the balloon
|
||||
#RPG
|
||||
#%AnimationPlayer.play("die")
|
||||
|
||||
#Non RPG
|
||||
queue_free()
|
||||
get:
|
||||
return dialogue_line
|
||||
|
@ -54,12 +60,17 @@ var mutation_cooldown: Timer = Timer.new()
|
|||
## The menu of responses
|
||||
@onready var responses_menu: DialogueResponsesMenu = %ResponsesMenu
|
||||
|
||||
var yield_nextline = false
|
||||
|
||||
#region Label References
|
||||
#Put label references here
|
||||
#endregion
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
#RPG
|
||||
#MapHandler.current_map.player.controllable = false
|
||||
set_dialog_settings()
|
||||
balloon.hide()
|
||||
Engine.get_singleton("DialogueManager").mutated.connect(_on_mutated)
|
||||
# If the responses menu doesn't have a next action set, use this one
|
||||
|
@ -83,6 +94,10 @@ func _notification(what: int) -> void:
|
|||
if visible_ratio < 1:
|
||||
dialogue_label.skip_typing()
|
||||
|
||||
func set_dialog_settings():
|
||||
pass
|
||||
#RPG
|
||||
#%DVNLabel.seconds_per_step = 0.0
|
||||
|
||||
## Start some dialogue
|
||||
func start(dialogue_resource: DialogueResource, title: String, extra_game_states: Array = []) -> void:
|
||||
|
@ -168,15 +183,27 @@ func _on_balloon_gui_input(event: InputEvent) -> void:
|
|||
# When there are no response options the balloon itself is the clickable thing
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
if event is InputEventMouseButton and event.is_pressed() and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
next(dialogue_line.next_id)
|
||||
elif event.is_action_pressed(next_action) and get_viewport().gui_get_focus_owner() == balloon:
|
||||
if event.is_action_pressed(next_action) and get_viewport().gui_get_focus_owner() == balloon:
|
||||
#RPG
|
||||
#if !%AnimationPlayer.is_playing():
|
||||
#next(dialogue_line.next_id)
|
||||
#else:
|
||||
#yield_nextline = true
|
||||
next(dialogue_line.next_id)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
print(dialogue_line.responses.size())
|
||||
|
||||
|
||||
func _on_responses_menu_response_selected(response: DialogueResponse) -> void:
|
||||
next(response.next_id)
|
||||
|
||||
#endregion
|
||||
|
||||
#RPG
|
||||
#func _on_animation_player_animation_finished(anim_name: StringName) -> void:
|
||||
#if anim_name == "die":
|
||||
#MapHandler.current_map.player.controllable = true
|
||||
#queue_free()
|
||||
#if anim_name == "newline":
|
||||
#if yield_nextline:
|
||||
#yield_nextline = false
|
||||
#next(dialogue_line.next_id)
|
||||
|
|
1
addons/dvn/balloon/dvn_balloon.gd.uid
Normal file
1
addons/dvn/balloon/dvn_balloon.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://bgjbro1bti40g
|
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://kssjsapnseux"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dvn/balloon/dvn_balloon.gd" id="1_7pshc"]
|
||||
[ext_resource type="PackedScene" uid="uid://cca3fm3pojb41" path="res://addons/dvn/label/dvn_label.tscn" id="2_7ceuc"]
|
||||
[ext_resource type="Script" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_72ixx"]
|
||||
[ext_resource type="Script" uid="uid://bgjbro1bti40g" path="res://dvn/balloon/dvn_balloon.gd" id="1_7pshc"]
|
||||
[ext_resource type="PackedScene" uid="uid://cca3fm3pojb41" path="res://dvn/label/dvn_label.tscn" id="2_7ceuc"]
|
||||
[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_72ixx"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
|
@ -146,7 +146,6 @@ layout_mode = 2
|
|||
text = "Response example"
|
||||
|
||||
[node name="TalktonePlayer" type="AudioStreamPlayer" parent="."]
|
||||
bus = &"VOX"
|
||||
|
||||
[connection signal="gui_input" from="Balloon" to="." method="_on_balloon_gui_input"]
|
||||
[connection signal="response_selected" from="Balloon/Responses/ResponsesMenu" to="." method="_on_responses_menu_response_selected"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue