Compare commits

..

No commits in common. "25152de5242b5518e7b8e7f42c55be27113d2377" and "65b0b39da3990e3756223946b30194258e7dfad7" have entirely different histories.

16 changed files with 18 additions and 188 deletions

View File

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 732 B

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/default.png-88b8771544923be91ca280c327742454.stex"
path="res://.import/MManPortrait.png-4e2ec0d6412baee3672a65d68519d9e1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/portraits/default.png"
dest_files=[ "res://.import/default.png-88b8771544923be91ca280c327742454.stex" ]
source_file="res://assets/MManPortrait.png"
dest_files=[ "res://.import/MManPortrait.png-4e2ec0d6412baee3672a65d68519d9e1.stex" ]
[params]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

View File

@ -1,35 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/WarriorGirl.png-9f501edf6f27b5a11aae7948e00cc6e3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/portraits/WarriorGirl.png"
dest_files=[ "res://.import/WarriorGirl.png-9f501edf6f27b5a11aae7948e00cc6e3.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -1,9 +0,0 @@
[gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://src/classes/dialog_item.gd" type="Script" id=1]
[ext_resource path="res://assets/portraits/WarriorGirl.png" type="Texture" id=2]
[resource]
script = ExtResource( 1 )
portrait = ExtResource( 2 )
text_lines = PoolStringArray( "Hey there. I heard you\'re Gangsta.", "Well I\'m pretty gangsta myself!" )

View File

@ -1,35 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/MManPortrait.png-c012ca0947bb1e1b73c5a27d8f73a91f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets_tmp/MManPortrait.png"
dest_files=[ "res://.import/MManPortrait.png-c012ca0947bb1e1b73c5a27d8f73a91f.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -11,13 +11,6 @@ var current_pane = UI_PANES.OFF
var debug_text :String
var _dialog_item :DialogItem
var playing_dialog :bool = false
var current_dialog_index :int
signal ui_change()
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
@ -27,33 +20,9 @@ signal ui_change()
func _ready():
pass # Replace with function body.
func play_dialog_item(dialog_item :DialogItem, dialog_index :int = 0):
_dialog_item = dialog_item
if _dialog_item.text_lines.size() > 0:
current_dialog_index = dialog_index
playing_dialog = true
dialog_text = _dialog_item.text_lines[current_dialog_index]
dialog_portrait = _dialog_item.portrait
current_pane = UI_PANES.DIALOG
emit_signal("ui_change")
func stop_dialog():
dialog_text = 'foo'
current_pane = UI_PANES.HUD
playing_dialog = false
emit_signal("ui_change")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if playing_dialog:
var foo = ''
##TODO: Lockout input on player before dialog happens.
if Input.is_action_just_pressed("crouch_1"):
if _dialog_item.text_lines.size() > (current_dialog_index + 1):
current_dialog_index += 1
dialog_text = _dialog_item.text_lines[current_dialog_index]
dialog_portrait = _dialog_item.portrait
emit_signal("ui_change")
else:
stop_dialog()
#func _process(delta):
# debug_text = ''
# for _player_id in NetworkManager.get_player_ids():
# debug_text += str(_player_id) + '\n'

View File

@ -35,11 +35,6 @@ _global_script_classes=[ {
"path": "res://lib/classes/collision_shape2D_state_receiver.gd"
}, {
"base": "Resource",
"class": "DialogItem",
"language": "GDScript",
"path": "res://src/classes/dialog_item.gd"
}, {
"base": "Resource",
"class": "GameSettings",
"language": "GDScript",
"path": "res://src/game_settings.gd"
@ -190,7 +185,6 @@ _global_script_class_icons={
"AudioStreamPlayer_StateReceiver": "",
"CameraGuide": "",
"CollisionShape2D_StateReceiver": "",
"DialogItem": "",
"GameSettings": "",
"HealthComponent": "",
"HealthPickup": "",

View File

@ -8,31 +8,10 @@ extends Interactable
export (String) var dialog_text
export (bool) var auto_start = false
export (Array, Resource) var dialog_items
# Called when the node enters the scene tree for the first time.
func _ready():
assert(verify_resources(), "Dialog contains invalid resources")
#func _ready():
# pass # Replace with function body.
func verify_resources() -> bool:
for r in dialog_items:
if not r is DialogItem:
return false
return true
func trigger_interaction():
var dialog :DialogItem = dialog_items[0]
# UiManager.dialog_text = dialog.text_lines[0]
# UiManager.dialog_portrait = dialog.portrait
# UiManager.current_pane = UiManager.UI_PANES.DIALOG
UiManager.play_dialog_item(dialog)
func disable_dialog():
pass
func _on_Interactable_Component_body_exited(body):
._on_Interactable_Component_body_exited(body)
disable_dialog()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):

View File

@ -22,4 +22,3 @@ func _on_NPC_Dialog_body_entered(body):
func _on_NPC_Dialog_body_exited(body):
movement_state_machine.change_to_known_state("default")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=9 format=2]
[ext_resource path="res://lib/parent_scenes/actor.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/actors/npcs/WarriorGirl/WarriorGirl.tres" type="SpriteFrames" id=2]
@ -6,7 +6,6 @@
[ext_resource path="res://src/Interactables/interactable_npc_dialog.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/actors/npcs/WarriorGirl/WarriorGirl.gd" type="Script" id=5]
[ext_resource path="res://src/actors/npcs/draw_sword.tres" type="Resource" id=6]
[ext_resource path="res://assets/text/dialog/WarriorGirl_Intro.tres" type="Resource" id=7]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 9, 14 )
@ -35,7 +34,6 @@ shape = SubResource( 1 )
[node name="NPC_Dialog" parent="." index="5" instance=ExtResource( 4 )]
collision_mask = 2
dialog_text = "Hello, I am a human."
dialog_items = [ ExtResource( 7 ) ]
[node name="CollisionShape2D" type="CollisionShape2D" parent="NPC_Dialog" index="0"]
modulate = Color( 0, 1, 0, 1 )

View File

@ -129,15 +129,14 @@ func process_physics_input(delta):
# call the parent, Which would call the individuals
.process_physics_input(delta)
# then process movement controls
if UiManager.current_pane == UiManager.UI_PANES.HUD:
get_movement_direction()
wants_jump()
wants_crouch()
wants_attack_primary()
wants_attack_secondary()
wants_dash()
wants_roll()
wants_climb()
get_movement_direction()
wants_jump()
wants_crouch()
wants_attack_primary()
wants_attack_secondary()
wants_dash()
wants_roll()
wants_climb()
func flip_sprite_to_movement_direction():
if desired_movement_vector.x != 0.0:

View File

@ -147,7 +147,6 @@ func touch_the_thing(the_thing: Interactable) -> bool:
if the_thing is Interactable_NPC_Dialog:
## Get this to the UI mananger
print("NPC wants to say: ",the_thing.dialog_text)
the_thing.trigger_interaction()
return true

View File

@ -1,20 +0,0 @@
class_name DialogItem
extends Resource
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
export(Texture) var portrait
export(PoolStringArray) var text_lines
# Called when the node enters the scene tree for the first time.
func _ready():
##TODO: I forgot the better way to determine a valid item is null or empty
if portrait == null:
push_warning("No protrait defined for dialog item.")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@ -37,8 +37,6 @@ func _ready():
tween.tween_property(DialogIndicator, "modulate", Color.darkgray, 1)
tween.tween_property(DialogIndicator, "modulate", Color.white , 1)
##tween.tween_property(DialogIndicator, "modulate", Color.RED, 1)
UiManager.connect("ui_change",self,"reset_current_pane_tracker")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
@ -48,12 +46,10 @@ func _process(delta):
current_pane = UiManager.current_pane
DialogContainer.visible = false
health_bar.visible = false
stamina_bar.visible = false
match current_pane:
UiManager.UI_PANES.HUD:
print("Enable HUD")
health_bar.visible = true
stamina_bar.visible = true
UiManager.UI_PANES.DIALOG:
print("Enable Dialog")
DialogContainerPortrait.texture = UiManager.dialog_portrait
@ -68,7 +64,3 @@ func _unhandled_input(event):
if current_pane == UiManager.UI_PANES.DIALOG and Input.is_action_just_pressed("ui_accept"):
UiManager.current_pane = UiManager.UI_PANES.HUD
#get_tree().paused = false
func reset_current_pane_tracker():
current_pane = 0