Add addons

This commit is contained in:
Joey Yakimowich-Payne 2023-01-03 16:53:53 -07:00
commit 3367bad24f
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
527 changed files with 36197 additions and 0 deletions

View file

@ -0,0 +1,13 @@
@tool
extends DialogicCharacterEditorMainTab
## Character editor tab that allows setting a custom style fot the character.
func _load_character(character:DialogicCharacter) -> void:
%StyleName.text = character.custom_info.get('style', '')
func _save_changes(character:DialogicCharacter) -> DialogicCharacter:
character.custom_info['style'] = %StyleName.text
return character

View file

@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://addons/dialogic/Events/Style/character_settings_style.gd" id="2"]
[node name="Style" type="HBoxContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = -569.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2")
[node name="Label" type="Label" parent="."]
layout_mode = 2
offset_right = 42.0
offset_bottom = 26.0
size_flags_vertical = 0
text = "Style:"
[node name="StyleName" type="LineEdit" parent="."]
unique_name_in_owner = true
layout_mode = 2
offset_left = 46.0
offset_right = 113.0
offset_bottom = 31.0
size_flags_vertical = 0

View file

@ -0,0 +1,56 @@
@tool
class_name DialogicStyleEvent
extends DialogicEvent
## Event that allows changing the currently displayed style.
### Settings
## The name of the style to change to. Can be set on the DialogicNode_Style.
var style_name: String = ""
################################################################################
## EXECUTE
################################################################################
func _execute() -> void:
dialogic.Styles.change_style(style_name)
# base style isn't overridden by character styles
# this means after a charcter style, we can change back to the base style
dialogic.current_state_info['base_style'] = style_name
finish()
################################################################################
## INITIALIZE
################################################################################
func _init() -> void:
event_name = "Change Style"
set_default_color('Color4')
event_category = Category.AudioVisual
event_sorting_index = 4
################################################################################
## SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "style"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"name" : {"property": "style_name", "default": ""},
}
################################################################################
## EDITOR REPRESENTATION
################################################################################
func build_event_editor():
add_header_edit('style_name', ValueType.SinglelineText, 'Show all style nodes with name ', '(hides others)')

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnpi18qcnme4i"
path="res://.godot/imported/icon.png-fa93dc6f9144a37a7ecefb7321f4625d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Events/Style/icon.png"
dest_files=["res://.godot/imported/icon.png-fa93dc6f9144a37a7ecefb7321f4625d.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,14 @@
@tool
extends DialogicIndexer
func _get_events() -> Array:
return [this_folder.path_join('event_style.gd')]
func _get_subsystems() -> Array:
return [{'name':'Styles', 'script':this_folder.path_join('subsystem_styles.gd')}]
func _get_character_editor_tabs() -> Array:
return [this_folder.path_join('character_settings_style.tscn')]

View file

@ -0,0 +1,13 @@
class_name DialogicNode_Style
extends Control
## Control node that is hidden and shown based on the current dialogic style.
## The style this node belongs to.
@export var style_name: String = 'Default'
func _ready():
if style_name.is_empty():
style_name = name
add_to_group('dialogic_styles')

View file

@ -0,0 +1,38 @@
extends DialogicSubsystem
## Subsystem that manages showing and hiding style nodes.
####################################################################################################
## STATE
####################################################################################################
func clear_game_state():
change_style('')
func load_game_state():
change_style(dialogic.current_state_info.get('style'))
####################################################################################################
## MAIN METHODS
####################################################################################################
func change_style(style_name:String) -> void:
var style_found: bool = false
var last_style := ""
dialogic.current_state_info['style'] = style_name
for style_node in get_tree().get_nodes_in_group('dialogic_styles'):
if style_node.style_name == style_name:
style_node.show()
style_found = true
else:
if style_node.visible:
last_style = style_node.style_name
style_node.hide()
if (!style_found):
for style_node in get_tree().get_nodes_in_group('dialogic_styles'):
if style_node.style_name == last_style:
style_node.show()