diff --git a/Scenes/GUI/Controls/CosmeticAdjustment.tscn b/Scenes/GUI/Controls/CosmeticAdjustment.tscn index 484f05f..ab73692 100644 --- a/Scenes/GUI/Controls/CosmeticAdjustment.tscn +++ b/Scenes/GUI/Controls/CosmeticAdjustment.tscn @@ -4,13 +4,15 @@ [node name="FlowControl" type="Control"] layout_mode = 3 +anchors_preset = 10 anchor_right = 1.0 offset_bottom = 40.0 +grow_horizontal = 2 script = ExtResource("1_fg0vw") [node name="Panel" type="Panel" parent="."] layout_mode = 1 -anchors_preset = -1 +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 diff --git a/Scenes/GUI/Controls/FlowControl.tscn b/Scenes/GUI/Controls/FlowControl.tscn index 9d2acc3..fce0b65 100644 --- a/Scenes/GUI/Controls/FlowControl.tscn +++ b/Scenes/GUI/Controls/FlowControl.tscn @@ -4,44 +4,56 @@ [node name="FlowControl" type="Control"] layout_mode = 3 -anchors_preset = 0 -offset_right = 512.0 +anchors_preset = 10 +anchor_right = 1.0 offset_bottom = 40.0 +grow_horizontal = 2 script = ExtResource("1_6sy3t") [node name="Panel" type="Panel" parent="."] -layout_mode = 0 -offset_right = 512.0 -offset_bottom = 40.0 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 [node name="Label" type="Label" parent="Panel"] -layout_mode = 0 +layout_mode = 1 +anchors_preset = -1 +anchor_right = 0.5 +anchor_bottom = 1.0 offset_left = 4.0 offset_top = 4.0 -offset_right = 244.0 -offset_bottom = 36.0 +offset_bottom = -4.0 text = "Movement" vertical_alignment = 1 clip_text = true text_overrun_behavior = 3 [node name="InStepper" type="SpinBox" parent="Panel"] -layout_mode = 0 -offset_left = 248.0 +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.5 +anchor_right = 0.75 +anchor_bottom = 1.0 offset_top = 4.0 -offset_right = 376.0 -offset_bottom = 36.0 +offset_right = -4.0 +offset_bottom = -4.0 max_value = 10000.0 step = 0.1 value = 1.0 prefix = "In:" [node name="OutStepper" type="SpinBox" parent="Panel"] -layout_mode = 0 -offset_left = 380.0 +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.75 +anchor_right = 1.0 +anchor_bottom = 1.0 offset_top = 4.0 -offset_right = 508.0 -offset_bottom = 36.0 +offset_right = -4.0 +offset_bottom = -4.0 max_value = 10000.0 step = 0.1 value = 1.0 diff --git a/Scenes/GUI/EditorScreen.tscn b/Scenes/GUI/EditorScreen.tscn index 46a53e3..50c37c4 100644 --- a/Scenes/GUI/EditorScreen.tscn +++ b/Scenes/GUI/EditorScreen.tscn @@ -594,7 +594,10 @@ offset_right = 516.0 offset_bottom = 388.0 [node name="FlowHandle" type="Control" parent="FlyoutPanel/FlowControls/InvisibleMask"] -anchors_preset = 0 +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +grow_horizontal = 2 [node name="VScrollBar" type="VScrollBar" parent="FlyoutPanel/FlowControls"] layout_mode = 0 diff --git a/Scenes/GUI/InGameMenu.tscn b/Scenes/GUI/InGameMenu.tscn index 2794b0d..62d1167 100644 --- a/Scenes/GUI/InGameMenu.tscn +++ b/Scenes/GUI/InGameMenu.tscn @@ -121,7 +121,6 @@ horizontal_alignment = 2 vertical_alignment = 1 [node name="FlowControlsScreen" type="Control" parent="."] -visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -182,7 +181,10 @@ grow_horizontal = 2 grow_vertical = 2 [node name="FlowHandle" type="Control" parent="FlowControlsScreen/DialogPanel/InvisibleMask"] -anchors_preset = 0 +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +grow_horizontal = 2 [node name="VScrollBar" type="VScrollBar" parent="FlowControlsScreen/DialogPanel"] layout_mode = 1 @@ -198,6 +200,7 @@ max_value = 0.0 step = 1.0 [node name="CosmeticsScreen" type="Control" parent="."] +visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -283,4 +286,6 @@ step = 1.0 [connection signal="pressed" from="Buttons/ExitMenuButton" to="." method="_on_exit_menu_button_pressed"] [connection signal="pressed" from="Buttons/ExitButton" to="." method="_on_exit_button_pressed"] [connection signal="pressed" from="FlowControlsScreen/InputEater" to="." method="_on_input_eater_pressed"] +[connection signal="value_changed" from="FlowControlsScreen/DialogPanel/VScrollBar" to="." method="_on_flow_v_scroll_bar_value_changed"] [connection signal="pressed" from="CosmeticsScreen/InputEater" to="." method="_on_input_eater_pressed"] +[connection signal="value_changed" from="CosmeticsScreen/DialogPanel/VScrollBar" to="." method="_on_cosmetics_v_scroll_bar_value_changed"] diff --git a/Scripts/EditorScreen.gd b/Scripts/EditorScreen.gd index 6ecde33..5de1b96 100644 --- a/Scripts/EditorScreen.gd +++ b/Scripts/EditorScreen.gd @@ -83,6 +83,7 @@ func reload_stage() -> void: flow_control.vis_name = bot + " " + movement flow_control.in_value = in_flow flow_control.out_value = out_flow + flow_control.anchor_right = 1.0 $FlyoutPanel/FlowControls/InvisibleMask/FlowHandle.add_child(flow_control) flows_offset += 44 flow_count += 1 diff --git a/Scripts/InGameMenu.gd b/Scripts/InGameMenu.gd index 7ad5358..0fceb00 100644 --- a/Scripts/InGameMenu.gd +++ b/Scripts/InGameMenu.gd @@ -1,52 +1,85 @@ extends Control +var in_flows = [] +var out_flows = [] + +var loaded_show = [] + func _ready() -> void: + var stage = FreeRoamMaps.MapIndex[get_node("../").current_map]["stage"] + var cosmetics_offset = 0 var cosmetics_count = 0 - for cosmetic_subtable in FreeRoamMaps.MapIndex[get_node("../").current_map]["stage"]["cosmetics"]: + for cosmetic_subtable in stage["cosmetics"]: for cosmetic in cosmetic_subtable: var cosmetic_adjustment = load("res://Scenes/GUI/Controls/CosmeticAdjustment.tscn").instantiate() cosmetic_adjustment.vis_name = cosmetic cosmetic_adjustment.options = cosmetic_subtable[cosmetic] cosmetic_adjustment.scene_handle = "../../../../../../../" - cosmetic_adjustment.drop_index = FreeRoamMaps.MapIndex[get_node("../").current_map]["stage"]["cosmetic_defaults"][cosmetics_count] + cosmetic_adjustment.drop_index = stage["cosmetic_defaults"][cosmetics_count] cosmetic_adjustment.position.y = cosmetics_offset cosmetic_adjustment.anchor_right = 1.0 cosmetics_offset += 44 cosmetics_count += 1 $CosmeticsScreen/DialogPanel/InvisibleMask/CosmeticsHandle.add_child(cosmetic_adjustment) $CosmeticsScreen/DialogPanel/VScrollBar.max_value = cosmetics_count - 1 + + var rows_offset = 0 + var flows_offset = 0 + var flow_count = 0 + for bit_number in stage["bit_mapping"]: + var bot = stage["bit_mapping"][bit_number]["bot"] + var movement = stage["bit_mapping"][bit_number]["movement"] + + var in_flow = stage["bit_mapping"][bit_number]["flow_in"] + var out_flow = stage["bit_mapping"][bit_number]["flow_out"] + + in_flows.push_back(in_flow) + out_flows.push_back(out_flow) + + if (in_flow is not String): + var flow_control = load("res://Scenes/GUI/Controls/FlowControl.tscn").instantiate() + flow_control.position.y = flows_offset + flow_control.name = str(bit_number) + bot + movement + get_node("../").current_map + flow_control.vis_name = bot + " " + movement + flow_control.in_value = in_flow + flow_control.out_value = out_flow + flow_control.anchor_right = 1.0 + $FlowControlsScreen/DialogPanel/InvisibleMask/FlowHandle.add_child(flow_control) + flows_offset += 44 + flow_count += 1 + + $FlowControlsScreen/DialogPanel/VScrollBar.max_value = flow_count - 1 func _on_exit_button_pressed() -> void: get_tree().quit() - func _on_exit_menu_button_pressed() -> void: get_tree().change_scene_to_file("res://Scenes/GUI/MainMenu.tscn") - func _on_flow_controls_button_pressed() -> void: $BG.visible = false $FlowControlsScreen.visible = true - func _on_cosmetics_button_pressed() -> void: $BG.visible = false $CosmeticsScreen.visible = true - func _on_load_show_button_pressed() -> void: $BG.visible = false - func _on_return_button_pressed() -> void: get_node("../").interact = true get_node("../").capture_mouse() visible = false - func _on_input_eater_pressed() -> void: $BG.visible = true $CosmeticsScreen.visible = false $FlowControlsScreen.visible = false - + +func _on_cosmetics_v_scroll_bar_value_changed(value: float) -> void: + $CosmeticsScreen/DialogPanel/InvisibleMask/CosmeticsHandle.position.y = value * -44 + +func _on_flow_v_scroll_bar_value_changed(value: float) -> void: + $FlowControlsScreen/DialogPanel/InvisibleMask/FlowHandle.position.y = value * -44