From e743eb88f6a6938f5491dba127b0b9a50b2eb78e Mon Sep 17 00:00:00 2001 From: FrobozzWaxwing Date: Tue, 20 Aug 2024 00:58:14 -0500 Subject: [PATCH] Version 0.1.8 * Fixed bug in copying options from one encounter to another. The copies were still pointing to the original encounter; now they correctly point to the encounter the option is copied to. * Fixed bug in script editor involving deletion of operands from an operator. * Improved storyworld validation tool, setting it up to detect when options, reactions, and effects are linked to the incorrect parent. * Made various interface changes. Resized some windows and interface elements, added collapse and expand buttons to event selection interface, updated gui themes to improve readability of placeholder text, added VSplitContainer to encounter editing screen to allow authors to resize the options list and encounter main text display, added placeholder text to TextEdit boxes and removed two labels on encounter editing screen to free up space. --- godot/ErrorReport.gd | 6 +- godot/custom_resources/clarity.tres | 3 +- godot/custom_resources/lapis_lazuli.tres | 2 + godot/export_presets.cfg | 179 ++++++++++++++++-- godot/interface/AutomatedRehearsalScreen.gd | 1 - godot/interface/AutomatedRehearsalScreen.tscn | 7 +- godot/interface/CharacterEditScreen.gd | 43 ++--- godot/interface/CharacterEditScreen.tscn | 102 ++++------ godot/interface/DragAndDropList.gd | 51 +++-- godot/interface/EncounterEditScreen.gd | 134 ++++++------- godot/interface/EncounterEditScreen.tscn | 112 ++++++----- godot/interface/EncounterOverviewScreen.gd | 1 - godot/interface/EncounterOverviewScreen.tscn | 3 +- godot/interface/EventSelectionInterface.gd | 22 ++- godot/interface/EventSelectionInterface.tscn | 19 +- godot/interface/GUI.gd | 2 +- godot/interface/GUI.tscn | 17 +- godot/interface/GraphViewScreen.gd | 1 - godot/interface/ScriptEditScreen.tscn | 2 +- godot/interface/StoryworldMergingScreen.gd | 95 +++------- godot/interface/StoryworldMergingScreen.tscn | 87 +++------ .../StoryworldValidationInterface.gd | 44 ++++- godot/interface/graphview_node.tscn | 1 + godot/project.godot | 13 +- godot/storyworld_elements/Actor.gd | 9 + godot/storyworld_elements/Encounter.gd | 2 +- godot/storyworld_elements/Option.gd | 2 +- godot/storyworld_elements/Reaction.gd | 5 +- godot/sw_scripting/SWIfOperator.gd | 4 +- godot/sw_scripting/SWOperator.gd | 2 +- 30 files changed, 560 insertions(+), 411 deletions(-) diff --git a/godot/ErrorReport.gd b/godot/ErrorReport.gd index 51e38c6..ae0f57b 100644 --- a/godot/ErrorReport.gd +++ b/godot/ErrorReport.gd @@ -4,7 +4,7 @@ class_name ErrorReport var reported_object = null var reported_script = null #enum sw_script_data_types {BOOLEAN, BNUMBER, STRING, VARIANT} -enum report_types {TEXT, ACCEPTABILITY, DESIRABILITY, VISIBILITY, PERFORMABILITY, EFFECT} +enum report_types {ITEM, TEXT, ACCEPTABILITY, DESIRABILITY, VISIBILITY, PERFORMABILITY, EFFECT} var script_type = null var error_summary = "" var error_details = "" @@ -17,7 +17,9 @@ func _init(in_reported_object, in_reported_script, in_script_type, in_error_summ error_details = in_error_details func set_script_type(in_script_type): - if (in_script_type.matchn("text")): + if (in_script_type.matchn("item")): + script_type = report_types.ITEM + elif (in_script_type.matchn("text")): script_type = report_types.TEXT elif (in_script_type.matchn("acceptability")): script_type = report_types.ACCEPTABILITY diff --git a/godot/custom_resources/clarity.tres b/godot/custom_resources/clarity.tres index afed658..11c78dd 100644 --- a/godot/custom_resources/clarity.tres +++ b/godot/custom_resources/clarity.tres @@ -565,7 +565,7 @@ ItemList/styles/selected_focus = SubResource("31") Label/colors/font_color = Color(0, 0, 0, 1) LineEdit/colors/caret_color = Color(0.0392157, 0.0392157, 0.0392157, 0.941176) LineEdit/colors/font_color = Color(0, 0, 0, 1) -LineEdit/colors/font_placeholder_color = Color(0.501961, 0.501961, 0.501961, 0.784314) +LineEdit/colors/font_placeholder_color = Color(0.470588, 0.470588, 0.470588, 0.784314) LineEdit/colors/selection_color = Color(0.490196, 0.733333, 0.980392, 0.784314) LineEdit/styles/normal = SubResource("6") LineEdit/styles/read_only = SubResource("7") @@ -603,6 +603,7 @@ TextEdit/colors/background_color = Color(0.980392, 0.980392, 0.980392, 1) TextEdit/colors/caret_color = Color(0.0392157, 0.0392157, 0.0392157, 0.941176) TextEdit/colors/current_line_color = Color(0.980392, 0.980392, 0.980392, 1) TextEdit/colors/font_color = Color(0, 0, 0, 1) +TextEdit/colors/font_placeholder_color = Color(0.470588, 0.470588, 0.470588, 0.784314) TextEdit/colors/function_color = Color(0, 0, 0, 1) TextEdit/colors/member_variable_color = Color(0, 0, 0, 1) TextEdit/colors/number_color = Color(0, 0, 0, 1) diff --git a/godot/custom_resources/lapis_lazuli.tres b/godot/custom_resources/lapis_lazuli.tres index de3d89f..db74cee 100644 --- a/godot/custom_resources/lapis_lazuli.tres +++ b/godot/custom_resources/lapis_lazuli.tres @@ -487,6 +487,7 @@ HSlider/styles/slider = SubResource("14") ItemList/styles/panel = SubResource("StyleBoxFlat_c4q0v") ItemList/styles/selected = SubResource("StyleBoxFlat_0uko0") ItemList/styles/selected_focus = SubResource("StyleBoxFlat_ucvff") +LineEdit/colors/font_placeholder_color = Color(0.875, 0.875, 0.875, 0.6) LineEdit/colors/selection_color = Color(0, 0.490196, 0.980392, 1) LineEdit/styles/normal = SubResource("6") LineEdit/styles/read_only = SubResource("7") @@ -510,6 +511,7 @@ TabContainer/styles/tab_selected = SubResource("StyleBoxFlat_wqhfd") TabContainer/styles/tab_unselected = SubResource("StyleBoxFlat_3h7xj") TextEdit/colors/background_color = Color(0.0666667, 0.141176, 0.207843, 1) TextEdit/colors/current_line_color = Color(0.152941, 0.227451, 0.294118, 1) +TextEdit/colors/font_placeholder_color = Color(0.875, 0.875, 0.875, 0.6) TextEdit/colors/function_color = Color(0.878431, 0.878431, 0.878431, 1) TextEdit/colors/member_variable_color = Color(0.878431, 0.878431, 0.878431, 1) TextEdit/colors/number_color = Color(0.878431, 0.878431, 0.878431, 1) diff --git a/godot/export_presets.cfg b/godot/export_presets.cfg index cfae80e..3d6a255 100644 --- a/godot/export_presets.cfg +++ b/godot/export_presets.cfg @@ -3,16 +3,18 @@ name="Windows Desktop" platform="Windows Desktop" runnable=true +advanced_options=false dedicated_server=false custom_features="" export_filter="all_resources" include_filter="*.html, *.json" exclude_filter="" -export_path="../External_Build/0_1_7/SweepWeave_Win_0_1_7.exe" +export_path="../External_Build/0_1_8/SweepWeave_Win_0_1_8.exe" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false encrypt_directory=false +script_export_mode=2 [preset.0.options] @@ -20,10 +22,8 @@ custom_template/debug="" custom_template/release="" debug/export_console_wrapper=1 binary_format/embed_pck=false -texture_format/bptc=false -texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false binary_format/architecture="x86_64" codesign/enable=false codesign/timestamp=true @@ -43,6 +43,8 @@ application/file_description="SweepWeave" application/copyright="MIT License, Sasha Fenn, 2020 - 2024" application/trademarks="" application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" ssh_remote_deploy/port="22" @@ -60,24 +62,30 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue Remove-Item -Recurse -Force '{temp_dir}'" +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false binary_format/64_bits=true texture_format/no_bptc_fallbacks=true [preset.1] name="Linux/X11" -platform="Linux/X11" +platform="Linux" runnable=true +advanced_options=false dedicated_server=false custom_features="" export_filter="all_resources" include_filter="*.html, *.json" exclude_filter="" -export_path="../External_Build/0_1_7/SweepWeave_Linux_0_1_7.x86_64" +export_path="../External_Build/0_1_8/SweepWeave_Linux_0_1_8.x86_64" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false encrypt_directory=false +script_export_mode=2 [preset.1.options] @@ -85,10 +93,8 @@ custom_template/debug="" custom_template/release="" debug/export_console_wrapper=1 binary_format/embed_pck=false -texture_format/bptc=false -texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false binary_format/architecture="x86_64" ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" @@ -102,6 +108,10 @@ unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") rm -rf \"{temp_dir}\"" +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false binary_format/64_bits=true texture_format/no_bptc_fallbacks=true @@ -110,16 +120,18 @@ texture_format/no_bptc_fallbacks=true name="macOS" platform="macOS" runnable=true +advanced_options=false dedicated_server=false custom_features="" export_filter="all_resources" include_filter="*.html, *.json" exclude_filter="" -export_path="../External_Build/0_1_7/SweepWeave_Mac_0_1_7.zip" +export_path="../External_Build/0_1_8/SweepWeave_Mac_0_1_8.zip" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false encrypt_directory=false +script_export_mode=2 [preset.2.options] @@ -140,6 +152,7 @@ application/copyright_localized={} application/min_macos_version="10.12" application/export_angle=0 display/high_res=true +application/additional_plist_content="" xcode/platform_build="14C18" xcode/sdk_version="13.1" xcode/sdk_build="22C55" @@ -198,6 +211,148 @@ privacy/network_volumes_usage_description="" privacy/network_volumes_usage_description_localized={} privacy/removable_volumes_usage_description="" privacy/removable_volumes_usage_description_localized={} +privacy/tracking_enabled=false +privacy/tracking_domains=PackedStringArray() +privacy/collected_data/name/collected=false +privacy/collected_data/name/linked_to_user=false +privacy/collected_data/name/used_for_tracking=false +privacy/collected_data/name/collection_purposes=0 +privacy/collected_data/email_address/collected=false +privacy/collected_data/email_address/linked_to_user=false +privacy/collected_data/email_address/used_for_tracking=false +privacy/collected_data/email_address/collection_purposes=0 +privacy/collected_data/phone_number/collected=false +privacy/collected_data/phone_number/linked_to_user=false +privacy/collected_data/phone_number/used_for_tracking=false +privacy/collected_data/phone_number/collection_purposes=0 +privacy/collected_data/physical_address/collected=false +privacy/collected_data/physical_address/linked_to_user=false +privacy/collected_data/physical_address/used_for_tracking=false +privacy/collected_data/physical_address/collection_purposes=0 +privacy/collected_data/other_contact_info/collected=false +privacy/collected_data/other_contact_info/linked_to_user=false +privacy/collected_data/other_contact_info/used_for_tracking=false +privacy/collected_data/other_contact_info/collection_purposes=0 +privacy/collected_data/health/collected=false +privacy/collected_data/health/linked_to_user=false +privacy/collected_data/health/used_for_tracking=false +privacy/collected_data/health/collection_purposes=0 +privacy/collected_data/fitness/collected=false +privacy/collected_data/fitness/linked_to_user=false +privacy/collected_data/fitness/used_for_tracking=false +privacy/collected_data/fitness/collection_purposes=0 +privacy/collected_data/payment_info/collected=false +privacy/collected_data/payment_info/linked_to_user=false +privacy/collected_data/payment_info/used_for_tracking=false +privacy/collected_data/payment_info/collection_purposes=0 +privacy/collected_data/credit_info/collected=false +privacy/collected_data/credit_info/linked_to_user=false +privacy/collected_data/credit_info/used_for_tracking=false +privacy/collected_data/credit_info/collection_purposes=0 +privacy/collected_data/other_financial_info/collected=false +privacy/collected_data/other_financial_info/linked_to_user=false +privacy/collected_data/other_financial_info/used_for_tracking=false +privacy/collected_data/other_financial_info/collection_purposes=0 +privacy/collected_data/precise_location/collected=false +privacy/collected_data/precise_location/linked_to_user=false +privacy/collected_data/precise_location/used_for_tracking=false +privacy/collected_data/precise_location/collection_purposes=0 +privacy/collected_data/coarse_location/collected=false +privacy/collected_data/coarse_location/linked_to_user=false +privacy/collected_data/coarse_location/used_for_tracking=false +privacy/collected_data/coarse_location/collection_purposes=0 +privacy/collected_data/sensitive_info/collected=false +privacy/collected_data/sensitive_info/linked_to_user=false +privacy/collected_data/sensitive_info/used_for_tracking=false +privacy/collected_data/sensitive_info/collection_purposes=0 +privacy/collected_data/contacts/collected=false +privacy/collected_data/contacts/linked_to_user=false +privacy/collected_data/contacts/used_for_tracking=false +privacy/collected_data/contacts/collection_purposes=0 +privacy/collected_data/emails_or_text_messages/collected=false +privacy/collected_data/emails_or_text_messages/linked_to_user=false +privacy/collected_data/emails_or_text_messages/used_for_tracking=false +privacy/collected_data/emails_or_text_messages/collection_purposes=0 +privacy/collected_data/photos_or_videos/collected=false +privacy/collected_data/photos_or_videos/linked_to_user=false +privacy/collected_data/photos_or_videos/used_for_tracking=false +privacy/collected_data/photos_or_videos/collection_purposes=0 +privacy/collected_data/audio_data/collected=false +privacy/collected_data/audio_data/linked_to_user=false +privacy/collected_data/audio_data/used_for_tracking=false +privacy/collected_data/audio_data/collection_purposes=0 +privacy/collected_data/gameplay_content/collected=false +privacy/collected_data/gameplay_content/linked_to_user=false +privacy/collected_data/gameplay_content/used_for_tracking=false +privacy/collected_data/gameplay_content/collection_purposes=0 +privacy/collected_data/customer_support/collected=false +privacy/collected_data/customer_support/linked_to_user=false +privacy/collected_data/customer_support/used_for_tracking=false +privacy/collected_data/customer_support/collection_purposes=0 +privacy/collected_data/other_user_content/collected=false +privacy/collected_data/other_user_content/linked_to_user=false +privacy/collected_data/other_user_content/used_for_tracking=false +privacy/collected_data/other_user_content/collection_purposes=0 +privacy/collected_data/browsing_history/collected=false +privacy/collected_data/browsing_history/linked_to_user=false +privacy/collected_data/browsing_history/used_for_tracking=false +privacy/collected_data/browsing_history/collection_purposes=0 +privacy/collected_data/search_hhistory/collected=false +privacy/collected_data/search_hhistory/linked_to_user=false +privacy/collected_data/search_hhistory/used_for_tracking=false +privacy/collected_data/search_hhistory/collection_purposes=0 +privacy/collected_data/user_id/collected=false +privacy/collected_data/user_id/linked_to_user=false +privacy/collected_data/user_id/used_for_tracking=false +privacy/collected_data/user_id/collection_purposes=0 +privacy/collected_data/device_id/collected=false +privacy/collected_data/device_id/linked_to_user=false +privacy/collected_data/device_id/used_for_tracking=false +privacy/collected_data/device_id/collection_purposes=0 +privacy/collected_data/purchase_history/collected=false +privacy/collected_data/purchase_history/linked_to_user=false +privacy/collected_data/purchase_history/used_for_tracking=false +privacy/collected_data/purchase_history/collection_purposes=0 +privacy/collected_data/product_interaction/collected=false +privacy/collected_data/product_interaction/linked_to_user=false +privacy/collected_data/product_interaction/used_for_tracking=false +privacy/collected_data/product_interaction/collection_purposes=0 +privacy/collected_data/advertising_data/collected=false +privacy/collected_data/advertising_data/linked_to_user=false +privacy/collected_data/advertising_data/used_for_tracking=false +privacy/collected_data/advertising_data/collection_purposes=0 +privacy/collected_data/other_usage_data/collected=false +privacy/collected_data/other_usage_data/linked_to_user=false +privacy/collected_data/other_usage_data/used_for_tracking=false +privacy/collected_data/other_usage_data/collection_purposes=0 +privacy/collected_data/crash_data/collected=false +privacy/collected_data/crash_data/linked_to_user=false +privacy/collected_data/crash_data/used_for_tracking=false +privacy/collected_data/crash_data/collection_purposes=0 +privacy/collected_data/performance_data/collected=false +privacy/collected_data/performance_data/linked_to_user=false +privacy/collected_data/performance_data/used_for_tracking=false +privacy/collected_data/performance_data/collection_purposes=0 +privacy/collected_data/other_diagnostic_data/collected=false +privacy/collected_data/other_diagnostic_data/linked_to_user=false +privacy/collected_data/other_diagnostic_data/used_for_tracking=false +privacy/collected_data/other_diagnostic_data/collection_purposes=0 +privacy/collected_data/environment_scanning/collected=false +privacy/collected_data/environment_scanning/linked_to_user=false +privacy/collected_data/environment_scanning/used_for_tracking=false +privacy/collected_data/environment_scanning/collection_purposes=0 +privacy/collected_data/hands/collected=false +privacy/collected_data/hands/linked_to_user=false +privacy/collected_data/hands/used_for_tracking=false +privacy/collected_data/hands/collection_purposes=0 +privacy/collected_data/head/collected=false +privacy/collected_data/head/linked_to_user=false +privacy/collected_data/head/used_for_tracking=false +privacy/collected_data/head/collection_purposes=0 +privacy/collected_data/other_data_types/collected=false +privacy/collected_data/other_data_types/linked_to_user=false +privacy/collected_data/other_data_types/used_for_tracking=false +privacy/collected_data/other_data_types/collection_purposes=0 ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" ssh_remote_deploy/port="22" diff --git a/godot/interface/AutomatedRehearsalScreen.gd b/godot/interface/AutomatedRehearsalScreen.gd index 3211391..adda324 100644 --- a/godot/interface/AutomatedRehearsalScreen.gd +++ b/godot/interface/AutomatedRehearsalScreen.gd @@ -589,4 +589,3 @@ func set_gui_theme(theme_name, _background_color): "Lapis Lazuli": light_mode = false refresh_outcome_sort_icon() - diff --git a/godot/interface/AutomatedRehearsalScreen.tscn b/godot/interface/AutomatedRehearsalScreen.tscn index 2fdbd30..6376a21 100644 --- a/godot/interface/AutomatedRehearsalScreen.tscn +++ b/godot/interface/AutomatedRehearsalScreen.tscn @@ -55,9 +55,11 @@ layout_mode = 2 [node name="ReportTabs" type="TabContainer" parent="Panel/VBC"] layout_mode = 2 size_flags_vertical = 3 +current_tab = 0 [node name="EventIndex" type="VBoxContainer" parent="Panel/VBC/ReportTabs"] layout_mode = 2 +metadata/_tab_index = 0 [node name="HBC" type="HBoxContainer" parent="Panel/VBC/ReportTabs/EventIndex"] layout_mode = 2 @@ -80,6 +82,7 @@ hide_root = true [node name="CastVariablesIndex" type="VBoxContainer" parent="Panel/VBC/ReportTabs"] visible = false layout_mode = 2 +metadata/_tab_index = 1 [node name="HBC" type="HBoxContainer" parent="Panel/VBC/ReportTabs/CastVariablesIndex"] visible = false @@ -107,6 +110,7 @@ layout_mode = 2 [node name="NotableOutcomeIndex" type="VBoxContainer" parent="Panel/VBC/ReportTabs"] visible = false layout_mode = 2 +metadata/_tab_index = 2 [node name="HBC" type="HBoxContainer" parent="Panel/VBC/ReportTabs/NotableOutcomeIndex"] layout_mode = 2 @@ -129,10 +133,9 @@ text = "Sort by:" [node name="SortMenu" type="OptionButton" parent="Panel/VBC/ReportTabs/NotableOutcomeIndex/HBC"] layout_mode = 2 -item_count = 10 selected = 0 +item_count = 10 popup/item_0/text = "Alphabetical" -popup/item_0/id = 0 popup/item_1/text = "Creation Time" popup/item_1/id = 1 popup/item_2/text = "Modified Time" diff --git a/godot/interface/CharacterEditScreen.gd b/godot/interface/CharacterEditScreen.gd index 9d1c309..3ed944b 100644 --- a/godot/interface/CharacterEditScreen.gd +++ b/godot/interface/CharacterEditScreen.gd @@ -22,14 +22,14 @@ func log_update(character = null): storyworld.project_saved = false func refresh_character_list(): - $HBC/VBC/Scroll/CharacterList.clear() + $HBC/VBC/CharacterList.clear() var index = 0 for character in storyworld.characters: - $HBC/VBC/Scroll/CharacterList.add_item(character.char_name) - $HBC/VBC/Scroll/CharacterList.set_item_metadata(index, character) + $HBC/VBC/CharacterList.add_item(character.get_listable_text()) + $HBC/VBC/CharacterList.set_item_metadata(index, character) index += 1 if (0 < storyworld.characters.size()): - $HBC/VBC/Scroll/CharacterList.select(0) + $HBC/VBC/CharacterList.select(0) func refresh_property_list(): for each in $HBC/VBC2/Scroll_Properties/VBC.get_children(): @@ -66,24 +66,24 @@ func _on_AddCharacter_pressed(): storyworld.add_character(new_character) new_character.initialize_bnumber_properties(storyworld.characters, storyworld.authored_properties) log_update(new_character) - $HBC/VBC/Scroll/CharacterList.add_item(new_character.char_name) - var index = $HBC/VBC/Scroll/CharacterList.get_item_count() - 1 - $HBC/VBC/Scroll/CharacterList.set_item_metadata(index, new_character) + $HBC/VBC/CharacterList.add_item(new_character.get_listable_text()) + var index = $HBC/VBC/CharacterList.get_item_count() - 1 + $HBC/VBC/CharacterList.set_item_metadata(index, new_character) new_character_created.emit(new_character) load_character(new_character) -func load_character(who): +func load_character(who:Actor): current_character = who $HBC/VBC2/CharNameEdit.text = current_character.char_name $HBC/VBC2/CharPronounEdit.text = current_character.pronoun refresh_property_list() - $HBC/VBC/Scroll/CharacterList.select(storyworld.characters.find(who)) + $HBC/VBC/CharacterList.select(storyworld.characters.find(who)) -func _on_CharNameEdit_text_changed(new_text): +func _on_CharNameEdit_text_changed(new_text:String): current_character.char_name = new_text - if ($HBC/VBC/Scroll/CharacterList.is_anything_selected()): - var selection = $HBC/VBC/Scroll/CharacterList.get_selected_items() - $HBC/VBC/Scroll/CharacterList.set_item_text(selection[0], current_character.char_name) + if ($HBC/VBC/CharacterList.is_anything_selected()): + var selection = $HBC/VBC/CharacterList.get_selected_items() + $HBC/VBC/CharacterList.set_item_text(selection[0], current_character.get_listable_text()) for each in $HBC/VBC2/Scroll_Properties/VBC.get_children(): each.refresh_character_name(current_character) log_update(current_character) @@ -94,28 +94,19 @@ func _on_CharPronounEdit_text_changed(new_text): log_update(null) func _on_DeleteCharacter_pressed(): - if ($HBC/VBC/Scroll/CharacterList.is_anything_selected()): + if ($HBC/VBC/CharacterList.is_anything_selected()): if (1 < storyworld.characters.size()): - var selection = $HBC/VBC/Scroll/CharacterList.get_selected_items() + var selection = $HBC/VBC/CharacterList.get_selected_items() var dialog_text = 'Are you sure you wish to delete the character: "' character_to_delete = storyworld.characters[selection[0]] dialog_text += character_to_delete.char_name + '"?' -# dialog_text += character_to_delete.char_name + '"? If so, please select a character to replace them with in every script currently employing them.' $ConfirmCharacterDeletion.dialog_text = dialog_text -# $ConfirmCharacterDeletion/Center/AntagonistReplacementPicker.clear() -# var option_index = 0 -# for each in storyworld.characters: -# if (each != character_to_delete): -# $ConfirmCharacterDeletion/Center/AntagonistReplacementPicker.add_item(each.char_name) -# $ConfirmCharacterDeletion/Center/AntagonistReplacementPicker.set_item_metadata(option_index, each) -# option_index += 1 -# $ConfirmCharacterDeletion/Center/AntagonistReplacementPicker.select(0) $ConfirmCharacterDeletion.popup_centered() else: print("The storyworld must have at least one character.") func _on_ConfirmCharacterDeletion_confirmed(): - if ($HBC/VBC/Scroll/CharacterList.is_anything_selected()): + if ($HBC/VBC/CharacterList.is_anything_selected()): #Delete character from scripts: for encounter in storyworld.encounters: encounter.acceptability_script.delete_character(character_to_delete) #ScriptManager @@ -141,7 +132,7 @@ func _on_ConfirmCharacterDeletion_confirmed(): func _on_CharacterList_item_selected(index): if (0 < storyworld.characters.size()): - var who = $HBC/VBC/Scroll/CharacterList.get_item_metadata(index) + var who = $HBC/VBC/CharacterList.get_item_metadata(index) load_character(who) #GUI Themes: diff --git a/godot/interface/CharacterEditScreen.tscn b/godot/interface/CharacterEditScreen.tscn index bbd07d3..c3ad082 100644 --- a/godot/interface/CharacterEditScreen.tscn +++ b/godot/interface/CharacterEditScreen.tscn @@ -1,111 +1,85 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=4 format=3 uid="uid://b4de5y8e6pc3k"] -[ext_resource path="res://interface/CharacterEditScreen.gd" type="Script" id=1] -[ext_resource path="res://icons/delete.svg" type="Texture2D" id=2] -[ext_resource path="res://icons/add.svg" type="Texture2D" id=3] +[ext_resource type="Script" path="res://interface/CharacterEditScreen.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://ifsr140r60d5" path="res://icons/delete.svg" id="2"] +[ext_resource type="Texture2D" uid="uid://cgalqocn148ji" path="res://icons/add.svg" id="3"] [node name="CharacterEditScreen" type="ColorRect"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 size_flags_horizontal = 3 -color = Color( 0, 0.0627451, 0.12549, 1 ) -script = ExtResource( 1 ) +color = Color(0, 0.0627451, 0.12549, 1) +script = ExtResource("1") [node name="HBC" type="HBoxContainer" parent="."] -offset_right = 40.0 -offset_bottom = 40.0 +layout_mode = 1 +anchors_preset = 9 +anchor_bottom = 1.0 +offset_right = 580.0 +grow_vertical = 2 size_flags_horizontal = 3 [node name="VBC" type="VBoxContainer" parent="HBC"] -offset_right = 160.0 -offset_bottom = 634.0 +custom_minimum_size = Vector2(256, 0) +layout_mode = 2 [node name="Header" type="HBoxContainer" parent="HBC/VBC"] -offset_right = 160.0 -offset_bottom = 30.0 +layout_mode = 2 [node name="AddCharacter" type="Button" parent="HBC/VBC/Header"] -offset_right = 36.0 -offset_bottom = 30.0 +layout_mode = 2 tooltip_text = "Add new character." -icon = ExtResource( 3 ) +icon = ExtResource("3") [node name="DeleteCharacter" type="Button" parent="HBC/VBC/Header"] -offset_left = 40.0 -offset_right = 76.0 -offset_bottom = 30.0 +layout_mode = 2 tooltip_text = "Delete selected characters." -icon = ExtResource( 2 ) +icon = ExtResource("2") [node name="Label" type="Label" parent="HBC/VBC/Header"] -offset_left = 80.0 -offset_top = 8.0 -offset_right = 151.0 -offset_bottom = 22.0 +layout_mode = 2 text = "Characters:" -[node name="Scroll" type="ScrollContainer" parent="HBC/VBC"] -offset_top = 34.0 -offset_right = 160.0 -offset_bottom = 634.0 -custom_minimum_size = Vector2( 160, 600 ) -scroll_horizontal_enabled = false - -[node name="CharacterList" type="ItemList" parent="HBC/VBC/Scroll"] -offset_right = 160.0 -offset_bottom = 600.0 -custom_minimum_size = Vector2( 160, 600 ) -auto_height = true +[node name="CharacterList" type="ItemList" parent="HBC/VBC"] +custom_minimum_size = Vector2(160, 600) +layout_mode = 2 +size_flags_vertical = 3 [node name="VBC2" type="VBoxContainer" parent="HBC"] -offset_left = 164.0 -offset_right = 484.0 -offset_bottom = 634.0 -custom_minimum_size = Vector2( 320, 624 ) +custom_minimum_size = Vector2(320, 624) +layout_mode = 2 size_flags_horizontal = 3 [node name="Label" type="Label" parent="HBC/VBC2"] -offset_right = 320.0 -offset_bottom = 14.0 +layout_mode = 2 text = "Character name: " [node name="CharNameEdit" type="LineEdit" parent="HBC/VBC2"] -offset_top = 18.0 -offset_right = 320.0 -offset_bottom = 42.0 +layout_mode = 2 caret_blink = true caret_blink_interval = 0.5 [node name="Label2" type="Label" parent="HBC/VBC2"] -offset_top = 46.0 -offset_right = 320.0 -offset_bottom = 77.0 +layout_mode = 2 text = "Character pronoun: (e.g. \"they,\" \"she,\" \"he.\")" [node name="CharPronounEdit" type="LineEdit" parent="HBC/VBC2"] -offset_top = 81.0 -offset_right = 320.0 -offset_bottom = 105.0 +layout_mode = 2 caret_blink = true caret_blink_interval = 0.5 [node name="Scroll_Properties" type="ScrollContainer" parent="HBC/VBC2"] -offset_top = 109.0 -offset_right = 320.0 -offset_bottom = 634.0 -custom_minimum_size = Vector2( 0, 525 ) -scroll_horizontal_enabled = false +custom_minimum_size = Vector2(0, 525) +layout_mode = 2 [node name="VBC" type="VBoxContainer" parent="HBC/VBC2/Scroll_Properties"] -offset_right = 320.0 -offset_bottom = 525.0 +layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="ConfirmCharacterDeletion" type="ConfirmationDialog" parent="."] -offset_right = 310.0 -offset_bottom = 202.0 dialog_autowrap = true [node name="Center" type="CenterContainer" parent="ConfirmCharacterDeletion"] @@ -113,22 +87,16 @@ offset_left = 8.0 offset_top = 8.0 offset_right = 302.0 offset_bottom = 166.0 -__meta__ = { -"_edit_use_anchors_": false -} [node name="AntagonistReplacementPicker" type="OptionButton" parent="ConfirmCharacterDeletion/Center"] visible = false -offset_left = 132.0 -offset_top = 69.0 -offset_right = 161.0 -offset_bottom = 89.0 +layout_mode = 2 size_flags_horizontal = 0 size_flags_vertical = 0 [connection signal="pressed" from="HBC/VBC/Header/AddCharacter" to="." method="_on_AddCharacter_pressed"] [connection signal="pressed" from="HBC/VBC/Header/DeleteCharacter" to="." method="_on_DeleteCharacter_pressed"] -[connection signal="item_selected" from="HBC/VBC/Scroll/CharacterList" to="." method="_on_CharacterList_item_selected"] +[connection signal="item_selected" from="HBC/VBC/CharacterList" to="." method="_on_CharacterList_item_selected"] [connection signal="text_changed" from="HBC/VBC2/CharNameEdit" to="." method="_on_CharNameEdit_text_changed"] [connection signal="text_changed" from="HBC/VBC2/CharPronounEdit" to="." method="_on_CharPronounEdit_text_changed"] [connection signal="confirmed" from="ConfirmCharacterDeletion" to="." method="_on_ConfirmCharacterDeletion_confirmed"] diff --git a/godot/interface/DragAndDropList.gd b/godot/interface/DragAndDropList.gd index e52869d..07c3c8a 100644 --- a/godot/interface/DragAndDropList.gd +++ b/godot/interface/DragAndDropList.gd @@ -195,6 +195,7 @@ func _on_item_rmb_selected(position): if ("option" == item_type): context_menu.add_item("Edit visibility script", 12) context_menu.add_item("Edit performability script", 13) + #context_menu.add_item("Inspect option internals", 16) if ("reaction" == item_type): context_menu.add_item("Edit desirability script", 14) if ("effect" == item_type): @@ -206,7 +207,7 @@ func _on_item_mouse_selected(position, mouse_button_index): _on_item_rmb_selected(position) func show_outer_context_menu(): - #This shows the context menu that is designed for when the user clicks the empty part of the tree. + # This shows the context menu that is designed for when the user clicks the empty part of the tree. focused_item = null # Bring up context menu. var mouse_position = get_global_mouse_position() @@ -216,7 +217,7 @@ func show_outer_context_menu(): context_menu.add_item("Add new " + item_type, 2) context_menu.add_item("Paste", 7) if (!can_paste()): - #Disable pasting options. + # Disable pasting options. context_menu.set_item_disabled((context_menu.get_item_count() - 1), true) context_menu.add_item("Select all", 10) context_menu.add_item("Deselect all", 11) @@ -234,67 +235,79 @@ func _on_ContextMenu_id_pressed(id): index = focused_item.get_index() match id: 0: - #Add new item before + # Add new item before add_at.emit(index) print ("Adding new " + item_type + " before the selected one.") 1: - #Add new item after + # Add new item after add_at.emit(index + 1) print ("Adding new " + item_type + " after the selected one.") 2: - #Add new item at end of list + # Add new item at end of list add_at.emit(item_count) print ("Adding new " + item_type + " at the end of the list.") 3: - #Cut + # Cut cut.emit(get_all_selected_metadata()) print ("Cutting selected " + item_type + " for pasting.") 4: - #Copy + # Copy copy.emit(get_all_selected_metadata()) print ("Copying selected " + item_type + ".") 5: - #Paste before + # Paste before paste_at.emit(index) print ("Pasting before selected " + item_type + ".") 6: - #Paste after + # Paste after paste_at.emit(index + 1) print ("Pasting after selected " + item_type + ".") 7: - #Paste at end of list + # Paste at end of list paste_at.emit(item_count) print ("Pasting at the end of the list.") 8: - #Delete + # Delete delete.emit(get_all_selected_metadata()) print ("Asking for confirmation for possible deletion of " + item_type + "s.") 9: - #Duplicate + # Duplicate duplicate.emit(get_all_selected_metadata()) print ("Duplicating selected " + item_type + "s.") 10: - #Select all + # Select all select_all() print ("Selecting all " + item_type + "s.") 11: - #Deselect all + # Deselect all deselect_all() print ("Deselecting all " + item_type + "s.") 12: - #Edit visibility script + # Edit visibility script edit_visibility_script.emit(focused_item) print ("Editing visibility script.") 13: - #Edit performability script + # Edit performability script edit_performability_script.emit(focused_item) print ("Editing performability script.") 14: - #Edit desirability script + # Edit desirability script edit_desirability_script.emit(focused_item) print ("Editing desirability script.") 15: - #Edit effect script + # Edit effect script edit_effect_script.emit(focused_item) print ("Editing effect script.") - + 16: + # Inspect item internals + if (null == focused_item): + print ("Item is null.") + elif (!(is_instance_valid(focused_item))): + print ("Item is invalid.") + elif (focused_item is Option): + if (null == focused_item.encounter): + print ("null == focused_item.encounter") + elif (focused_item.encounter is Encounter): + print ("focused_item.encounter: " + focused_item.encounter.id) + else: + print ("Item is not the correct type.") diff --git a/godot/interface/EncounterEditScreen.gd b/godot/interface/EncounterEditScreen.gd index 6113bcd..686f844 100644 --- a/godot/interface/EncounterEditScreen.gd +++ b/godot/interface/EncounterEditScreen.gd @@ -97,21 +97,21 @@ func set_display_reaction_qdse(display): func set_clipboard(new_clipboard): clipboard = new_clipboard - $HSC/Column2/OptionsList.clipboard = new_clipboard + $HSC/Column2/OptionDetails/OptionsList.clipboard = new_clipboard $HSC/Column3/ReactionsList.clipboard = new_clipboard $HSC/Column3/AfterReactionEffectsDisplay.clipboard = new_clipboard func refresh_option_list(): - $HSC/Column2/OptionsList.clear() + $HSC/Column2/OptionDetails/OptionsList.clear() if (null != current_encounter): - $HSC/Column2/OptionsList.items_to_list = current_encounter.options.duplicate() - $HSC/Column2/OptionsList.refresh() + $HSC/Column2/OptionDetails/OptionsList.items_to_list = current_encounter.options.duplicate() + $HSC/Column2/OptionDetails/OptionsList.refresh() if (0 < current_encounter.options.size()): load_Option(current_encounter.options.front()) - $HSC/Column2/OptionsList.select_first_item() + $HSC/Column2/OptionDetails/OptionsList.select_first_item() else: - $HSC/Column2/OptionsList.items_to_list.clear() - $HSC/Column2/OptionsList.refresh() + $HSC/Column2/OptionDetails/OptionsList.items_to_list.clear() + $HSC/Column2/OptionDetails/OptionsList.refresh() func refresh_reaction_list(): $HSC/Column3/ReactionsList.clear() @@ -142,8 +142,8 @@ func refresh_reaction_after_effects_list(): $EffectEditor/EffectEditorScreen.refresh() func refresh_bnumber_property_lists(): - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.storyworld = storyworld - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.refresh_bnumber_property_lists() + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.storyworld = storyworld + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.refresh_bnumber_property_lists() $HSC/Column3/SimplifiedReactionDesirabilityScriptingInterface.storyworld = storyworld $HSC/Column3/SimplifiedReactionDesirabilityScriptingInterface.refresh_bnumber_property_lists() refresh_reaction_after_effects_list() @@ -152,17 +152,17 @@ func refresh_spool_lists(): refresh_reaction_after_effects_list() func refresh_quick_encounter_scripting_interface(): - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.storyworld = storyworld + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.storyworld = storyworld if (current_encounter is Encounter and current_encounter.desirability_script is ScriptManager): - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.script_to_edit = current_encounter.desirability_script - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.refresh() + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.script_to_edit = current_encounter.desirability_script + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.refresh() if (display_encounter_qdse): - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.set_visible(true) + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.set_visible(true) else: - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.set_visible(false) + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.set_visible(false) else: - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.script_to_edit = null - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.set_visible(false) + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.script_to_edit = null + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.set_visible(false) func refresh_quick_reaction_scripting_interface(): $HSC/Column3/SimplifiedReactionDesirabilityScriptingInterface.storyworld = storyworld @@ -191,12 +191,12 @@ func refresh_reaction_consequence_display(): $HSC/Column3/HBCConsequence/ChangeConsequence.set_text("") func on_character_deleted(): - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.refresh() + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.refresh() $HSC/Column3/SimplifiedReactionDesirabilityScriptingInterface.refresh() refresh_bnumber_property_lists() func on_property_deleted(): - $HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface.refresh() + $HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface.refresh() $HSC/Column3/SimplifiedReactionDesirabilityScriptingInterface.refresh() refresh_bnumber_property_lists() @@ -224,10 +224,10 @@ func load_Option(option): current_option = option refresh_reaction_list() if (null == option): - $HSC/Column2/OptionText.text = "" + $HSC/Column2/OptionDetails/OptionText.text = "" load_Reaction(null) else: - $HSC/Column2/OptionText.text = option.get_text() + $HSC/Column2/OptionDetails/OptionText.text = option.get_text() if (0 < option.reactions.size()): load_Reaction(option.reactions[0]) $HSC/Column3/ReactionsList.select_first_item() @@ -242,14 +242,14 @@ func load_Encounter(encounter): if (encounter == $Column1/EncountersList.get_item_metadata(index)): $Column1/EncountersList.select(index) break - $HSC/Column2/HBCTitle/EncounterTitleEdit.text = encounter.title - $HSC/Column2/EncounterMainTextEdit.text = encounter.get_text() + $HSC/Column2/EncounterDetails/HBCTitle/EncounterTitleEdit.text = encounter.title + $HSC/Column2/EncounterDetails/EncounterMainTextEdit.text = encounter.get_text() refresh_bnumber_property_lists() refresh_quick_encounter_scripting_interface() refresh_option_list() if (0 < encounter.options.size()): load_Option(encounter.options[0]) - $HSC/Column2/OptionsList.select_first_item() + $HSC/Column2/OptionDetails/OptionsList.select_first_item() else: load_Option(null) @@ -262,11 +262,11 @@ func Clear_Encounter_Editing_Screen(): current_encounter = null current_option = null current_reaction = null - $HSC/Column2/HBCTitle/EncounterTitleEdit.text = "" - $HSC/Column2/EncounterMainTextEdit.text = "" - $HSC/Column2/OptionsList.items_to_list.clear() - $HSC/Column2/OptionsList.refresh() - $HSC/Column2/OptionText.text = "" + $HSC/Column2/EncounterDetails/HBCTitle/EncounterTitleEdit.text = "" + $HSC/Column2/EncounterDetails/EncounterMainTextEdit.text = "" + $HSC/Column2/OptionDetails/OptionsList.items_to_list.clear() + $HSC/Column2/OptionDetails/OptionsList.refresh() + $HSC/Column2/OptionDetails/OptionText.text = "" $HSC/Column3/ReactionsList.items_to_list.clear() $HSC/Column3/ReactionsList.refresh() $HSC/Column3/ReactionText.text = "" @@ -336,7 +336,7 @@ func _on_EncounterTitleEdit_text_changed(new_text): func _on_EncounterMainTextEdit_text_changed(): #Change encounter main text if (null != current_encounter): - current_encounter.set_text($HSC/Column2/EncounterMainTextEdit.text) + current_encounter.set_text($HSC/Column2/EncounterDetails/EncounterMainTextEdit.text) update_wordcount(current_encounter) log_update(current_encounter) refresh_graphview.emit() @@ -377,7 +377,7 @@ func _on_ConfirmDeletion_confirmed(): refresh_option_list() if (!current_encounter.options.is_empty()): load_Option(current_encounter.options.front()) - $HSC/Column2/OptionsList.select_first_item() + $HSC/Column2/OptionDetails/OptionsList.select_first_item() else: load_Option(null) update_wordcount(current_encounter) @@ -430,11 +430,11 @@ func _on_AddOption_pressed(): if (null != current_encounter): var new_option = storyworld.create_new_generic_option(current_encounter) current_encounter.options.append(new_option) - $HSC/Column2/OptionsList.items_to_list.append(new_option) - $HSC/Column2/OptionsList.list_item(new_option) + $HSC/Column2/OptionDetails/OptionsList.items_to_list.append(new_option) + $HSC/Column2/OptionDetails/OptionsList.list_item(new_option) load_Option(new_option) - $HSC/Column2/OptionsList.deselect_all() - $HSC/Column2/OptionsList.select_last_item() + $HSC/Column2/OptionDetails/OptionsList.deselect_all() + $HSC/Column2/OptionDetails/OptionsList.select_last_item() update_wordcount(current_encounter) log_update(current_encounter) @@ -451,7 +451,7 @@ func confirm_option_deletion(options): $ConfirmDeletion.popup_centered() func _on_DeleteOption_pressed(): - confirm_option_deletion($HSC/Column2/OptionsList.get_all_selected_metadata()) + confirm_option_deletion($HSC/Column2/OptionDetails/OptionsList.get_all_selected_metadata()) func _on_OptionsList_item_moved(item, from_index, to_index): if (null == current_encounter): @@ -466,13 +466,13 @@ func _on_OptionsList_item_moved(item, from_index, to_index): current_encounter.options.append(option) func _on_MoveOptionUpButton_pressed(): - $HSC/Column2/OptionsList.raise_selected_item() + $HSC/Column2/OptionDetails/OptionsList.raise_selected_item() func _on_MoveOptionDownButton_pressed(): - $HSC/Column2/OptionsList.lower_selected_item() + $HSC/Column2/OptionDetails/OptionsList.lower_selected_item() func _on_OptionsList_multi_selected(item, column, selected): - var selected_option = $HSC/Column2/OptionsList.get_first_selected_metadata() + var selected_option = $HSC/Column2/OptionDetails/OptionsList.get_first_selected_metadata() if (null != selected_option): current_option = selected_option load_Option(current_option) @@ -481,15 +481,17 @@ func _on_OptionsList_multi_selected(item, column, selected): func _on_OptionText_text_changed(new_text): if (null != current_option): - current_option.set_text($HSC/Column2/OptionText.text) - $HSC/Column2/OptionsList.refresh() - $HSC/Column2/OptionsList.select_linked_item(current_option) + current_option.set_text($HSC/Column2/OptionDetails/OptionText.text) + $HSC/Column2/OptionDetails/OptionsList.refresh() + $HSC/Column2/OptionDetails/OptionsList.select_linked_item(current_option) update_wordcount(current_encounter) log_update(current_encounter) #Option list context menu: func add_options_at_position(options_to_add, position_in_list): + for option in options_to_add: + option.encounter = current_encounter if (1 == options_to_add.size()): current_encounter.options.insert(position_in_list, options_to_add.front()) elif (0 >= position_in_list): @@ -511,11 +513,11 @@ func duplicate_selected_options(selected_items): new_option.set_as_copy_of(option, false) new_option.encounter = current_encounter current_encounter.options.append(new_option) - $HSC/Column2/OptionsList.items_to_list.append(new_option) - $HSC/Column2/OptionsList.list_item(new_option) + $HSC/Column2/OptionDetails/OptionsList.items_to_list.append(new_option) + $HSC/Column2/OptionDetails/OptionsList.list_item(new_option) last_option_added = new_option load_Option(last_option_added) - $HSC/Column2/OptionsList.select_only_linked_item(last_option_added) + $HSC/Column2/OptionDetails/OptionsList.select_only_linked_item(last_option_added) update_wordcount(current_encounter) log_update(current_encounter) refresh_graphview.emit() @@ -526,7 +528,7 @@ func _on_OptionsList_add_at(index): current_encounter.options.insert(index, new_option) refresh_option_list() load_Option(new_option) - $HSC/Column2/OptionsList.select_only_linked_item(new_option) + $HSC/Column2/OptionDetails/OptionsList.select_only_linked_item(new_option) update_wordcount(current_encounter) log_update(current_encounter) @@ -544,7 +546,7 @@ func _on_OptionsList_paste_at(index): clipboard.delete_clipped_originals() refresh_option_list() load_Option(items_to_add.front()) - $HSC/Column2/OptionsList.select_only_linked_item(items_to_add.front()) + $HSC/Column2/OptionDetails/OptionsList.select_only_linked_item(items_to_add.front()) update_wordcount(current_encounter) log_update(current_encounter) refresh_graphview.emit() @@ -625,6 +627,8 @@ func _on_SimplifiedReactionDesirabilityScriptingInterface_sw_script_changed(sw_s #Reaction list context menu: func add_reactions_at_position(reactions_to_add, position_in_list): + for reaction in reactions_to_add: + reaction.option = current_option if (1 == reactions_to_add.size()): current_option.reactions.insert(position_in_list, reactions_to_add.front()) elif (0 >= position_in_list): @@ -783,6 +787,8 @@ func _on_AfterReactionEffectsDisplay_edit_effect_script(effect): #Effect list context menu: func add_effects_at_position(effects_to_add, position_in_list): + for effect in effects_to_add: + effect.cause = current_reaction if (1 == effects_to_add.size()): current_reaction.after_effects.insert(position_in_list, effects_to_add.front()) elif (0 >= position_in_list): @@ -850,8 +856,8 @@ func update_wordcount(encounter): refresh_encounter_list() func _ready(): - $HSC/Column2/OptionsList.context_menu_enabled = true - $HSC/Column2/OptionsList.item_type = "option" + $HSC/Column2/OptionDetails/OptionsList.context_menu_enabled = true + $HSC/Column2/OptionDetails/OptionsList.item_type = "option" $HSC/Column3/ReactionsList.context_menu_enabled = true $HSC/Column3/ReactionsList.item_type = "reaction" $HSC/Column3/AfterReactionEffectsDisplay.context_menu_enabled = true @@ -976,14 +982,14 @@ func set_gui_theme(theme_name, background_color): "Clarity": $Column1/HBC/AddButton.icon = add_icon_dark $Column1/HBC/DeleteButton.icon = delete_icon_dark - $HSC/Column2/HBCTitle/EditEncounterAcceptabilityScriptButton.icon = acceptability_icon_dark - $HSC/Column2/HBCTitle/EditEncounterDesirabilityScriptButton.icon = desirability_icon_dark - $HSC/Column2/HBCOptionButtons/AddOption.icon = add_icon_dark - $HSC/Column2/HBCOptionButtons/DeleteOption.icon = delete_icon_dark - $HSC/Column2/HBCOptionButtons/MoveOptionUpButton.icon = move_up_icon_dark - $HSC/Column2/HBCOptionButtons/MoveOptionDownButton.icon = move_down_icon_dark - $HSC/Column2/HBCOptionButtons/EditOptionVisibilityScriptButton.icon = visibility_icon_dark - $HSC/Column2/HBCOptionButtons/EditOptionPerformabilityScriptButton.icon = performability_icon_dark + $HSC/Column2/EncounterDetails/HBCTitle/EditEncounterAcceptabilityScriptButton.icon = acceptability_icon_dark + $HSC/Column2/EncounterDetails/HBCTitle/EditEncounterDesirabilityScriptButton.icon = desirability_icon_dark + $HSC/Column2/OptionDetails/HBCOptionButtons/AddOption.icon = add_icon_dark + $HSC/Column2/OptionDetails/HBCOptionButtons/DeleteOption.icon = delete_icon_dark + $HSC/Column2/OptionDetails/HBCOptionButtons/MoveOptionUpButton.icon = move_up_icon_dark + $HSC/Column2/OptionDetails/HBCOptionButtons/MoveOptionDownButton.icon = move_down_icon_dark + $HSC/Column2/OptionDetails/HBCOptionButtons/EditOptionVisibilityScriptButton.icon = visibility_icon_dark + $HSC/Column2/OptionDetails/HBCOptionButtons/EditOptionPerformabilityScriptButton.icon = performability_icon_dark $HSC/Column3/HBC/AddReaction.icon = add_icon_dark $HSC/Column3/HBC/DeleteReaction.icon = delete_icon_dark $HSC/Column3/HBC/MoveReactionUpButton.icon = move_up_icon_dark @@ -997,14 +1003,14 @@ func set_gui_theme(theme_name, background_color): "Lapis Lazuli": $Column1/HBC/AddButton.icon = add_icon_light $Column1/HBC/DeleteButton.icon = delete_icon_light - $HSC/Column2/HBCTitle/EditEncounterAcceptabilityScriptButton.icon = acceptability_icon - $HSC/Column2/HBCTitle/EditEncounterDesirabilityScriptButton.icon = desirability_icon - $HSC/Column2/HBCOptionButtons/AddOption.icon = add_icon_light - $HSC/Column2/HBCOptionButtons/DeleteOption.icon = delete_icon_light - $HSC/Column2/HBCOptionButtons/MoveOptionUpButton.icon = move_up_icon_light - $HSC/Column2/HBCOptionButtons/MoveOptionDownButton.icon = move_down_icon_light - $HSC/Column2/HBCOptionButtons/EditOptionVisibilityScriptButton.icon = visibility_icon - $HSC/Column2/HBCOptionButtons/EditOptionPerformabilityScriptButton.icon = performability_icon + $HSC/Column2/EncounterDetails/HBCTitle/EditEncounterAcceptabilityScriptButton.icon = acceptability_icon + $HSC/Column2/EncounterDetails/HBCTitle/EditEncounterDesirabilityScriptButton.icon = desirability_icon + $HSC/Column2/OptionDetails/HBCOptionButtons/AddOption.icon = add_icon_light + $HSC/Column2/OptionDetails/HBCOptionButtons/DeleteOption.icon = delete_icon_light + $HSC/Column2/OptionDetails/HBCOptionButtons/MoveOptionUpButton.icon = move_up_icon_light + $HSC/Column2/OptionDetails/HBCOptionButtons/MoveOptionDownButton.icon = move_down_icon_light + $HSC/Column2/OptionDetails/HBCOptionButtons/EditOptionVisibilityScriptButton.icon = visibility_icon + $HSC/Column2/OptionDetails/HBCOptionButtons/EditOptionPerformabilityScriptButton.icon = performability_icon $HSC/Column3/HBC/AddReaction.icon = add_icon_light $HSC/Column3/HBC/DeleteReaction.icon = delete_icon_light $HSC/Column3/HBC/MoveReactionUpButton.icon = move_up_icon_light diff --git a/godot/interface/EncounterEditScreen.tscn b/godot/interface/EncounterEditScreen.tscn index 025adda..3029392 100644 --- a/godot/interface/EncounterEditScreen.tscn +++ b/godot/interface/EncounterEditScreen.tscn @@ -20,8 +20,6 @@ clip_contents = true anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -offset_right = -521.0 -offset_bottom = -39.0 grow_horizontal = 2 grow_vertical = 2 size_flags_horizontal = 3 @@ -60,10 +58,9 @@ text = "Sort by:" [node name="SortMenu" type="OptionButton" parent="Column1/SortBar"] layout_mode = 2 -item_count = 10 selected = 0 +item_count = 10 popup/item_0/text = "Alphabetical" -popup/item_0/id = 0 popup/item_1/text = "Creation Time" popup/item_1/id = 1 popup/item_2/text = "Modified Time" @@ -106,90 +103,94 @@ custom_minimum_size = Vector2(64, 0) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +split_offset = 730 -[node name="Column2" type="VBoxContainer" parent="HSC"] -custom_minimum_size = Vector2(32, 0) +[node name="Column2" type="VSplitContainer" parent="HSC"] +clip_contents = true +layout_mode = 2 +split_offset = 500 + +[node name="EncounterDetails" type="VBoxContainer" parent="HSC/Column2"] layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -[node name="HBCTitle" type="HBoxContainer" parent="HSC/Column2"] +[node name="HBCTitle" type="HBoxContainer" parent="HSC/Column2/EncounterDetails"] layout_mode = 2 -[node name="EncounterTitleEdit" type="LineEdit" parent="HSC/Column2/HBCTitle"] +[node name="EncounterTitleEdit" type="LineEdit" parent="HSC/Column2/EncounterDetails/HBCTitle"] layout_mode = 2 size_flags_horizontal = 3 placeholder_text = "Encounter Title" caret_blink = true caret_blink_interval = 0.5 -[node name="EditEncounterAcceptabilityScriptButton" type="Button" parent="HSC/Column2/HBCTitle"] +[node name="EditEncounterAcceptabilityScriptButton" type="Button" parent="HSC/Column2/EncounterDetails/HBCTitle"] layout_mode = 2 tooltip_text = "Edit this encounter's acceptability script." icon = ExtResource("14") -[node name="EditEncounterDesirabilityScriptButton" type="Button" parent="HSC/Column2/HBCTitle"] +[node name="EditEncounterDesirabilityScriptButton" type="Button" parent="HSC/Column2/EncounterDetails/HBCTitle"] layout_mode = 2 tooltip_text = "Edit this encounter's desirability script." icon = ExtResource("15") -[node name="EncounterMainTextEdit" type="TextEdit" parent="HSC/Column2"] +[node name="EncounterMainTextEdit" type="TextEdit" parent="HSC/Column2/EncounterDetails"] layout_mode = 2 size_flags_vertical = 3 +placeholder_text = "Encounter main text" wrap_mode = 1 highlight_current_line = true -[node name="SimplifiedEncounterDesirabilityScriptingInterface" parent="HSC/Column2" instance=ExtResource("17")] +[node name="SimplifiedEncounterDesirabilityScriptingInterface" parent="HSC/Column2/EncounterDetails" instance=ExtResource("17")] visible = false layout_mode = 2 -[node name="HBCOptionButtons" type="HBoxContainer" parent="HSC/Column2"] +[node name="OptionDetails" type="VBoxContainer" parent="HSC/Column2"] +layout_mode = 2 + +[node name="HBCOptionButtons" type="HBoxContainer" parent="HSC/Column2/OptionDetails"] layout_mode = 2 size_flags_horizontal = 3 -[node name="Label" type="Label" parent="HSC/Column2/HBCOptionButtons"] +[node name="Label" type="Label" parent="HSC/Column2/OptionDetails/HBCOptionButtons"] layout_mode = 2 text = "Options: " -[node name="AddOption" type="Button" parent="HSC/Column2/HBCOptionButtons"] +[node name="AddOption" type="Button" parent="HSC/Column2/OptionDetails/HBCOptionButtons"] layout_mode = 2 tooltip_text = "Add new option." icon = ExtResource("2") -[node name="DeleteOption" type="Button" parent="HSC/Column2/HBCOptionButtons"] +[node name="DeleteOption" type="Button" parent="HSC/Column2/OptionDetails/HBCOptionButtons"] layout_mode = 2 tooltip_text = "Delete selected options." icon = ExtResource("11") -[node name="MoveOptionUpButton" type="Button" parent="HSC/Column2/HBCOptionButtons"] +[node name="MoveOptionUpButton" type="Button" parent="HSC/Column2/OptionDetails/HBCOptionButtons"] layout_mode = 2 tooltip_text = "Move option up." icon = ExtResource("3") -[node name="MoveOptionDownButton" type="Button" parent="HSC/Column2/HBCOptionButtons"] +[node name="MoveOptionDownButton" type="Button" parent="HSC/Column2/OptionDetails/HBCOptionButtons"] layout_mode = 2 tooltip_text = "Move option down." icon = ExtResource("10") -[node name="EditOptionVisibilityScriptButton" type="Button" parent="HSC/Column2/HBCOptionButtons"] +[node name="EditOptionVisibilityScriptButton" type="Button" parent="HSC/Column2/OptionDetails/HBCOptionButtons"] layout_mode = 2 tooltip_text = "Edit this option's visibility script." icon = ExtResource("12") -[node name="EditOptionPerformabilityScriptButton" type="Button" parent="HSC/Column2/HBCOptionButtons"] +[node name="EditOptionPerformabilityScriptButton" type="Button" parent="HSC/Column2/OptionDetails/HBCOptionButtons"] layout_mode = 2 tooltip_text = "Edit this option's performability script." icon = ExtResource("13") -[node name="OptionsList" parent="HSC/Column2" instance=ExtResource("8")] -custom_minimum_size = Vector2(0, 128) -layout_mode = 2 - -[node name="OptTxtLabel" type="Label" parent="HSC/Column2"] +[node name="OptionsList" parent="HSC/Column2/OptionDetails" instance=ExtResource("8")] +custom_minimum_size = Vector2(0, 64) layout_mode = 2 -text = "Text of option: " +size_flags_vertical = 3 -[node name="OptionText" type="LineEdit" parent="HSC/Column2"] +[node name="OptionText" type="LineEdit" parent="HSC/Column2/OptionDetails"] custom_minimum_size = Vector2(200, 0) layout_mode = 2 placeholder_text = "Option text" @@ -241,15 +242,12 @@ icon_alignment = 1 custom_minimum_size = Vector2(0, 128) layout_mode = 2 -[node name="Label" type="Label" parent="HSC/Column3"] -layout_mode = 2 -text = "Reaction text:" - [node name="ReactionText" type="TextEdit" parent="HSC/Column3"] custom_minimum_size = Vector2(0, 100) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +placeholder_text = "Reaction text" wrap_mode = 1 [node name="SimplifiedReactionDesirabilityScriptingInterface" parent="HSC/Column3" instance=ExtResource("17")] @@ -262,7 +260,7 @@ layout_mode = 2 [node name="ChangeConsequence" type="Button" parent="HSC/Column3/HBCConsequence"] visible = false layout_mode = 2 -tooltip_text = "This sets the reaction's consequence to the first currently selected encounter, (selected in the encounter list on the far left of the screen.)" +tooltip_text = "Any time this reaction occurs, this encounter will occur next." text = "Change Consequence:" [node name="HBCEffectButtons" type="HBoxContainer" parent="HSC/Column3"] @@ -328,7 +326,7 @@ dialog_autowrap = true [node name="ScriptEditWindow" type="AcceptDialog" parent="."] title = "Script Editor" -size = Vector2i(800, 650) +size = Vector2i(900, 650) [node name="ScriptEditScreen" parent="ScriptEditWindow" instance=ExtResource("6")] offset_left = 8.0 @@ -343,28 +341,28 @@ offset_bottom = -36.0 [connection signal="pressed" from="Column1/HBC2/Duplicate" to="." method="_on_Duplicate_pressed"] [connection signal="item_selected" from="Column1/EncountersList" to="." method="_on_EncountersList_item_selected"] [connection signal="multi_selected" from="Column1/EncountersList" to="." method="_on_EncountersList_multi_selected"] -[connection signal="text_changed" from="HSC/Column2/HBCTitle/EncounterTitleEdit" to="." method="_on_EncounterTitleEdit_text_changed"] -[connection signal="pressed" from="HSC/Column2/HBCTitle/EditEncounterAcceptabilityScriptButton" to="." method="_on_EditEncounterAcceptabilityScriptButton_pressed"] -[connection signal="pressed" from="HSC/Column2/HBCTitle/EditEncounterDesirabilityScriptButton" to="." method="_on_EditEncounterDesirabilityScriptButton_pressed"] -[connection signal="text_changed" from="HSC/Column2/EncounterMainTextEdit" to="." method="_on_EncounterMainTextEdit_text_changed"] -[connection signal="sw_script_changed" from="HSC/Column2/SimplifiedEncounterDesirabilityScriptingInterface" to="." method="_on_SimplifiedEncounterDesirabilityScriptingInterface_sw_script_changed"] -[connection signal="pressed" from="HSC/Column2/HBCOptionButtons/AddOption" to="." method="_on_AddOption_pressed"] -[connection signal="pressed" from="HSC/Column2/HBCOptionButtons/DeleteOption" to="." method="_on_DeleteOption_pressed"] -[connection signal="pressed" from="HSC/Column2/HBCOptionButtons/MoveOptionUpButton" to="." method="_on_MoveOptionUpButton_pressed"] -[connection signal="pressed" from="HSC/Column2/HBCOptionButtons/MoveOptionDownButton" to="." method="_on_MoveOptionDownButton_pressed"] -[connection signal="pressed" from="HSC/Column2/HBCOptionButtons/EditOptionVisibilityScriptButton" to="." method="_on_EditOptionVisibilityScriptButton_pressed"] -[connection signal="pressed" from="HSC/Column2/HBCOptionButtons/EditOptionPerformabilityScriptButton" to="." method="_on_EditOptionPerformabilityScriptButton_pressed"] -[connection signal="add_at" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_add_at"] -[connection signal="copy" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_copy"] -[connection signal="cut" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_cut"] -[connection signal="delete" from="HSC/Column2/OptionsList" to="." method="confirm_option_deletion"] -[connection signal="duplicate" from="HSC/Column2/OptionsList" to="." method="duplicate_selected_options"] -[connection signal="edit_performability_script" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_edit_performability_script"] -[connection signal="edit_visibility_script" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_edit_visibility_script"] -[connection signal="item_moved" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_item_moved"] -[connection signal="multi_selected" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_multi_selected"] -[connection signal="paste_at" from="HSC/Column2/OptionsList" to="." method="_on_OptionsList_paste_at"] -[connection signal="text_changed" from="HSC/Column2/OptionText" to="." method="_on_OptionText_text_changed"] +[connection signal="text_changed" from="HSC/Column2/EncounterDetails/HBCTitle/EncounterTitleEdit" to="." method="_on_EncounterTitleEdit_text_changed"] +[connection signal="pressed" from="HSC/Column2/EncounterDetails/HBCTitle/EditEncounterAcceptabilityScriptButton" to="." method="_on_EditEncounterAcceptabilityScriptButton_pressed"] +[connection signal="pressed" from="HSC/Column2/EncounterDetails/HBCTitle/EditEncounterDesirabilityScriptButton" to="." method="_on_EditEncounterDesirabilityScriptButton_pressed"] +[connection signal="text_changed" from="HSC/Column2/EncounterDetails/EncounterMainTextEdit" to="." method="_on_EncounterMainTextEdit_text_changed"] +[connection signal="sw_script_changed" from="HSC/Column2/EncounterDetails/SimplifiedEncounterDesirabilityScriptingInterface" to="." method="_on_SimplifiedEncounterDesirabilityScriptingInterface_sw_script_changed"] +[connection signal="pressed" from="HSC/Column2/OptionDetails/HBCOptionButtons/AddOption" to="." method="_on_AddOption_pressed"] +[connection signal="pressed" from="HSC/Column2/OptionDetails/HBCOptionButtons/DeleteOption" to="." method="_on_DeleteOption_pressed"] +[connection signal="pressed" from="HSC/Column2/OptionDetails/HBCOptionButtons/MoveOptionUpButton" to="." method="_on_MoveOptionUpButton_pressed"] +[connection signal="pressed" from="HSC/Column2/OptionDetails/HBCOptionButtons/MoveOptionDownButton" to="." method="_on_MoveOptionDownButton_pressed"] +[connection signal="pressed" from="HSC/Column2/OptionDetails/HBCOptionButtons/EditOptionVisibilityScriptButton" to="." method="_on_EditOptionVisibilityScriptButton_pressed"] +[connection signal="pressed" from="HSC/Column2/OptionDetails/HBCOptionButtons/EditOptionPerformabilityScriptButton" to="." method="_on_EditOptionPerformabilityScriptButton_pressed"] +[connection signal="add_at" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_add_at"] +[connection signal="copy" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_copy"] +[connection signal="cut" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_cut"] +[connection signal="delete" from="HSC/Column2/OptionDetails/OptionsList" to="." method="confirm_option_deletion"] +[connection signal="duplicate" from="HSC/Column2/OptionDetails/OptionsList" to="." method="duplicate_selected_options"] +[connection signal="edit_performability_script" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_edit_performability_script"] +[connection signal="edit_visibility_script" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_edit_visibility_script"] +[connection signal="item_moved" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_item_moved"] +[connection signal="multi_selected" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_multi_selected"] +[connection signal="paste_at" from="HSC/Column2/OptionDetails/OptionsList" to="." method="_on_OptionsList_paste_at"] +[connection signal="text_changed" from="HSC/Column2/OptionDetails/OptionText" to="." method="_on_OptionText_text_changed"] [connection signal="pressed" from="HSC/Column3/HBC/AddReaction" to="." method="_on_AddReaction_pressed"] [connection signal="pressed" from="HSC/Column3/HBC/DeleteReaction" to="." method="_on_DeleteReaction_pressed"] [connection signal="pressed" from="HSC/Column3/HBC/MoveReactionUpButton" to="." method="_on_MoveReactionUpButton_pressed"] diff --git a/godot/interface/EncounterOverviewScreen.gd b/godot/interface/EncounterOverviewScreen.gd index 08b189b..1e77bbc 100644 --- a/godot/interface/EncounterOverviewScreen.gd +++ b/godot/interface/EncounterOverviewScreen.gd @@ -265,4 +265,3 @@ func set_gui_theme(theme_name, background_color): $Background/VBC/HFlowContainer/DeleteEncounterButton.set_button_icon(delete_icon_light) light_mode = false refresh_sort_icon() - diff --git a/godot/interface/EncounterOverviewScreen.tscn b/godot/interface/EncounterOverviewScreen.tscn index a824045..8dbac57 100644 --- a/godot/interface/EncounterOverviewScreen.tscn +++ b/godot/interface/EncounterOverviewScreen.tscn @@ -71,10 +71,9 @@ text = "Sort by:" [node name="SortMenu" type="OptionButton" parent="Background/VBC/HFlowContainer/SortBar"] layout_mode = 2 -item_count = 10 selected = 0 +item_count = 10 popup/item_0/text = "Alphabetical" -popup/item_0/id = 0 popup/item_1/text = "Creation Time" popup/item_1/id = 1 popup/item_2/text = "Modified Time" diff --git a/godot/interface/EventSelectionInterface.gd b/godot/interface/EventSelectionInterface.gd index 275eeb3..3ffc36a 100644 --- a/godot/interface/EventSelectionInterface.gd +++ b/godot/interface/EventSelectionInterface.gd @@ -5,7 +5,7 @@ var blacklist = [] #A list of encounters that should not be made available for s var selected_event = null #An EventPointer. var searchterm = "" var display_options = true #If true, the refresh function will display the options of encounters as branches of those encounters in the EventTree. -var display_negated_checkbox = true +var display_negated_checkbox = false var light_mode = true #Clarity is a light mode theme, while Lapis Lazuli is a dark mode theme. @@ -132,6 +132,26 @@ func _on_ToggleReverseButton_toggled(button_pressed): refresh() refresh_sort_icon() +func _on_collapse_all_pressed() -> void: + var branch = $Background/VBC/EventTree.get_root().get_first_child() + while (null != branch): + branch.call_recursive("set_collapsed", true) + branch = branch.get_next() + +func _on_expand_to_options_pressed() -> void: + var branch = $Background/VBC/EventTree.get_root().get_first_child() + while (null != branch): + branch.set_collapsed(false) + for leaf in branch.get_children(): + leaf.set_collapsed(true) + branch = branch.get_next() + +func _on_expand_to_reactions_pressed() -> void: + var branch = $Background/VBC/EventTree.get_root().get_first_child() + while (null != branch): + branch.call_recursive("set_collapsed", false) + branch = branch.get_next() + func _on_EventTree_item_activated(): event_doubleclicked.emit(selected_event) diff --git a/godot/interface/EventSelectionInterface.tscn b/godot/interface/EventSelectionInterface.tscn index 94410b2..a0e108b 100644 --- a/godot/interface/EventSelectionInterface.tscn +++ b/godot/interface/EventSelectionInterface.tscn @@ -50,16 +50,27 @@ placeholder_text = "Enter search term" [node name="SortBar" type="HBoxContainer" parent="Background/VBC"] layout_mode = 2 +[node name="CollapseAll" type="Button" parent="Background/VBC/SortBar"] +layout_mode = 2 +text = "Collapse All" + +[node name="ExpandToOptions" type="Button" parent="Background/VBC/SortBar"] +layout_mode = 2 +text = "Expand to Options" + +[node name="ExpandToReactions" type="Button" parent="Background/VBC/SortBar"] +layout_mode = 2 +text = "Expand to Reactions" + [node name="Label" type="Label" parent="Background/VBC/SortBar"] layout_mode = 2 text = " Sort by:" [node name="SortMenu" type="OptionButton" parent="Background/VBC/SortBar"] layout_mode = 2 -item_count = 10 selected = 0 +item_count = 10 popup/item_0/text = "Alphabetical" -popup/item_0/id = 0 popup/item_1/text = "Creation Time" popup/item_1/id = 1 popup/item_2/text = "Modified Time" @@ -92,10 +103,14 @@ size_flags_vertical = 3 hide_root = true [node name="NegatedCheckBox" type="CheckBox" parent="Background/VBC"] +visible = false layout_mode = 2 text = "Negated" [connection signal="text_submitted" from="Background/VBC/SearchBar/LineEdit" to="." method="_on_LineEdit_text_entered"] +[connection signal="pressed" from="Background/VBC/SortBar/CollapseAll" to="." method="_on_collapse_all_pressed"] +[connection signal="pressed" from="Background/VBC/SortBar/ExpandToOptions" to="." method="_on_expand_to_options_pressed"] +[connection signal="pressed" from="Background/VBC/SortBar/ExpandToReactions" to="." method="_on_expand_to_reactions_pressed"] [connection signal="item_selected" from="Background/VBC/SortBar/SortMenu" to="." method="_on_SortMenu_item_selected"] [connection signal="toggled" from="Background/VBC/SortBar/ToggleReverseButton" to="." method="_on_ToggleReverseButton_toggled"] [connection signal="item_activated" from="Background/VBC/EventTree" to="." method="_on_EventTree_item_activated"] diff --git a/godot/interface/GUI.gd b/godot/interface/GUI.gd index 4dd41bb..c3fd8f7 100644 --- a/godot/interface/GUI.gd +++ b/godot/interface/GUI.gd @@ -4,7 +4,7 @@ var current_project_path = "" var current_html_template_path = "res://custom_resources/encounter_engine.html" var open_after_compiling = false -var sweepweave_version_number = "0.1.7" +var sweepweave_version_number = "0.1.8" var storyworld = null var clipboard = Clipboard.new() diff --git a/godot/interface/GUI.tscn b/godot/interface/GUI.tscn index 0a2359c..7e7a369 100644 --- a/godot/interface/GUI.tscn +++ b/godot/interface/GUI.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" path="res://interface/GUI.gd" id="1"] [ext_resource type="Script" path="res://interface/FileMenu.gd" id="2"] [ext_resource type="PackedScene" uid="uid://bf3pftycfcdvc" path="res://interface/EncounterEditScreen.tscn" id="3"] -[ext_resource type="PackedScene" path="res://interface/StoryworldMergingScreen.tscn" id="4"] +[ext_resource type="PackedScene" uid="uid://dyoqojiia0nn0" path="res://interface/StoryworldMergingScreen.tscn" id="4"] [ext_resource type="PackedScene" uid="uid://2drjtayo0geb" path="res://interface/SettingsEditScreen.tscn" id="5"] [ext_resource type="PackedScene" uid="uid://6cxvq1qx3md7" path="res://interface/DocumentationScreen.tscn" id="6"] [ext_resource type="PackedScene" uid="uid://dny4elq2jiwd1" path="res://interface/AuthoredPropertyCreationScreen.tscn" id="7"] @@ -12,7 +12,7 @@ [ext_resource type="PackedScene" uid="uid://bf14vd68l46tj" path="res://interface/EncounterOverviewScreen.tscn" id="10"] [ext_resource type="PackedScene" uid="uid://dnxd03sk3fslv" path="res://interface/GraphViewScreen.tscn" id="11"] [ext_resource type="PackedScene" uid="uid://cuwvdxyyh1unn" path="res://interface/PlayScreen.tscn" id="12"] -[ext_resource type="PackedScene" path="res://interface/CharacterEditScreen.tscn" id="13"] +[ext_resource type="PackedScene" uid="uid://b4de5y8e6pc3k" path="res://interface/CharacterEditScreen.tscn" id="13"] [ext_resource type="PackedScene" path="res://interface/StatisticsScreen.tscn" id="14"] [ext_resource type="Script" path="res://interface/ViewMenu.gd" id="15"] [ext_resource type="Script" path="res://interface/HelpMenu.gd" id="16"] @@ -77,45 +77,56 @@ clip_contents = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +current_tab = 0 [node name="Overview" parent="Background/VBC/EditorTabs" instance=ExtResource("10")] layout_mode = 2 +metadata/_tab_index = 0 [node name="Encounters" parent="Background/VBC/EditorTabs" instance=ExtResource("3")] visible = false layout_mode = 2 +metadata/_tab_index = 1 [node name="Spools" parent="Background/VBC/EditorTabs" instance=ExtResource("9")] visible = false layout_mode = 2 +metadata/_tab_index = 2 [node name="Characters" parent="Background/VBC/EditorTabs" instance=ExtResource("13")] visible = false layout_mode = 2 +metadata/_tab_index = 3 [node name="PersonalityModel" parent="Background/VBC/EditorTabs" instance=ExtResource("7")] visible = false layout_mode = 2 +metadata/_tab_index = 4 [node name="Settings" parent="Background/VBC/EditorTabs" instance=ExtResource("5")] visible = false layout_mode = 2 +metadata/_tab_index = 5 [node name="Documentation" parent="Background/VBC/EditorTabs" instance=ExtResource("6")] visible = false layout_mode = 2 +metadata/_tab_index = 6 [node name="GraphView" parent="Background/VBC/EditorTabs" instance=ExtResource("11")] visible = false layout_mode = 2 +metadata/_tab_index = 7 [node name="Play" parent="Background/VBC/EditorTabs" instance=ExtResource("12")] visible = false layout_mode = 2 +metadata/_tab_index = 8 [node name="Rehearsal" parent="Background/VBC/EditorTabs" instance=ExtResource("21")] visible = false layout_mode = 2 +metadata/_tab_index = 9 [node name="LoadFileDialog" type="FileDialog" parent="."] title = "Load Storyworld" @@ -243,7 +254,7 @@ layout_mode = 2 [node name="StoryworldTroubleshooting" type="AcceptDialog" parent="."] title = "Storyworld Troubleshooter" -size = Vector2i(700, 650) +size = Vector2i(1000, 650) popup_window = true [node name="StoryworldValidationInterface" parent="StoryworldTroubleshooting" instance=ExtResource("8")] diff --git a/godot/interface/GraphViewScreen.gd b/godot/interface/GraphViewScreen.gd index 70884e0..37df5f0 100644 --- a/godot/interface/GraphViewScreen.gd +++ b/godot/interface/GraphViewScreen.gd @@ -120,4 +120,3 @@ func set_gui_theme(theme_name, background_color): "Lapis Lazuli": light_mode = false get_tree().call_group("graphview_nodes", "set_gui_theme", theme_name, background_color) - diff --git a/godot/interface/ScriptEditScreen.tscn b/godot/interface/ScriptEditScreen.tscn index 4a193d5..d406166 100644 --- a/godot/interface/ScriptEditScreen.tscn +++ b/godot/interface/ScriptEditScreen.tscn @@ -47,7 +47,7 @@ size_flags_vertical = 3 size_flags_stretch_ratio = 0.5 [node name="EventSelectionDialog" type="ConfirmationDialog" parent="."] -size = Vector2i(256, 256) +size = Vector2i(700, 512) [node name="EventSelectionInterface" parent="EventSelectionDialog" instance=ExtResource("2")] offset_left = 8.0 diff --git a/godot/interface/StoryworldMergingScreen.gd b/godot/interface/StoryworldMergingScreen.gd index 17cab45..97967d2 100644 --- a/godot/interface/StoryworldMergingScreen.gd +++ b/godot/interface/StoryworldMergingScreen.gd @@ -1,72 +1,35 @@ extends Panel -var file_paths = null -var storyworlds = [] -var encounters = [] -var characters = [] -var MainLabel = null -var EncounterList = null -var CharacterList = null +var file_path = "" +var storyworld_to_merge = null func _ready(): - MainLabel = $Margin/VBC/HBC1/Label - EncounterList = $Margin/VBC/HBC2/VBC1/EncounterList - CharacterList = $Margin/VBC/HBC2/VBC2/CharacterList - -func clear_data(): - for storyworld in storyworlds: - storyworld.clear() - storyworld.call_deferred("free") - storyworlds = [] - encounters = [] - characters = [] + pass func load_content_from_files(): - EncounterList.clear() - CharacterList.clear() - if (0 == file_paths.size()): - MainLabel.text = "No files selected for importation." - elif (1 == file_paths.size()): - MainLabel.text = "Importing content from file:" - else: - MainLabel.text = "Importing content from files:" - for path in file_paths: - MainLabel.text += " (" + path + ")" - if not FileAccess.file_exists(path): - continue # Error: File not found. - var file = FileAccess.open(path, FileAccess.READ) - if (null == file): - continue # Error: Could not open file. - var json_string = file.get_as_text().replacen("var storyworld_data = ", "") - var storyworld = Storyworld.new() - storyworld.load_from_json(json_string) - file.close() - storyworlds.append(storyworld) - for encounter in storyworld.encounters: - if ("" == encounter.title): - EncounterList.add_item("[Encounter with blank title]") - else: - EncounterList.add_item(encounter.title) - var index = EncounterList.get_item_count() - 1 - EncounterList.set_item_metadata(index, encounter) - for character in storyworld.characters: - if ("" == character.char_name): - CharacterList.add_item("[Character with blank name]") - else: - CharacterList.add_item(character.char_name) - var index = CharacterList.get_item_count() - 1 - CharacterList.set_item_metadata(index, character) - -func get_selected_encounters(): - var selected_encounters = [] - for index in EncounterList.get_selected_items(): - var encounter = EncounterList.get_item_metadata(index) - selected_encounters.append(encounter) - return selected_encounters - -func get_selected_characters(): - var selected_characters = [] - for index in CharacterList.get_selected_items(): - var character = CharacterList.get_item_metadata(index) - selected_characters.append(character) - return selected_characters + if ("" == file_path): + return + if not FileAccess.file_exists(file_path): + return # Error: File not found. + var file = FileAccess.open(file_path, FileAccess.READ) + if (null == file): + return # Error: Could not open file. + var json_string = file.get_as_text().replacen("var storyworld_data = ", "") + var storyworld = Storyworld.new() + storyworld.load_from_json(json_string) + file.close() + #storyworlds.append(storyworld) + #for encounter in storyworld.encounters: + #if ("" == encounter.title): + #EncounterList.add_item("[Encounter with blank title]") + #else: + #EncounterList.add_item(encounter.title) + #var index = EncounterList.get_item_count() - 1 + #EncounterList.set_item_metadata(index, encounter) + #for character in storyworld.characters: + #if ("" == character.char_name): + #CharacterList.add_item("[Character with blank name]") + #else: + #CharacterList.add_item(character.char_name) + #var index = CharacterList.get_item_count() - 1 + #CharacterList.set_item_metadata(index, character) diff --git a/godot/interface/StoryworldMergingScreen.tscn b/godot/interface/StoryworldMergingScreen.tscn index dcb0c1f..3596ec3 100644 --- a/godot/interface/StoryworldMergingScreen.tscn +++ b/godot/interface/StoryworldMergingScreen.tscn @@ -1,86 +1,43 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=2 format=3 uid="uid://dyoqojiia0nn0"] -[ext_resource path="res://interface/StoryworldMergingScreen.gd" type="Script" id=1] +[ext_resource type="Script" path="res://interface/StoryworldMergingScreen.gd" id="1"] [node name="StoryworldMergingScreen" type="Panel"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 size_flags_horizontal = 3 size_flags_vertical = 3 -script = ExtResource( 1 ) +script = ExtResource("1") [node name="Margin" type="MarginContainer" parent="."] -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -258.0 -offset_top = 8.0 -offset_right = 258.0 -offset_bottom = 292.0 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 [node name="VBC" type="VBoxContainer" parent="Margin"] -offset_right = 516.0 -offset_bottom = 300.0 +layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="HBC1" type="HBoxContainer" parent="Margin/VBC"] -offset_right = 516.0 -offset_bottom = 14.0 +layout_mode = 2 [node name="Label" type="Label" parent="Margin/VBC/HBC1"] -offset_right = 512.0 -offset_bottom = 14.0 -custom_minimum_size = Vector2( 512, 0 ) -text = "Importing encounters and characters." -autowrap = true +custom_minimum_size = Vector2(512, 0) +layout_mode = 2 +text = "Select which encounters you want to keep." [node name="HSeparator" type="HSeparator" parent="Margin/VBC"] -offset_top = 18.0 -offset_right = 516.0 -offset_bottom = 22.0 - -[node name="HBC2" type="HBoxContainer" parent="Margin/VBC"] -offset_top = 26.0 -offset_right = 516.0 -offset_bottom = 300.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="VBC1" type="VBoxContainer" parent="Margin/VBC/HBC2"] -offset_right = 256.0 -offset_bottom = 274.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Label" type="Label" parent="Margin/VBC/HBC2/VBC1"] -offset_right = 256.0 -offset_bottom = 14.0 -text = "Select encounters for importation." - -[node name="EncounterList" type="ItemList" parent="Margin/VBC/HBC2/VBC1"] -offset_top = 18.0 -offset_right = 256.0 -offset_bottom = 274.0 -custom_minimum_size = Vector2( 256, 256 ) -size_flags_vertical = 3 -select_mode = 1 - -[node name="VBC2" type="VBoxContainer" parent="Margin/VBC/HBC2"] -offset_left = 260.0 -offset_right = 516.0 -offset_bottom = 274.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Label" type="Label" parent="Margin/VBC/HBC2/VBC2"] -offset_right = 256.0 -offset_bottom = 14.0 -text = "Select Characters for importation." +layout_mode = 2 -[node name="CharacterList" type="ItemList" parent="Margin/VBC/HBC2/VBC2"] -offset_top = 18.0 -offset_right = 256.0 -offset_bottom = 274.0 -custom_minimum_size = Vector2( 256, 256 ) +[node name="Tree" type="Tree" parent="Margin/VBC"] +layout_mode = 2 size_flags_vertical = 3 -select_mode = 1 +columns = 5 +column_titles_visible = true +hide_root = true +select_mode = 2 diff --git a/godot/interface/StoryworldValidationInterface.gd b/godot/interface/StoryworldValidationInterface.gd index 0a7a593..f4112eb 100644 --- a/godot/interface/StoryworldValidationInterface.gd +++ b/godot/interface/StoryworldValidationInterface.gd @@ -60,7 +60,7 @@ func _on_ValidateButton_pressed(): $ColorRect/HBC/VBC/StoryworldValidationOverview.text = "" if (perform_validation): for encounter in storyworld.encounters: - if (!(encounter is Encounter)): + if (null == encounter or !(is_instance_valid(encounter)) or encounter is not Encounter): number_of_invalid_encounters += 1 continue if (null == encounter.text_script): @@ -100,9 +100,21 @@ func _on_ValidateButton_pressed(): list_error(new_error_report) number_of_invalid_encounter_desirability_scripts += 1 for option in encounter.options: - if (!(option is Option)): + if (null == option or !(is_instance_valid(option)) or option is not Option): number_of_invalid_options += 1 continue + if (null == option.encounter): + var summary = "Option \"" + option.get_truncated_text(20) + "\" encounter is null." + var details = "Error found in Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" Option encounter is null." + var new_error_report = ErrorReport.new(option, null, "item", summary, details) + list_error(new_error_report) + number_of_invalid_options += 1 + elif (option.encounter != encounter): + var summary = "Option \"" + option.get_truncated_text(20) + "\" is linked to incorrect encounter." + var details = "Error found in Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" Option is linked to incorrect encounter." + var new_error_report = ErrorReport.new(option, null, "item", summary, details) + list_error(new_error_report) + number_of_invalid_options += 1 if (null == option.text_script): var summary = "Option \"" + option.get_truncated_text(20) + "\" text script is null." var details = "Error found in Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" text script is null." @@ -143,9 +155,21 @@ func _on_ValidateButton_pressed(): list_error(new_error_report) number_of_invalid_option_performability_scripts += 1 for reaction in option.reactions: - if (!(reaction is Reaction)): + if (null == reaction or !(is_instance_valid(reaction)) or reaction is not Reaction): number_of_invalid_reactions += 1 continue + if (null == reaction.option): + var summary = "Reaction \"" + reaction.get_truncated_text(20) + "\" option is null." + var details = "Error found in Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" / reaction \"" + reaction.get_text() + "\" Reaction option is null." + var new_error_report = ErrorReport.new(reaction, null, "item", summary, details) + list_error(new_error_report) + number_of_invalid_reactions += 1 + elif (reaction.option != option): + var summary = "Reaction \"" + reaction.get_truncated_text(20) + "\" is linked to incorrect option." + var details = "Error found in Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" / reaction \"" + reaction.get_text() + "\" Reaction is linked to incorrect option." + var new_error_report = ErrorReport.new(reaction, null, "item", summary, details) + list_error(new_error_report) + number_of_invalid_reactions += 1 if (null == reaction.text_script): var summary = "Reaction \"" + reaction.get_truncated_text(20) + "\" text script is null." var details = "Error found in Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" / reaction \"" + reaction.get_text() + "\" performability script is null." @@ -173,9 +197,21 @@ func _on_ValidateButton_pressed(): list_error(new_error_report) number_of_invalid_reaction_desirability_scripts += 1 for effect in reaction.after_effects: - if (!(effect is SWEffect)): + if (null == effect or !(is_instance_valid(effect)) or effect is not SWEffect): number_of_invalid_reaction_effects += 1 continue + if (null == effect.cause): + var summary = "Effect (" + effect.data_to_string() + ") cause is null." + var details = "Error found in effect of Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" / reaction \"" + reaction.get_text() + "\" Effect cause is null." + var new_error_report = ErrorReport.new(reaction, null, "item", summary, details) + list_error(new_error_report) + number_of_invalid_reaction_effects += 1 + elif (effect.cause != reaction): + var summary = "Effect (" + effect.data_to_string() + ") is linked to incorrect cause." + var details = "Error found in effect of Encounter \"" + encounter.title + "\" / option \"" + option.get_text() + "\" / reaction \"" + reaction.get_text() + "\" Effect is linked to incorrect cause." + var new_error_report = ErrorReport.new(reaction, null, "item", summary, details) + list_error(new_error_report) + number_of_invalid_reaction_effects += 1 var reaction_effect_validation_report = effect.validate(sw_script_data_types.VARIANT) if ("Passed." != reaction_effect_validation_report): var summary = "Effect (" + effect.data_to_string() + ")" diff --git a/godot/interface/graphview_node.tscn b/godot/interface/graphview_node.tscn index b4e575f..b8e69f8 100644 --- a/godot/interface/graphview_node.tscn +++ b/godot/interface/graphview_node.tscn @@ -73,6 +73,7 @@ size_flags_horizontal = 0 min_value = -0.99 max_value = 0.99 step = 0.01 +value = 0.01 [node name="EditButton" type="Button" parent="VBC"] layout_mode = 2 diff --git a/godot/project.godot b/godot/project.godot index fb0f367..22c4aaa 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -12,9 +12,9 @@ config_version=5 config/name="SweepWeave" config/description="An experimental authoring tool for interactive storyworlds." -config/version="0.1.7.0" +config/version="0.1.8.0" run/main_scene="res://interface/GUI.tscn" -config/features=PackedStringArray("4.2") +config/features=PackedStringArray("4.3") run/low_processor_mode=true config/icon="res://custom_resources/ball_of_yarn.png" config/windows_native_icon="res://custom_resources/ball_of_yarn.ico" @@ -28,27 +28,28 @@ window/size/viewport_height=736 project_save_overwrite={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } project_save_as={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } project_new={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":78,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":78,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } project_load={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":79,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":79,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } [rendering] +textures/vram_compression/import_etc2_astc=true environment/defaults/default_environment="res://default_env.tres" quality/driver/driver_name="GLES2" vram_compression/import_etc=true diff --git a/godot/storyworld_elements/Actor.gd b/godot/storyworld_elements/Actor.gd index e9e9317..2656390 100644 --- a/godot/storyworld_elements/Actor.gd +++ b/godot/storyworld_elements/Actor.gd @@ -30,6 +30,15 @@ func get_index(): return storyworld.characters.find(self) return -1 +func get_listable_text(maximum_output_length:int = 200): + var text = char_name + if ("" == text): + return "[Unnamed Character]" + elif (maximum_output_length >= text.length()): + return text + else: + return text.left(maximum_output_length - 3) + "..." + func index_authored_property(property): authored_properties.append(property) authored_property_directory[property.id] = property diff --git a/godot/storyworld_elements/Encounter.gd b/godot/storyworld_elements/Encounter.gd index 7a85462..18ffa82 100644 --- a/godot/storyworld_elements/Encounter.gd +++ b/godot/storyworld_elements/Encounter.gd @@ -61,7 +61,7 @@ func set_text(new_text:String): if (text_script.contents is StringConstant): text_script.contents.set_value(new_text) -func get_listable_text(maximum_output_length:int = 70): +func get_listable_text(maximum_output_length:int = 200): var text = title if ("" == text): return "[Untitled Encounter]" diff --git a/godot/storyworld_elements/Option.gd b/godot/storyworld_elements/Option.gd index d85d3e7..b1a7809 100644 --- a/godot/storyworld_elements/Option.gd +++ b/godot/storyworld_elements/Option.gd @@ -52,7 +52,7 @@ func get_truncated_text(maximum_output_length = 20): else: return text.left(maximum_output_length - 3) + "..." -func get_listable_text(maximum_output_length = 80): +func get_listable_text(maximum_output_length = 200): var text = get_text() if ("" == text): return "[Blank Option]" diff --git a/godot/storyworld_elements/Reaction.gd b/godot/storyworld_elements/Reaction.gd index adc17b2..64d3e64 100644 --- a/godot/storyworld_elements/Reaction.gd +++ b/godot/storyworld_elements/Reaction.gd @@ -54,11 +54,12 @@ func get_truncated_text(maximum_output_length:int = 20): else: return text.left(maximum_output_length - 3) + "..." -func get_listable_text(maximum_output_length:int = 80): +func get_listable_text(maximum_output_length:int = 200): var text = get_text() if ("" == text): return "[Blank Reaction]" - elif (maximum_output_length >= text.length()): + text = text.get_slice("\n", 0) + if (maximum_output_length >= text.length()): return text else: return text.left(maximum_output_length - 3) + "..." diff --git a/godot/sw_scripting/SWIfOperator.gd b/godot/sw_scripting/SWIfOperator.gd index b39b978..e327a7b 100644 --- a/godot/sw_scripting/SWIfOperator.gd +++ b/godot/sw_scripting/SWIfOperator.gd @@ -28,12 +28,12 @@ func remove_conditional(in_index): index = in_index -1 #Remove condition. var operand = operands[index] - operands.remove(index) + operands.remove_at(index) operand.clear() operand.call_deferred("free") #Remove conditional result. operand = operands[index] - operands.remove(index) + operands.remove_at(index) operand.clear() operand.call_deferred("free") for i in range(index, operands.size()): diff --git a/godot/sw_scripting/SWOperator.gd b/godot/sw_scripting/SWOperator.gd index 7f19bf4..db455ab 100644 --- a/godot/sw_scripting/SWOperator.gd +++ b/godot/sw_scripting/SWOperator.gd @@ -18,7 +18,7 @@ func add_operand(operand): operand.script_index = operands.size() - 1 func erase_operand(operand_to_erase): - operands.remove(operand_to_erase.script_index) + operands.remove_at(operand_to_erase.script_index) for i in range(operand_to_erase.script_index, operands.size()): var operand = operands[i] if (operand is SWScriptElement):