Skip to content

Commit

Permalink
less bugs!
Browse files Browse the repository at this point in the history
  • Loading branch information
BinAl-Sadiq committed Jun 26, 2024
1 parent 2b60ed7 commit 8a4f1d6
Show file tree
Hide file tree
Showing 29 changed files with 134 additions and 105 deletions.
4 changes: 2 additions & 2 deletions La Rayb - Launcher/.godot/editor/editor_layout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ dock_floating={}
dock_split_2=118
dock_split_3=0
dock_hsplit_1=0
dock_hsplit_2=406
dock_hsplit_3=-455
dock_hsplit_2=318
dock_hsplit_3=-351
dock_hsplit_4=0
dock_filesystem_split=0
dock_filesystem_display_mode=0
Expand Down
16 changes: 8 additions & 8 deletions La Rayb - Launcher/.godot/editor/filesystem_cache8
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
ea4bc82a6ad023ab7ee23ee620429895
::res://::1719341209
::res://::1719443966
Borders.gd::GDScript::-1::1719258654::0::1::::<>Control<>::
close.png::CompressedTexture2D::5039746674228996357::1719162221::1719162226::1::::<><>::
Decision Buttons.gd::GDScript::-1::1719327508::0::1::::DecisionButtons<>MarginContainer<>::
export_presets.cfg::TextFile::-1::1719327521::0::1::::<><>::
export_presets.cfg::TextFile::-1::1719443784::0::1::::<><>::
icon.svg::CompressedTexture2D::5104844780715234746::1719151095::1719151106::1::::<><>::
Launcher.tscn::PackedScene::8330496468944870485::1719326890::0::1::::<><>::res://WindowMovement.gd<>res://WindowHeader.gd<>uid://cd2j5kp6chvfp
Launcher.tscn::PackedScene::8330496468944870485::1719443699::0::1::::<><>::res://WindowMovement.gd<>res://WindowHeader.gd<>uid://cd2j5kp6chvfp::::res://close.png<>uid://dkggc51omeuwx::::res://maximize.png<>uid://1irvujtmn7oh::::res://minimize.png<>res://Projects List.gd<>res://Borders.gd<>res://Decision Buttons.gd<>uid://bbmyuq8md5pjx::::res://Sitka-Display.ttf<>uid://bwvbrh3bofg57::::res://project_button.tscn<>res://New Project Window.gd
maximize.png::CompressedTexture2D::7873906244046126451::1719162678::1719162823::1::::<><>::
minimize.png::CompressedTexture2D::1842495712420453035::1719162816::1719162823::1::::<><>::
New Project Window.gd::GDScript::-1::1719267789::0::1::::<>Window<>::
Projects List.gd::GDScript::-1::1719251680::0::1::::ProjectsList<>MarginContainer<>::
Projects.json::JSON::-1::1719267762::0::1::::<><>::
project_button.tscn::PackedScene::3974018663036541788::1719327508::0::1::::<><>::uid://dgc1infqvovxa::::res://warning.png
New Project Window.gd::GDScript::-1::1719415121::0::1::::<>Window<>::
Projects List.gd::GDScript::-1::1719443698::0::1::::ProjectsList<>MarginContainer<>::
Projects.json::JSON::-1::1719410135::0::1::::<><>::
project_button.tscn::PackedScene::3974018663036541788::1719443718::0::1::::<><>::uid://dgc1infqvovxa::::res://warning.png
Sitka-Display.ttf::FontFile::2482875875986922725::1719268041::1719268052::1::::<><>::
warning.png::CompressedTexture2D::7586117487861963362::1719227473::1719227478::1::::<><>::
WindowHeader.gd::GDScript::-1::1719268559::0::1::::<>PanelContainer<>::
WindowMovement.gd::GDScript::-1::1719259222::0::1::::<>Control<>::
::res://Icon/::1719326856
::res://Icon/::1719344400
exe Launcher Icon.png::CompressedTexture2D::5128967193173478331::1719326557::1719326856::1::::<><>::
exe_Icon.png::CompressedTexture2D::7587129103952493371::1719325011::1719326856::1::::<><>::
fire.png::CompressedTexture2D::3970761648854307172::1719324784::1719326856::1::::<><>::
Expand Down
3 changes: 2 additions & 1 deletion La Rayb - Launcher/.godot/editor/filesystem_update4
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
res://project_button.tscn
res://Decision Buttons.gd
res://Projects List.gd
res://Launcher.tscn
2 changes: 1 addition & 1 deletion La Rayb - Launcher/.godot/editor/project_metadata.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ editor_settings=Rect2(510, 190, 900, 700)
[recent_files]

