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,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.9645 2.62927L12.8459 5.22444C12.6271 5.04546 12.3835 4.89134 12.1151 4.76208C11.8565 4.62287 11.5881 4.55327 11.3097 4.55327C11.0909 4.55327 10.8821 4.59802 10.6832 4.68751C10.4943 4.77699 10.3203 4.89631 10.1612 5.04546C10.0021 5.19461 9.86293 5.36364 9.74361 5.55256C9.6243 5.73154 9.52486 5.91052 9.44532 6.08949L9.14702 6.93964C9.35583 7.37714 9.55966 7.79475 9.75853 8.19248C9.92756 8.53055 10.1016 8.87359 10.2805 9.2216C10.4595 9.55966 10.6087 9.82813 10.728 10.027C10.9169 10.3153 11.1058 10.6136 11.2948 10.9219C11.4837 11.2202 11.6925 11.4936 11.9212 11.7422C12.0206 11.8516 12.1399 11.9261 12.2791 11.9659C12.4283 11.9957 12.5625 12.0107 12.6818 12.0107C12.8707 12.0107 13.0497 11.9858 13.2188 11.9361C13.3878 11.8864 13.5469 11.8217 13.696 11.7422L14.0689 12.2195C13.9297 12.4382 13.7607 12.657 13.5618 12.8757C13.3629 13.0945 13.1442 13.2933 12.9055 13.4723C12.6769 13.6513 12.4283 13.7955 12.1598 13.9048C11.9013 14.0242 11.6378 14.0838 11.3693 14.0838C11.1307 14.0838 10.9169 14.044 10.728 13.9645C10.549 13.8949 10.3849 13.8004 10.2358 13.6811C10.0867 13.5519 9.94745 13.4027 9.81819 13.2337C9.68893 13.0646 9.55469 12.8906 9.41549 12.7117C9.30611 12.5426 9.1868 12.3388 9.05753 12.1001C8.93822 11.8516 8.81393 11.598 8.68466 11.3395C8.5554 11.081 8.42614 10.8324 8.29688 10.5938C8.16762 10.3452 8.04333 10.1364 7.92401 9.96734C7.8743 10.1364 7.82955 10.3054 7.78978 10.4744C7.75001 10.6136 7.70526 10.7578 7.65555 10.907C7.60583 11.0561 7.56109 11.1705 7.52131 11.25C7.37216 11.5682 7.18324 11.8963 6.95455 12.2344C6.72586 12.5724 6.46236 12.8807 6.16407 13.1591C5.87572 13.4276 5.55753 13.6513 5.20952 13.8303C4.86151 13.9993 4.49361 14.0838 4.10583 14.0838C3.75782 14.0838 3.41975 14.0142 3.09162 13.875C2.7635 13.7457 2.46023 13.5717 2.18182 13.353L3.12145 10.8771C3.43964 11.076 3.78765 11.255 4.16549 11.4141C4.54333 11.5632 4.92117 11.6378 5.29901 11.6378C5.41833 11.6378 5.54262 11.6278 5.67188 11.608C5.80114 11.5781 5.92543 11.5384 6.04475 11.4886C6.17401 11.429 6.28836 11.3594 6.38779 11.2798C6.48722 11.1903 6.5618 11.0859 6.61151 10.9666C6.68111 10.8374 6.75569 10.6683 6.83523 10.4595C6.91478 10.2507 6.99432 10.0419 7.07387 9.8331C7.16336 9.59447 7.25285 9.34091 7.34234 9.07245L4.53836 4.5831C4.4091 4.43395 4.25001 4.31464 4.06109 4.22515C3.88211 4.12572 3.69319 4.076 3.49432 4.076C3.32529 4.076 3.1662 4.1108 3.01705 4.1804C2.8679 4.24006 2.72373 4.32458 2.58452 4.43395L2.18182 3.91194C2.32103 3.70313 2.48509 3.4993 2.67401 3.30043C2.87287 3.09162 3.08665 2.90768 3.31535 2.74859C3.54404 2.57955 3.78765 2.44532 4.04617 2.34589C4.30469 2.23651 4.56819 2.18182 4.83665 2.18182C5.16478 2.18182 5.46805 2.26634 5.74645 2.43537C6.02486 2.59447 6.28339 2.79333 6.52202 3.03197C6.76066 3.2706 6.97941 3.52912 7.17827 3.80753C7.37714 4.08594 7.55611 4.34447 7.7152 4.5831C7.79475 4.69248 7.87927 4.83168 7.96876 5.00072C8.06819 5.15981 8.16265 5.3189 8.25214 5.47799C8.36151 5.65697 8.46591 5.85086 8.56535 6.05966C8.66478 5.82103 8.76918 5.58239 8.87856 5.34376C8.96805 5.14489 9.05753 4.94106 9.14702 4.73225C9.24645 4.5135 9.33594 4.32458 9.41549 4.16549C9.56464 3.88708 9.73367 3.62856 9.92259 3.38992C10.1115 3.15128 10.3203 2.94248 10.549 2.7635C10.7876 2.58452 11.0462 2.44532 11.3246 2.34589C11.603 2.23651 11.9063 2.18182 12.2344 2.18182C12.5426 2.18182 12.8409 2.2216 13.1293 2.30114C13.4176 2.38069 13.696 2.49006 13.9645 2.62927Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dlwtdexd63bxi"
path="res://.godot/imported/definition.svg-22368503ac4b1eb0eb4b2dc0b2354e38.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Events/History/definition.svg"
dest_files=["res://.godot/imported/definition.svg-22368503ac4b1eb0eb4b2dc0b2354e38.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,77 @@
@tool
class_name DialogicHistoryEvent
extends DialogicEvent
## Event that allows clearing, pausing and resuming of history functionality.
enum ActionTypes {Clear, Pause, Resume}
### Settings
## The type of action: Clear, Pause or Resume
var action_type := ActionTypes.Pause
################################################################################
## EXECUTION
################################################################################
func _execute() -> void:
match action_type:
ActionTypes.Clear:
dialogic.History.full_history = []
ActionTypes.Pause:
dialogic.History.full_history_enabled = false
ActionTypes.Resume:
dialogic.History.full_history_enabled = true
finish()
################################################################################
## INITIALIZE
################################################################################
func _init() -> void:
event_name = "History"
set_default_color('Color6')
event_category = Category.AudioVisual
event_sorting_index = 0
expand_by_default = false
################################################################################
## SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "history"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"action" : {"property": "action_type", "default": ActionTypes.Pause,
"suggestions": func(): return {"Clear":{'value':'0'}, "Pause":{'value':'1'}, "Resume":{'value':'2'}}},
}
################################################################################
## EDITOR REPRESENTATION
################################################################################
func build_event_editor():
add_header_edit('action_type', ValueType.FixedOptionSelector, '', '', {
'selector_options': [
{
'label': 'Pause History',
'value': ActionTypes.Pause,
},
{
'label': 'Resume History',
'value': ActionTypes.Resume,
},
{
'label': 'Clear History',
'value': ActionTypes.Clear,
},
]
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b2dft055rbthc"
path="res://.godot/imported/icon.png-0f163f3ae73119c52d1c0fa16d2c9e6e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Events/History/icon.png"
dest_files=["res://.godot/imported/icon.png-0f163f3ae73119c52d1c0fa16d2c9e6e.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,13 @@
@tool
extends DialogicIndexer
func _get_events() -> Array:
return [this_folder.path_join('event_history.gd')]
func _get_subsystems() -> Array:
return [{'name':'History', 'script':this_folder.path_join('subsystem_history.gd')}]
func _get_settings_pages() -> Array:
return [this_folder.path_join('settings_history.tscn')]

View file

@ -0,0 +1,35 @@
@tool
extends HBoxContainer
func refresh():
%HistoryToggle.button_pressed = DialogicUtil.get_project_setting('dialogic/history/history_system', true)
%FullHistory.button_pressed = DialogicUtil.get_project_setting('dialogic/history/full_history', true)
%HistoryLength.value = DialogicUtil.get_project_setting('dialogic/history/full_history_length', 50)
%TextHistory.button_pressed = DialogicUtil.get_project_setting('dialogic/history/text_history', true)
%FullText.button_pressed = DialogicUtil.get_project_setting('dialogic/history/full_history_option_save_text', false)
func _on_history_toggle_toggled(button_pressed):
ProjectSettings.set_setting('dialogic/history/history_system', button_pressed)
ProjectSettings.save()
func _on_full_history_toggled(button_pressed):
ProjectSettings.set_setting('dialogic/history/full_history', button_pressed)
ProjectSettings.save()
func _on_history_length_value_changed(value):
ProjectSettings.set_setting('dialogic/history/full_history_length', value)
ProjectSettings.save()
func _on_text_history_toggled(button_pressed):
ProjectSettings.set_setting('dialogic/history/text_history', button_pressed)
ProjectSettings.save()
func _on_full_text_toggled(button_pressed):
ProjectSettings.set_setting('dialogic/history/full_history_option_save_text', button_pressed)
ProjectSettings.save()

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,91 @@
extends DialogicSubsystem
## Subsystem that manages history storing.
signal history_text_already_read()
## Set from the settings at runtime. If false, no history will be saved.
var enabled: bool = true
## If true, all events will be stored with additional information.
## Usefull if you want to be able to undo, or jump to certain points.
## (Change from the settings).
var full_history_enabled: bool = true
var full_history_length: int = 50
var full_history_option_save_text: bool = false
## Stores the content of the full_history
var full_history: Array = []
## If true, all text and choices text will be saved to the history. (Change from the settings).
var text_read_history_enabled: bool = true
## Stores the content of the text_read_history
var text_read_history: Dictionary = {}
####################################################################################################
## INITIALIZE
####################################################################################################
func _ready() -> void:
enabled = DialogicUtil.get_project_setting('dialogic/history/history_system', true)
full_history_enabled = DialogicUtil.get_project_setting('dialogic/history/full_history', true)
full_history_length = DialogicUtil.get_project_setting('dialogic/history/full_history_length', 50)
full_history_option_save_text = DialogicUtil.get_project_setting('dialogic/history/full_history_option_save_text', false)
text_read_history_enabled = DialogicUtil.get_project_setting('dialogic/history/text_history', true)
####################################################################################################
## STATE
####################################################################################################
# nothing implemented right now
####################################################################################################
## MAIN METHODS
####################################################################################################
func add_event_to_history(current_timeline:String, current_index:int, current_event:DialogicEvent) -> void:
if full_history_enabled:
var event_dict: Dictionary = {}
event_dict['timeline'] = current_timeline
event_dict['index'] = current_index
event_dict['event_object'] = current_event
event_dict['event_type'] = current_event.event_name
#A few more specific types of checks need to happen here to capture previous values
if current_event.event_name == "Text" and full_history_option_save_text:
event_dict['text_event_character'] = current_event.character.get_character_name()
event_dict['text_event_portrait'] = current_event.portrait
event_dict['text_event_text'] = current_event.text
full_history.push_front(event_dict)
if full_history.size() > full_history_length:
var dropped = full_history.pop_back()
if text_read_history_enabled:
if current_event.event_name == "Text" or current_event.event_name == "Choice":
var line = str(current_index)+ "**" + current_timeline
if line in text_read_history:
emit_signal("history_text_already_read")
else:
text_read_history[line] = true
func strip_events_from_full_history() -> void:
for i in full_history.size():
full_history[i].erase('event_object')
func rebuild_all_history_events() -> void:
var temp_timelines: Dictionary = {}
for i in full_history.size():
if full_history[i]['timeline'] in temp_timelines:
full_history[i]['event_object'] = temp_timelines[full_history[i]['timeline']].events[full_history[i]['index']]
else:
var loaded_timeline = Dialogic.preload_timeline(full_history[i]['timeline'])
temp_timelines[full_history[i]['timeline']] = loaded_timeline
full_history[i]['event_object'] = loaded_timeline.events[full_history[i]['index']]