Skip to content

Commit

Permalink
Version 0.1.2
Browse files Browse the repository at this point in the history
Updated version number to 0.1.2 in GUI.gd and export settings.

Optimizations:

Reworked encounter selection functions in encounter_engine.html and in rehearsal class within editor in order to speed up performance.

Feature changes:

Edited clarity theme to remove some black outlines from various interface elements, and made other minor theme changes to both themes.

Removed circles from add, delete, up arrow, and down arrow icons. Added check mark, bullseye, eye, hand, and sort icons. Edited clarity and lapis lazuli themes and various scripts to implement icon changes. Reorganized files a bit, creating a new, dedicated folder for icons.

Changed encounter sorting system and interface. A toggle button has been added to replace the menu options for sorting in reverse order, and the button switches between alphabetical and numerical symbols based on which sorting algorithm is selected. Algorithms have also been added to allow sorting by spools or characters connected to an encounter. Set up sort reverse toggle buttons to use alphabetical symbol when sorting by characters or spools. Allowed pressing column titles on overview screen to sort. Also moved encounter script buttons on encounter edit screen.

Edited documentation to credit Bootstrap Icons and Skoll at game-icons.net for various images used with SweepWeave.

Edited scripting interface to place script title in window title instead of in a label right below the window title. This saves a small amount of screen space.

Changed datatostring function in BNumberPointer to no longer display the initial value of the variable.

Removed a redundant signal connection instruction in GUI.gd.

Changed new_storyworld function in GUI.gd so that the encounter tab's _on_AddButton_pressed() function is no longer called and the encounter tab can now be refreshed once, rather than twice, when creating a new storyworld.

Removed several unnecessary print statements that had been used for debugging.

Added a new scene for a simplified scripting interface to replace the version that was built into the encounter tab. Relatedly, the encounter tab now features quick scripting interfaces for both encounter and reaction desirability scripts. Both can be shown or hidden via the view menu; the interface for encounter desirability is hidden by default.

Added script edit options to option, reaction, and effect context menus.

Bugfixes:

Saving a project under a new filename will now change the current save path on the Settings tab.

Fixed bug on script edit screen wherein typing a new value into a spinbox, then selecting a different script element, could change the newly selected element rather than the element that was being edited.
  • Loading branch information
FrobozzWaxwing committed Jul 15, 2023
1 parent 4f09bfb commit cce4cd3
Show file tree
Hide file tree
Showing 140 changed files with 3,614 additions and 964 deletions.
8 changes: 4 additions & 4 deletions godot/AuthoredPropertyCreationScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ func on_character_properties_changed(property, character):

#GUI Themes:

onready var add_icon_light = preload("res://custom_resources/add_icon.svg")
onready var add_icon_dark = preload("res://custom_resources/add_icon_dark.svg")
onready var delete_icon_light = preload("res://custom_resources/delete_icon.svg")
onready var delete_icon_dark = preload("res://custom_resources/delete_icon_dark.svg")
onready var add_icon_light = preload("res://icons/add.svg")
onready var add_icon_dark = preload("res://icons/add_dark.svg")
onready var delete_icon_light = preload("res://icons/delete.svg")
onready var delete_icon_dark = preload("res://icons/delete_dark.svg")

func set_gui_theme(theme_name, background_color):
$ColorRect.color = background_color
Expand Down
4 changes: 2 additions & 2 deletions godot/AuthoredPropertyCreationScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[ext_resource path="res://AuthoredPropertyCreationScreen.gd" type="Script" id=1]
[ext_resource path="res://SingleBNumberBlueprintEditPanel.tscn" type="PackedScene" id=2]
[ext_resource path="res://custom_resources/add_icon.svg" type="Texture" id=3]
[ext_resource path="res://custom_resources/delete_icon.svg" type="Texture" id=4]
[ext_resource path="res://icons/add.svg" type="Texture" id=3]
[ext_resource path="res://icons/delete.svg" type="Texture" id=4]

[node name="Control" type="Control"]
anchor_right = 1.0
Expand Down
62 changes: 23 additions & 39 deletions godot/BNumberConstantEditingInterface.gd
Original file line number Diff line number Diff line change
@@ -1,54 +1,38 @@
extends Control

var storyworld = null
var operator = null
var reference_operator = null
var value = 0

onready var ControlDial = $Background/VBC/GridContainer/SpinBox
onready var ControlSlider = $Background/VBC/GridContainer/Slidebar
onready var ControlDial = $VBC/GridContainer/SpinBox
onready var ControlSlider = $VBC/GridContainer/Slidebar

signal bnumber_value_changed(operator)
signal bnumber_value_changed(reference_operator, value)