scenes=["res://project_button.tscn", "res://Launcher.tscn"]
scripts=["res://New Project Window.gd", "Node", "OS", "FileAccess", "Array", "BaseButton", "String", "res://Projects List.gd", "res://Decision Buttons.gd", "Window"]
scripts=["MainLoop", "EditorExportPlatformAndroid", "OS", "FileAccess", "res://New Project Window.gd", "Node", "Array", "BaseButton", "String", "res://Projects List.gd"]

[script_setup]

Expand Down
28 changes: 16 additions & 12 deletions La Rayb - Launcher/.godot/editor/script_editor_cache.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ state={
"breakpoints": PackedInt32Array(),
"column": 4,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"h_scroll_position": 18,
"row": 9,
"scroll_position": 0.0,
"scroll_position": 9.0,
"selection": false,
"syntax_highlighter": "GDScript"
}
Expand All @@ -49,10 +49,10 @@ state={
state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 23,
"column": 0,
"folded_lines": Array[int]([12, 19, 22, 25, 43, 49]),
"h_scroll_position": 0,
"row": 43,
"row": 18,
"scroll_position": 0.0,
"selection": false,
"syntax_highlighter": "GDScript"
Expand All @@ -63,11 +63,11 @@ state={
state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 141,
"column": 0,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 33,
"scroll_position": 8.0,
"row": 6,
"scroll_position": 6.0,
"selection": false,
"syntax_highlighter": "GDScript"
}
Expand All @@ -77,11 +77,15 @@ state={
state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 0,
"folded_lines": Array[int]([]),
"column": 20,
"folded_lines": Array[int]([6, 146, 149]),
"h_scroll_position": 0,
"row": 9,
"scroll_position": 0.0,
"selection": false,
"row": 130,
"scroll_position": 120.0,
"selection": true,
"selection_from_column": 17,
"selection_from_line": 130,
"selection_to_column": 20,
"selection_to_line": 130,
"syntax_highlighter": "GDScript"
}
4 changes: 2 additions & 2 deletions La Rayb - Launcher/.godot/exported/133200997/file_cache
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
res://Launcher.tscn::6740039b7a4049d04c70852e6ea8c579::1719326890::res://.godot/exported/133200997/export-7bbbae38ef95ecab0bd77fc16af01144-Launcher.scn
res://project_button.tscn::26e6898c71f77ef20b1c455a18769882::1719327508::res://.godot/exported/133200997/export-2762a4a53060bc4cb437e3359d066318-project_button.scn
res://Launcher.tscn::6740039b7a4049d04c70852e6ea8c579::1719443699::res://.godot/exported/133200997/export-7bbbae38ef95ecab0bd77fc16af01144-Launcher.scn
res://project_button.tscn::26e6898c71f77ef20b1c455a18769882::1719443718::res://.godot/exported/133200997/export-2762a4a53060bc4cb437e3359d066318-project_button.scn
2 changes: 1 addition & 1 deletion La Rayb - Launcher/Projects List.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class_name ProjectsList

static var instance: ProjectsList = null

const current_version: String = "1.0.0"
const current_version: String = "1.0.1"

@export var container: VBoxContainer = null
@export var project_button: PackedScene = null
Expand Down
8 changes: 4 additions & 4 deletions La Rayb - Launcher/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../La Rayb - Launcher.exe"
export_path="C:/Users/NEMFi/Desktop/La Rayb - Launcher.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
Expand All @@ -35,12 +35,12 @@ application/modify_resources=true
application/icon="res://Icon/exe Launcher Icon.ico"
application/console_wrapper_icon="res://Icon/exe Launcher Icon.ico"
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/file_version="1.0.1.0"
application/product_version="1.0.1.0"
application/company_name=""
application/product_name="La Rayb - Launcher"
application/file_description="A Launcher"
application/copyright=""
application/copyright="Copyright (c) 2024 BinAl-Sadiq"
application/trademarks="Bin Al-Sadiq"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ popup/item_1/text = "Included"
popup/item_1/id = 1
popup/item_2/text = "Include"
popup/item_2/id = 2
popup/item_3/text = "Save"
popup/item_3/text = "Save Selected"
popup/item_3/id = 3
popup/item_4/text = "Close"
popup/item_4/id = 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func _ready():
grid.material.set_shader_parameter("UV_offset", grid_offset)

func _physics_process(delta):
if Input.is_action_just_pressed("Middle Mouse Button") and BoardsController.instance.get_rect().has_point(BoardsController.instance.get_local_mouse_position()):
if Input.is_action_just_pressed("Middle Mouse Button") and board == BoardsController.instance.selected_board and BoardsController.instance.get_rect().has_point(BoardsController.instance.get_local_mouse_position()):
dragging = true
BoardsController.instance.set_default_cursor_shape(Control.CURSOR_DRAG)
prevMousePos = get_local_mouse_position()
Expand Down Expand Up @@ -98,4 +98,6 @@ func focus_on(target: BoardComponent) -> void:
func drag() -> void:
var currentMousePoss: Vector2 = get_local_mouse_position()
position += prevMousePos - currentMousePoss
grid_offset += prevMousePos - currentMousePoss
grid.material.set_shader_parameter("UV_offset", grid_offset)
prevMousePos = currentMousePoss
16 changes: 11 additions & 5 deletions La Rayb - digital logic simulator/Scripts/DataManagement.gd
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
extends Control
class_name DataManagement

const current_version: String = "1.0.0"
const current_version: String = "1.0.1"
var project_path: String = ""
var project_file: String = ""

static var instance: DataManagement = null

Expand Down Expand Up @@ -54,7 +55,7 @@ func load_project(input_project_path: String) -> void:
if not FileAccess.file_exists(input_project_path):
Utilities.abort()

var project_file: String = input_project_path.get_file()
project_file = input_project_path.get_file()
project_path = input_project_path.left(input_project_path.length() - project_file.length())
if not (DirAccess.dir_exists_absolute(project_path + "Boards") and FileAccess.file_exists(project_path + "ICs/and.IC") and FileAccess.file_exists(project_path + "ICs/or.IC") and FileAccess.file_exists(project_path + "ICs/not.IC")):
Utilities.abort_for_corruption()
Expand Down Expand Up @@ -283,7 +284,11 @@ func open_board(board_name: String) -> Board:
var component: BoardComponent = new_components[component_key]

component.global_position = Vector2(Utilities.ACE(component_values,"position",[TYPE_ARRAY])[0], Utilities.ACE(component_values,"position",[TYPE_ARRAY])[1])
component.set_component_name(Utilities.ACE(component_values,"name",[TYPE_STRING]))
if component is IO_Component:
component.name = Utilities.ACE(component_values,"name",[TYPE_STRING])
component.interface.label.text = Utilities.ACE(component_values,"name",[TYPE_STRING])
else:
component.set_component_name(Utilities.ACE(component_values,"name",[TYPE_STRING]))

if type == "IC":
#give the inputs/outputs temporary names to prevent names conflict while renaming
Expand All @@ -300,8 +305,9 @@ func open_board(board_name: String) -> Board:
index = 0
for out in Utilities.ACE(attributes,"outputs",[TYPE_ARRAY]):
component.set_output_name(index, Utilities.ACE(out,"name",[TYPE_STRING]))
var out_color = Utilities.ACE(out,"output color",[TYPE_ARRAY])
component.outputs[index].output_color = Color(out_color[0], out_color[1], out_color[2])
if Utilities.ACE(out,"type",[TYPE_STRING]) == "pin":
var out_color = Utilities.ACE(out,"output color",[TYPE_ARRAY])
component.outputs[index].output_color = Color(out_color[0], out_color[1], out_color[2])
index += 1
elif type == "Distributor":
for inp in Utilities.ACE(attributes,"inputs",[TYPE_ARRAY]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func set_input_name(index: int, new_name: String):
Utilities.instance.trigger_error_msbox("This name is already used by another input!")
return

if new_name == "*" or new_name == "|" or new_name == "!" or new_name == "^" or (inputs[index].name.contains("$") and (new_name.left(0) != "$" or new_name.right(0) != "$" or new_name.count("$") > 2)) or (not inputs[index].name.contains("$") and new_name.contains("$")):
if new_name == "*" or new_name == "|" or new_name == "!" or new_name == "^" or (inputs[index].name.contains("$") and (new_name.left(1) != "$" or new_name.right(1) != "$" or new_name.count("$") > 2)) or (not inputs[index] is Port and new_name.contains("$")):
Utilities.instance.trigger_error_msbox("Invalid name!")
return

Expand All @@ -260,8 +260,8 @@ func set_input_name(index: int, new_name: String):
inputs[index].name = new_name

func set_output_name(index: int, new_name: String):
if outputs[index].name.contains("$"):
if new_name.left(0) != "$" or new_name.right(0) != "$" or new_name.count("$") > 2:
if outputs[index] is Port:
if new_name.left(1) != "$" or new_name.right(1) != "$" or new_name.count("$") > 2:
Utilities.instance.trigger_error_msbox("Invalid name!")
return
functions_names[index].A = new_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func set_component_name(new_name: String) -> void:
for c in BoardsController.instance.selected_board.IO_Components:
if self is LED and c is Switch or self is Switch and c is LED:
if c.name == new_name or (new_name.contains("$") and c.name.contains(new_name)):
Utilities.instance.trigger_error_msbox("Inputs and Outputs components cannot have the same name!")
Utilities.instance.trigger_error_msbox("Inputs and Outputs components cannot have the same names!")
return

if new_name.contains("$"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func handle_picked_interactables():
selected_board.handle_picked_interactables()

func clone_components(src: Board = selected_board) -> void:
selected_board.camera.position = src.camera.position
selected_board.camera.zoom = src.camera.zoom

var to_clone: Array[BoardComponent] = []
var cables_to_clone: Array[Cable] = []
var to_visit: Array[BoardComponent] = src.selected_board_components.duplicate()
Expand Down Expand Up @@ -110,7 +113,10 @@ func clone_components(src: Board = selected_board) -> void:
while to_clone.size():
var original = to_clone.pop_back() as BoardComponent
var new_clone = original.clone.call() as BoardComponent
new_clone.set_component_name(original.label.text if original is IC else original.name)
if new_clone is IO_Component and original.name.contains("$"):
new_clone.set_component_name(original.name.substr(0, original.name.find("$", 1) + 1))
else:
new_clone.set_component_name(original.label.text if original is IC else original.name)
clones[original] = new_clone
#attach cables
while cables_to_clone.size():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,5 @@ func cancel_changing_board_component_name():

func submit_board_component_name(text: String):
BoardsController.instance.selected_board.selected_board_components[0].set_component_name(board_component_name_LineEdit.text)
BoardsController.instance.grab_focus()
cancel_changing_board_component_name()
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ func display_component_properties() -> void:
Outputs_Names_VBoxContainer.visible = true
Component_Color_VBoxContainer.visible = true
Component_ColorPickerButton.color = displayed_component.sprite.modulate
Output_Color_VBoxContainer.visible = true
output_OptionButton.visible = true

for joint in displayed_component.outputs:
if joint is Pin:
output_OptionButton.add_item(joint.name)
output_OptionButton.select(0)
_on_output_option_button_item_selected(0)
if output_OptionButton.item_count:
Output_Color_VBoxContainer.visible = true
output_OptionButton.visible = true
output_OptionButton.select(0)
_on_output_option_button_item_selected(0)

Inputs_Names_VBoxContainer.get_child(1).text_submitted.connect(func(new_text: String): displayed_component.set_input_name(0, new_text))
Inputs_Names_VBoxContainer.get_child(1).text = displayed_component.inputs[0].name
Expand Down
15 changes: 10 additions & 5 deletions La Rayb - digital logic simulator/Scripts/UI/message_box.gd
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
extends PanelContainer
class_name MessageBox

const threshold: float = 0.75
const life_threshold: float = 0.75
var life_timer: float = 0.0
var intro_timer: float = 0.0
@onready var message_label: Label = $"MarginContainer/HBoxContainer/Message Label"
@onready var title_label: Label = $"MarginContainer/HBoxContainer/Title Label"

func trigger(title_value: String, title_color: Color, message: String):
modulate.a = 1.0
modulate.a = 0.0
life_timer = 5.0
intro_timer = 0.125
title_label.modulate = title_color
title_label.text = title_value
message_label.text = message
Expand All @@ -20,9 +22,12 @@ func trigger(title_value: String, title_color: Color, message: String):
visible = true

func _process(delta):
if life_timer > 0:
if intro_timer > 0:
intro_timer -= delta
modulate.a = 1 - (intro_timer / 0.125)
elif life_timer > 0:
life_timer -= delta
if life_timer < threshold:
modulate.a = life_timer / threshold
if life_timer < life_threshold:
modulate.a = life_timer / life_threshold
elif visible:
visible = false
Loading

0 comments on commit 8a4f1d6

Please sign in to comment.