Skip to content

Commit

Permalink
Version 0.1.4
Browse files Browse the repository at this point in the history
Version 0.1.4: Ready for release.

Bugfixes:
Loading an encounter from a tab other than the Encounters tab should now select the loaded encounter in the Encounters list on the Encounters tab.
The Graph View should now use the correct edit icon for the clarity theme when first opening SweepWeave.
The switch to exclude self-perceptions from character relationships, which was included in version 0.1.3, introduced a number of errors that showed up when deleting characters or properties. These errors appear to have been fixed successfully in the present version. Relatedly, the process of deleting bnumber pointers from scripts has been simplified so that the removed pointers are replaced with constants rather than different pointers. The script editor has also been changed to hide the bnumber pointer option when no bounded number properties are available to point to.

Optimizations:
The arguments of some function definitions have been edited to include variable types, when possible.

New or Changed Features:
The view menu now includes a toggle to show or hide encounter main text excerpts on the Graph View tab. Encounters have a new function for generating excerpts that stop at the end of a word instead of, potentially, in the middle.
The Graph View has also been updated so that all scripts associated with an encounter will be checked for references to other encounters, where before only boolean outputting scripts were being checked. The graphview should, therefore, now show all script links between encounters. Graph View nodes have also been changed to use the labels "Script Links" and "Next-Page Links" instead of "Prerequisites" and "Consequences."
A number of changes have been made to the spool editing screen. One can now add or remove multiple encounters to or from a spool at once. The addable encounters list will only display encounters that are not already on the current spool. Double-clicking an encounter from the list of encounters on the current spool will switch to the Encounters tab and load that encounter for editing. Finally, the encounters on the current spool will now be sorted by highest to lowest desirability at start of play, and their order can no longer be changed by the author via drag and drop.
  • Loading branch information
FrobozzWaxwing committed Dec 29, 2023
1 parent 29440f9 commit 26c6f8d
Show file tree
Hide file tree
Showing 38 changed files with 801 additions and 385 deletions.
8 changes: 4 additions & 4 deletions godot/Rehearsal.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var current_page = null
var storyworld = null
var initial_pValues = null

func _init(in_storyworld):
func _init(in_storyworld:Storyworld):
storyworld = Storyworld.new()
if (null != in_storyworld):
storyworld.set_as_copy_of(in_storyworld)
Expand Down Expand Up @@ -36,7 +36,7 @@ func select_page(reaction = null):
selection = encounter
return selection

func find_open_options(leaf):
func find_open_options(leaf:HB_Record):
if (null == leaf.encounter):
return []
var all_options = leaf.encounter.options
Expand Down Expand Up @@ -125,12 +125,12 @@ func begin_playthrough():
starting_page.record_spool_statuses(storyworld)
current_page = starting_page

func turn_to_page(leaf):
func turn_to_page(leaf:HB_Record):
#Turns to a specific page of the history book, setting all variables appropriately. Used for playtesting.
reset_occurrences_to(leaf)
step_playthrough(leaf)

func step_playthrough(leaf):
func step_playthrough(leaf:HB_Record):
current_page = leaf
reset_pValues_to(leaf)
reset_spools_to(leaf)
Expand Down
10 changes: 5 additions & 5 deletions godot/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ custom_features=""
export_filter="all_resources"
include_filter="*.html, *.json"
exclude_filter=""
export_path="../Internal_TestBed/SweepWeave_Win_0_1_3.exe"
export_path="../Internal_TestBed/SweepWeave_Win_0_1_4.exe"
script_export_mode=1
script_encryption_key=""

Expand All @@ -107,12 +107,12 @@ codesign/description=""
codesign/custom_options=PoolStringArray( )
application/modify_resources=true
application/icon="res://custom_resources/ball_of_yarn.ico"
application/file_version="0.1.3.0"
application/product_version="0.1.3.0"
application/file_version="0.1.4.0"
application/product_version="0.1.4.0"
application/company_name="Neon Hopscotch"
application/product_name="SweepWeave"
application/file_description="SweepWeave"
application/copyright="MIT License, Sasha Fenn, 2020 - 2023"
application/copyright="MIT License, Sasha Fenn, 2020 - 2024"
application/trademarks=""

[preset.2]
Expand All @@ -124,7 +124,7 @@ custom_features=""
export_filter="all_resources"
include_filter="*.html, *.json"
exclude_filter=""
export_path="../Internal_TestBed/SweepWeave_Linux_0_1_3.x86_64"
export_path="../Internal_TestBed/SweepWeave_Linux_0_1_4.x86_64"
script_export_mode=1
script_encryption_key=""

Expand Down
51 changes: 27 additions & 24 deletions godot/interface/AuthoredPropertyCreationScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var authored_properties_to_delete = []
enum possible_attribution_targets {STORYWORLD, CAST_MEMBERS, ENTIRE_CAST}

signal refresh_authored_property_lists()
signal property_deleted()

func _ready():
$ColorRect/VBC/HBC/BNumberEditPanel.connect("bnumber_property_name_changed", self, "refresh_property_name")
Expand Down Expand Up @@ -124,45 +125,47 @@ func _on_ConfirmPropertyDeletionWindow_confirmed():
if (storyworld.characters.empty()):
return
#Build replacement pointer.
var replacement = null
if (replacement_property.possible_attribution_targets.ENTIRE_CAST == replacement_property.attribution_target):
for layer in range(replacement_property.depth):
new_keyring.append(storyworld.characters[0].id)
replacement = BNumberPointer.new(storyworld.characters[0], new_keyring.duplicate(true))
elif (replacement_property.possible_attribution_targets.CAST_MEMBERS == replacement_property.attribution_target):
if (replacement_property.affected_characters.empty()):
print ("Error when creating default bnumber pointer: chosen property has no affected characters.")
return
var character = replacement_property.affected_characters[0]
for layer in range(replacement_property.depth):
new_keyring.append(character.id)
replacement = BNumberPointer.new(character, new_keyring.duplicate(true))
# var replacement = null
# if (replacement_property.possible_attribution_targets.ENTIRE_CAST == replacement_property.attribution_target):
# for layer in range(replacement_property.depth):
# new_keyring.append(storyworld.characters[0].id)
# replacement = BNumberPointer.new(storyworld.characters[0], new_keyring.duplicate(true))
# elif (replacement_property.possible_attribution_targets.CAST_MEMBERS == replacement_property.attribution_target):
# if (replacement_property.affected_characters.empty()):
# print ("Error when creating default bnumber pointer: chosen property has no affected characters.")
# return
# var character = replacement_property.affected_characters[0]
# for layer in range(replacement_property.depth):
# new_keyring.append(character.id)
# replacement = BNumberPointer.new(character, new_keyring.duplicate(true))
#Replace property references with pointer.
for property_blueprint in authored_properties_to_delete:
print ("Replacing " + property_blueprint.get_property_name() + " with " + replacement.data_to_string() + ".")
#Search scripts and replace the properties that we're deleting with the replacement pointer.
for encounter in storyworld.encounters:
encounter.acceptability_script.replace_property_with_pointer(property_blueprint, replacement)
encounter.desirability_script.replace_property_with_pointer(property_blueprint, replacement)
encounter.acceptability_script.delete_property(property_blueprint)
encounter.desirability_script.delete_property(property_blueprint)
for option in encounter.options:
option.visibility_script.replace_property_with_pointer(property_blueprint, replacement)
option.performability_script.replace_property_with_pointer(property_blueprint, replacement)
option.visibility_script.delete_property(property_blueprint)
option.performability_script.delete_property(property_blueprint)
for reaction in option.reactions:
reaction.desirability_script.replace_property_with_pointer(property_blueprint, replacement)
reaction.desirability_script.delete_property(property_blueprint)
print (reaction.desirability_script.data_to_string())
for effect in reaction.after_effects:
var effects = reaction.after_effects.duplicate()
for effect in effects:
if (effect is BNumberEffect):
if (effect.assignee.get_ap_blueprint().id == property_blueprint.id):
effect.assignee.set_as_copy_of(replacement)
effect.assignment_script.replace_property_with_pointer(property_blueprint, replacement)
reaction.after_effects.erase(effect)
effect.call_deferred("free")
continue
effect.assignment_script.delete_property(property_blueprint)
elif (effect is SpoolEffect):
effect.assignment_script.replace_property_with_pointer(property_blueprint, replacement)
effect.assignment_script.delete_property(property_blueprint)
#Delete property.
storyworld.delete_authored_property(property_blueprint)
#Update interface.
log_update()
refresh_property_list()
emit_signal("refresh_authored_property_lists")
emit_signal("property_deleted")

func _on_PropertyList_item_selected(index):
var property_blueprint = $ColorRect/VBC/HBC/VBC/PropertyList.get_item_metadata(index)
Expand Down
1 change: 1 addition & 0 deletions godot/interface/AutomatedRehearsalScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ margin_left = 209.0
margin_right = 283.0
margin_bottom = 24.0
min_value = 1.0
max_value = 1000.0
value = 1.0

[node name="SaveReportButton" type="Button" parent="Panel/VBC/HBC"]
Expand Down
1 change: 1 addition & 0 deletions godot/interface/BNumberConstantEditingInterface.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ func set_reference_operator(new_reference_operator):
func _on_Slidebar_value_changed(new_value):
set_value(new_value)
emit_signal("bnumber_value_changed", reference_operator, new_value)

36 changes: 22 additions & 14 deletions godot/interface/BNumberPropertySelector.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ func refresh():
var option_index = 0
var selected_index = 0
for character in storyworld.characters:
if (!character.bnumber_properties.empty()):
if (character.has_properties()):
$Background/InverseParserHBC/RootCharacterSelector.add_item(character.char_name)
$Background/InverseParserHBC/RootCharacterSelector.set_item_metadata(option_index, character)
if (selected_property.character == character):
selected_index = option_index
option_index += 1
$Background/InverseParserHBC/RootCharacterSelector.select(selected_index)
if (0 == option_index):
set_error_message("No one selected.", "No characters are available to select. Try adding some characters or adding some properties to your existing characters.")
break
else:
$Background/InverseParserHBC/RootCharacterSelector.select(selected_index)
if (0 == selected_property.character.authored_property_directory.size()):
$Background/InverseParserHBC/NegateToggleButton.visible = false
#The selected character has no authored properties associated with them.
Expand Down Expand Up @@ -89,11 +93,18 @@ func refresh():
if (selected_property.keyring[keyring_index] == property_blueprint.id):
selected_index = option_index
option_index += 1
selector.select(selected_index)
if (0 == option_index):
set_error_message("No property selected.", "The selected character, \"" + selected_property.character.char_name + ",\" currently has no properties available to select.")
break
else:
selector.select(selected_index)
selector.connect("keyring_change_requested", self, "change_keyring")
$Background/InverseParserHBC/KeyringBC.add_child(selector)
elif (1 <= keyring_index):
if (!onion.empty()):
if (onion.empty()):
set_error_message("Error: The selected property is empty.")
break
else:
var selector = KeyringOptionButton.instance()
selector.keyring_index = keyring_index
option_index = 0
Expand All @@ -115,7 +126,7 @@ func refresh():
break
return true

func change_keyring(keyring_index, option_index, option_metadata):
func change_keyring(keyring_index, option_metadata):
if (null == storyworld or storyworld.characters.empty()):
return
var onion = null
Expand Down Expand Up @@ -158,13 +169,10 @@ func _on_NegateToggleButton_pressed():
emit_signal("bnumber_property_selected", selected_property)

func _on_RootCharacterSelector_item_selected(index):
var metadata = $Background/InverseParserHBC/RootCharacterSelector.get_item_metadata(index)
if (metadata is Actor):
var character = $Background/InverseParserHBC/RootCharacterSelector.get_item_metadata(index)
if (character is Actor):
selected_property.character = character
var blueprint = selected_property.get_ap_blueprint()
if (null != blueprint and blueprint.applies_to(metadata)):
selected_property.character = metadata
else:
reset()
selected_property.character = metadata
refresh()
emit_signal("bnumber_property_selected", selected_property)
if (null == blueprint or !blueprint.applies_to(character) or !character.bnumber_properties.has(blueprint.id)):
blueprint = character.authored_properties.front()
change_keyring(0, blueprint)
52 changes: 23 additions & 29 deletions godot/interface/CharacterEditScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var character_to_delete = null #We want to set this up as a gloabal variable for

signal new_character_created(character)
signal character_name_changed(character)
signal character_deleted(deleted_character, replacement)
signal character_deleted()
signal refresh_authored_property_lists()

func _ready():
Expand Down Expand Up @@ -99,50 +99,44 @@ func _on_DeleteCharacter_pressed():
var selection = $HBC/VBC/Scroll/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 + '"? If so, please select a character to replace them with in every script currently employing them.'
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/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()):
var replacement = $ConfirmCharacterDeletion/Center/AntagonistReplacementPicker.get_selected_metadata()
#Replace character in authored properties:
for property in storyworld.authored_properties:
property.replace_character_with_character(character_to_delete, replacement)
if (!replacement.authored_property_directory.has(property)):
replacement.add_property_to_bnumber_properties(property, storyworld.characters)
#Replace character in scripts:
#Delete character from scripts:
for encounter in storyworld.encounters:
encounter.acceptability_script.replace_character_with_character(character_to_delete, replacement) #ScriptManager
encounter.desirability_script.replace_character_with_character(character_to_delete, replacement) #ScriptManager
encounter.acceptability_script.delete_character(character_to_delete) #ScriptManager
encounter.desirability_script.delete_character(character_to_delete) #ScriptManager
for option in encounter.options:
option.visibility_script.replace_character_with_character(character_to_delete, replacement) #ScriptManager
option.performability_script.replace_character_with_character(character_to_delete, replacement) #ScriptManager
option.visibility_script.delete_character(character_to_delete) #ScriptManager
option.performability_script.delete_character(character_to_delete) #ScriptManager
for reaction in option.reactions:
reaction.desirability_script.replace_character_with_character(character_to_delete, replacement) #ScriptManager
reaction.desirability_script.delete_character(character_to_delete) #ScriptManager
for effect in reaction.after_effects:
if (effect is BNumberEffect):
effect.assignee.replace_character_with_character(character_to_delete, replacement) #BNumberPointer
effect.assignment_script.replace_character_with_character(character_to_delete, replacement) #ScriptManager
effect.assignee.delete_character(character_to_delete) #BNumberPointer
effect.assignment_script.delete_character(character_to_delete) #ScriptManager
elif (effect is SpoolEffect):
effect.assignment_script.replace_character_with_character(character_to_delete, replacement) #ScriptManager
effect.assignment_script.delete_character(character_to_delete) #ScriptManager
storyworld.delete_character(character_to_delete)
log_update(null)
refresh_character_list()
if (0 < storyworld.characters.size()):
$HBC/VBC/Scroll/CharacterList.select(0)
load_character(storyworld.characters[0])
emit_signal("character_deleted", character_to_delete, replacement)
if (!storyworld.characters.empty()):
load_character(storyworld.characters.front())
emit_signal("character_deleted")
emit_signal("refresh_authored_property_lists")

func _on_CharacterList_item_selected(index):
Expand Down
1 change: 1 addition & 0 deletions godot/interface/CharacterEditScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ __meta__ = {
}

[node name="AntagonistReplacementPicker" type="OptionButton" parent="ConfirmCharacterDeletion/Center"]
visible = false
margin_left = 132.0
margin_top = 69.0
margin_right = 161.0
Expand Down
7 changes: 5 additions & 2 deletions godot/interface/CharacterTraitEditingInterface.gd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ func refresh():
if (null == value):
set_error_message("Error: Could not find property when checking character.")
return false
else:
elif (TYPE_DICTIONARY == typeof(value)):
set_error_message("Error: Could not find bnumber when checking character.")
return false
elif (TYPE_INT == typeof(value) or TYPE_REAL == typeof(value)):
$VBC/HBC2/Slidebar.set_value(value)
$VBC/HBC2/SpinBox.set_value(value)
var property_id = keyring.front()
Expand Down Expand Up @@ -97,7 +100,7 @@ func refresh_keyring_interface(refresh_index):
selector.select(selected_index)
onion = onion[keyring[keyring_index]]

func change_keyring(keyring_index, option_index, perceived_character):
func change_keyring(keyring_index, perceived_character):
keyring[keyring_index] = perceived_character.id
var length = keyring.size()
keyring.resize(keyring_index + 1)
Expand Down
4 changes: 2 additions & 2 deletions godot/interface/DragAndDropList.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func _ready():

func list_item(item):
var branch = create_item(get_root())
branch.set_text(0, item.get_listable_text(120))
branch.set_tooltip(0, item.get_listable_text(120))
branch.set_text(0, item.get_listable_text(500))
branch.set_tooltip(0, item.get_listable_text(500))
var meta = {}
meta["index"] = item_count
meta["listed_object"] = item
Expand Down
Loading

0 comments on commit 26c6f8d

Please sign in to comment.