func _ready():
pass # Replace with function body.
$VBC/GridContainer/SpinBox.share($VBC/GridContainer/Slidebar)

func set_layout(label, number_of_columns):
if ("" == label):
$Background/VBC/Label.visible = false
$VBC/Label.visible = false
else:
$Background/VBC/Label.visible = true
$Background/VBC/Label.text = label
$Background/VBC/GridContainer.columns = number_of_columns

func reset():
if (null != storyworld and storyworld is Storyworld):
if (null == operator):
operator = BNumberConstant.new(0)
#Since this is a temporary pointer used by the interface, we need not set the "parent_operator" property.
operator.set_value(0)
$VBC/Label.visible = true
$VBC/Label.text = label
$VBC/GridContainer.columns = number_of_columns

func refresh():
if (null == operator or null == storyworld):
$Background/VBC/GridContainer/Slidebar.value = 0
$Background/VBC/GridContainer/SpinBox.value = 0
return false
else:
var value = operator.get_value()
$Background/VBC/GridContainer/Slidebar.value = value
$Background/VBC/GridContainer/SpinBox.value = value
return true

func _on_Slidebar_value_changed(value):
operator.set_value(value) # This automatically clamps the value to be within bounds.
ControlDial.value = (operator.get_value())
emit_signal("bnumber_value_changed", operator)
$VBC/GridContainer/Slidebar.set_value(value)

func _on_SpinBox_value_changed(value):
operator.set_value(value) # This automatically clamps the value to be within bounds.
ControlSlider.value = (operator.get_value())
emit_signal("bnumber_value_changed", operator)
func set_value(new_value):
value = new_value
refresh()

#GUI Themes:

func set_gui_theme(theme_name, background_color):
$Background.color = background_color
func set_reference_operator(new_reference_operator):
if (new_reference_operator is BNumberConstant):
reference_operator = new_reference_operator
set_value(reference_operator.get_value())
else:
reference_operator = null

func _on_Slidebar_value_changed(new_value):
set_value(new_value)
emit_signal("bnumber_value_changed", reference_operator, new_value)
21 changes: 8 additions & 13 deletions godot/BNumberConstantEditingInterface.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,28 @@ size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 1 )

[node name="Background" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0, 0.0627451, 0.12549, 1 )

[node name="VBC" type="VBoxContainer" parent="Background"]
[node name="VBC" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 3.0
margin_right = -3.0
margin_bottom = 12.0
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="Label" type="Label" parent="Background/VBC"]
[node name="Label" type="Label" parent="VBC"]
visible = false
margin_right = 1360.0
margin_bottom = 14.0
text = "Bounded number constant:"

[node name="GridContainer" type="GridContainer" parent="Background/VBC"]
margin_top = 18.0
[node name="GridContainer" type="GridContainer" parent="VBC"]
margin_right = 1360.0
margin_bottom = 62.0
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="Slidebar" type="HSlider" parent="Background/VBC/GridContainer"]
[node name="Slidebar" type="HSlider" parent="VBC/GridContainer"]
margin_right = 1360.0
margin_bottom = 16.0
size_flags_horizontal = 3
Expand All @@ -44,7 +40,7 @@ step = 0.01
tick_count = 3
ticks_on_borders = true

[node name="SpinBox" type="SpinBox" parent="Background/VBC/GridContainer"]
[node name="SpinBox" type="SpinBox" parent="VBC/GridContainer"]
margin_left = 643.0
margin_top = 20.0
margin_right = 717.0
Expand All @@ -55,5 +51,4 @@ min_value = -0.99
max_value = 0.99
step = 0.01

[connection signal="value_changed" from="Background/VBC/GridContainer/Slidebar" to="." method="_on_Slidebar_value_changed"]
[connection signal="value_changed" from="Background/VBC/GridContainer/SpinBox" to="." method="_on_SpinBox_value_changed"]
[connection signal="value_changed" from="VBC/GridContainer/Slidebar" to="." method="_on_Slidebar_value_changed"]
10 changes: 5 additions & 5 deletions godot/BNumberEffect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func _init(in_assignee = null, in_assignment_script = null):
assignment_script = in_assignment_script

