diff --git a/.gitignore b/.gitignore index 398f3e8..e6843e2 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ PublishProfiles *.user logs.txt -EIV_Platform.* \ No newline at end of file +EIV_Platform.* +Mods/ \ No newline at end of file diff --git a/csharp/Client/MasterServerManager.cs b/csharp/Client/MasterServerManager.cs index 477fb6c..34a863a 100644 --- a/csharp/Client/MasterServerManager.cs +++ b/csharp/Client/MasterServerManager.cs @@ -22,15 +22,14 @@ public static string Authenticate() if (!CanConnect) return string.Empty; - IPlatform platform = GameManager.Instance.Platform_Manager.Platform; - IUser user = platform.GetUser(); + IUser user = PlatformManager.Platform.GetUser(); if (user == null) return string.Empty; HttpClient httpClient = new(); UserInfoJson userInfoJSON = new() { - Platform = platform.PlatformType, + Platform = PlatformManager.Platform.PlatformType, UserId = user.GetUserId(), Name = user.GetUserName(), Version = BuildDefined.Version.ToString(), diff --git a/csharp/Managers/BuildDefined.cs b/csharp/Managers/BuildDefined.cs index ff8cf21..de95543 100644 --- a/csharp/Managers/BuildDefined.cs +++ b/csharp/Managers/BuildDefined.cs @@ -1,5 +1,4 @@ using EIV_JsonLib; -using Godot; using System; using System.IO; @@ -40,7 +39,14 @@ public static ReleaseType Release } - public static string INI = Path.Combine(Path.GetDirectoryName(OS.GetExecutablePath()), + public static string INI = Path.Combine( +#if TOOLS + Directory.GetCurrentDirectory(), + "resources", + "ini", +#else + Path.GetDirectoryName(Godot.OS.GetExecutablePath()), +#endif #if GAME "Game.ini" #elif SERVER diff --git a/csharp/Managers/GameManager.cs b/csharp/Managers/GameManager.cs index 965e7a0..3e92896 100644 --- a/csharp/Managers/GameManager.cs +++ b/csharp/Managers/GameManager.cs @@ -15,23 +15,24 @@ public partial class GameManager : Node public Client.UIManager UIManager { get; set; } #endif - public PlatformManager Platform_Manager { get; set; } - Array Nodes = new(); public override void _Ready() { + this.Name = "GameManager"; MainLog.CreateNew(); - Log.Information(csharp.Properties.Resource.BuildDate.Replace("\n", "")); + Log.Information(csharp.Properties.Resource.BuildDate.Replace("\n", "_")); Log.Information(BuildDefined.FullVersion); Instance = this; Log.Verbose("Preload JsonLib! " + (CoreConverters.Converters.Count == 1)); - ModManagerInstance = new(); + ModManagerInstance = new() + { + Name = "ModManager" + }; Nodes.Add(ModManagerInstance); #if CLIENT || GAME UIManager = new(); #endif - Platform_Manager = new(); foreach (var item in Nodes) { this.CallDeferred("add_sibling", item); @@ -42,8 +43,8 @@ public override void _Ready() private void ModManagerInstance_AllModsLoaded() { - Platform_Manager.Init(); - if (Platform_Manager.Platform.PlatformType == EIV_Common.Platform.PlatformType.Unknown) + PlatformManager.Init(); + if (PlatformManager.Platform.PlatformType == EIV_Common.Platform.PlatformType.Unknown) { Log.Error("The Platform set to unknown. We dont know what Platform you using. Please use EIV_Platform.Free solution!"); Quit(); diff --git a/csharp/Managers/PlatformManager.cs b/csharp/Managers/PlatformManager.cs index cb98c2a..7f48e27 100644 --- a/csharp/Managers/PlatformManager.cs +++ b/csharp/Managers/PlatformManager.cs @@ -13,26 +13,35 @@ namespace ExtractIntoVoid.Managers; public class PlatformManager { - protected List PlatformNames = ["EIV_Platform.Free.dll", "EIV_Platform.Steam.dll", "EIV_Platform.Epic.dll"]; - - public IPlatform Platform; + protected static List PlatformNames = ["EIV_Platform.Free.dll", "EIV_Platform.Steam.dll", "EIV_Platform.Epic.dll"]; + protected static IPlatform internal_platform; + public static IPlatform Platform + { + get + { + if (internal_platform == null) + GetPlatform(); + internal_platform.Init(); + return internal_platform; + } + } - public void Init() + public static void Init() { - if (Platform == null) + if (internal_platform == null) GetPlatform(); - Platform.Init(); + internal_platform.Init(); } - public void GetPlatform() + public static void GetPlatform() { CreatePlatformEvent createPlatformEvent = new() { Platform = null }; ModAPI.V2.V2Manager.TriggerEvent(createPlatformEvent); - Platform = createPlatformEvent.Platform; - if (Platform == null) + internal_platform = createPlatformEvent.Platform; + if (internal_platform == null) { string thisLocation = typeof(PlatformManager).Assembly.Location.GetBaseDir(); // this fixing if we "playing" in-editor. @@ -52,13 +61,13 @@ public void GetPlatform() IPlatform platform = (IPlatform)Activator.CreateInstance(iType); if (platform == null) continue; - Platform = platform; + internal_platform = platform; } } } - if (Platform == null) + if (internal_platform == null) { - Platform = new UnknownPlatform(); + internal_platform = new UnknownPlatform(); } } } diff --git a/csharp/Menus/ConnectionScreen.cs b/csharp/Menus/ConnectionScreen.cs index dba1131..90bac78 100644 --- a/csharp/Menus/ConnectionScreen.cs +++ b/csharp/Menus/ConnectionScreen.cs @@ -113,6 +113,7 @@ public void Refresh() { ServerList.RemoveChild(item); } + GD.Print(BuildDefined.INI); var lobbyList = ConfigINI.Read(BuildDefined.INI, "Lobby", "OfflineLobbyList"); if (lobbyList.Contains("{EXE}")) { diff --git a/csharp/Menus/SettingsMenu.cs b/csharp/Menus/SettingsMenu.cs index 9e1e4f2..bc45adf 100644 --- a/csharp/Menus/SettingsMenu.cs +++ b/csharp/Menus/SettingsMenu.cs @@ -148,7 +148,7 @@ public void Apply() public void Back() { this.Hide(); - GetTree().Root.GetNode("/MainMenu").Show(); + GetTree().Root.GetNode("MainMenu").Show(); this.QueueFree(); } @@ -201,6 +201,20 @@ private void ScreenSpaceAAButton_IdPressed(long id) ScreenSpaceAA_LastIndex = (int)id; } + public void AdvancedVideoSettings_Toggle(bool toggle) + { + if (toggle) + { + VideoSettings.GetNode("Borderless").Show(); + VideoSettings.GetNode("Exclusive").Show(); + } + else + { + VideoSettings.GetNode("Borderless").Hide(); + VideoSettings.GetNode("Exclusive").Hide(); + } + } + public void GameButton_Pressed() { GameSettingsContainer.Show(); diff --git a/csharp/Properties/BuildDate.txt b/csharp/Properties/BuildDate.txt index 8876b90..f0aa123 100644 --- a/csharp/Properties/BuildDate.txt +++ b/csharp/Properties/BuildDate.txt @@ -1,3 +1,3 @@ update-deps -2024-12-26T19:58:54 -0c89531 +2024-12-28 00:11 +d57ada0 diff --git a/resources/ini/Client.ini b/resources/ini/Client.ini index d6f7aeb..1205e05 100644 --- a/resources/ini/Client.ini +++ b/resources/ini/Client.ini @@ -1,15 +1,12 @@ ; ; Welcome to Client related configs -; 1 = Enabled | True -; 0 = Disabled | False -; Empty = "" ; ; Master server related configuration [MasterServer] ; Connect or not to the master server. -ConnectToMasterServer = 0 +ConnectToMasterServer = false ; This for testing master server, only works on Debug build. MasterServerURL = 26.48.71.165:7777 diff --git a/resources/ini/Game.ini b/resources/ini/Game.ini index fcf89d0..817307b 100644 --- a/resources/ini/Game.ini +++ b/resources/ini/Game.ini @@ -1,15 +1,12 @@ ; ; Welcome to Game related configs -; 1 = Enabled | True -; 0 = Disabled | False -; Empty = "" ; ; Master server related configuration [MasterServer] ; Connect or not to the master server. -ConnectToMasterServer = 0 +ConnectToMasterServer = false ; This for testing master server, only works on Debug build. MasterServerURL = 26.48.71.165:7777 diff --git a/resources/ini/Server.ini b/resources/ini/Server.ini index 6612d93..f1aa77a 100644 --- a/resources/ini/Server.ini +++ b/resources/ini/Server.ini @@ -1,8 +1,5 @@ ; ; Welcome to Server related configs -; 1 = Enabled | True -; 0 = Disabled | False -; Empty = "" ; diff --git a/scenes/Menu/Settings.tscn b/scenes/Menu/Settings.tscn index b5bfff4..6eb7f4d 100644 --- a/scenes/Menu/Settings.tscn +++ b/scenes/Menu/Settings.tscn @@ -27,12 +27,14 @@ layout_mode = 1 anchors_preset = 5 anchor_left = 0.5 anchor_right = 0.5 -offset_left = -324.0 -offset_right = 324.0 -offset_bottom = 65.0 +offset_left = -325.0 +offset_top = 30.0 +offset_right = 323.0 +offset_bottom = 95.0 grow_horizontal = 2 [node name="Separator" type="HBoxContainer" parent="TopElements"] +layout_mode = 0 theme_override_constants/separation = 60 alignment = 1 @@ -40,21 +42,25 @@ alignment = 1 layout_mode = 2 theme_override_font_sizes/font_size = 27 text = "Game" +flat = true [node name="Video" type="Button" parent="TopElements/Separator"] layout_mode = 2 theme_override_font_sizes/font_size = 27 text = "Video" +flat = true [node name="Controls" type="Button" parent="TopElements/Separator"] layout_mode = 2 theme_override_font_sizes/font_size = 27 text = "Controls" +flat = true [node name="Audio" type="Button" parent="TopElements/Separator"] layout_mode = 2 theme_override_font_sizes/font_size = 27 text = "Audio" +flat = true [node name="Panel" type="Control" parent="."] layout_mode = 1 @@ -69,7 +75,6 @@ grow_horizontal = 2 grow_vertical = 2 [node name="Game Settings" type="VBoxContainer" parent="Panel"] -visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -111,8 +116,10 @@ offset_bottom = 15.5 grow_horizontal = 0 grow_vertical = 2 text = "BUTTON" +flat = true [node name="Video Settings" type="VBoxContainer" parent="Panel"] +visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -127,7 +134,36 @@ size_flags_horizontal = 0 theme_override_font_sizes/font_size = 20 text = "Video Settings" +[node name="Enable Advanced" type="Control" parent="Panel/Video Settings"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Panel/Video Settings/Enable Advanced"] +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_top = -11.5 +offset_right = 233.0 +offset_bottom = 11.5 +grow_vertical = 2 +text = "Enable Advanced" + +[node name="CheckBox" type="CheckBox" parent="Panel/Video Settings/Enable Advanced"] +layout_mode = 1 +anchors_preset = 6 +anchor_left = 1.0 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +offset_left = -81.0 +offset_top = -15.5 +offset_bottom = 15.5 +grow_horizontal = 0 +grow_vertical = 2 +text = "Enable" + [node name="Borderless" type="Control" parent="Panel/Video Settings"] +visible = false layout_mode = 2 [node name="Label" type="Label" parent="Panel/Video Settings/Borderless"] @@ -156,6 +192,7 @@ grow_vertical = 2 text = "Enable" [node name="Exclusive" type="Control" parent="Panel/Video Settings"] +visible = false layout_mode = 2 [node name="Label" type="Label" parent="Panel/Video Settings/Exclusive"] @@ -606,21 +643,36 @@ grow_vertical = 0 text = "Apply" [node name="CancelButton" type="Button" parent="."] -layout_mode = 0 -offset_left = 480.0 -offset_top = 650.0 -offset_right = 540.0 -offset_bottom = 685.0 +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -140.0 +offset_top = -70.0 +offset_right = -80.0 +offset_bottom = -35.0 +grow_horizontal = 2 +grow_vertical = 0 text = "Cancel" [node name="BackButton" type="Button" parent="."] -layout_mode = 0 -offset_left = 750.0 -offset_top = 650.0 -offset_right = 810.0 -offset_bottom = 685.0 +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = 80.0 +offset_top = -70.0 +offset_right = 140.0 +offset_bottom = -35.0 +grow_horizontal = 2 +grow_vertical = 0 text = "Back" +[connection signal="pressed" from="TopElements/Separator/Game" to="." method="GameButton_Pressed"] [connection signal="pressed" from="TopElements/Separator/Video" to="." method="VideoButton_Pressed"] [connection signal="pressed" from="TopElements/Separator/Controls" to="." method="ControlsButton_Pressed"] [connection signal="pressed" from="TopElements/Separator/Audio" to="." method="AudioButton_Pressed"]