Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Example Assets/backgrounds/background-2.png" type="Texture" id=1]
|
||||
|
||||
[node name="DefaultBackground" type="Panel"]
|
||||
self_modulate = Color( 1, 1, 1, 0 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
texture = ExtResource( 1 )
|
||||
expand = true
|
||||
stretch_mode = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
[gd_resource type="Theme" load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Example Assets/backgrounds/background-2.png" type="Texture" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Example Assets/Fonts/Overlock/Overlock-Black.ttf" type="DynamicFontData" id=2]
|
||||
|
||||
[sub_resource type="DynamicFont" id=5]
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id=4]
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 0, 0, 1175, 263 )
|
||||
margin_left = 5.0
|
||||
margin_right = 5.0
|
||||
margin_top = 5.0
|
||||
margin_bottom = 5.0
|
||||
modulate_color = Color( 1, 1, 1, 0.572549 )
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id=1]
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 0, 0, 1175, 263 )
|
||||
margin_left = 5.0
|
||||
margin_right = 5.0
|
||||
margin_top = 5.0
|
||||
margin_bottom = 5.0
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id=3]
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 0, 0, 1175, 263 )
|
||||
margin_left = 5.0
|
||||
margin_right = 5.0
|
||||
margin_top = 5.0
|
||||
margin_bottom = 5.0
|
||||
modulate_color = Color( 0.113725, 0.105882, 0.105882, 0.764706 )
|
||||
|
||||
[resource]
|
||||
Button/colors/font_color = Color( 1, 1, 1, 1 )
|
||||
Button/fonts/font = SubResource( 5 )
|
||||
Button/styles/hover = SubResource( 4 )
|
||||
Button/styles/normal = SubResource( 1 )
|
||||
Button/styles/pressed = SubResource( 3 )
|
22
addons/dialogic/Example Assets/History/HistoryButton.tscn
Normal file
22
addons/dialogic/Example Assets/History/HistoryButton.tscn
Normal file
|
@ -0,0 +1,22 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Example Assets/History/HistoryButton-theme.tres" type="Theme" id=1]
|
||||
|
||||
[sub_resource type="DynamicFontData" id=1]
|
||||
font_path = "res://resources/fonts/TimesNewerRoman-Regular.otf"
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
font_data = SubResource( 1 )
|
||||
|
||||
[node name="HistoryButton" type="Button"]
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -20.0
|
||||
margin_right = 58.0
|
||||
theme = ExtResource( 1 )
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
disabled = true
|
||||
text = "History"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Example Assets/History/HistoryButton-theme.tres" type="Theme" id=1]
|
||||
|
||||
[node name="HistoryButton" type="Button"]
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -20.0
|
||||
margin_right = 58.0
|
||||
theme = ExtResource( 1 )
|
||||
disabled = true
|
||||
text = "Return"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
89
addons/dialogic/Example Assets/History/HistoryRow.gd
Normal file
89
addons/dialogic/Example Assets/History/HistoryRow.gd
Normal file
|
@ -0,0 +1,89 @@
|
|||
tool
|
||||
extends PanelContainer
|
||||
|
||||
export (NodePath) var Audio_Button_Path = NodePath("HBoxContainer/PlayAudioButton")
|
||||
export (NodePath) var Text_Label_Path = NodePath("HBoxContainer/RichTextLabel")
|
||||
|
||||
var audioPath = ""
|
||||
var AudioButton
|
||||
var TextLabel
|
||||
onready var TextContainer = $HBoxContainer
|
||||
onready var ColorRectElement = $ColorRect
|
||||
onready var TextureRectElement = $TextureRect
|
||||
|
||||
"
\n Example of a HistoryRow. Every time dialog is logged, a new row is created.
\n You can extend this class to customize the logging experience as you see fit.
\n
\n This class can be edited or replaced as long as add_history is implemented
\n"
|
||||
|
||||
class_name HistoryRow
|
||||
|
||||
func _ready():
|
||||
TextLabel = get_node(Text_Label_Path)
|
||||
AudioButton = get_node(Audio_Button_Path)
|
||||
|
||||
assert (TextLabel is RichTextLabel, "Text_Label must be a rich text label.")
|
||||
assert (AudioButton is Button, "Audio_Button must be a button.")
|
||||
|
||||
|
||||
func add_history(historyString, newAudio = ""):
|
||||
TextLabel.append_bbcode(historyString)
|
||||
audioPath = newAudio
|
||||
if newAudio != "":
|
||||
AudioButton.disabled = false
|
||||
AudioButton.icon = load("res://addons/dialogic/Images/Event Icons/Main Icons/audio-event.svg")
|
||||
AudioButton.flat = false
|
||||
else :
|
||||
AudioButton.disabled = true
|
||||
|
||||
AudioButton.focus_mode = FOCUS_NONE
|
||||
|
||||
|
||||
|
||||
func load_theme(theme:ConfigFile):
|
||||
|
||||
var theme_font = DialogicUtil.path_fixer_load(theme.get_value("text", "font", "res://addons/dialogic/Example Assets/Fonts/DefaultFont.tres"))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var alignment = theme.get_value("text", "alignment", 0)
|
||||
if alignment <= 2:
|
||||
TextContainer.alignment = BoxContainer.ALIGN_BEGIN
|
||||
elif alignment <= 5:
|
||||
TextContainer.alignment = BoxContainer.ALIGN_CENTER
|
||||
elif alignment <= 8:
|
||||
TextContainer.alignment = BoxContainer.ALIGN_END
|
||||
|
||||
var text_color = Color(theme.get_value("text", "color", "#ffffffff"))
|
||||
TextLabel.set("custom_colors/default_color", text_color)
|
||||
|
||||
|
||||
TextLabel.set("custom_colors/font_color_shadow", Color("#00ffffff"))
|
||||
|
||||
|
||||
if theme.get_value("text", "shadow", false):
|
||||
var text_shadow_color = Color(theme.get_value("text", "shadow_color", "#9e000000"))
|
||||
TextLabel.set("custom_colors/font_color_shadow", text_shadow_color)
|
||||
|
||||
var shadow_offset = theme.get_value("text", "shadow_offset", Vector2(2, 2))
|
||||
TextLabel.set("custom_constants/shadow_offset_x", shadow_offset.x)
|
||||
TextLabel.set("custom_constants/shadow_offset_y", shadow_offset.y)
|
||||
|
||||
|
||||
var text_margin = theme.get_value("text", "margin", Vector2(20, 10))
|
||||
TextContainer.set("margin_left", text_margin.x)
|
||||
TextContainer.set("margin_right", text_margin.x * - 1)
|
||||
TextContainer.set("margin_top", text_margin.y)
|
||||
TextContainer.set("margin_bottom", text_margin.y * - 1)
|
||||
|
||||
|
||||
TextureRectElement.texture = DialogicUtil.path_fixer_load(theme.get_value("background", "image", "res://addons/dialogic/Example Assets/backgrounds/background-2.png"))
|
||||
ColorRectElement.color = Color(theme.get_value("background", "color", "#ff000000"))
|
||||
|
||||
if theme.get_value("background", "modulation", false):
|
||||
TextureRectElement.modulate = Color(theme.get_value("background", "modulation_color", "#ffffffff"))
|
||||
else :
|
||||
TextureRectElement.modulate = Color("#ffffffff")
|
||||
|
||||
ColorRectElement.visible = theme.get_value("background", "use_color", false)
|
||||
TextureRectElement.visible = theme.get_value("background", "use_image", true)
|
96
addons/dialogic/Example Assets/History/HistoryRow.tscn
Normal file
96
addons/dialogic/Example Assets/History/HistoryRow.tscn
Normal file
|
@ -0,0 +1,96 @@
|
|||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Example Assets/History/HistoryRow.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Example Assets/backgrounds/background-2.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="DynamicFontData" id=1]
|
||||
font_path = "res://resources/fonts/TimesNewerRoman-Italic.otf"
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 32
|
||||
font_data = SubResource( 1 )
|
||||
|
||||
[sub_resource type="DynamicFontData" id=3]
|
||||
font_path = "res://resources/fonts/TimesNewerRoman-Bold.otf"
|
||||
|
||||
[sub_resource type="DynamicFont" id=4]
|
||||
size = 32
|
||||
font_data = SubResource( 3 )
|
||||
|
||||
[sub_resource type="DynamicFontData" id=5]
|
||||
font_path = "res://resources/fonts/TimesNewerRoman-Regular.otf"
|
||||
|
||||
[sub_resource type="DynamicFont" id=6]
|
||||
size = 32
|
||||
font_data = SubResource( 5 )
|
||||
|
||||
[node name="HistoryRow" type="PanelContainer"]
|
||||
self_modulate = Color( 1, 1, 1, 0 )
|
||||
rect_min_size = Vector2( 0, 28 )
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
visible = false
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 51.0
|
||||
margin_bottom = 43.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 51.0
|
||||
margin_bottom = 47.0
|
||||
texture = ExtResource( 2 )
|
||||
expand = true
|
||||
stretch_mode = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 51.0
|
||||
margin_bottom = 47.0
|
||||
size_flags_horizontal = 11
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 8
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="PlayAudioButton" type="Button" parent="HBoxContainer"]
|
||||
margin_top = 2.0
|
||||
margin_right = 36.0
|
||||
margin_bottom = 38.0
|
||||
rect_min_size = Vector2( 36, 36 )
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
flat = true
|
||||
expand_icon = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="HBoxContainer"]
|
||||
margin_left = 44.0
|
||||
margin_right = 44.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/italics_font = SubResource( 2 )
|
||||
custom_fonts/bold_font = SubResource( 4 )
|
||||
custom_fonts/normal_font = SubResource( 6 )
|
||||
bbcode_enabled = true
|
||||
meta_underlined = false
|
||||
fit_content_height = true
|
||||
scroll_active = false
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue