diff --git a/README.md b/README.md index 1f91a8e..f83b89c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # NovetusFE - A frontend application for Novetus, by https://bitl.itch.io + A frontend application made for Novetus, by https://bitl.itch.io # Features / planned - Multiplayer Server List diff --git a/scenes/main.gd b/scenes/main.gd index 4f0e8cd..f75c5c1 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -123,14 +123,13 @@ func settings_item_activated(index): "General Settings": $"Main/Settings/General Settings".visible = true "Launch Novetus": - $Overlay.visible = true - yield(get_tree().create_timer(1),"timeout") launch("/bin/Novetus.exe") - $Overlay.visible = false #$Main/Settings/ItemList.grab_focus() func launch(program,arg=""): + $OverlayLayer/Overlay.visible = true + yield(get_tree().create_timer(1),"timeout") match OS.get_name(): "Windows": if arg == "": @@ -149,6 +148,7 @@ func launch(program,arg=""): OS.execute("sh",[WorkingDirectory + "/Start.sh", LinuxWinePrefix, LinuxWinePath, WorkingDirectory + program]) else: OS.execute("sh",[WorkingDirectory + "/Start.sh", LinuxWinePrefix, LinuxWinePath, WorkingDirectory + program, arg]) + $OverlayLayer/Overlay.visible = false func menu(menu, parent=$Main): for i in $Main.get_children(): if i is Control: @@ -234,15 +234,9 @@ func studio_item_activated(index): "Launch without map": launch("/clients/"+ Version + "/RobloxApp_studio.exe") "Launch with map": - $Overlay.visible = true - yield(get_tree().create_timer(1),"timeout") launch("/clients/"+ Version + "/RobloxApp_studio.exe", Drive + Map) - $Overlay.visible = false "Play Solo": - $Overlay.visible = true - yield(get_tree().create_timer(1),"timeout") launch("/clients/"+ Version + "/RobloxApp_solo.exe", Drive + Map) - $Overlay.visible = false func _input(event): if Input.is_action_just_pressed("versions"): @@ -257,12 +251,6 @@ func _input(event): func _on_Maps_confirmed(): print($Main/Maps.current_file) Map = str($Main/Maps.current_dir.replace(WorkingDirectory,"") + "/" + $Main/Maps.current_file) - #Map = "../.." + Map - #var counter = 0 - #for i in Map: - # if i == "/": - # Map[counter] = "//" - # counter += 1 Map = Map.replacen("/","//") Map = WorkingDirectory.replacen("/","//") + Map $Background/Info.text = "Hello, %PLAYER%! Client Selected: %CLIENT%, Map Selected: %MAP%" @@ -319,6 +307,9 @@ func imageadd(path): $Main/AddServerWindow/ScrollContainer/HBoxContainer.add_child(t) NewServerTexture = t.texture_normal t.connect("pressed",self,"icon_pressed",[t.texture_normal,t,path]) + var e = t.duplicate() + $Main/EditServerWindow/ScrollContainer/HBoxContainer.add_child(e) + e.connect("pressed",self,"icon_pressed",[e.texture_normal,e,path]) func pathtoimage(path,resize=null): var img = Image.new() @@ -336,15 +327,17 @@ func icon_pressed(icon,node,path): for i in $Main/AddServerWindow/ScrollContainer/HBoxContainer.get_children(): if i is TextureButton: i.modulate = Color("707070") + for i in $Main/EditServerWindow/ScrollContainer/HBoxContainer.get_children(): + if i is TextureButton: + i.modulate = Color("707070") node.modulate = Color("ffffff") NewServerTexture = icon NewServerTexturePath = path print("pressed") - print(NewServerTexture) - print(icon) func AddServer_Close_pressed(): $Main/AddServerWindow.visible = false + $Main/EditServerWindow.visible = false func _on_Add_Server_pressed(): @@ -385,19 +378,40 @@ func mplist_item_selected(index): func _on_Join_pressed(): - $Overlay.visible = true - yield(get_tree().create_timer(1),"timeout") var e = $Main/Serverlist/ItemList.get_item_text(ServerIndex) serverconfig.load(WorkingDirectory + "/NovetusFE/servers.ini") launch("/bin/NovetusURI.exe " + to_uri(serverconfig.get_value(e,"ip"),serverconfig.get_value(e,"port"))) - $Overlay.visible = false - func multi_Versions_pressed(): $Main/Serverlist/Versions.text = Version $Main/VersionsWindow.popup() - func multi_closed(): $Main/Serverlist.visible = false + +func multi_edit_pressed(): + var e = $Main/Serverlist/ItemList.get_item_text(ServerIndex) + serverconfig.load(WorkingDirectory + "/NovetusFE/servers.ini") + $Main/EditServerWindow/LineEdit2.text = e + $Main/EditServerWindow/LineEdit.text = serverconfig.get_value(e,"ip") + ":" + serverconfig.get_value(e,"port") + $Main/EditServerWindow.popup() + +func delete_server_pressed(): + serverconfig.load(WorkingDirectory + "/NovetusFE/servers.ini") + serverconfig.erase_section($Main/EditServerWindow/LineEdit2.text) + serverconfig.save(WorkingDirectory + "/NovetusFE/servers.ini") + $Main/EditServerWindow.visible = false + refreshserverlist() + +func save_server_pressed(): + var e = $Main/Serverlist/ItemList.get_item_text(ServerIndex) + serverconfig.load(WorkingDirectory + "/NovetusFE/servers.ini") + serverconfig.erase_section(e) + e = $Main/EditServerWindow/LineEdit2.text + serverconfig.set_value(e,"ip",$Main/EditServerWindow/LineEdit.text.split(":")[0]) + serverconfig.set_value(e,"port",$Main/EditServerWindow/LineEdit.text.split(":")[1]) + serverconfig.set_value(e, "icon", NewServerTexturePath) + serverconfig.save(WorkingDirectory + "/NovetusFE/servers.ini") + refreshserverlist() + $Main/EditServerWindow.visible = false diff --git a/scenes/main.tscn b/scenes/main.tscn index b08e527..857b924 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=81 format=2] +[gd_scene load_steps=84 format=2] [ext_resource path="res://textures/hZZ7X7.png" type="Texture" id=1] [ext_resource path="res://textures/multiplayer.png" type="Texture" id=2] @@ -402,6 +402,9 @@ border_width_right = 2 border_width_bottom = 2 border_color = Color( 0.294118, 0.294118, 0.294118, 1 ) +[sub_resource type="DynamicFont" id=76] +font_data = ExtResource( 6 ) + [sub_resource type="StyleBoxFlat" id=65] content_margin_left = 5.0 bg_color = Color( 0.0588235, 0.0470588, 0.145098, 1 ) @@ -410,6 +413,12 @@ border_width_top = 2 border_width_right = 2 border_width_bottom = 2 +[sub_resource type="DynamicFont" id=77] +font_data = ExtResource( 6 ) + +[sub_resource type="DynamicFont" id=78] +font_data = ExtResource( 6 ) + [sub_resource type="DynamicFont" id=74] size = 17 font_data = ExtResource( 6 ) @@ -1312,6 +1321,228 @@ custom_styles/disabled = SubResource( 64 ) custom_styles/normal = SubResource( 56 ) text = "Version" +[node name="HostWindow" type="WindowDialog" parent="Main"] +margin_left = -266.0 +margin_top = -104.0 +margin_right = 318.0 +margin_bottom = 296.0 +window_title = "Host Server" + +[node name="Panel" type="Panel" parent="Main/HostWindow"] +margin_right = 584.0 +margin_bottom = 400.0 +custom_styles/panel = SubResource( 62 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Panel2" type="Panel" parent="Main/HostWindow"] +margin_right = 584.0 +margin_bottom = 296.0 +custom_styles/panel = SubResource( 73 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Join" type="Button" parent="Main/HostWindow"] +margin_left = 72.0 +margin_top = 312.0 +margin_right = 200.0 +margin_bottom = 342.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Host" + +[node name="DirectConnect" type="Button" parent="Main/HostWindow"] +margin_left = 216.0 +margin_top = 312.0 +margin_right = 376.0 +margin_bottom = 342.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Maps" + +[node name="AddServer" type="Button" parent="Main/HostWindow"] +margin_left = 392.0 +margin_top = 312.0 +margin_right = 520.0 +margin_bottom = 342.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Addons" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Close" type="Button" parent="Main/HostWindow"] +margin_left = 392.0 +margin_top = 352.0 +margin_right = 520.0 +margin_bottom = 382.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Close" + +[node name="Edit" type="Button" parent="Main/HostWindow"] +margin_left = 72.0 +margin_top = 352.0 +margin_right = 200.0 +margin_bottom = 382.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Presets" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Versions" type="Button" parent="Main/HostWindow"] +margin_left = 216.0 +margin_top = 352.0 +margin_right = 376.0 +margin_bottom = 382.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Version" + +[node name="RichTextLabel" type="RichTextLabel" parent="Main/HostWindow"] +margin_left = 176.0 +margin_top = 8.0 +margin_right = 448.0 +margin_bottom = 224.0 +focus_mode = 2 +custom_fonts/normal_font = SubResource( 76 ) +text = "Server Information: +IP: %IP% +Port: %PORT% +Client: %CLIENT% +Map: %MAP% +Players: %PLAYERS% +Novetus Version: %NOVER% +URI: %URI% +" +selection_enabled = true + +[node name="LineEdit" type="LineEdit" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 32.0 +margin_right = 160.0 +margin_bottom = 56.0 +custom_styles/normal = SubResource( 65 ) +placeholder_text = "Novetus" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineEdit2" type="LineEdit" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 88.0 +margin_right = 160.0 +margin_bottom = 112.0 +custom_styles/normal = SubResource( 65 ) +placeholder_text = "53640" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineEdit3" type="LineEdit" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 144.0 +margin_right = 160.0 +margin_bottom = 168.0 +custom_styles/normal = SubResource( 65 ) +placeholder_text = "12" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineEdit4" type="LineEdit" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 200.0 +margin_right = 160.0 +margin_bottom = 224.0 +custom_styles/normal = SubResource( 65 ) +placeholder_text = "novetus.viw.se" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 8.0 +margin_right = 64.0 +margin_bottom = 27.0 +custom_fonts/font = SubResource( 77 ) +text = "Name" + +[node name="Label2" type="Label" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 64.0 +margin_right = 64.0 +margin_bottom = 83.0 +custom_fonts/font = SubResource( 77 ) +text = "Port" + +[node name="Label3" type="Label" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 120.0 +margin_right = 69.0 +margin_bottom = 139.0 +custom_fonts/font = SubResource( 77 ) +text = "Players" + +[node name="Label4" type="Label" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 176.0 +margin_right = 136.0 +margin_bottom = 195.0 +custom_fonts/font = SubResource( 77 ) +text = "Master Server IP" + +[node name="CheckBox" type="CheckBox" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 256.0 +margin_right = 89.0 +margin_bottom = 283.0 +custom_fonts/font = SubResource( 78 ) +text = "No3D" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CheckBox2" type="CheckBox" parent="Main/HostWindow"] +margin_left = 96.0 +margin_top = 256.0 +margin_right = 169.0 +margin_bottom = 283.0 +custom_fonts/font = SubResource( 78 ) +text = "UPnP" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="CheckBox3" type="CheckBox" parent="Main/HostWindow"] +margin_left = 16.0 +margin_top = 232.0 +margin_right = 141.0 +margin_bottom = 259.0 +custom_fonts/font = SubResource( 78 ) +text = "Notifications" +__meta__ = { +"_edit_use_anchors_": false +} + [node name="DirectConnectWindow" type="WindowDialog" parent="Main"] anchor_left = 0.5 anchor_top = 0.5 @@ -1500,7 +1731,141 @@ custom_fonts/font = SubResource( 74 ) custom_styles/normal = SubResource( 75 ) text = " New " -[node name="Overlay" type="Control" parent="."] +[node name="EditServerWindow" type="WindowDialog" parent="Main"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -150.0 +margin_top = -72.0 +margin_right = 149.0 +margin_bottom = 204.0 +window_title = "Edit Server" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Panel" type="Panel" parent="Main/EditServerWindow"] +margin_right = 296.0 +margin_bottom = 276.0 +custom_styles/panel = SubResource( 62 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineEdit" type="LineEdit" parent="Main/EditServerWindow"] +margin_left = 16.0 +margin_top = 188.0 +margin_right = 280.0 +margin_bottom = 212.0 +custom_styles/normal = SubResource( 65 ) +placeholder_text = "localhost:53640" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineEdit2" type="LineEdit" parent="Main/EditServerWindow"] +margin_left = 16.0 +margin_top = 124.0 +margin_right = 280.0 +margin_bottom = 148.0 +custom_styles/normal = SubResource( 65 ) +placeholder_text = "Novetus" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Add Server" type="Button" parent="Main/EditServerWindow"] +margin_left = 16.0 +margin_top = 228.0 +margin_right = 144.0 +margin_bottom = 258.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Delete" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Close" type="Button" parent="Main/EditServerWindow"] +margin_left = 152.0 +margin_top = 228.0 +margin_right = 280.0 +margin_bottom = 258.0 +custom_fonts/font = SubResource( 63 ) +custom_styles/hover = SubResource( 55 ) +custom_styles/disabled = SubResource( 64 ) +custom_styles/normal = SubResource( 56 ) +text = "Save" + +[node name="Label" type="Label" parent="Main/EditServerWindow"] +margin_left = 16.0 +margin_top = 156.0 +margin_right = 280.0 +margin_bottom = 180.0 +custom_fonts/font = ExtResource( 8 ) +text = "Server Address" + +[node name="Label3" type="Label" parent="Main/EditServerWindow"] +margin_left = 16.0 +margin_top = 92.0 +margin_right = 280.0 +margin_bottom = 116.0 +custom_fonts/font = ExtResource( 8 ) +text = "Server Name" + +[node name="Label2" type="Label" parent="Main/EditServerWindow"] +margin_left = 16.0 +margin_top = 12.0 +margin_right = 280.0 +margin_bottom = 36.0 +custom_fonts/font = ExtResource( 8 ) +text = "Icons" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ImageSelect" type="FileDialog" parent="Main/EditServerWindow"] +margin_left = -154.0 +margin_top = -60.0 +margin_right = 470.0 +margin_bottom = 340.0 +window_title = "Select an Image" +mode_overrides_title = false +mode = 0 +access = 2 +filters = PoolStringArray( "*.png" ) +current_dir = "/home/lachrymogenic/NovetusFE" +current_path = "/home/lachrymogenic/NovetusFE/" + +[node name="ScrollContainer" type="ScrollContainer" parent="Main/EditServerWindow"] +margin_left = 16.0 +margin_top = 36.0 +margin_right = 280.0 +margin_bottom = 92.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HBoxContainer" type="HBoxContainer" parent="Main/EditServerWindow/ScrollContainer"] +margin_right = 50.0 +margin_bottom = 45.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Button" type="Button" parent="Main/EditServerWindow/ScrollContainer/HBoxContainer"] +margin_right = 50.0 +margin_bottom = 45.0 +custom_fonts/font = SubResource( 74 ) +custom_styles/normal = SubResource( 75 ) +text = " New " + +[node name="OverlayLayer" type="CanvasLayer" parent="."] + +[node name="Overlay" type="Control" parent="OverlayLayer"] visible = false anchor_left = 0.5 anchor_top = 0.5 @@ -1510,22 +1875,31 @@ margin_left = -20.0 margin_top = -20.0 margin_right = 20.0 margin_bottom = 20.0 +__meta__ = { +"_edit_use_anchors_": false +} -[node name="ColorRect" type="ColorRect" parent="Overlay"] +[node name="ColorRect" type="ColorRect" parent="OverlayLayer/Overlay"] modulate = Color( 1, 1, 1, 0.564706 ) -margin_left = -268.0 -margin_top = -88.0 -margin_right = 316.0 -margin_bottom = 296.0 +margin_left = -954.0 +margin_top = -520.0 +margin_right = 974.0 +margin_bottom = 560.0 color = Color( 0, 0, 0, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} -[node name="RichTextLabel" type="RichTextLabel" parent="Overlay"] +[node name="RichTextLabel" type="RichTextLabel" parent="OverlayLayer/Overlay"] margin_left = -116.0 margin_top = 72.0 margin_right = 220.0 margin_bottom = 128.0 custom_fonts/normal_font = SubResource( 22 ) text = "Starting Novetus..." +__meta__ = { +"_edit_use_anchors_": false +} [connection signal="text_entered" from="Background/Control2/LineEdit" to="." method="workingdirectory_text_entered"] [connection signal="pressed" from="Background/FirstTime/Panel/Button" to="." method="Firsttime_Button_pressed"] @@ -1547,10 +1921,16 @@ text = "Starting Novetus..." [connection signal="pressed" from="Main/Serverlist/DirectConnect" to="." method="_on_DirectConnect_pressed"] [connection signal="pressed" from="Main/Serverlist/AddServer" to="." method="_on_AddServer_pressed"] [connection signal="pressed" from="Main/Serverlist/Close" to="." method="multi_closed"] +[connection signal="pressed" from="Main/Serverlist/Edit" to="." method="multi_edit_pressed"] [connection signal="pressed" from="Main/Serverlist/Versions" to="." method="multi_Versions_pressed"] +[connection signal="pressed" from="Main/HostWindow/Versions" to="." method="multi_Versions_pressed"] [connection signal="pressed" from="Main/DirectConnectWindow/Join" to="." method="DirectConnect_Join_pressed"] [connection signal="pressed" from="Main/DirectConnectWindow/Close" to="." method="DirectConnect_Close_pressed"] [connection signal="pressed" from="Main/AddServerWindow/Add Server" to="." method="_on_Add_Server_pressed"] [connection signal="pressed" from="Main/AddServerWindow/Close" to="." method="AddServer_Close_pressed"] [connection signal="file_selected" from="Main/AddServerWindow/ImageSelect" to="." method="_on_ImageSelect_file_selected"] [connection signal="pressed" from="Main/AddServerWindow/ScrollContainer/HBoxContainer/Button" to="." method="new_icon_pressed"] +[connection signal="pressed" from="Main/EditServerWindow/Add Server" to="." method="delete_server_pressed"] +[connection signal="pressed" from="Main/EditServerWindow/Close" to="." method="save_server_pressed"] +[connection signal="file_selected" from="Main/EditServerWindow/ImageSelect" to="." method="_on_ImageSelect_file_selected"] +[connection signal="pressed" from="Main/EditServerWindow/ScrollContainer/HBoxContainer/Button" to="." method="new_icon_pressed"]