func enact(leaf = null):
if (null != assignee and assignee is BNumberPointer and assignment_script is ScriptManager):
if (assignee is BNumberPointer and assignment_script is ScriptManager):
var result = assignment_script.get_value(leaf, false)
if (null != result):
assignee.set_value(result)
Expand Down Expand Up @@ -88,14 +88,14 @@ func load_from_json_v0_0_21_through_v0_0_29(storyworld, data_to_load):
if (data_to_load["to"].has("script_element_type")):
var script = ScriptManager.new()
var output_datatype = sw_script_data_types.VARIANT
if (null != assignee and assignee is SWPointer):
if (assignee is SWPointer):
if (assignee.output_type == sw_script_data_types.BNUMBER):
output_datatype = sw_script_data_types.BNUMBER
elif (assignee.output_type == sw_script_data_types.BOOLEAN):
output_datatype = sw_script_data_types.BOOLEAN
script.load_from_json_v0_0_21_through_v0_0_29(storyworld, data_to_load["to"], output_datatype)
assignment_script = script
if (null != assignee and assignee is BNumberPointer and null != assignment_script and assignment_script is ScriptManager):
if (assignee is BNumberPointer and assignment_script is ScriptManager):
return true
else:
return false
Expand All @@ -112,14 +112,14 @@ func load_from_json_v0_0_34_through_v0_1_0(storyworld, data_to_load):
if (data_to_load["to"].has("script_element_type")):
var script = ScriptManager.new()
var output_datatype = sw_script_data_types.VARIANT
if (null != assignee and assignee is SWPointer):
if (assignee is SWPointer):
if (assignee.output_type == sw_script_data_types.BNUMBER):
output_datatype = sw_script_data_types.BNUMBER
elif (assignee.output_type == sw_script_data_types.BOOLEAN):
output_datatype = sw_script_data_types.BOOLEAN
script.load_from_json_v0_0_34_through_v0_1_0(storyworld, data_to_load["to"], output_datatype)
assignment_script = script
if (null != assignee and assignee is BNumberPointer and null != assignment_script and assignment_script is ScriptManager):
if (assignee is BNumberPointer and assignment_script is ScriptManager):
return true
else:
return false
Expand Down
2 changes: 1 addition & 1 deletion godot/BNumberPropertySelector.gd
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func change_keyring(keyring_index, option_index, option_metadata):

func reset():
#This function resets the selected property to default, or creates a new property if necessary.
if (null != storyworld and storyworld is Storyworld):
if (storyworld is Storyworld):
if (0 < storyworld.characters.size() and 0 < storyworld.authored_property_directory.size()):
if (null != selected_property and is_instance_valid(selected_property)):
var temporary = storyworld.create_default_bnumber_pointer()
Expand Down
8 changes: 4 additions & 4 deletions godot/CharacterEditScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ func _on_CharacterList_item_selected(index):

#GUI Themes:

onready var add_icon_light = preload("res://custom_resources/add_icon.svg")
onready var add_icon_dark = preload("res://custom_resources/add_icon_dark.svg")
onready var delete_icon_light = preload("res://custom_resources/delete_icon.svg")
onready var delete_icon_dark = preload("res://custom_resources/delete_icon_dark.svg")
onready var add_icon_light = preload("res://icons/add.svg")
onready var add_icon_dark = preload("res://icons/add_dark.svg")
onready var delete_icon_light = preload("res://icons/delete.svg")
onready var delete_icon_dark = preload("res://icons/delete_dark.svg")

func set_gui_theme(theme_name, background_color):
color = background_color
Expand Down
4 changes: 2 additions & 2 deletions godot/CharacterEditScreen.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://CharacterEditScreen.gd" type="Script" id=1]
[ext_resource path="res://custom_resources/delete_icon.svg" type="Texture" id=2]
[ext_resource path="res://custom_resources/add_icon.svg" type="Texture" id=3]
[ext_resource path="res://icons/delete.svg" type="Texture" id=2]
[ext_resource path="res://icons/add.svg" type="Texture" id=3]

[node name="CharacterEditScreen" type="ColorRect"]
anchor_right = 1.0
Expand Down
8 changes: 4 additions & 4 deletions godot/DocumentationScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ func _on_PageText_meta_clicked(meta):

#GUI Themes:

onready var previous_icon_light = preload("res://custom_resources/arrow-left.svg")
onready var previous_icon_dark = preload("res://custom_resources/arrow-left_dark.svg")
onready var next_icon_light = preload("res://custom_resources/arrow-right.svg")
onready var next_icon_dark = preload("res://custom_resources/arrow-right_dark.svg")
onready var previous_icon_light = preload("res://icons/arrow-left.svg")
onready var previous_icon_dark = preload("res://icons/arrow-left_dark.svg")
onready var next_icon_light = preload("res://icons/arrow-right.svg")
onready var next_icon_dark = preload("res://icons/arrow-right_dark.svg")

func set_gui_theme(theme_name, background_color):
match theme_name:
Expand Down
4 changes: 2 additions & 2 deletions godot/DocumentationScreen.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=5 format=2]

