hide tooltips while speaking. Abstract ItemComponent, clean up, gitignore addons. Default font. Fixes #138 #130
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -12,3 +12,7 @@ bin
|
||||
addons/escoria-core/default_bus_layout.tres
|
||||
|
||||
.idea/
|
||||
|
||||
# Optional Addons per environment.
|
||||
addons/godot-plugin-refresher/
|
||||
addons/script-ide/
|
||||
|
||||
@@ -36,7 +36,7 @@ func _ready() -> void:
|
||||
# - type: required type
|
||||
# *Returns* Whether the type is supported or not
|
||||
func has_type(type: String) -> bool:
|
||||
return true if type in ["floating"] else false
|
||||
return true if type == "floating" else false
|
||||
|
||||
# Check whether a specific chooser type is supported by the
|
||||
# dialog plugin
|
||||
@@ -142,11 +142,13 @@ func _on_say_finished():
|
||||
|
||||
_is_saying = false
|
||||
|
||||
say_finished.emit()
|
||||
_dialog_player.say_finished.emit()
|
||||
escoria.game_scene.show_tooltips()
|
||||
|
||||
|
||||
|
||||
func _on_say_visible():
|
||||
say_visible.emit()
|
||||
escoria.game_scene.hide_tooltips()
|
||||
|
||||
|
||||
# Present an option chooser to the player and sends the signal
|
||||
@@ -159,12 +161,15 @@ func _on_say_visible():
|
||||
func choose(dialog_player: Node, dialog: ESCDialog, type: String):
|
||||
_dialog_player = dialog_player
|
||||
|
||||
escoria.game_scene.close_inventory()
|
||||
state_machine.states_map["choices"].initialize(dialog_player, self, dialog, type)
|
||||
state_machine._change_state("choices")
|
||||
|
||||
|
||||
|
||||
func do_choose(dialog_player: Node, dialog: ESCDialog, type: String = "simple"):
|
||||
escoria.game_scene.hide_tooltips()
|
||||
|
||||
|
||||
var chooser
|
||||
|
||||
if type == "simple" or type == "":
|
||||
@@ -178,11 +183,14 @@ func do_choose(dialog_player: Node, dialog: ESCDialog, type: String = "simple"):
|
||||
|
||||
var option = await chooser.option_chosen
|
||||
dialog_player.remove_child(chooser)
|
||||
|
||||
# MODIFIED FOR RETURN TO MONKEY UI
|
||||
if option is ESCDialogOption:
|
||||
escoria.globals_manager.set_global("ESC_DIALOG_CHOSEN_OPTION", option.option)
|
||||
# END MODIFIED FOR RETURN TO MONKEY UI
|
||||
option_chosen.emit(option)
|
||||
escoria.game_scene.hide_tooltips()
|
||||
|
||||
|
||||
# Trigger running the dialogue faster
|
||||
func speedup():
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
[gd_resource type="Theme" load_steps=5 format=3 uid="uid://dlo07cyfhpilq"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://dfs4e42nd215" path="res://addons/escoria-ui-return-monkey-island/fonts/determination.ttf" id="1_yc5i3"]
|
||||
[gd_resource type="Theme" load_steps=4 format=3 uid="uid://dlo07cyfhpilq"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="1"]
|
||||
content_margin_left = 4.0
|
||||
@@ -36,9 +34,9 @@ Label/colors/font_color = Color(1, 1, 1, 1)
|
||||
Label/colors/font_color_shadow = Color(0, 0, 0, 0)
|
||||
Label/colors/font_outline_modulate = Color(1, 0, 0, 1)
|
||||
Label/colors/label_box_bg = Color(0, 0, 0, 0.745098)
|
||||
Label/fonts/font = ExtResource("1_yc5i3")
|
||||
Label/fonts/font = null
|
||||
Label/styles/normal = SubResource("1")
|
||||
RichTextLabel/font_sizes/font_size = 20
|
||||
RichTextLabel/fonts/normal_font = ExtResource("1_yc5i3")
|
||||
RichTextLabel/fonts/normal_font = null
|
||||
RichTextLabel/styles/focus = SubResource("2")
|
||||
RichTextLabel/styles/normal = SubResource("3")
|
||||
|
||||
@@ -121,6 +121,7 @@ func say(character: String, line: String) :
|
||||
_current_line = line
|
||||
|
||||
show()
|
||||
say_visible.emit()
|
||||
|
||||
_is_speeding_up = false
|
||||
|
||||
@@ -215,8 +216,6 @@ func _on_dialog_line_typed(object, key):
|
||||
$Timer.start(time_to_disappear)
|
||||
$Timer.timeout.connect(_on_dialog_finished)
|
||||
|
||||
say_visible.emit()
|
||||
|
||||
|
||||
func _calculate_time_to_disappear() -> float:
|
||||
return (_get_number_of_words() / _reading_speed_in_wpm as float) * 60
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
[gd_resource type="FontFile" load_steps=2 format=3 uid="uid://cne31d6e0513y"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://dbuthr0652qv7" path="res://addons/escoria-ui-return-monkey-island/fonts/caslonantique.ttf" id="1"]
|
||||
|
||||
[resource]
|
||||
fallbacks = Array[Font]([ExtResource("1")])
|
||||
cache/0/16/0/ascent = 0.0
|
||||
cache/0/16/0/descent = 0.0
|
||||
cache/0/16/0/underline_position = 0.0
|
||||
cache/0/16/0/underline_thickness = 0.0
|
||||
cache/0/16/0/scale = 1.0
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,36 +1,13 @@
|
||||
extends ESCInventory
|
||||
|
||||
|
||||
# Whether the inventory is visible currently
|
||||
var inventory_visible: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
#$FloatingInventory/panel.position.x = ProjectSettings.get_setting("display/window/size/viewport_width") - $FloatingInventory/panel.size.x
|
||||
|
||||
|
||||
func show_inventory():
|
||||
#$FloatingInventory/panel.show()
|
||||
self.show()
|
||||
inventory_visible = true
|
||||
|
||||
|
||||
func hide_inventory():
|
||||
#$FloatingInventory/panel.hide()
|
||||
self.hide()
|
||||
inventory_visible = false
|
||||
|
||||
|
||||
func show_ui():
|
||||
#$FloatingInventory/inventory_bg.show()
|
||||
#$FloatingInventory/panel/MarginContainer/ScrollContainer/container.show()
|
||||
self.show()
|
||||
inventory_visible = true
|
||||
|
||||
|
||||
func hide_ui():
|
||||
self.hide()
|
||||
#$FloatingInventory/inventory_bg.hide()
|
||||
#$FloatingInventory/panel/MarginContainer/ScrollContainer/container.hide()
|
||||
inventory_visible = false
|
||||
|
||||
func show_inventory():
|
||||
show_ui()
|
||||
|
||||
func hide_inventory():
|
||||
hide_ui()
|
||||
@@ -1,13 +1,12 @@
|
||||
extends Node
|
||||
class_name ESCItemComponent
|
||||
@abstract class_name ESCItemComponent extends Node
|
||||
|
||||
var _custom_data: Dictionary
|
||||
|
||||
func get_global_id():
|
||||
return self.get_parent().global_id
|
||||
@abstract
|
||||
func get_component_type() -> String
|
||||
|
||||
func get_component_type():
|
||||
pass
|
||||
func register(custom_data: Dictionary) -> void:
|
||||
pass
|
||||
|
||||
func register(custom_data: Dictionary):
|
||||
pass
|
||||
func get_global_id() -> String:
|
||||
return self.get_parent().global_id
|
||||
@@ -1,6 +1,4 @@
|
||||
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://djtwqnfbbt5t8"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://dfs4e42nd215" path="res://addons/escoria-ui-return-monkey-island/fonts/determination.ttf" id="1_p03cv"]
|
||||
[gd_resource type="Theme" load_steps=11 format=3 uid="uid://djtwqnfbbt5t8"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="1"]
|
||||
bg_color = Color(0.14902, 0.14902, 0.14902, 0.784314)
|
||||
@@ -36,7 +34,6 @@ bg_color = Color(0.219501, 0.219501, 0.219501, 1)
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_p03cv"]
|
||||
|
||||
[resource]
|
||||
Button/fonts/font = ExtResource("1_p03cv")
|
||||
Button/styles/disabled = null
|
||||
Button/styles/focus = SubResource("1")
|
||||
Button/styles/hover = SubResource("2")
|
||||
@@ -47,7 +44,6 @@ CheckButton/styles/hover = SubResource("StyleBoxEmpty_gwd03")
|
||||
CheckButton/styles/hover_pressed = SubResource("StyleBoxEmpty_6jmhn")
|
||||
CheckButton/styles/normal = SubResource("StyleBoxEmpty_ktabe")
|
||||
CheckButton/styles/pressed = SubResource("StyleBoxEmpty_4rhik")
|
||||
Label/fonts/font = ExtResource("1_p03cv")
|
||||
MarginContainer/constants/margin_bottom = 5
|
||||
MarginContainer/constants/margin_left = 5
|
||||
MarginContainer/constants/margin_right = 5
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
[gd_resource type="Theme" load_steps=7 format=3 uid="uid://bf2eet52fueam"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://dfs4e42nd215" path="res://addons/escoria-ui-return-monkey-island/fonts/determination.ttf" id="1_6h504"]
|
||||
[gd_resource type="Theme" load_steps=6 format=3 uid="uid://bf2eet52fueam"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h504"]
|
||||
|
||||
@@ -35,20 +33,16 @@ expand_margin_right = 5.0
|
||||
expand_margin_bottom = 5.0
|
||||
|
||||
[resource]
|
||||
Button/fonts/font = ExtResource("1_6h504")
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_6h504")
|
||||
Label/colors/font_color = Color(1, 1, 1, 1)
|
||||
Label/colors/font_color_shadow = Color(0, 0, 0, 0)
|
||||
Label/colors/font_outline_modulate = Color(1, 0, 0, 1)
|
||||
Label/colors/label_box_bg = Color(0, 0, 0, 0.745098)
|
||||
Label/fonts/font = ExtResource("1_6h504")
|
||||
Label/styles/normal = SubResource("1")
|
||||
MarginContainer/constants/margin_bottom = 5
|
||||
MarginContainer/constants/margin_left = 5
|
||||
MarginContainer/constants/margin_right = 5
|
||||
MarginContainer/constants/margin_top = 5
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxEmpty_6h504")
|
||||
RichTextLabel/fonts/mono_font = ExtResource("1_6h504")
|
||||
RichTextLabel/fonts/normal_font = ExtResource("1_6h504")
|
||||
RichTextLabel/styles/focus = SubResource("2")
|
||||
RichTextLabel/styles/normal = SubResource("3")
|
||||
|
||||
Reference in New Issue
Block a user