prog
This commit is contained in:
12
addons/madtalk/components/resources/ButtonStyle.tres
Normal file
12
addons/madtalk/components/resources/ButtonStyle.tres
Normal file
@@ -0,0 +1,12 @@
|
||||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
bg_color = Color( 0.2883, 0.2666, 0.31, 1 )
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color( 0.1, 0.1, 0.1, 1 )
|
||||
border_blend = true
|
||||
shadow_color = Color( 0, 0, 0, 0.12549 )
|
||||
shadow_size = 2
|
31
addons/madtalk/components/resources/DialogData.gd
Normal file
31
addons/madtalk/components/resources/DialogData.gd
Normal file
@@ -0,0 +1,31 @@
|
||||
@tool
|
||||
extends Resource
|
||||
class_name DialogData
|
||||
|
||||
# This Resource is the top container of all the dialog data in the game
|
||||
# It contains sheets, each sheet contains sequences, each sequence contains
|
||||
# items and options
|
||||
#
|
||||
# DialogData
|
||||
# |- DialogSheetData -> e.g. sheet_id = "npc1_shop"
|
||||
# | |- DialogNodeData -> e.g. ID=0 - START (options are inside)
|
||||
# | | |- DialogNodeItemData -> e.g. welcome message
|
||||
# | | |- DialogNodeItemData -> e.g. some condition
|
||||
# | | '- DialogNodeItemData -> e.g. some effects
|
||||
# | |- DialogNodeData -> e.g. ID=1 (e.g. some item purchase)
|
||||
# | | |- DialogNodeItemData -> e.g. thank you message
|
||||
# | | |- DialogNodeItemData -> e.g. effect to buy item
|
||||
# | | ...
|
||||
# | ...
|
||||
# |- DialogSheetData -> e.g. dialog in some other context
|
||||
# ...
|
||||
|
||||
# Version number will be used in the future to convert databases to newer
|
||||
# versions. This is necessary since conditions and effects are based on
|
||||
# enums (and therefore int's) and adding new items might potentially break
|
||||
# existing designs
|
||||
@export var version: float = 1.0
|
||||
|
||||
# Dictionary keys are strings
|
||||
# Dictionary values are DialogSheetData resource
|
||||
@export var sheets: Dictionary = {}
|
1
addons/madtalk/components/resources/DialogData.gd.uid
Normal file
1
addons/madtalk/components/resources/DialogData.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bw2q2eucjkylk
|
17
addons/madtalk/components/resources/DialogNodeData.gd
Normal file
17
addons/madtalk/components/resources/DialogNodeData.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
@tool
|
||||
extends Resource
|
||||
class_name DialogNodeData
|
||||
|
||||
# This Resource refers to an entire dialog sequence (graphical node),
|
||||
# and does not include sub-items
|
||||
# It is used to define sequence ID and option buttons
|
||||
|
||||
@export var sequence_id: int = 0
|
||||
@export var position: Vector2 = Vector2(0,0)
|
||||
@export var comment: String = ""
|
||||
|
||||
@export var items = [] # (Array, Resource)
|
||||
@export var options = [] # (Array, Resource)
|
||||
|
||||
@export var continue_sequence_id: int = -1
|
||||
@export var continue_port_index: int = -1
|
@@ -0,0 +1 @@
|
||||
uid://b2mrnotqjr75d
|
73
addons/madtalk/components/resources/DialogNodeItemData.gd
Normal file
73
addons/madtalk/components/resources/DialogNodeItemData.gd
Normal file
@@ -0,0 +1,73 @@
|
||||
@tool
|
||||
extends Resource
|
||||
class_name DialogNodeItemData
|
||||
|
||||
# This resource is variant and is shared across all node item types
|
||||
# Properties which are not applicable are just ignored
|
||||
|
||||
enum ItemTypes {
|
||||
Message, # Basic item, displays a dialog message
|
||||
Condition, # Condition to branch out
|
||||
Effect # Effect causing a change to some in-game state
|
||||
}
|
||||
|
||||
# Type of item (message, condition or effect)
|
||||
@export var item_type: ItemTypes = ItemTypes.Message
|
||||
# To what sequence id this item is connected (only valid for condition)
|
||||
@export var connected_to_id: int = -1
|
||||
# Holds the GraphNode port index for this item
|
||||
var port_index : int = -1
|
||||
|
||||
# ==============================================================================
|
||||
# USED BY TYPE: MESSAGE
|
||||
|
||||
@export var message_speaker_id: String = ""
|
||||
@export var message_speaker_variant: String = ""
|
||||
|
||||
# For compatibility reasons, default names are associated with the default
|
||||
# language - that is, if locale isn't specified.
|
||||
@export var message_voice_clip: String = "" # Default locale
|
||||
@export_multiline var message_text := "" # Default locale
|
||||
|
||||
# Localised versions go on separate properties
|
||||
@export var message_voice_clip_locales: Dictionary = {}
|
||||
@export var message_text_locales: Dictionary = {}
|
||||
|
||||
@export var message_hide_on_end: int = 0
|
||||
|
||||
func get_localized_text() -> String:
|
||||
var locale = MadTalkGlobals.current_locale
|
||||
|
||||
if locale == "":
|
||||
return message_text
|
||||
|
||||
elif (locale in message_text_locales):
|
||||
return message_text_locales[locale]
|
||||
|
||||
else:
|
||||
return message_text
|
||||
|
||||
|
||||
func get_localized_voice_clip() -> String:
|
||||
var locale = MadTalkGlobals.current_locale
|
||||
|
||||
if locale == "":
|
||||
return message_voice_clip
|
||||
|
||||
elif (locale in message_voice_clip_locales):
|
||||
return message_voice_clip_locales[locale]
|
||||
|
||||
else:
|
||||
return message_voice_clip
|
||||
|
||||
# ==============================================================================
|
||||
# USED BY TYPE: CONDITION
|
||||
|
||||
@export var condition_type := MTDefs.ConditionTypes.Custom # (MTDefs.ConditionTypes)
|
||||
@export var condition_values: Array = []
|
||||
|
||||
# ==============================================================================
|
||||
# USED BY TYPE: EFFECT
|
||||
|
||||
@export var effect_type := MTDefs.EffectTypes.Custom # (MTDefs.EffectTypes)
|
||||
@export var effect_values: Array = []
|
@@ -0,0 +1 @@
|
||||
uid://c2bv5lwcvdmrb
|
57
addons/madtalk/components/resources/DialogNodeOptionData.gd
Normal file
57
addons/madtalk/components/resources/DialogNodeOptionData.gd
Normal file
@@ -0,0 +1,57 @@
|
||||
@tool
|
||||
extends Resource
|
||||
class_name DialogNodeOptionData
|
||||
|
||||
enum AutodisableModes {
|
||||
NEVER,
|
||||
RESET_ON_SHEET_RUN,
|
||||
ALWAYS
|
||||
}
|
||||
|
||||
enum InactiveMode {
|
||||
DISABLED,
|
||||
HIDDEN
|
||||
}
|
||||
|
||||
## Text shown in the button, default locale
|
||||
@export var text: String = ""
|
||||
|
||||
## Text shown in the button, other locales
|
||||
@export var text_locales: Dictionary = {}
|
||||
|
||||
## To what sequence id this option is connected
|
||||
@export var connected_to_id: int = -1
|
||||
# Holds the GraphNode port index for this item
|
||||
var port_index : int = -1
|
||||
|
||||
## If option visibility is conditional
|
||||
@export var is_conditional: bool = false
|
||||
|
||||
## Variable name
|
||||
@export var condition_variable: String = ""
|
||||
|
||||
## Condition operator ("=", "!=", ">", "<", ">=", "<=")
|
||||
## This version keeps it as string for code simplicity
|
||||
@export var condition_operator: String = "="
|
||||
|
||||
## Variable value - if the string is a valid number, value is the number itself
|
||||
## otherwise (if it's a text String) it's the variable name to compare to
|
||||
@export var condition_value: String = ""
|
||||
|
||||
## If the option auto-disables itself after selected
|
||||
@export var autodisable_mode := AutodisableModes.NEVER
|
||||
|
||||
## How the option is handled when it's not active
|
||||
@export var inactive_mode := InactiveMode.DISABLED
|
||||
|
||||
func get_localized_text() -> String:
|
||||
var locale = MadTalkGlobals.current_locale
|
||||
|
||||
if locale == "":
|
||||
return text
|
||||
|
||||
elif (locale in text_locales):
|
||||
return text_locales[locale]
|
||||
|
||||
else:
|
||||
return text
|
@@ -0,0 +1 @@
|
||||
uid://bfg2ff7c0tanh
|
22
addons/madtalk/components/resources/DialogSheetData.gd
Normal file
22
addons/madtalk/components/resources/DialogSheetData.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
@tool
|
||||
extends Resource
|
||||
class_name DialogSheetData
|
||||
|
||||
# This resource contains a sheet of dialog, consisting of interconnected nodes
|
||||
# Each node is a DialogNodeData
|
||||
#
|
||||
# E.g.
|
||||
# DialogSheetData -> e.g. sheet_id = "npc1_shop"
|
||||
# |- DialogNodeData -> e.g. ID=0 - START (options are inside)
|
||||
# | |- DialogNodeItemData -> e.g. welcome message
|
||||
# | |- DialogNodeItemData -> e.g. some condition
|
||||
# | '- DialogNodeItemData -> e.g. some effects
|
||||
# |- DialogNodeData -> e.g. ID=1 (e.g. some item purchase)
|
||||
# | |- DialogNodeItemData -> e.g. thank you message
|
||||
# | |- DialogNodeItemData -> e.g. effect to buy item
|
||||
# | ...
|
||||
|
||||
@export var sheet_id: String = ""
|
||||
@export var sheet_description: String = ""
|
||||
@export var next_sequence_id: int = 0
|
||||
@export var nodes: Array = [] # "nodes" as in dialog node, not Godot Node # (Array, Resource)
|
@@ -0,0 +1 @@
|
||||
uid://butd1fwy4a2hn
|
10
addons/madtalk/components/resources/GraphStyle.tres
Normal file
10
addons/madtalk/components/resources/GraphStyle.tres
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
bg_color = Color( 0.20055, 0.1911, 0.21, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.06, 0.06, 0.06, 1 )
|
||||
border_blend = true
|
12
addons/madtalk/components/resources/InputDarkStyle.tres
Normal file
12
addons/madtalk/components/resources/InputDarkStyle.tres
Normal file
@@ -0,0 +1,12 @@
|
||||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 4.0
|
||||
content_margin_right = 4.0
|
||||
bg_color = Color( 0.1116, 0.1032, 0.12, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.06, 0.06, 0.06, 1 )
|
||||
border_blend = true
|
10
addons/madtalk/components/resources/InputStyle_grey.tres
Normal file
10
addons/madtalk/components/resources/InputStyle_grey.tres
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dk8cb0qbpag2d"]
|
||||
|
||||
[resource]
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.403922, 0.396078, 0.396078, 1)
|
||||
border_blend = true
|
||||
expand_margin_left = 2.0
|
16
addons/madtalk/components/resources/NodeStyle.tres
Normal file
16
addons/madtalk/components/resources/NodeStyle.tres
Normal file
@@ -0,0 +1,16 @@
|
||||
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dgwdu67tftiqs"]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 8.0
|
||||
content_margin_top = 22.0
|
||||
content_margin_right = 8.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.186, 0.172, 0.2, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.06, 0.06, 0.06, 1)
|
||||
border_blend = true
|
||||
corner_detail = 1
|
||||
shadow_size = 4
|
10
addons/madtalk/components/resources/PanelStyle.tres
Normal file
10
addons/madtalk/components/resources/PanelStyle.tres
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
bg_color = Color( 0.1581, 0.1462, 0.17, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.06, 0.06, 0.06, 1 )
|
||||
border_blend = true
|
@@ -0,0 +1,4 @@
|
||||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
bg_color = Color( 1, 1, 1, 0 )
|
@@ -0,0 +1,4 @@
|
||||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
bg_color = Color( 0.733333, 0.733333, 0.733333, 1 )
|
14
addons/madtalk/components/resources/SheetItemStyle.tres
Normal file
14
addons/madtalk/components/resources/SheetItemStyle.tres
Normal file
@@ -0,0 +1,14 @@
|
||||
[gd_resource type="StyleBoxFlat" format=2]
|
||||
|
||||
[resource]
|
||||
content_margin_left = 0.0
|
||||
content_margin_right = 0.0
|
||||
content_margin_top = 0.0
|
||||
content_margin_bottom = 0.0
|
||||
bg_color = Color( 0.22432, 0.2064, 0.24, 1 )
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color( 0.109804, 0.109804, 0.109804, 1 )
|
||||
border_blend = true
|
Reference in New Issue
Block a user