[ext_resource path="res://DocumentationScreen.gd" type="Script" id=6]
[ext_resource path="res://custom_resources/arrow-left.svg" type="Texture" id=7]
[ext_resource path="res://custom_resources/arrow-right.svg" type="Texture" id=8]
[ext_resource path="res://icons/arrow-left.svg" type="Texture" id=7]
[ext_resource path="res://icons/arrow-right.svg" type="Texture" id=8]
[ext_resource path="res://DocPageDisplay.tscn" type="PackedScene" id=9]

[node name="Control" type="Control"]
Expand Down
31 changes: 29 additions & 2 deletions godot/DragAndDropList.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ signal copy(items)
signal paste_at(index)
signal delete(items)
signal duplicate(items)
signal edit_visibility_script(option)
signal edit_performability_script(option)
signal edit_desirability_script(reaction)
signal edit_effect_script(effect)

func _ready():
refresh()
Expand Down Expand Up @@ -78,15 +82,15 @@ func drop_data(position, item): # end drag
func get_first_selected_metadata():
#Returns the element stored as metadata in the first currently selected list item.
var selected_item = get_next_selected(null)
if (null != selected_item and selected_item is TreeItem):
if (selected_item is TreeItem):
return selected_item.get_metadata(0)["listed_object"]
else:
return null

func get_first_selected_index():
#Returns the index of the first currently selected list item.
var selected_item = get_next_selected(null)
if (null != selected_item and selected_item is TreeItem):
if (selected_item is TreeItem):
return selected_item.get_metadata(0)["index"]
else:
return null
Expand Down Expand Up @@ -194,6 +198,13 @@ func _on_item_rmb_selected(position):
context_menu.add_item("Duplicate", 9)
context_menu.add_item("Select all", 10)
context_menu.add_item("Deselect all", 11)
if ("option" == item_type):
context_menu.add_item("Edit visibility script", 12)
context_menu.add_item("Edit performability script", 13)
if ("reaction" == item_type):
context_menu.add_item("Edit desirability script", 14)
if ("effect" == item_type):
context_menu.add_item("Edit effect script", 15)
context_menu.popup(Rect2(mouse_position.x, mouse_position.y, context_menu.rect_size.x, context_menu.rect_size.y))

func show_outer_context_menu():
Expand Down Expand Up @@ -276,3 +287,19 @@ func _on_ContextMenu_id_pressed(id):
#Deselect all
deselect_all()
print ("Deselecting all " + item_type + "s.")
12:
#Edit visibility script
emit_signal("edit_visibility_script", focused_item)
print ("Editing visibility script.")
13:
#Edit performability script
emit_signal("edit_performability_script", focused_item)
print ("Editing performability script.")
14:
#Edit desirability script
emit_signal("edit_desirability_script", focused_item)
print ("Editing desirability script.")
15:
#Edit effect script
emit_signal("edit_effect_script", focused_item)
print ("Editing effect script.")
2 changes: 0 additions & 2 deletions godot/EffectEditorScreen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func reset():
$TabContainer/BNumberProperty/VBC/PropertySelector.reset()
$TabContainer/BNumberProperty/VBC/PropertySelector.refresh()
var new_script = ScriptManager.new(BNumberConstant.new(0))
$TabContainer/BNumberProperty/VBC/ScriptEditingInterface/Background/VBC/Label.text = ""
$TabContainer/BNumberProperty/VBC/ScriptEditingInterface.storyworld = storyworld
if (null != $TabContainer/BNumberProperty/VBC/ScriptEditingInterface.script_to_edit and is_instance_valid($TabContainer/BNumberProperty/VBC/ScriptEditingInterface.script_to_edit) and $TabContainer/BNumberProperty/VBC/ScriptEditingInterface.script_to_edit is ScriptManager):
$TabContainer/BNumberProperty/VBC/ScriptEditingInterface.script_to_edit.call_deferred("free")
Expand All @@ -83,7 +82,6 @@ func reset():
$TabContainer/SpoolStatus/VBC/SpoolSelector.reset("SpoolPointer")
$TabContainer/SpoolStatus/VBC/SpoolSelector.refresh()
new_script = ScriptManager.new(BooleanConstant.new(true))
$TabContainer/SpoolStatus/VBC/ScriptEditingInterface/Background/VBC/Label.text = ""
$TabContainer/SpoolStatus/VBC/ScriptEditingInterface.storyworld = storyworld
if (null != $TabContainer/SpoolStatus/VBC/ScriptEditingInterface.script_to_edit and is_instance_valid($TabContainer/SpoolStatus/VBC/ScriptEditingInterface.script_to_edit) and $TabContainer/SpoolStatus/VBC/ScriptEditingInterface.script_to_edit is ScriptManager):
$TabContainer/SpoolStatus/VBC/ScriptEditingInterface.script_to_edit.call_deferred("free")
Expand Down
Loading

0 comments on commit cce4cd3

Please sign in to comment.