├── .github ├── COMMON_MISTAKES.md ├── CONTRIBUTING.md ├── FORMATTING_GUIDELINES.md ├── MOD_LOADER.md ├── NETCODE.md ├── USEFUL_TIPS.md └── UTILITY_SCRIPTS.md ├── .gitignore ├── .vs ├── GodotModulesCSharp │ └── DesignTimeBuild │ │ └── .dtbcache.v2 └── LuaModdingTest │ ├── DesignTimeBuild │ └── .dtbcache.v2 │ ├── v16 │ └── .suo │ └── v17 │ ├── .futdcache.v1 │ └── .suo ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── Audio └── Music │ ├── Unsolicited trailer music loop edit.wav │ ├── Unsolicited trailer music loop edit.wav.import │ └── credit.txt ├── ENet-CSharp.dll ├── Fonts └── Roboto │ ├── LICENSE.txt │ ├── Roboto-Black.ttf │ ├── Roboto-BlackItalic.ttf │ ├── Roboto-Bold.ttf │ ├── Roboto-BoldItalic.ttf │ ├── Roboto-Italic.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-LightItalic.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-MediumItalic.ttf │ ├── Roboto-Regular.ttf │ ├── Roboto-Thin.ttf │ └── Roboto-ThinItalic.ttf ├── GodotModules.csproj ├── GodotModules.sln ├── LICENSE ├── README.md ├── Scenes ├── Main.tscn ├── Prefabs │ ├── Debugger.tscn │ ├── Game │ │ ├── Bullet.tscn │ │ ├── ClientPlayer.tscn │ │ ├── Enemy.tscn │ │ └── OtherPlayer.tscn │ ├── LobbyListing.tscn │ ├── LobbyPlayerListing.tscn │ ├── ModInfo.tscn │ ├── ModLoader.tscn │ ├── NotifyError.tscn │ ├── Options.tscn │ ├── Popups │ │ ├── PopupCreateLobby.tscn │ │ ├── PopupDirectConnect.tscn │ │ ├── PopupError.tscn │ │ ├── PopupFileDialogMods.tscn │ │ ├── PopupMessage.tscn │ │ ├── PopupReportBug.tscn │ │ └── PopupSetupOnlineProfile.tscn │ ├── ServerManager.tscn │ └── ServerSimulation.tscn └── Scenes │ ├── Game.tscn │ ├── GameServers.tscn │ ├── Lobby.tscn │ └── Menu.tscn ├── Scripts ├── Lua │ └── Game.lua ├── Msc │ ├── Commands │ │ ├── Command.cs │ │ ├── CommandDebug.cs │ │ ├── CommandExit.cs │ │ └── CommandHelp.cs │ ├── UIGameConsole.cs │ ├── UINotifyError.cs │ ├── UIPopupCreateLobby.cs │ ├── UIPopupDirectConnect.cs │ ├── UIPopupError.cs │ ├── UIPopupFileDialogMods.cs │ ├── UIPopupMessage.cs │ └── UIPopupReportBug.cs ├── Netcode │ ├── Client │ │ ├── ENetClient.cs │ │ ├── GameClient.cs │ │ ├── GodotCommands.cs │ │ └── Utils │ │ │ ├── GTimer.cs │ │ │ ├── PrevCurQueue.cs │ │ │ └── UtilOptions.cs │ └── Common │ │ ├── CPacketLobby.cs │ │ ├── CPacketPing.cs │ │ ├── CPacketPlayerMovementDirections.cs │ │ ├── CPacketPlayerPosition.cs │ │ ├── CPacketPlayerRotation.cs │ │ ├── Core │ │ ├── ClientPacket.cs │ │ ├── GamePacket.cs │ │ ├── PacketReader.cs │ │ ├── PacketWriter.cs │ │ └── ServerPacket.cs │ │ ├── Data │ │ ├── DataBullet.cs │ │ ├── DataEnemy.cs │ │ ├── DataEntityTransform.cs │ │ ├── DataLobby.cs │ │ └── DataPlayer.cs │ │ ├── Packet │ │ ├── APacket.cs │ │ ├── APacketClient.cs │ │ ├── APacketServer.cs │ │ └── APacketServerPeerId.cs │ │ ├── SPacketEnemyPositions.cs │ │ ├── SPacketGame.cs │ │ ├── SPacketLobby.cs │ │ ├── SPacketPlayerTransforms.cs │ │ ├── SPacketPong.cs │ │ ├── Server │ │ ├── ENetServer.cs │ │ ├── GameServer.cs │ │ ├── ServerSimulation.cs │ │ └── Utils │ │ │ └── STimer.cs │ │ ├── Utils │ │ ├── EncryptionHelper.cs │ │ ├── Extensions.cs │ │ ├── GlobalUsings.cs │ │ ├── GodotExtensions.cs │ │ ├── GodotFileManager.cs │ │ ├── Logger.cs │ │ ├── NetworkManager.cs │ │ ├── ReflectionUtils.cs │ │ ├── SystemFileManager.cs │ │ ├── Utils.cs │ │ └── WebClient.cs │ │ ├── _Common.cs │ │ └── _Opcodes.cs └── Scenes │ ├── AScene.cs │ ├── Game Servers │ ├── SceneGameServers.cs │ ├── UIGameServersNavBtns.cs │ └── UILobbyListing.cs │ ├── Game │ ├── ClientPlayer.cs │ ├── Enemy.cs │ ├── OtherPlayer.cs │ └── SceneGame.cs │ ├── Lobby │ ├── LobbyChat.cs │ ├── SceneLobby.cs │ └── UILobbyPlayerListing.cs │ ├── Main │ ├── Debug.cs │ ├── GM.cs │ ├── MusicManager.cs │ ├── Notifier.cs │ ├── Prefabs.cs │ └── SceneManager.cs │ └── Menu │ ├── ModLoader.cs │ ├── SceneMenu.cs │ ├── UIModInfo.cs │ ├── UIModLoader.cs │ ├── UIOptions.cs │ └── UISetupOnlineProfile.cs ├── Sprites ├── Black.png ├── Black.png.import ├── Circle 256.png ├── Circle 256.png.import ├── Circle 32 - Marked.png ├── Circle 32 - Marked.png.import ├── Circle 32.png ├── Circle 32.png.import ├── Circle 64.png ├── Circle 64.png.import ├── Enemy.png └── Enemy.png.import ├── Themes ├── Button │ ├── Btn_Disabled.tres │ ├── Btn_Focus.tres │ ├── Btn_Hover.tres │ ├── Btn_Normal.tres │ └── Btn_Pressed.tres ├── Fonts │ └── Roboto.tres ├── LineEdit │ └── LineEdit_Normal.tres ├── Main.tres ├── PanelNoBorder.tres ├── ScrollBar │ └── ScrollBar_Grabber.tres ├── Slider │ └── Slider_Grabber_Area.tres └── TextEdit │ └── TextEdit_Normal.tres ├── default_env.tres ├── enet.dll ├── icon.png ├── icon.png.import ├── libenet.dylib ├── libenet.so ├── options.json └── project.godot /.github/COMMON_MISTAKES.md: -------------------------------------------------------------------------------- 1 | ## Export settings not setup properly 2 | ![image](https://user-images.githubusercontent.com/6277739/176059155-de5edd40-3529-4e39-9769-aff75832ad7b.png) 3 | 4 | Make sure export resource settings look exactly like this or you may run into the error 5 | `[Warning]: Failed to open res://Scripts/Lua, Error: 'InvalidParameter'` 6 | 7 | ## Copying `enet.dll` to the release folder 8 | Do not forget to copy `enet.dll` next to the games executable when exporting the game or the netcode will not function properly. 9 | 10 | ## Thread Safety 11 | The netcode uses a while loop that runs constantly and thus needs to be on a separate thread from the Godot thread. Two methods are used to safely send data between threads, ConcurrentQueue and Interlocked.Read(). ConcurrentQueue allows any kind of data to be enqueued on one thread and dequeued on another. Interlocked.Read() is a nice and easy way to read a bool from any thread. If data is not accessed through one of these methods, then the rules of thread safety are being violated and will vastly increase the chances of the program crashing with no errors. Trying to debug errors that do not appear in the console is a nightmare, please be mindful when sending data between threads. 12 | 13 | ## Reading data from packets 14 | You may forget to assign the value that `reader.readXXXX();` returns. If this happens then in this case the `Ready` bool will always have the default value `false`. 15 | ```cs 16 | public bool Ready { get; set; } 17 | 18 | public override void Write(PacketWriter writer) 19 | { 20 | writer.Write(Ready); 21 | } 22 | 23 | public override void Read(PacketReader reader) 24 | { 25 | // reader.ReadBool(); This is bad, do not do this!!! 26 | Ready = reader.ReadBool(); // Do this!! 27 | } 28 | ``` 29 | 30 | Also, forgetting to extend from `PacketServerPeerId` (if, for example, telling everyone else in the server about changes to a peer) is a common misake. Forgetting to write `base.Write(writer)` and `base.Read(reader)` in this case can also lead to problems. 31 | 32 | 33 | ## Removing and adding a child in the same frame 34 | Adding and removing a child within the same frame almost always this leads to errors (sometimes game crashing errors). Generally, the workaround is to wait 1 idle_frame between removing and adding the child. Perhaps there is a better solution to what you are trying to do like re-assigning the parent of the child instead. 35 | 36 | 37 | ## Changing the location of a script 38 | If a script in Godot is attached to a node, do not change the location of the script inside VSCode, instead do it inside Godot. Changing the location of the script in Godot will update the necessary references whereas doing so in VSCode will not. 39 | 40 | 41 | ## Renaming export node paths 42 | Generally, it's a good idea to keep the script as close as you can to the NodePaths so when renaming nodes you won't have to worry about re-assigning the nodepaths. 43 | 44 | 45 | ## `Host.Create(address, byte)` 46 | Host.Create(address, byte) will always fail. Always do Host.Create(address, int) and don't even try casting from byte to int, it will fail. Client will not connect and you won't know why. 47 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | Contributions and pull requests are very much welcomed. If you want to help contribute, get the project running on your PC and see how everything works. My code isn't the best and it would be nice if others peer reviewed it and pointed out things I could do better. 3 | 4 | 5 | > ⚠️ **IMPORTANT**: The whole project is being done from scratch on the [dev branch](https://github.com/GodotModules/GodotModulesCSharp/tree/dev). 6 | 7 | 8 | You can discuss about the project in the [Godot Modules Discord Server](https://discord.gg/866cg8yfxZ). If you have any questions, contact `valk#9904` though the server. 9 | 10 | 11 | ## Setup 12 | 13 | 14 | ### Godot Mono (C#) 15 | 1. Install [Godot Mono 64 Bit](https://godotengine.org) 16 | 2. Install [.NET SDK from this link](https://dotnet.microsoft.com/en-us/download) 17 | 3. Install [.NET Framework 4.7.2](https://duckduckgo.com/?q=.net+framework+4.7.2) 18 | 4. Launch Godot through [VSCode](#vscode) 19 | 5. In `Godot Editor > Editor Settings > Mono > Builds`: Make sure `Build Tool` is set to `dotnet CLI` 20 | 21 | The Godot startup scene should be set to `res://Scenes/Main.tscn`, if it is not then the game server and web server will not start and a lot of other code that needs to be initialized will not be initialized. To fix this go to `Godot > Project Settings > Application > Run > Main Scene` and set it to the main scene. 22 | 23 | ### VSCode 24 | VSCode is a UI friendly text editor for developers 25 | 1. Install [VSCode](https://code.visualstudio.com) 26 | 2. Install the following extensions for VSCode 27 | - [C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) 28 | - [C# Tools for Godot](https://marketplace.visualstudio.com/items?itemName=neikeq.godot-csharp-vscode) 29 | - [godot-tools](https://marketplace.visualstudio.com/items?itemName=geequlim.godot-tools) 30 | - [Mono Debug](https://marketplace.visualstudio.com/items?itemName=ms-vscode.mono-debug) 31 | - [MoonSharp Debug](https://marketplace.visualstudio.com/items?itemName=xanathar.moonsharp-debug) (only if debugging lua) 32 | 3. Launch Godot through VSCode by hitting `F1` to open up VSCode command and run `godot tools: open workspace with godot editor` or simply click the `Open Godot Editor` button bottom right 33 | 34 | ### GitHub 35 | 1. Fork this repo 36 | 2. Clone your fork with `git clone https://github.com//GodotModules` (replace `` with your GitHub username) 37 | - *If you get `'git' is not recognized as an internal or external command` then install [Git scm](https://git-scm.com/downloads)* 38 | 3. Extract the zip and open the folder in VSCode 39 | 4. Go to the source control tab 40 | 5. Click the 3 dots icon, click `Checkout to...`, switch to the `dev` branch 41 | - *If you want to see the netcode working in action then stay on `main`* 42 | 6. All the files you make changes to should appear here as well, you can stage the files you want to commit, give the commit a message and then push it to your fork 43 | 7. Once you have some commits on your fork, you can go [here](https://github.com/GodotModules/GodotModulesCSharp/pulls) and open up a new pull request and request to merge your work with the main repo 44 | 45 | > ⚠️ Before committing anything please talk to `va#9904` in the [Godot Modules Discord Server](https://discord.gg/866cg8yfxZ) so we can mitigate potential merge conflicts. 46 | 47 | > Some development has been moved to a [separate repo](https://github.com/GodotModules/Sandbox) as it's nice to work with a clean environment and sometimes the main repo gets too messy in some areas. Once the code has been refined here, it will be merged back with the main repo. 48 | 49 | > You can have a look at the projects roadmap [here](https://github.com/GodotModules/GodotModulesCSharp/issues/124). 50 | 51 | ### [Formatting Guidelines](https://github.com/GodotModules/GodotModulesCSharp/blob/main/.github/FORMATTING_GUIDELINES.md) 52 | 53 | ### [Useful Tips](https://github.com/GodotModules/GodotModulesCSharp/blob/main/.github/USEFUL_TIPS.md) 54 | 55 | ### [Common Mistakes](https://github.com/valkyrienyanko/GodotModules/blob/main/.github/COMMON_MISTAKES.md) 56 | -------------------------------------------------------------------------------- /.github/FORMATTING_GUIDELINES.md: -------------------------------------------------------------------------------- 1 | # No longer being updated, moved to Sankari project 2 | 3 | ### Project Specific 4 | - Please always use `Logger.Log()` over `GD.Print()` 5 | - `void Preinit(GameManager gameManager)` should go just above `override void _Ready()` 6 | 7 | ### Case Format 8 | - Always prefer use of auto properties over readonly keyword and fields 9 | - Class, struct, methods, protected and public variables and properties are `PascalCase` format 10 | - Private fields are `camelCase` format 11 | 12 | ### Namespaces / usings 13 | - Please make sure all classes have file scoped namespaces 14 | - If a `using` is used across several scripts, consider making it `global` if there are no conflicts 15 | 16 | ### Readability 17 | - Try to add comments to all the new things you add, not everyone will understand what you did! 18 | - Favor readability over everything else, space out the code, consider using `=>`, and do not use `new()` if it makes the code look cryptic 19 | - Use `var` wherever you can, if something looks too cryptic just add a comment 20 | - Try not to squash every piece of logic into one class, if code is related to a cat put it in a cat class, don't just stuff it all in animals class 21 | - All abstract classes should start with a capital `A` 22 | 23 | ### VSCode 24 | - Please set `Tab Size` to `4` and `End of Line Sequence` to `CRLF` *(if you do not do this then you may accidentially change every single line in the project making it extremely difficult to find what you changed and solve merge conflicts)* 25 | 26 | ### The Order of Things 27 | - All `static` members should go to the very top of the class 28 | - `_Ready()` `_Process()` functions should be at the top, all user-defined functions go below 29 | - All private methods should go below public methods 30 | - All Godot signal methods should go to the very bottom of the class 31 | 32 | ### GitHub 33 | - Try not to commit all your work in one commit, create commits with meaningful messages describing small things you add here and there. Or at least create a commit for each separate file. 34 | 35 | ### Code Snippets 36 | Please make use of the following snippets 37 | 38 | - `nodepath` -> `"[Export] protected readonly NodePath NodePath"` 39 | - `packedscene` -> `"public readonly static PackedScene "` 40 | -------------------------------------------------------------------------------- /.github/MOD_LOADER.md: -------------------------------------------------------------------------------- 1 | This module was created to better understand MoonSharp (Lua) for implementing modding into a game. The project has evolved into a template to be used in other Godot C# games to add Lua modding support. 2 | 3 | Learn Lua: https://www.lua.org/pil/contents.html 4 | Learn MoonSharp: https://www.moonsharp.org/getting_started.html 5 | 6 | #### Features 7 | - Mods all share one Lua environment 8 | - Mods can register callbacks without overwriting other mod callbacks 9 | - Callbacks support params 10 | - ModLoader can register function hooks anywhere 11 | - Mods can see objects like Player and do stuff like Player:setHealth(x) 12 | - Lua Debugger support 13 | - Safety null checks to see if all properties were filled out in mod info.json 14 | - Individual mods can be enabled or disabled 15 | - Mod name, description, author, version, game versions, dependencies displayed in UI 16 | 17 | #### Hooks 18 | ```cs 19 | public override void _Ready() 20 | { 21 | // if we had a Player class defined with SetHealth function, this is how you would link that function with Lua 22 | ModLoader.Script.Globals["Player", "setHealth"] = (Action)D_Master.Player.SetHealth; 23 | 24 | ModLoader.Call("OnGameInit"); 25 | } 26 | 27 | public override void _Process(float delta) 28 | { 29 | ModLoader.Call("OnGameUpdate", delta); 30 | } 31 | ``` 32 | 33 | #### Mod Structure 34 | info.json 35 | ```json 36 | { 37 | "name": "ModTest", 38 | "version": "0.0.1", 39 | "author": "Foo", 40 | "dependencies": ["Bar"], 41 | "description": "Example mod", 42 | "gameVersions": [] 43 | } 44 | ``` 45 | 46 | script.lua 47 | ```lua 48 | -- example script of what you can do 49 | 50 | RegisterCallback('OnGameInit', nil, function() 51 | print('Game start') 52 | end) 53 | 54 | local x = 0 55 | 56 | RegisterCallback('OnGameUpdate', nil, function(delta) 57 | print('Delta', delta) 58 | Player:setHealth(x) 59 | x = x + 1 60 | end) 61 | ``` 62 | 63 | Mod file structure 64 | ``` 65 | |-Mods 66 | |--Foo 67 | |---info.json 68 | |---script.lua 69 | |--Bar 70 | |---info.json 71 | |---script.lua 72 | ``` 73 | 74 | Mods Directory Location 75 | - Exported Releases: `${GameExecutable}/Mods/...` 76 | - Non-Exported Releases: `res://Mods/...` 77 | 78 | Lua Scripts Location 79 | - `res://Scripts/Lua/...` 80 | 81 | #### Note 82 | Just found out that this is a thing https://docs.godotengine.org/en/3.4/tutorials/export/exporting_pcks.html although as of writing this it will not work with C# projects because of this issue https://github.com/godotengine/godot/issues/36828. If your project is 100% GDScript then by all means use PCK files instead of this. 83 | -------------------------------------------------------------------------------- /.github/NETCODE.md: -------------------------------------------------------------------------------- 1 | #### Threads 2 | The client runs on 2 threads; the Godot thread and the ENet thread. Never run Godot code in the ENet thread and likewise never run ENet code in the Godot thread. If you ever need to communicate between the threads, use the proper `ConcurrentQueue`'s in `ENetClient.cs`. 3 | 4 | #### Networking 5 | The netcode utilizes [ENet-CSharp](https://github.com/SoftwareGuy/ENet-CSharp/blob/master/DOCUMENTATION.md), a reliable UDP networking library. 6 | 7 | Never give the client any authority, the server always has the final say in everything. This should always be thought of when sending new packets. 8 | 9 | Example using LobbyChatMessage packet. 10 | ```cs 11 | using GodotModules.Netcode.Server; 12 | 13 | namespace GodotModules.Netcode 14 | { 15 | public class CPacketLobbyChatMessage : APacketClient // C = Client, A = abstract 16 | { 17 | public string Message { get; set; } 18 | 19 | public override void Write(PacketWriter writer) 20 | { 21 | writer.Write(Message); 22 | } 23 | 24 | public override void Read(PacketReader reader) 25 | { 26 | Message = reader.ReadString(); 27 | } 28 | 29 | // the packet handled server-side 30 | // only use GameServer.Log(...) for debugging 31 | public override void Handle(ENet.Peer peer) 32 | { 33 | GameServer.SendToAllPlayers(ServerPacketOpcode.LobbyChatMessage, new SPacketLobbyChatMessage { 34 | Id = peer.ID, 35 | Message = Message 36 | }); 37 | } 38 | } 39 | } 40 | ``` 41 | 42 | ```cs 43 | // Godot LineEdit node that accepts text input on enter 44 | private async void _on_Chat_Input_text_entered(string text) 45 | { 46 | ChatInput.Clear(); 47 | if (!string.IsNullOrWhiteSpace(text)) 48 | { 49 | // Since packets are being enqueued to a ConcurrentQueue they can be called from any thread 50 | // Make sure to define the LobbyChatMessage opcode for both the client and server in _Opcodes.cs 51 | await GameClient.Send(ClientPacketOpcode.LobbyChatMessage, new CPacketLobbyChatMessage { 52 | Message = text.Trim() 53 | }); 54 | } 55 | } 56 | ``` 57 | 58 | ```cs 59 | namespace GodotModules.Netcode 60 | { 61 | // only extend from APacketServerPeerId if you're telling other clients about 62 | // something that changed about a peer, otherwise extend from APacketServer 63 | public class SPacketLobbyChatMessage : APacketServerPeerId // S = Server 64 | { 65 | public string Message { get; set; } 66 | 67 | public override void Write(PacketWriter writer) 68 | { 69 | base.Write(writer); // write the peer id 70 | writer.Write((string)Message); 71 | } 72 | 73 | public override void Read(PacketReader reader) 74 | { 75 | base.Read(reader); // read the peer id 76 | Message = reader.ReadString(); 77 | } 78 | 79 | // the packet handled client-side 80 | // preferably use GodotModules.Utils.Log(...) for debugging 81 | public override void Handle() 82 | { 83 | // the message is logged to in-game chat 84 | SceneLobby.Log(Id, Message); 85 | } 86 | } 87 | } 88 | ``` 89 | 90 | Have a look at the other packets for more examples. 91 | 92 | Consider size of data types when sending them over the network https://condor.depaul.edu/sjost/nwdp/notes/cs1/CSDatatypes.htm (the smaller the better but keep it practical) 93 | -------------------------------------------------------------------------------- /.github/USEFUL_TIPS.md: -------------------------------------------------------------------------------- 1 | # Useful Tips 2 | 3 | ## Logging packet opcodes 4 | If you don't see the opcodes, these lines of code might be commented out. Feel free to un-comment them when debugging the netcode. 5 | 6 | > ⚠️ Lobby packets have 2 opcodes, the first is the 'Lobby' opcode and the next is the lobby opcode type, e.g. 'LobbyJoin'. Perhaps this information should be logged too. 7 | 8 | ### Server packets 9 | https://github.com/GodotModules/GodotModulesCSharp/blob/4e1f6b20c99256a5ac2164b463412f64d87f942d/Scripts/Netcode/Server/GameServer.cs#L101-L103 10 | 11 | ### Client Packets 12 | https://github.com/GodotModules/GodotModulesCSharp/blob/4e1f6b20c99256a5ac2164b463412f64d87f942d/Scripts/Msc/GodotCommands.cs#L25-L30 13 | -------------------------------------------------------------------------------- /.github/UTILITY_SCRIPTS.md: -------------------------------------------------------------------------------- 1 | ## Scripts 2 | ### Notifications 3 | ![image](https://user-images.githubusercontent.com/6277739/173916833-1e9caa62-62d5-4239-843e-7b28dfba5788.png) 4 | ![image](https://user-images.githubusercontent.com/6277739/173916937-bc433fc0-c1e0-44c5-8a88-0cd3896a3f06.png) 5 | 6 | ### Music Manager 7 | ```cs 8 | // Load and play music 9 | MusicManager.Load("menu theme", pathToMusic); 10 | MusicManager.Play("menu theme"); 11 | MusicManager.SetVolume(50) // value ranges from 0 to 100 12 | MusicManager.Pause(); 13 | MusicManager.Resume(); 14 | ``` 15 | 16 | ### File Manager 17 | ```cs 18 | // FileManager 19 | SystemFileManager.GetProjectPath(); // non-exported = "res://", exported = next to the game exe 20 | SystemFileManager.GetConfig(path); 21 | SystemFileManager.WriteConfig(path); 22 | SystemFileManager.WriteConfig(path, data); 23 | SystemFileManager.GetGameDataPath(); // gets AppData/Local/GameName/ path 24 | 25 | // non-exported release returns res:// and exported release returns path next to games exe 26 | GodotFileManager.GetProjectPath(); 27 | 28 | // all main scenes are put into res://Scenes/Scenes directory 29 | var loadedScenes = GodotFileManager.LoadDir("Scenes/Scenes", (dir, fileName) => 30 | { 31 | if (!dir.CurrentIsDir()) 32 | LoadScene(fileName.Replace(".tscn", "")); 33 | }); 34 | 35 | if (loadedScenes) 36 | ChangeScene("Menu"); 37 | ``` 38 | 39 | ### Scene Manager 40 | ```cs 41 | // All scenes are changed through the scene mananger, this allows for persistent nodes throughout scenes. 42 | // (for e.g. a debugger console that pops up when pressing F12) 43 | 44 | SceneManager.ChangeScene("Menu"); 45 | SceneManager.ChangeScene("Game"); 46 | 47 | // Change scene to menu scene when ESC is pressed 48 | SceneManager.EscapeToScene("Menu", () => { 49 | // optional code here 50 | }); 51 | ``` 52 | 53 | ### Game Manager 54 | ```cs 55 | // spawns a popup message in the center of the screen 56 | GameManager.SpawnPopupMessage(string message); 57 | 58 | // spawns a error message in the center of the screen 59 | GameManager.SpawnPopupError(Exception e); 60 | 61 | // Exit and do proper clean up 62 | GameManager.Exit(); 63 | ``` 64 | 65 | ![image](https://user-images.githubusercontent.com/6277739/164518782-328291c5-f96d-4ca1-b980-c01180ec6eb2.png) 66 | ![image](https://user-images.githubusercontent.com/6277739/164518875-4f769eb1-5c1e-44df-bf20-938b37843677.png) 67 | 68 | ### Utils 69 | ```cs 70 | // string extensions 71 | "helloWorld".AddSpaceBeforeEachCapitol(); // hello World 72 | 73 | "player_move_up".Replace("_", " ").ToTitleCase().SmallWordsToUpper(2, (word) => { 74 | var words = new string[] {"Up", "In"}; 75 | return !words.Contains(word); 76 | }); // Player Move UP 77 | 78 | // collection extensions 79 | var list = new List{1,2,3}; 80 | list.Print(); // 1, 2, 3 81 | 82 | var dict = new Dictionary{ {1,1}, {2,3} }; 83 | dict.Print(); // 1 1, 2 3 84 | 85 | // utils 86 | var someValue = 24f; 87 | someValue.Remap(0, 100, -40, 80); //remap someValue from range 0-100 to range -40-80 88 | 89 | Vector2 newPos = Utils.Lerp(playerPos, targetPos, 0.1f); 90 | 91 | Vector2 randomDir = Utils.RandomDir(); 92 | enemy.Position = randomDir * 10; 93 | 94 | myList.ForEach(x => x.DoSomething()); // functional programming with ForEach extension (do not abuse as hard to debug) 95 | 96 | // timers 97 | var gTimer = new GTimer(this, nameof(Method)); // wrapper for Godot timer 98 | var sTimer = new STimer(action); // wrapper for System timer 99 | sTimer.Dispose(); 100 | 101 | // filters for LineEdit nodes with realtime feedback 102 | inputName.Filter((text) => text.IsMatch("^[A-Za-z ]+$")); 103 | inputPort.FilterRange(ushort.MaxValue); 104 | 105 | // quick and dirty encryption 106 | var encryptedPassword = EncryptionHelper.Encrypt("epicPa55w0rd"); 107 | var password = EncryptionHelper.Decrypt(encryptedPassword); 108 | ``` 109 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Godot-specific ignores 3 | .import/ 4 | export.cfg 5 | export_presets.cfg 6 | 7 | # Mono-specific ignores 8 | .mono/ 9 | data_*/ 10 | 11 | # User-specific ignores -------------------------------------------------------------------------------- /.vs/GodotModulesCSharp/DesignTimeBuild/.dtbcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/.vs/GodotModulesCSharp/DesignTimeBuild/.dtbcache.v2 -------------------------------------------------------------------------------- /.vs/LuaModdingTest/DesignTimeBuild/.dtbcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/.vs/LuaModdingTest/DesignTimeBuild/.dtbcache.v2 -------------------------------------------------------------------------------- /.vs/LuaModdingTest/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/.vs/LuaModdingTest/v16/.suo -------------------------------------------------------------------------------- /.vs/LuaModdingTest/v17/.futdcache.v1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/.vs/LuaModdingTest/v17/.futdcache.v1 -------------------------------------------------------------------------------- /.vs/LuaModdingTest/v17/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/.vs/LuaModdingTest/v17/.suo -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "MoonSharp Attach", 9 | "type": "moonsharp-debug", 10 | "request": "attach", 11 | "debugServer": 41912 12 | }, 13 | { 14 | "name": "Play in Editor", 15 | "type": "godot-mono", 16 | "mode": "playInEditor", 17 | "request": "launch" 18 | }, 19 | { 20 | "name": "Launch", 21 | "type": "godot-mono", 22 | "request": "launch", 23 | "mode": "executable", 24 | "preLaunchTask": "build", 25 | "executable": "C:/Users/VALK-DESKTOP/Downloads/Godot_v3.4.2-stable_mono_win64/Godot_v3.4.2-stable_mono_win64.exe\r", 26 | "executableArguments": [ 27 | "--path", 28 | "${workspaceRoot}" 29 | ] 30 | }, 31 | { 32 | "name": "Launch (Select Scene)", 33 | "type": "godot-mono", 34 | "request": "launch", 35 | "mode": "executable", 36 | "preLaunchTask": "build", 37 | "executable": "C:/Users/VALK-DESKTOP/Downloads/Godot_v3.4.2-stable_mono_win64/Godot_v3.4.2-stable_mono_win64.exe\r", 38 | "executableArguments": [ 39 | "--path", 40 | "${workspaceRoot}", 41 | "${command:SelectLaunchScene}" 42 | ] 43 | }, 44 | { 45 | "name": "Attach", 46 | "type": "godot-mono", 47 | "request": "attach", 48 | "address": "localhost", 49 | "port": 23685 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "godot_tools.editor_path": "c:\\Users\\VALK-DESKTOP\\Downloads\\Godot_v3.4.4-stable_mono_win64\\Godot_v3.4.4-stable_mono_win64.exe" 3 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "C:/Users/VALK-DESKTOP/Downloads/Godot_v3.4.2-stable_mono_win64/Godot_v3.4.2-stable_mono_win64.exe\r", 7 | "type": "process", 8 | "args": [ 9 | "--build-solutions", 10 | "--path", 11 | "${workspaceRoot}", 12 | "--no-window", 13 | "-q" 14 | ], 15 | "problemMatcher": "$msCompile" 16 | }, 17 | { 18 | "label": "publish", 19 | "command": "dotnet", 20 | "type": "process", 21 | "args": [ 22 | "publish", 23 | "${workspaceFolder}/LuaModdingTest.csproj", 24 | "/property:GenerateFullPaths=true", 25 | "/consoleloggerparameters:NoSummary" 26 | ], 27 | "problemMatcher": "$msCompile" 28 | }, 29 | { 30 | "label": "watch", 31 | "command": "dotnet", 32 | "type": "process", 33 | "args": [ 34 | "watch", 35 | "run", 36 | "--project", 37 | "${workspaceFolder}/LuaModdingTest.csproj" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /Audio/Music/Unsolicited trailer music loop edit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Audio/Music/Unsolicited trailer music loop edit.wav -------------------------------------------------------------------------------- /Audio/Music/Unsolicited trailer music loop edit.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/Unsolicited trailer music loop edit.wav-81fc7b789d48d1882ef8c54893def45b.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Audio/Music/Unsolicited trailer music loop edit.wav" 10 | dest_files=[ "res://.import/Unsolicited trailer music loop edit.wav-81fc7b789d48d1882ef8c54893def45b.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=true 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Audio/Music/credit.txt: -------------------------------------------------------------------------------- 1 | https://opengameart.org/content/unsolicited-trailer-music 2 | 3 | License: CC0 4 | Author: Emma_MA -------------------------------------------------------------------------------- /ENet-CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/ENet-CSharp.dll -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-Black.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-Italic.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /Fonts/Roboto/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSharpGodotTools/GodotModulesCSharp-Old/a62cf76c467b8dc76b1ff861ded1a70b8494c7fb/Fonts/Roboto/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /GodotModules.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net472 4 | 10 5 | CLIENT; 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ENet-CSharp.dll 14 | 15 | 16 | -------------------------------------------------------------------------------- /GodotModules.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 2012 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotModules", "GodotModules.csproj", "{7CEDC3E5-9743-41D8-AB67-C911DBF2A548}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | ExportDebug|Any CPU = ExportDebug|Any CPU 9 | ExportRelease|Any CPU = ExportRelease|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {7CEDC3E5-9743-41D8-AB67-C911DBF2A548}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {7CEDC3E5-9743-41D8-AB67-C911DBF2A548}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {7CEDC3E5-9743-41D8-AB67-C911DBF2A548}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU 15 | {7CEDC3E5-9743-41D8-AB67-C911DBF2A548}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU 16 | {7CEDC3E5-9743-41D8-AB67-C911DBF2A548}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU 17 | {7CEDC3E5-9743-41D8-AB67-C911DBF2A548}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 valkyrienyanko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Scenes/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=14 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Main/GM.cs" type="Script" id=1] 4 | [ext_resource path="res://Scripts/Scenes/Main/MusicManager.cs" type="Script" id=2] 5 | [ext_resource path="res://Scripts/Scenes/Main/Debug.cs" type="Script" id=3] 6 | [ext_resource path="res://Scripts/Netcode/Common/Utils/NetworkManager.cs" type="Script" id=4] 7 | [ext_resource path="res://Scripts/Scenes/Main/SceneManager.cs" type="Script" id=5] 8 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=6] 9 | [ext_resource path="res://Scripts/Scenes/Main/Notifier.cs" type="Script" id=7] 10 | [ext_resource path="res://Scripts/Msc/UIGameConsole.cs" type="Script" id=8] 11 | [ext_resource path="res://Scenes/Prefabs/ServerSimulation.tscn" type="PackedScene" id=9] 12 | 13 | [sub_resource type="StyleBoxEmpty" id=1] 14 | 15 | [sub_resource type="StyleBoxEmpty" id=7] 16 | 17 | [sub_resource type="StyleBoxEmpty" id=6] 18 | 19 | [sub_resource type="StyleBoxFlat" id=8] 20 | bg_color = Color( 0, 0, 0, 0.784314 ) 21 | 22 | [node name="Main" type="Node"] 23 | 24 | [node name="GameManager" type="Node" parent="."] 25 | script = ExtResource( 1 ) 26 | NodePathGameConsole = NodePath("../CanvasLayer/Game Console") 27 | NodePathNotifier = NodePath("../Notifier") 28 | 29 | [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] 30 | volume_db = -10.0 31 | script = ExtResource( 2 ) 32 | 33 | [node name="Debug" type="Node" parent="."] 34 | script = ExtResource( 3 ) 35 | 36 | [node name="NetworkManager" type="Node" parent="."] 37 | script = ExtResource( 4 ) 38 | NodePathServerSimulation = NodePath("../CanvasLayer/Server Simulation/ViewportContainer/Viewport/Server Simulation") 39 | 40 | [node name="SceneManager" type="Node" parent="."] 41 | script = ExtResource( 5 ) 42 | 43 | [node name="Notifier" type="Node" parent="."] 44 | script = ExtResource( 7 ) 45 | 46 | [node name="CanvasLayer" type="CanvasLayer" parent="."] 47 | 48 | [node name="Server Simulation" type="Control" parent="CanvasLayer"] 49 | anchor_right = 1.0 50 | anchor_bottom = 1.0 51 | mouse_filter = 2 52 | 53 | [node name="ViewportContainer" type="ViewportContainer" parent="CanvasLayer/Server Simulation"] 54 | anchor_right = 1.0 55 | anchor_bottom = 1.0 56 | mouse_filter = 2 57 | stretch = true 58 | 59 | [node name="Viewport" type="Viewport" parent="CanvasLayer/Server Simulation/ViewportContainer"] 60 | size = Vector2( 1024, 600 ) 61 | transparent_bg = true 62 | handle_input_locally = false 63 | render_target_update_mode = 3 64 | gui_disable_input = true 65 | 66 | [node name="Server Simulation" parent="CanvasLayer/Server Simulation/ViewportContainer/Viewport" instance=ExtResource( 9 )] 67 | 68 | [node name="Camera2D" type="Camera2D" parent="CanvasLayer/Server Simulation/ViewportContainer/Viewport"] 69 | current = true 70 | 71 | [node name="Game Console" type="PanelContainer" parent="CanvasLayer"] 72 | visible = false 73 | anchor_right = 1.0 74 | anchor_bottom = 1.0 75 | theme = ExtResource( 6 ) 76 | custom_styles/panel = SubResource( 1 ) 77 | script = ExtResource( 8 ) 78 | NodePathLogs = NodePath("VBoxContainer/TextEdit") 79 | NodePathConsole = NodePath("VBoxContainer/Console") 80 | 81 | [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Game Console"] 82 | margin_right = 1024.0 83 | margin_bottom = 600.0 84 | 85 | [node name="TextEdit" type="TextEdit" parent="CanvasLayer/Game Console/VBoxContainer"] 86 | margin_right = 1024.0 87 | margin_bottom = 580.0 88 | size_flags_vertical = 3 89 | custom_styles/read_only = SubResource( 7 ) 90 | custom_styles/focus = SubResource( 6 ) 91 | custom_styles/normal = SubResource( 8 ) 92 | readonly = true 93 | syntax_highlighting = true 94 | show_line_numbers = true 95 | highlight_all_occurrences = true 96 | smooth_scrolling = true 97 | wrap_enabled = true 98 | 99 | [node name="Console" type="LineEdit" parent="CanvasLayer/Game Console/VBoxContainer"] 100 | margin_top = 584.0 101 | margin_right = 1024.0 102 | margin_bottom = 600.0 103 | 104 | [connection signal="text_entered" from="CanvasLayer/Game Console/VBoxContainer/Console" to="CanvasLayer/Game Console" method="_on_Console_text_entered"] 105 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Debugger.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=2] 2 | 3 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scripts/Msc/UIGameConsole.cs" type="Script" id=2] 5 | 6 | [sub_resource type="StyleBoxEmpty" id=1] 7 | 8 | [sub_resource type="StyleBoxEmpty" id=7] 9 | 10 | [sub_resource type="StyleBoxEmpty" id=6] 11 | 12 | [sub_resource type="StyleBoxFlat" id=8] 13 | bg_color = Color( 0, 0, 0, 0.784314 ) 14 | 15 | [node name="Debugger" type="PanelContainer"] 16 | anchor_right = 1.0 17 | anchor_bottom = 1.0 18 | theme = ExtResource( 1 ) 19 | custom_styles/panel = SubResource( 1 ) 20 | script = ExtResource( 2 ) 21 | 22 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 23 | margin_right = 1024.0 24 | margin_bottom = 600.0 25 | 26 | [node name="TextEdit" type="TextEdit" parent="VBoxContainer"] 27 | margin_right = 1024.0 28 | margin_bottom = 580.0 29 | size_flags_vertical = 3 30 | custom_styles/read_only = SubResource( 7 ) 31 | custom_styles/focus = SubResource( 6 ) 32 | custom_styles/normal = SubResource( 8 ) 33 | readonly = true 34 | syntax_highlighting = true 35 | show_line_numbers = true 36 | highlight_all_occurrences = true 37 | smooth_scrolling = true 38 | wrap_enabled = true 39 | 40 | [node name="Console" type="LineEdit" parent="VBoxContainer"] 41 | margin_top = 584.0 42 | margin_right = 1024.0 43 | margin_bottom = 600.0 44 | 45 | [connection signal="text_entered" from="VBoxContainer/Console" to="." method="_on_Console_text_entered"] 46 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Game/Bullet.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Sprites/Circle 32.png" type="Texture" id=1] 4 | 5 | [node name="Bullet" type="Sprite"] 6 | scale = Vector2( 0.2, 0.2 ) 7 | texture = ExtResource( 1 ) 8 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Game/ClientPlayer.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Game/ClientPlayer.cs" type="Script" id=1] 4 | [ext_resource path="res://Sprites/Circle 32 - Marked.png" type="Texture" id=2] 5 | [ext_resource path="res://Fonts/Roboto/Roboto-Bold.ttf" type="DynamicFontData" id=3] 6 | 7 | [sub_resource type="CircleShape2D" id=2] 8 | radius = 17.0 9 | 10 | [sub_resource type="CircleShape2D" id=3] 11 | radius = 18.0 12 | 13 | [sub_resource type="DynamicFont" id=1] 14 | font_data = ExtResource( 3 ) 15 | 16 | [node name="Player" type="KinematicBody2D"] 17 | script = ExtResource( 1 ) 18 | NodePathPlayerSprite = NodePath("Sprite") 19 | NodePathLabelUsername = NodePath("Username") 20 | NodePathLabelPosition = NodePath("Position") 21 | 22 | [node name="Collider" type="CollisionShape2D" parent="."] 23 | shape = SubResource( 2 ) 24 | 25 | [node name="Area2D" type="Area2D" parent="."] 26 | 27 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 28 | shape = SubResource( 3 ) 29 | 30 | [node name="Sprite" type="Sprite" parent="."] 31 | texture = ExtResource( 2 ) 32 | 33 | [node name="Camera2D" type="Camera2D" parent="Sprite"] 34 | current = true 35 | 36 | [node name="Username" type="Label" parent="."] 37 | anchor_left = 0.5 38 | anchor_right = 0.5 39 | margin_left = -100.0 40 | margin_top = -38.0 41 | margin_right = 100.0 42 | margin_bottom = -19.0 43 | grow_horizontal = 2 44 | rect_min_size = Vector2( 200, 0 ) 45 | custom_fonts/font = SubResource( 1 ) 46 | text = "Name" 47 | align = 1 48 | __meta__ = { 49 | "_edit_use_anchors_": false 50 | } 51 | 52 | [node name="Position" type="Label" parent="."] 53 | anchor_left = 0.5 54 | anchor_top = 1.0 55 | anchor_right = 0.5 56 | anchor_bottom = 1.0 57 | margin_left = -150.0 58 | margin_top = 23.0 59 | margin_right = 150.0 60 | margin_bottom = 37.0 61 | grow_horizontal = 2 62 | rect_min_size = Vector2( 300, 0 ) 63 | text = "x: 0, y: 0" 64 | align = 1 65 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Game/Enemy.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://Sprites/Enemy.png" type="Texture" id=1] 4 | [ext_resource path="res://Scripts/Scenes/Game/Enemy.cs" type="Script" id=2] 5 | 6 | [sub_resource type="CircleShape2D" id=1] 7 | radius = 16.0 8 | 9 | [sub_resource type="CircleShape2D" id=2] 10 | radius = 17.0 11 | 12 | [node name="Enemy" type="RigidBody2D"] 13 | gravity_scale = 0.0 14 | script = ExtResource( 2 ) 15 | NodePathSprite = NodePath("Sprite") 16 | 17 | [node name="Sprite" type="Sprite" parent="."] 18 | texture = ExtResource( 1 ) 19 | 20 | [node name="Collider" type="CollisionShape2D" parent="."] 21 | shape = SubResource( 1 ) 22 | 23 | [node name="Hit Zone" type="Area2D" parent="."] 24 | 25 | [node name="Area" type="CollisionShape2D" parent="Hit Zone"] 26 | shape = SubResource( 2 ) 27 | 28 | [connection signal="area_entered" from="Hit Zone" to="." method="_on_Hit_Zone_area_entered"] 29 | [connection signal="area_exited" from="Hit Zone" to="." method="_on_Hit_Zone_area_exited"] 30 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Game/OtherPlayer.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Game/OtherPlayer.cs" type="Script" id=1] 4 | [ext_resource path="res://Sprites/Circle 32 - Marked.png" type="Texture" id=2] 5 | [ext_resource path="res://Fonts/Roboto/Roboto-Bold.ttf" type="DynamicFontData" id=3] 6 | 7 | [sub_resource type="CircleShape2D" id=2] 8 | radius = 16.0 9 | 10 | [sub_resource type="CircleShape2D" id=3] 11 | radius = 18.0 12 | 13 | [sub_resource type="DynamicFont" id=1] 14 | font_data = ExtResource( 3 ) 15 | 16 | [node name="Other Player" type="KinematicBody2D"] 17 | position = Vector2( 475, 280 ) 18 | script = ExtResource( 1 ) 19 | NodePathPlayerSprite = NodePath("Sprite") 20 | NodePathLabelUsername = NodePath("Username") 21 | 22 | [node name="Collider" type="CollisionShape2D" parent="."] 23 | shape = SubResource( 2 ) 24 | 25 | [node name="Area2D" type="Area2D" parent="."] 26 | 27 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 28 | shape = SubResource( 3 ) 29 | 30 | [node name="Sprite" type="Sprite" parent="."] 31 | texture = ExtResource( 2 ) 32 | 33 | [node name="Username" type="Label" parent="."] 34 | anchor_left = 0.5 35 | anchor_right = 0.5 36 | margin_left = -100.0 37 | margin_top = -40.0 38 | margin_right = 100.0 39 | margin_bottom = -21.0 40 | grow_horizontal = 2 41 | rect_min_size = Vector2( 200, 0 ) 42 | custom_fonts/font = SubResource( 1 ) 43 | text = "ID: 0" 44 | align = 1 45 | __meta__ = { 46 | "_edit_use_anchors_": false 47 | } 48 | -------------------------------------------------------------------------------- /Scenes/Prefabs/LobbyListing.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Game Servers/UILobbyListing.cs" type="Script" id=1] 4 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=2] 5 | 6 | [node name="Lobby" type="PanelContainer"] 7 | anchor_right = 1.0 8 | margin_bottom = 20.0 9 | rect_min_size = Vector2( 0, 100 ) 10 | size_flags_vertical = 0 11 | theme = ExtResource( 2 ) 12 | script = ExtResource( 1 ) 13 | NodePathLabelTitle = NodePath("Padding/VBox Left/Name") 14 | NodePathLabelDescription = NodePath("Padding/VBox Left/Description") 15 | NodePathLabelPing = NodePath("Padding/VBox Right/Ping") 16 | NodePathLabelPlayerCount = NodePath("Padding/VBox Right/Players") 17 | NodePathButtonLobby = NodePath("Btn") 18 | 19 | [node name="Btn" type="Button" parent="."] 20 | margin_left = 1.0 21 | margin_top = 1.0 22 | margin_right = 1023.0 23 | margin_bottom = 99.0 24 | 25 | [node name="Padding" type="MarginContainer" parent="."] 26 | margin_left = 1.0 27 | margin_top = 1.0 28 | margin_right = 1023.0 29 | margin_bottom = 99.0 30 | mouse_filter = 2 31 | size_flags_horizontal = 3 32 | size_flags_vertical = 3 33 | custom_constants/margin_right = 15 34 | custom_constants/margin_top = 15 35 | custom_constants/margin_left = 15 36 | custom_constants/margin_bottom = 15 37 | __meta__ = { 38 | "_edit_use_anchors_": false 39 | } 40 | 41 | [node name="VBox Left" type="VBoxContainer" parent="Padding"] 42 | margin_left = 15.0 43 | margin_top = 15.0 44 | margin_right = 150.0 45 | margin_bottom = 53.0 46 | mouse_filter = 2 47 | size_flags_horizontal = 0 48 | size_flags_vertical = 0 49 | 50 | [node name="Name" type="Label" parent="Padding/VBox Left"] 51 | margin_right = 135.0 52 | margin_bottom = 17.0 53 | text = "My Lobby" 54 | 55 | [node name="Description" type="Label" parent="Padding/VBox Left"] 56 | margin_top = 21.0 57 | margin_right = 135.0 58 | margin_bottom = 38.0 59 | text = "Epic lobby description" 60 | 61 | [node name="VBox Right" type="VBoxContainer" parent="Padding"] 62 | margin_left = 969.0 63 | margin_top = 15.0 64 | margin_right = 1007.0 65 | margin_bottom = 53.0 66 | mouse_filter = 2 67 | size_flags_horizontal = 8 68 | size_flags_vertical = 0 69 | 70 | [node name="Ping" type="Label" parent="Padding/VBox Right"] 71 | margin_right = 38.0 72 | margin_bottom = 17.0 73 | text = "32 ms" 74 | align = 2 75 | 76 | [node name="Players" type="Label" parent="Padding/VBox Right"] 77 | margin_top = 21.0 78 | margin_right = 38.0 79 | margin_bottom = 38.0 80 | text = "1 / 4" 81 | align = 2 82 | 83 | [connection signal="focus_entered" from="Btn" to="." method="_on_Btn_focus_entered"] 84 | [connection signal="pressed" from="Btn" to="." method="_on_Btn_pressed"] 85 | -------------------------------------------------------------------------------- /Scenes/Prefabs/LobbyPlayerListing.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Lobby/UILobbyPlayerListing.cs" type="Script" id=1] 4 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=2] 5 | 6 | [node name="Player" type="PanelContainer"] 7 | margin_right = 398.0 8 | margin_bottom = 19.0 9 | theme = ExtResource( 2 ) 10 | script = ExtResource( 1 ) 11 | NodePathName = NodePath("HBox/Name") 12 | NodePathStatus = NodePath("HBox/HBoxContainer/Status") 13 | NodePathKick = NodePath("HBox/HBoxContainer/Kick") 14 | 15 | [node name="HBox" type="HBoxContainer" parent="."] 16 | margin_left = 1.0 17 | margin_top = 1.0 18 | margin_right = 397.0 19 | margin_bottom = 24.0 20 | rect_min_size = Vector2( 200, 0 ) 21 | 22 | [node name="Name" type="Label" parent="HBox"] 23 | margin_top = 3.0 24 | margin_right = 76.0 25 | margin_bottom = 20.0 26 | text = "PlayerName" 27 | 28 | [node name="HBoxContainer" type="HBoxContainer" parent="HBox"] 29 | margin_left = 295.0 30 | margin_right = 396.0 31 | margin_bottom = 23.0 32 | size_flags_horizontal = 10 33 | 34 | [node name="Kick" type="Button" parent="HBox/HBoxContainer"] 35 | margin_right = 32.0 36 | margin_bottom = 23.0 37 | text = "Kick" 38 | 39 | [node name="Status" type="Label" parent="HBox/HBoxContainer"] 40 | margin_left = 36.0 41 | margin_top = 3.0 42 | margin_right = 101.0 43 | margin_bottom = 20.0 44 | text = "Not Ready" 45 | 46 | [connection signal="pressed" from="HBox/HBoxContainer/Kick" to="." method="_on_Kick_pressed"] 47 | -------------------------------------------------------------------------------- /Scenes/Prefabs/ModInfo.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Menu/UIModInfo.cs" type="Script" id=1] 4 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=2] 5 | 6 | [node name="ModInfo" type="Control"] 7 | anchor_right = 1.0 8 | anchor_bottom = 1.0 9 | margin_right = -1024.0 10 | margin_bottom = -600.0 11 | rect_min_size = Vector2( 150, 35 ) 12 | theme = ExtResource( 2 ) 13 | script = ExtResource( 1 ) 14 | __meta__ = { 15 | "_edit_use_anchors_": false 16 | } 17 | NodePathBtnMod = NodePath("PanelContainer/MarginContainer/HBoxContainer/Mod") 18 | NodePathBtnModEnabled = NodePath("PanelContainer/MarginContainer/HBoxContainer/Enabled") 19 | 20 | [node name="PanelContainer" type="PanelContainer" parent="."] 21 | anchor_right = 1.0 22 | anchor_bottom = 1.0 23 | __meta__ = { 24 | "_edit_use_anchors_": false 25 | } 26 | 27 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] 28 | margin_left = 1.0 29 | margin_top = 1.0 30 | margin_right = 149.0 31 | margin_bottom = 34.0 32 | custom_constants/margin_right = 10 33 | custom_constants/margin_left = 10 34 | __meta__ = { 35 | "_edit_use_anchors_": false 36 | } 37 | 38 | [node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer"] 39 | margin_left = 10.0 40 | margin_right = 138.0 41 | margin_bottom = 33.0 42 | __meta__ = { 43 | "_edit_use_anchors_": false 44 | } 45 | 46 | [node name="Mod" type="Button" parent="PanelContainer/MarginContainer/HBoxContainer"] 47 | margin_right = 71.0 48 | margin_bottom = 33.0 49 | text = "ModName" 50 | flat = true 51 | 52 | [node name="Enabled" type="Button" parent="PanelContainer/MarginContainer/HBoxContainer"] 53 | margin_left = 105.0 54 | margin_right = 128.0 55 | margin_bottom = 33.0 56 | size_flags_horizontal = 10 57 | toggle_mode = true 58 | text = "[X]" 59 | flat = true 60 | 61 | [connection signal="pressed" from="PanelContainer/MarginContainer/HBoxContainer/Mod" to="." method="_on_Mod_pressed"] 62 | [connection signal="pressed" from="PanelContainer/MarginContainer/HBoxContainer/Enabled" to="." method="_on_Enabled_pressed"] 63 | -------------------------------------------------------------------------------- /Scenes/Prefabs/NotifyError.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=9 format=2] 2 | 3 | [ext_resource path="res://Fonts/Roboto/Roboto-Bold.ttf" type="DynamicFontData" id=1] 4 | [ext_resource path="res://Scripts/Msc/UINotifyError.cs" type="Script" id=3] 5 | 6 | [sub_resource type="StyleBoxEmpty" id=11] 7 | 8 | [sub_resource type="StyleBoxFlat" id=5] 9 | bg_color = Color( 1, 0, 0, 1 ) 10 | border_width_left = 3 11 | border_width_top = 3 12 | border_width_right = 3 13 | border_width_bottom = 3 14 | border_color = Color( 0.733333, 0, 0, 1 ) 15 | 16 | [sub_resource type="DynamicFont" id=2] 17 | use_filter = true 18 | font_data = ExtResource( 1 ) 19 | 20 | [sub_resource type="Animation" id=7] 21 | resource_name = "Appear" 22 | tracks/0/type = "value" 23 | tracks/0/path = NodePath(".:rect_position") 24 | tracks/0/interp = 1 25 | tracks/0/loop_wrap = true 26 | tracks/0/imported = false 27 | tracks/0/enabled = true 28 | tracks/0/keys = { 29 | "times": PoolRealArray( 0, 1 ), 30 | "transitions": PoolRealArray( 1, 1 ), 31 | "update": 0, 32 | "values": [ Vector2( 0, 25 ), Vector2( 0, 0 ) ] 33 | } 34 | 35 | [sub_resource type="Animation" id=10] 36 | resource_name = "Disappear" 37 | tracks/0/type = "value" 38 | tracks/0/path = NodePath(".:rect_position") 39 | tracks/0/interp = 1 40 | tracks/0/loop_wrap = true 41 | tracks/0/imported = false 42 | tracks/0/enabled = true 43 | tracks/0/keys = { 44 | "times": PoolRealArray( 0, 1 ), 45 | "transitions": PoolRealArray( 1, 1 ), 46 | "update": 0, 47 | "values": [ Vector2( 0, 0 ), Vector2( 0, 25 ) ] 48 | } 49 | 50 | [sub_resource type="Animation" id=8] 51 | length = 0.001 52 | tracks/0/type = "value" 53 | tracks/0/path = NodePath(".:rect_position") 54 | tracks/0/interp = 1 55 | tracks/0/loop_wrap = true 56 | tracks/0/imported = false 57 | tracks/0/enabled = true 58 | tracks/0/keys = { 59 | "times": PoolRealArray( 0 ), 60 | "transitions": PoolRealArray( 1 ), 61 | "update": 0, 62 | "values": [ Vector2( 0, 30 ) ] 63 | } 64 | tracks/1/type = "value" 65 | tracks/1/path = NodePath(".:margin_top") 66 | tracks/1/interp = 1 67 | tracks/1/loop_wrap = true 68 | tracks/1/imported = false 69 | tracks/1/enabled = true 70 | tracks/1/keys = { 71 | "times": PoolRealArray( 0 ), 72 | "transitions": PoolRealArray( 1 ), 73 | "update": 0, 74 | "values": [ 30.0 ] 75 | } 76 | tracks/2/type = "value" 77 | tracks/2/path = NodePath(".:margin_bottom") 78 | tracks/2/interp = 1 79 | tracks/2/loop_wrap = true 80 | tracks/2/imported = false 81 | tracks/2/enabled = true 82 | tracks/2/keys = { 83 | "times": PoolRealArray( 0 ), 84 | "transitions": PoolRealArray( 1 ), 85 | "update": 0, 86 | "values": [ 55.0 ] 87 | } 88 | 89 | [node name="NotifyError" type="PanelContainer"] 90 | anchor_left = 1.0 91 | anchor_top = 1.0 92 | anchor_right = 1.0 93 | anchor_bottom = 1.0 94 | margin_left = -80.0 95 | margin_top = -25.0 96 | margin_bottom = 25.0 97 | rect_min_size = Vector2( 80, 35 ) 98 | custom_styles/panel = SubResource( 11 ) 99 | script = ExtResource( 3 ) 100 | NodePathErrorCount = NodePath("Popup Error/Label") 101 | NodePathAnimationPlayer = NodePath("Popup Error/AnimationPlayer") 102 | 103 | [node name="Popup Error" type="PanelContainer" parent="."] 104 | margin_top = 30.0 105 | margin_right = 80.0 106 | margin_bottom = 55.0 107 | size_flags_vertical = 8 108 | custom_styles/panel = SubResource( 5 ) 109 | 110 | [node name="Label" type="Label" parent="Popup Error"] 111 | margin_left = 3.0 112 | margin_top = 3.0 113 | margin_right = 77.0 114 | margin_bottom = 22.0 115 | custom_fonts/font = SubResource( 2 ) 116 | text = "23" 117 | align = 1 118 | __meta__ = { 119 | "_edit_use_anchors_": false 120 | } 121 | 122 | [node name="AnimationPlayer" type="AnimationPlayer" parent="Popup Error"] 123 | playback_speed = 3.0 124 | anims/Appear = SubResource( 7 ) 125 | anims/Disappear = SubResource( 10 ) 126 | anims/RESET = SubResource( 8 ) 127 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Options.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Menu/UIOptions.cs" type="Script" id=1] 4 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=2] 5 | 6 | [node name="Options" type="TabContainer"] 7 | anchor_right = 1.0 8 | anchor_bottom = 1.0 9 | margin_right = -1767.0 10 | margin_bottom = -916.0 11 | rect_min_size = Vector2( 400, 0 ) 12 | size_flags_horizontal = 0 13 | size_flags_vertical = 0 14 | theme = ExtResource( 2 ) 15 | tab_align = 0 16 | script = ExtResource( 1 ) 17 | NodePathFullscreenOptions = NodePath("General/VBoxContainer/Fullscreen") 18 | NodePathResolutionOptions = NodePath("General/VBoxContainer/Resolution") 19 | NodePathSliderMusic = NodePath("General/VBoxContainer/Music") 20 | NodePathSliderSFX = NodePath("General/VBoxContainer/SFX") 21 | NodePathVSync = NodePath("General/VBoxContainer/VSync/VSync") 22 | NodePathInputOnlineUsername = NodePath("Multiplayer/VBoxContainer/Online Username/OnlineUsername") 23 | NodePathInputWebServerIp = NodePath("Multiplayer/VBoxContainer/Web Server/WebServerIp") 24 | 25 | [node name="General" type="MarginContainer" parent="."] 26 | visible = false 27 | anchor_right = 1.0 28 | anchor_bottom = 1.0 29 | margin_left = 4.0 30 | margin_top = 32.0 31 | margin_right = -4.0 32 | margin_bottom = -4.0 33 | custom_constants/margin_right = 15 34 | custom_constants/margin_top = 15 35 | custom_constants/margin_left = 15 36 | custom_constants/margin_bottom = 15 37 | 38 | [node name="VBoxContainer" type="VBoxContainer" parent="General"] 39 | margin_left = 15.0 40 | margin_top = 15.0 41 | margin_right = 377.0 42 | margin_bottom = 174.0 43 | 44 | [node name="Label1" type="Label" parent="General/VBoxContainer"] 45 | margin_right = 362.0 46 | margin_bottom = 17.0 47 | text = "Music" 48 | 49 | [node name="Music" type="HSlider" parent="General/VBoxContainer"] 50 | margin_top = 21.0 51 | margin_right = 362.0 52 | margin_bottom = 37.0 53 | min_value = -40.0 54 | max_value = 0.0 55 | 56 | [node name="Label2" type="Label" parent="General/VBoxContainer"] 57 | margin_top = 41.0 58 | margin_right = 362.0 59 | margin_bottom = 58.0 60 | text = "SFX" 61 | 62 | [node name="SFX" type="HSlider" parent="General/VBoxContainer"] 63 | margin_top = 62.0 64 | margin_right = 362.0 65 | margin_bottom = 78.0 66 | min_value = -40.0 67 | max_value = 0.0 68 | 69 | [node name="Resolution" type="OptionButton" parent="General/VBoxContainer"] 70 | margin_top = 82.0 71 | margin_right = 362.0 72 | margin_bottom = 105.0 73 | text = "Resolution" 74 | 75 | [node name="Fullscreen" type="OptionButton" parent="General/VBoxContainer"] 76 | margin_top = 109.0 77 | margin_right = 362.0 78 | margin_bottom = 132.0 79 | text = "Fullscreen Mode" 80 | 81 | [node name="VSync" type="HBoxContainer" parent="General/VBoxContainer"] 82 | margin_top = 136.0 83 | margin_right = 362.0 84 | margin_bottom = 159.0 85 | 86 | [node name="Label" type="Label" parent="General/VBoxContainer/VSync"] 87 | margin_top = 3.0 88 | margin_right = 39.0 89 | margin_bottom = 20.0 90 | text = "VSync" 91 | 92 | [node name="VSync" type="CheckBox" parent="General/VBoxContainer/VSync"] 93 | margin_left = 43.0 94 | margin_right = 65.0 95 | margin_bottom = 23.0 96 | 97 | [node name="Multiplayer" type="MarginContainer" parent="."] 98 | anchor_right = 1.0 99 | anchor_bottom = 1.0 100 | margin_top = 24.0 101 | custom_constants/margin_right = 15 102 | custom_constants/margin_top = 15 103 | custom_constants/margin_left = 15 104 | custom_constants/margin_bottom = 15 105 | 106 | [node name="VBoxContainer" type="VBoxContainer" parent="Multiplayer"] 107 | margin_left = 15.0 108 | margin_top = 15.0 109 | margin_right = 385.0 110 | margin_bottom = 53.0 111 | 112 | [node name="Online Username" type="HBoxContainer" parent="Multiplayer/VBoxContainer"] 113 | margin_right = 370.0 114 | margin_bottom = 17.0 115 | 116 | [node name="Label" type="Label" parent="Multiplayer/VBoxContainer/Online Username"] 117 | margin_right = 111.0 118 | margin_bottom = 17.0 119 | text = "Online Username: " 120 | 121 | [node name="OnlineUsername" type="LineEdit" parent="Multiplayer/VBoxContainer/Online Username"] 122 | margin_left = 170.0 123 | margin_right = 370.0 124 | margin_bottom = 17.0 125 | rect_min_size = Vector2( 200, 0 ) 126 | size_flags_horizontal = 10 127 | caret_blink = true 128 | caret_blink_speed = 0.5 129 | 130 | [node name="Web Server" type="HBoxContainer" parent="Multiplayer/VBoxContainer"] 131 | margin_top = 21.0 132 | margin_right = 370.0 133 | margin_bottom = 38.0 134 | 135 | [node name="Label" type="Label" parent="Multiplayer/VBoxContainer/Web Server"] 136 | margin_right = 72.0 137 | margin_bottom = 17.0 138 | text = "Web Server:" 139 | 140 | [node name="WebServerIp" type="LineEdit" parent="Multiplayer/VBoxContainer/Web Server"] 141 | margin_left = 170.0 142 | margin_right = 370.0 143 | margin_bottom = 17.0 144 | rect_min_size = Vector2( 200, 0 ) 145 | size_flags_horizontal = 10 146 | 147 | [connection signal="value_changed" from="General/VBoxContainer/Music" to="." method="_on_Music_value_changed"] 148 | [connection signal="value_changed" from="General/VBoxContainer/SFX" to="." method="_on_SFX_value_changed"] 149 | [connection signal="item_selected" from="General/VBoxContainer/Resolution" to="." method="_on_Resolution_item_selected"] 150 | [connection signal="item_selected" from="General/VBoxContainer/Fullscreen" to="." method="_on_Fullscreen_item_selected"] 151 | [connection signal="toggled" from="General/VBoxContainer/VSync/VSync" to="." method="_on_VSync_toggled"] 152 | [connection signal="text_changed" from="Multiplayer/VBoxContainer/Online Username/OnlineUsername" to="." method="_on_OnlineUsername_text_changed"] 153 | [connection signal="text_changed" from="Multiplayer/VBoxContainer/Web Server/WebServerIp" to="." method="_on_WebServerIp_text_changed"] 154 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Popups/PopupDirectConnect.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scripts/Msc/UIPopupDirectConnect.cs" type="Script" id=2] 5 | 6 | [node name="PopupDirectConnect" type="WindowDialog"] 7 | anchor_left = 0.5 8 | anchor_top = 0.5 9 | anchor_right = 0.5 10 | anchor_bottom = 0.5 11 | margin_left = -150.0 12 | margin_top = -75.0 13 | margin_right = 150.0 14 | margin_bottom = 21.0 15 | rect_min_size = Vector2( 0, 100 ) 16 | size_flags_horizontal = 0 17 | size_flags_vertical = 0 18 | theme = ExtResource( 1 ) 19 | window_title = "Direct Connect" 20 | script = ExtResource( 2 ) 21 | __meta__ = { 22 | "_edit_use_anchors_": false 23 | } 24 | NodePathIp = NodePath("PanelContainer/VBoxContainer/MarginContainer/Ip") 25 | 26 | [node name="PanelContainer" type="PanelContainer" parent="."] 27 | anchor_right = 1.0 28 | anchor_bottom = 1.0 29 | __meta__ = { 30 | "_edit_use_anchors_": false 31 | } 32 | 33 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 34 | margin_left = 1.0 35 | margin_top = 1.0 36 | margin_right = 299.0 37 | margin_bottom = 99.0 38 | 39 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 40 | margin_right = 298.0 41 | margin_bottom = 41.0 42 | custom_constants/margin_top = 25 43 | 44 | [node name="Ip" type="LineEdit" parent="PanelContainer/VBoxContainer/MarginContainer"] 45 | margin_left = 49.0 46 | margin_top = 25.0 47 | margin_right = 249.0 48 | margin_bottom = 41.0 49 | rect_min_size = Vector2( 200, 0 ) 50 | size_flags_horizontal = 4 51 | size_flags_vertical = 0 52 | text = "127.0.0.1:25565" 53 | placeholder_text = "Enter IP to connect to" 54 | 55 | [node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 56 | margin_top = 65.0 57 | margin_right = 298.0 58 | margin_bottom = 98.0 59 | size_flags_vertical = 10 60 | custom_constants/margin_bottom = 10 61 | 62 | [node name="Ok" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer2"] 63 | margin_left = 120.0 64 | margin_right = 178.0 65 | margin_bottom = 23.0 66 | size_flags_horizontal = 4 67 | size_flags_vertical = 10 68 | text = "Connect" 69 | 70 | [connection signal="popup_hide" from="." to="." method="_on_PopupDirectConnect_popup_hide"] 71 | [connection signal="text_changed" from="PanelContainer/VBoxContainer/MarginContainer/Ip" to="." method="_on_Ip_text_changed"] 72 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer2/Ok" to="." method="_on_Ok_pressed"] 73 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Popups/PopupError.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scripts/Msc/UIPopupError.cs" type="Script" id=2] 5 | 6 | [node name="PopupError" type="WindowDialog"] 7 | visible = true 8 | anchor_right = 1.0 9 | anchor_bottom = 1.0 10 | margin_right = -774.0 11 | margin_bottom = -450.0 12 | rect_min_size = Vector2( 350, 150 ) 13 | theme = ExtResource( 1 ) 14 | window_title = "Error" 15 | script = ExtResource( 2 ) 16 | __meta__ = { 17 | "_edit_use_anchors_": false 18 | } 19 | NodePathStackTrace = NodePath("PanelContainer/VBoxContainer/MarginContainer2/TextEdit") 20 | 21 | [node name="PanelContainer" type="PanelContainer" parent="."] 22 | anchor_right = 1.0 23 | anchor_bottom = 1.0 24 | __meta__ = { 25 | "_edit_use_anchors_": false 26 | } 27 | 28 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 29 | margin_left = 1.0 30 | margin_top = 1.0 31 | margin_right = 349.0 32 | margin_bottom = 149.0 33 | 34 | [node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 35 | margin_right = 348.0 36 | margin_bottom = 111.0 37 | size_flags_vertical = 3 38 | custom_constants/margin_right = 10 39 | custom_constants/margin_top = 10 40 | custom_constants/margin_left = 10 41 | custom_constants/margin_bottom = 5 42 | 43 | [node name="TextEdit" type="TextEdit" parent="PanelContainer/VBoxContainer/MarginContainer2"] 44 | margin_left = 10.0 45 | margin_top = 10.0 46 | margin_right = 338.0 47 | margin_bottom = 106.0 48 | size_flags_vertical = 3 49 | readonly = true 50 | syntax_highlighting = true 51 | show_line_numbers = true 52 | highlight_all_occurrences = true 53 | wrap_enabled = true 54 | 55 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 56 | margin_top = 115.0 57 | margin_right = 348.0 58 | margin_bottom = 148.0 59 | custom_constants/margin_bottom = 10 60 | 61 | [node name="Ok" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer"] 62 | margin_left = 162.0 63 | margin_right = 185.0 64 | margin_bottom = 23.0 65 | size_flags_horizontal = 4 66 | size_flags_vertical = 0 67 | text = "Ok" 68 | 69 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer/Ok" to="." method="_on_Ok_pressed"] 70 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Popups/PopupFileDialogMods.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Scripts/Msc/UIPopupFileDialogMods.cs" type="Script" id=1] 4 | 5 | [sub_resource type="Theme" id=1] 6 | 7 | [node name="PopupFileDialogMods" type="MarginContainer"] 8 | anchor_right = 1.0 9 | anchor_bottom = 1.0 10 | theme = SubResource( 1 ) 11 | custom_constants/margin_right = 30 12 | custom_constants/margin_top = 30 13 | custom_constants/margin_left = 30 14 | custom_constants/margin_bottom = 30 15 | script = ExtResource( 1 ) 16 | __meta__ = { 17 | "_edit_use_anchors_": false 18 | } 19 | NodePathFileManager = NodePath("FileDialog") 20 | 21 | [node name="FileDialog" type="FileDialog" parent="."] 22 | visible = true 23 | margin_left = 30.0 24 | margin_top = 30.0 25 | margin_right = 994.0 26 | margin_bottom = 570.0 27 | window_title = "Open a File or Directory" 28 | mode = 3 29 | access = 2 30 | current_dir = "/Users/VALK-DESKTOP/Documents/Godot Projects/GodotLuaModdingTest" 31 | current_path = "/Users/VALK-DESKTOP/Documents/Godot Projects/GodotLuaModdingTest/" 32 | __meta__ = { 33 | "_edit_use_anchors_": false 34 | } 35 | 36 | [connection signal="popup_hide" from="FileDialog" to="." method="_on_FileDialog_popup_hide"] 37 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Popups/PopupMessage.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scripts/Msc/UIPopupMessage.cs" type="Script" id=2] 5 | 6 | [node name="PopupMessage" type="WindowDialog"] 7 | visible = true 8 | anchor_right = 1.0 9 | anchor_bottom = 1.0 10 | margin_right = -976.0 11 | margin_bottom = -599.0 12 | rect_min_size = Vector2( 450, 150 ) 13 | theme = ExtResource( 1 ) 14 | script = ExtResource( 2 ) 15 | __meta__ = { 16 | "_edit_use_anchors_": false 17 | } 18 | NodePathMessage = NodePath("PanelContainer/VBoxContainer/CenterContainer/Message") 19 | 20 | [node name="PanelContainer" type="PanelContainer" parent="."] 21 | anchor_right = 1.0 22 | anchor_bottom = 1.0 23 | __meta__ = { 24 | "_edit_use_anchors_": false 25 | } 26 | 27 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 28 | margin_left = 1.0 29 | margin_top = 1.0 30 | margin_right = 449.0 31 | margin_bottom = 149.0 32 | 33 | [node name="CenterContainer" type="CenterContainer" parent="PanelContainer/VBoxContainer"] 34 | margin_right = 448.0 35 | margin_bottom = 111.0 36 | size_flags_vertical = 3 37 | 38 | [node name="Message" type="Label" parent="PanelContainer/VBoxContainer/CenterContainer"] 39 | margin_left = 196.0 40 | margin_top = 47.0 41 | margin_right = 252.0 42 | margin_bottom = 64.0 43 | text = "Message" 44 | 45 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 46 | margin_top = 115.0 47 | margin_right = 448.0 48 | margin_bottom = 148.0 49 | custom_constants/margin_bottom = 10 50 | 51 | [node name="Ok" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer"] 52 | margin_left = 212.0 53 | margin_right = 235.0 54 | margin_bottom = 23.0 55 | size_flags_horizontal = 4 56 | size_flags_vertical = 8 57 | text = "Ok" 58 | 59 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer/Ok" to="." method="_on_Ok_pressed"] 60 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Popups/PopupReportBug.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scripts/Msc/UIPopupReportBug.cs" type="Script" id=2] 5 | 6 | [node name="PopupReportBug" type="WindowDialog"] 7 | visible = true 8 | anchor_right = 1.0 9 | anchor_bottom = 1.0 10 | margin_right = -476.0 11 | margin_bottom = -255.0 12 | rect_min_size = Vector2( 550, 350 ) 13 | theme = ExtResource( 1 ) 14 | window_title = "Report Bug" 15 | script = ExtResource( 2 ) 16 | __meta__ = { 17 | "_edit_use_anchors_": false 18 | } 19 | 20 | [node name="PanelContainer" type="PanelContainer" parent="."] 21 | anchor_right = 1.0 22 | anchor_bottom = 1.0 23 | __meta__ = { 24 | "_edit_use_anchors_": false 25 | } 26 | 27 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 28 | margin_left = 1.0 29 | margin_top = 1.0 30 | margin_right = 549.0 31 | margin_bottom = 349.0 32 | 33 | [node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 34 | margin_right = 548.0 35 | margin_bottom = 301.0 36 | size_flags_vertical = 3 37 | custom_constants/margin_right = 25 38 | custom_constants/margin_top = 10 39 | custom_constants/margin_left = 25 40 | custom_constants/margin_bottom = 10 41 | 42 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/MarginContainer2"] 43 | margin_left = 25.0 44 | margin_top = 10.0 45 | margin_right = 523.0 46 | margin_bottom = 291.0 47 | 48 | [node name="Label" type="Label" parent="PanelContainer/VBoxContainer/MarginContainer2/VBoxContainer"] 49 | margin_right = 498.0 50 | margin_bottom = 17.0 51 | text = "Error" 52 | align = 1 53 | 54 | [node name="Error" type="TextEdit" parent="PanelContainer/VBoxContainer/MarginContainer2/VBoxContainer"] 55 | margin_top = 21.0 56 | margin_right = 498.0 57 | margin_bottom = 131.0 58 | size_flags_vertical = 3 59 | readonly = true 60 | syntax_highlighting = true 61 | show_line_numbers = true 62 | highlight_all_occurrences = true 63 | wrap_enabled = true 64 | 65 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/MarginContainer2/VBoxContainer"] 66 | margin_top = 135.0 67 | margin_right = 498.0 68 | margin_bottom = 167.0 69 | custom_constants/margin_top = 15 70 | 71 | [node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/MarginContainer2/VBoxContainer/MarginContainer"] 72 | margin_top = 15.0 73 | margin_right = 498.0 74 | margin_bottom = 32.0 75 | text = "Please give a description of what caused this bug" 76 | align = 1 77 | 78 | [node name="Description" type="TextEdit" parent="PanelContainer/VBoxContainer/MarginContainer2/VBoxContainer"] 79 | margin_top = 171.0 80 | margin_right = 498.0 81 | margin_bottom = 281.0 82 | size_flags_vertical = 3 83 | 84 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 85 | margin_top = 305.0 86 | margin_right = 548.0 87 | margin_bottom = 348.0 88 | custom_constants/margin_top = 10 89 | custom_constants/margin_bottom = 10 90 | 91 | [node name="Send" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer"] 92 | margin_left = 255.0 93 | margin_top = 10.0 94 | margin_right = 292.0 95 | margin_bottom = 33.0 96 | size_flags_horizontal = 4 97 | text = "Send" 98 | 99 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer/Send" to="." method="_on_Send_pressed"] 100 | -------------------------------------------------------------------------------- /Scenes/Prefabs/Popups/PopupSetupOnlineProfile.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Menu/UISetupOnlineProfile.cs" type="Script" id=1] 4 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=2] 5 | 6 | [node name="Control" type="AcceptDialog"] 7 | visible = true 8 | anchor_right = 1.0 9 | anchor_bottom = 1.0 10 | margin_right = -1720.0 11 | margin_bottom = -980.0 12 | rect_min_size = Vector2( 250, 100 ) 13 | size_flags_horizontal = 0 14 | size_flags_vertical = 0 15 | theme = ExtResource( 2 ) 16 | window_title = "Set Online Username" 17 | dialog_hide_on_ok = false 18 | script = ExtResource( 1 ) 19 | __meta__ = { 20 | "_edit_use_anchors_": false 21 | } 22 | NodePathInputUsername = NodePath("CenterContainer/VBoxContainer/Username") 23 | NodePathLabelFeedback = NodePath("CenterContainer/VBoxContainer/Feedback") 24 | 25 | [node name="CenterContainer" type="CenterContainer" parent="."] 26 | anchor_right = 1.0 27 | anchor_bottom = 1.0 28 | margin_left = 8.0 29 | margin_top = 8.0 30 | margin_right = -8.0 31 | margin_bottom = -39.0 32 | __meta__ = { 33 | "_edit_use_anchors_": false 34 | } 35 | 36 | [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] 37 | margin_left = 42.0 38 | margin_top = 8.0 39 | margin_right = 192.0 40 | margin_bottom = 45.0 41 | 42 | [node name="Username" type="LineEdit" parent="CenterContainer/VBoxContainer"] 43 | margin_right = 150.0 44 | margin_bottom = 16.0 45 | rect_min_size = Vector2( 150, 0 ) 46 | caret_blink = true 47 | caret_blink_speed = 0.5 48 | 49 | [node name="Feedback" type="Label" parent="CenterContainer/VBoxContainer"] 50 | margin_top = 20.0 51 | margin_right = 150.0 52 | margin_bottom = 37.0 53 | align = 1 54 | -------------------------------------------------------------------------------- /Scenes/Prefabs/ServerManager.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scripts/Scenes/Menu/UIServerManager.cs" type="Script" id=2] 5 | 6 | [node name="ServerManager" type="PanelContainer"] 7 | anchor_right = 1.0 8 | anchor_bottom = 1.0 9 | margin_right = -1839.0 10 | margin_bottom = -1055.0 11 | rect_min_size = Vector2( 350, 0 ) 12 | size_flags_horizontal = 0 13 | size_flags_vertical = 0 14 | theme = ExtResource( 1 ) 15 | script = ExtResource( 2 ) 16 | __meta__ = { 17 | "_edit_use_anchors_": false 18 | } 19 | NodePathIp = NodePath("HBoxContainer/VBoxContainer/IP") 20 | NodePathLogger = NodePath("HBoxContainer/VBoxContainer/Logger") 21 | 22 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 23 | margin_left = 1.0 24 | margin_top = 1.0 25 | margin_right = 349.0 26 | margin_bottom = 264.0 27 | 28 | [node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] 29 | margin_right = 244.0 30 | margin_bottom = 263.0 31 | size_flags_horizontal = 3 32 | 33 | [node name="Start" type="Button" parent="HBoxContainer/VBoxContainer"] 34 | margin_right = 244.0 35 | margin_bottom = 23.0 36 | text = "Start Server" 37 | 38 | [node name="Stop" type="Button" parent="HBoxContainer/VBoxContainer"] 39 | margin_top = 27.0 40 | margin_right = 244.0 41 | margin_bottom = 50.0 42 | text = "Stop Server" 43 | 44 | [node name="Restart" type="Button" parent="HBoxContainer/VBoxContainer"] 45 | margin_top = 54.0 46 | margin_right = 244.0 47 | margin_bottom = 77.0 48 | text = "Restart Server" 49 | 50 | [node name="Connect" type="Button" parent="HBoxContainer/VBoxContainer"] 51 | margin_top = 81.0 52 | margin_right = 244.0 53 | margin_bottom = 104.0 54 | text = "Connect" 55 | 56 | [node name="Disconnect" type="Button" parent="HBoxContainer/VBoxContainer"] 57 | margin_top = 108.0 58 | margin_right = 244.0 59 | margin_bottom = 131.0 60 | text = "Disconnect" 61 | 62 | [node name="IP" type="LineEdit" parent="HBoxContainer/VBoxContainer"] 63 | margin_top = 135.0 64 | margin_right = 244.0 65 | margin_bottom = 159.0 66 | text = "127.0.0.1" 67 | align = 1 68 | 69 | [node name="Logger" type="RichTextLabel" parent="HBoxContainer/VBoxContainer"] 70 | margin_top = 163.0 71 | margin_right = 244.0 72 | margin_bottom = 263.0 73 | rect_min_size = Vector2( 0, 100 ) 74 | scroll_following = true 75 | 76 | [node name="Usernames go here" type="VBoxContainer" parent="HBoxContainer"] 77 | margin_left = 248.0 78 | margin_right = 348.0 79 | margin_bottom = 263.0 80 | rect_min_size = Vector2( 100, 0 ) 81 | 82 | [connection signal="pressed" from="HBoxContainer/VBoxContainer/Start" to="." method="_on_Start_pressed"] 83 | [connection signal="pressed" from="HBoxContainer/VBoxContainer/Stop" to="." method="_on_Stop_pressed"] 84 | [connection signal="pressed" from="HBoxContainer/VBoxContainer/Restart" to="." method="_on_Restart_pressed"] 85 | [connection signal="pressed" from="HBoxContainer/VBoxContainer/Connect" to="." method="_on_Connect_pressed"] 86 | [connection signal="pressed" from="HBoxContainer/VBoxContainer/Disconnect" to="." method="_on_Disconnect_pressed"] 87 | -------------------------------------------------------------------------------- /Scenes/Prefabs/ServerSimulation.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Scripts/Netcode/Common/Server/ServerSimulation.cs" type="Script" id=1] 4 | 5 | [node name="Server Simulation" type="Node2D"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /Scenes/Scenes/Game.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Scripts/Scenes/Game/SceneGame.cs" type="Script" id=1] 4 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=2] 5 | 6 | [node name="Game" type="Node2D"] 7 | script = ExtResource( 1 ) 8 | NodePathLabelPlayerHealth = NodePath("CanvasLayer/PanelContainer/HBoxContainer/Label") 9 | 10 | [node name="ColorRect" type="ColorRect" parent="."] 11 | margin_left = -220.0 12 | margin_top = -220.0 13 | margin_right = -180.0 14 | margin_bottom = -180.0 15 | color = Color( 1, 0.458824, 0.988235, 1 ) 16 | 17 | [node name="ColorRect2" type="ColorRect" parent="."] 18 | margin_left = 220.0 19 | margin_top = -220.0 20 | margin_right = 260.0 21 | margin_bottom = -180.0 22 | color = Color( 1, 0.329412, 0.329412, 1 ) 23 | __meta__ = { 24 | "_edit_use_anchors_": false 25 | } 26 | 27 | [node name="ColorRect3" type="ColorRect" parent="."] 28 | margin_left = 220.0 29 | margin_top = 220.0 30 | margin_right = 260.0 31 | margin_bottom = 260.0 32 | color = Color( 0.298039, 0.309804, 1, 1 ) 33 | __meta__ = { 34 | "_edit_use_anchors_": false 35 | } 36 | 37 | [node name="ColorRect4" type="ColorRect" parent="."] 38 | margin_left = -220.0 39 | margin_top = 220.0 40 | margin_right = -180.0 41 | margin_bottom = 260.0 42 | color = Color( 0.313726, 1, 0.466667, 1 ) 43 | __meta__ = { 44 | "_edit_use_anchors_": false 45 | } 46 | 47 | [node name="ColorRect5" type="ColorRect" parent="."] 48 | margin_left = -20.0 49 | margin_top = -20.0 50 | margin_right = 20.0 51 | margin_bottom = 20.0 52 | color = Color( 1, 0.780392, 0.360784, 1 ) 53 | __meta__ = { 54 | "_edit_use_anchors_": false 55 | } 56 | 57 | [node name="CanvasLayer" type="CanvasLayer" parent="."] 58 | 59 | [node name="PanelContainer" type="PanelContainer" parent="CanvasLayer"] 60 | anchor_top = 1.0 61 | anchor_right = 1.0 62 | anchor_bottom = 1.0 63 | margin_top = -28.0 64 | theme = ExtResource( 2 ) 65 | 66 | [node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/PanelContainer"] 67 | margin_left = 1.0 68 | margin_top = 1.0 69 | margin_right = 1023.0 70 | margin_bottom = 27.0 71 | 72 | [node name="Label" type="Label" parent="CanvasLayer/PanelContainer/HBoxContainer"] 73 | margin_top = 4.0 74 | margin_right = 71.0 75 | margin_bottom = 21.0 76 | text = "Health: 100" 77 | -------------------------------------------------------------------------------- /Scenes/Scenes/GameServers.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scripts/Scenes/Game Servers/SceneGameServers.cs" type="Script" id=2] 5 | [ext_resource path="res://Scripts/Scenes/Game Servers/UIGameServersNavBtns.cs" type="Script" id=3] 6 | [ext_resource path="res://Scenes/Prefabs/Popups/PopupCreateLobby.tscn" type="PackedScene" id=4] 7 | [ext_resource path="res://Themes/PanelNoBorder.tres" type="Theme" id=5] 8 | 9 | [node name="Control" type="Control"] 10 | anchor_right = 1.0 11 | anchor_bottom = 1.0 12 | theme = ExtResource( 1 ) 13 | script = ExtResource( 2 ) 14 | NodePathServerList = NodePath("PanelContainer/VBoxContainer/MarginContainer/ScrollContainer/PanelContainer/Server List") 15 | NodePathServerCreationPopup = NodePath("PanelContainer/CreateLobby") 16 | 17 | [node name="PanelContainer" type="PanelContainer" parent="."] 18 | anchor_right = 1.0 19 | anchor_bottom = 1.0 20 | theme = ExtResource( 5 ) 21 | __meta__ = { 22 | "_edit_use_anchors_": false 23 | } 24 | 25 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 26 | margin_right = 1024.0 27 | margin_bottom = 600.0 28 | 29 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 30 | margin_right = 1024.0 31 | margin_bottom = 521.0 32 | size_flags_vertical = 3 33 | custom_constants/margin_right = 100 34 | custom_constants/margin_top = 100 35 | custom_constants/margin_left = 100 36 | custom_constants/margin_bottom = 100 37 | 38 | [node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/MarginContainer"] 39 | margin_left = 100.0 40 | margin_top = 100.0 41 | margin_right = 924.0 42 | margin_bottom = 421.0 43 | size_flags_vertical = 3 44 | follow_focus = true 45 | 46 | [node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/MarginContainer/ScrollContainer"] 47 | margin_right = 824.0 48 | margin_bottom = 321.0 49 | size_flags_horizontal = 3 50 | size_flags_vertical = 3 51 | 52 | [node name="Server List" type="VBoxContainer" parent="PanelContainer/VBoxContainer/MarginContainer/ScrollContainer/PanelContainer"] 53 | margin_right = 824.0 54 | margin_bottom = 321.0 55 | 56 | [node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 57 | margin_top = 525.0 58 | margin_right = 1024.0 59 | margin_bottom = 600.0 60 | custom_constants/margin_right = 20 61 | custom_constants/margin_top = 20 62 | custom_constants/margin_left = 20 63 | custom_constants/margin_bottom = 20 64 | 65 | [node name="Nav" type="HBoxContainer" parent="PanelContainer/VBoxContainer/MarginContainer2"] 66 | margin_left = 348.0 67 | margin_top = 20.0 68 | margin_right = 675.0 69 | margin_bottom = 55.0 70 | rect_min_size = Vector2( 0, 35 ) 71 | size_flags_horizontal = 4 72 | size_flags_vertical = 0 73 | script = ExtResource( 3 ) 74 | NodePathRefresh = NodePath("Refresh") 75 | 76 | [node name="Join Lobby" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer2/Nav"] 77 | margin_right = 75.0 78 | margin_bottom = 35.0 79 | focus_mode = 0 80 | text = "Join Lobby" 81 | 82 | [node name="Create Lobby" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer2/Nav"] 83 | margin_left = 79.0 84 | margin_right = 168.0 85 | margin_bottom = 35.0 86 | focus_mode = 0 87 | text = "Create Lobby" 88 | 89 | [node name="Direct Connect" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer2/Nav"] 90 | margin_left = 172.0 91 | margin_right = 269.0 92 | margin_bottom = 35.0 93 | text = "Direct Connect" 94 | 95 | [node name="Refresh" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer2/Nav"] 96 | margin_left = 273.0 97 | margin_right = 327.0 98 | margin_bottom = 35.0 99 | focus_mode = 0 100 | text = "Refresh" 101 | 102 | [node name="CreateLobby" parent="PanelContainer" instance=ExtResource( 4 )] 103 | margin_left = 237.0 104 | margin_top = 125.0 105 | margin_right = 787.0 106 | margin_bottom = 475.0 107 | 108 | [connection signal="resized" from="." to="." method="_on_Control_resized"] 109 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer2/Nav/Join Lobby" to="PanelContainer/VBoxContainer/MarginContainer2/Nav" method="_on_Join_Lobby_pressed"] 110 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer2/Nav/Create Lobby" to="PanelContainer/VBoxContainer/MarginContainer2/Nav" method="_on_Create_Lobby_pressed"] 111 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer2/Nav/Direct Connect" to="PanelContainer/VBoxContainer/MarginContainer2/Nav" method="_on_Direct_Connect_pressed"] 112 | [connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer2/Nav/Refresh" to="PanelContainer/VBoxContainer/MarginContainer2/Nav" method="_on_Refresh_pressed"] 113 | -------------------------------------------------------------------------------- /Scenes/Scenes/Menu.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=2] 2 | 3 | [ext_resource path="res://Themes/PanelNoBorder.tres" type="Theme" id=1] 4 | [ext_resource path="res://Scenes/Prefabs/ModLoader.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://Scenes/Prefabs/Options.tscn" type="PackedScene" id=3] 6 | [ext_resource path="res://Themes/Main.tres" type="Theme" id=4] 7 | [ext_resource path="res://Scripts/Scenes/Menu/SceneMenu.cs" type="Script" id=5] 8 | [ext_resource path="res://Scenes/Prefabs/Popups/PopupSetupOnlineProfile.tscn" type="PackedScene" id=6] 9 | 10 | [sub_resource type="StyleBoxFlat" id=1] 11 | bg_color = Color( 0, 0, 0, 1 ) 12 | 13 | [node name="Menu" type="Control"] 14 | anchor_right = 1.0 15 | anchor_bottom = 1.0 16 | theme = ExtResource( 4 ) 17 | script = ExtResource( 5 ) 18 | NodePathSetupOnlineUsernamePopup = NodePath("Set Online Username Popup") 19 | 20 | [node name="PanelContainer" type="PanelContainer" parent="."] 21 | anchor_right = 1.0 22 | anchor_bottom = 1.0 23 | theme = ExtResource( 1 ) 24 | custom_styles/panel = SubResource( 1 ) 25 | __meta__ = { 26 | "_edit_use_anchors_": false 27 | } 28 | 29 | [node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer"] 30 | margin_right = 1024.0 31 | margin_bottom = 600.0 32 | 33 | [node name="Grid" type="GridContainer" parent="PanelContainer/ScrollContainer"] 34 | margin_right = 1004.0 35 | margin_bottom = 500.0 36 | columns = 2 37 | 38 | [node name="ModLoader" parent="PanelContainer/ScrollContainer/Grid" instance=ExtResource( 2 )] 39 | anchor_right = 0.0 40 | anchor_bottom = 0.0 41 | margin_right = 600.0 42 | margin_bottom = 500.0 43 | rect_min_size = Vector2( 600, 500 ) 44 | 45 | [node name="Options" parent="PanelContainer/ScrollContainer/Grid" instance=ExtResource( 3 )] 46 | anchor_right = 0.0 47 | anchor_bottom = 0.0 48 | margin_left = 604.0 49 | margin_right = 1004.0 50 | margin_bottom = 213.0 51 | 52 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 53 | margin_left = 474.0 54 | margin_top = 261.0 55 | margin_right = 549.0 56 | margin_bottom = 338.0 57 | size_flags_horizontal = 4 58 | size_flags_vertical = 4 59 | 60 | [node name="Play" type="Button" parent="PanelContainer/VBoxContainer"] 61 | margin_right = 75.0 62 | margin_bottom = 23.0 63 | text = "Play" 64 | 65 | [node name="Multiplayer" type="Button" parent="PanelContainer/VBoxContainer"] 66 | margin_top = 27.0 67 | margin_right = 75.0 68 | margin_bottom = 50.0 69 | text = "Multiplayer" 70 | 71 | [node name="Exit" type="Button" parent="PanelContainer/VBoxContainer"] 72 | margin_top = 54.0 73 | margin_right = 75.0 74 | margin_bottom = 77.0 75 | text = "Exit" 76 | 77 | [node name="Set Online Username Popup" parent="." instance=ExtResource( 6 )] 78 | visible = false 79 | anchor_left = 0.5 80 | anchor_top = 0.5 81 | anchor_right = 0.5 82 | anchor_bottom = 0.5 83 | margin_left = -100.0 84 | margin_top = -50.0 85 | margin_right = 100.0 86 | margin_bottom = 50.0 87 | 88 | [connection signal="pressed" from="PanelContainer/VBoxContainer/Play" to="." method="_on_Play_pressed"] 89 | [connection signal="pressed" from="PanelContainer/VBoxContainer/Multiplayer" to="." method="_on_Multiplayer_pressed"] 90 | [connection signal="pressed" from="PanelContainer/VBoxContainer/Exit" to="." method="_on_Exit_pressed"] 91 | [connection signal="confirmed" from="Set Online Username Popup" to="." method="_on_Set_Online_Username_Popup_confirmed"] 92 | -------------------------------------------------------------------------------- /Scripts/Lua/Game.lua: -------------------------------------------------------------------------------- 1 | -- Player 2 | Player = {} 3 | 4 | -- Functions 5 | function OnGameInit() end 6 | function OnGameUpdate() end 7 | 8 | -- Callback 9 | function RegisterCallback(funcname, precallback, postcallback) 10 | --- fetch the original function 11 | local originalFunction = _G[funcname] 12 | --- wrap it 13 | _G[funcname] = function(self, ...) 14 | local arg = {...} 15 | 16 | --- call any prehook (this can change arguments but not return values) 17 | if precallback ~= nil then precallback(self, table.unpack(arg)) end 18 | --- call the original function save the result 19 | local result = originalFunction(self, table.unpack(arg)) 20 | --- call any post hook, this can return a new result 21 | if postcallback ~= nil then postcallback(self, table.unpack(arg)) end 22 | -- return result 23 | return result 24 | end 25 | end -------------------------------------------------------------------------------- /Scripts/Msc/Commands/Command.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace GodotModules 5 | { 6 | public abstract class Command 7 | { 8 | public static readonly List Instances = Assembly.GetExecutingAssembly() 9 | .GetTypes() 10 | .Where(x => typeof(Command).IsAssignableFrom(x) && !x.IsAbstract) 11 | .Select(Activator.CreateInstance).Cast() 12 | .ToList(); 13 | 14 | public string[] Aliases { get; set; } 15 | 16 | public bool IsMatch(string cmd) 17 | { 18 | var cmdMatchesAlias = false; 19 | if (Aliases != null) 20 | cmdMatchesAlias = Aliases.Contains(cmd); 21 | 22 | return cmdMatchesAlias || GetType().Name.Replace("Command", "").ToLower() == cmd; 23 | } 24 | 25 | public abstract void Run(string[] args); 26 | } 27 | } -------------------------------------------------------------------------------- /Scripts/Msc/Commands/CommandDebug.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GodotModules.Netcode.Client; 3 | using GodotModules.Netcode.Server; 4 | 5 | namespace GodotModules 6 | { 7 | public class CommandDebug : Command 8 | { 9 | public CommandDebug() => Aliases = new string[] { "x" }; 10 | public static float TEST_VALUE = 0.1f; 11 | 12 | public override void Run(string[] args) 13 | { 14 | // debug command 15 | // do debug stuff here 16 | if (args.Length == 0) 17 | return; 18 | 19 | if (args[0] == "a") 20 | if (NetworkManager.IsServerRunning()) 21 | GM.LogDebug(NetworkManager.GameServer.Players.Print()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Scripts/Msc/Commands/CommandExit.cs: -------------------------------------------------------------------------------- 1 | namespace GodotModules 2 | { 3 | public class CommandExit : Command 4 | { 5 | public CommandExit() => Aliases = new string[] { "stop" }; 6 | 7 | public override void Run(string[] args) 8 | { 9 | GM.Exit(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Scripts/Msc/Commands/CommandHelp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace GodotModules 5 | { 6 | public class CommandHelp : Command 7 | { 8 | private static readonly List CommandNames = Assembly.GetExecutingAssembly() 9 | .GetTypes() 10 | .Where(x => typeof(Command).IsAssignableFrom(x) && !x.IsAbstract) 11 | .Select(Activator.CreateInstance).Cast() 12 | .Select(x => x.GetType().Name.Replace("Command", "").ToLower()).ToList(); 13 | 14 | public override void Run(string[] args) => GM.Log($"Commands:\n{CommandNames.Print()}"); 15 | } 16 | } -------------------------------------------------------------------------------- /Scripts/Msc/UIGameConsole.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | using System; 3 | 4 | namespace GodotModules 5 | { 6 | // This is the in game console which appears on pressing F12 7 | public class UIGameConsole : PanelContainer 8 | { 9 | [Export] public readonly NodePath NodePathLogs; 10 | [Export] public readonly NodePath NodePathConsole; 11 | 12 | private TextEdit Logs { get; set; } 13 | 14 | private LineEdit Console { get; set; } // the console input 15 | 16 | public override void _Ready() 17 | { 18 | Logs = GetNode(NodePathLogs); 19 | Console = GetNode(NodePathConsole); 20 | } 21 | 22 | public void AddException(Exception e) => AddMessage($"{e.Message}\n{e.StackTrace}"); 23 | 24 | public void AddMessage(string message) 25 | { 26 | Logs.Text += $"{message}\n"; 27 | ScrollToBottom(); 28 | } 29 | 30 | public void ToggleVisibility() 31 | { 32 | Visible = !Visible; 33 | Console.GrabFocus(); 34 | ScrollToBottom(); 35 | } 36 | 37 | private void ScrollToBottom() => Logs.ScrollVertical = Mathf.Inf; 38 | 39 | private void _on_Console_text_entered(string text) 40 | { 41 | var inputArr = text.Trim().ToLower().Split(' '); 42 | var cmd = inputArr[0]; 43 | 44 | if (string.IsNullOrWhiteSpace(cmd)) 45 | return; 46 | 47 | var command = Command.Instances.FirstOrDefault(x => x.IsMatch(cmd)); 48 | 49 | if (command != null) 50 | command.Run(inputArr.Skip(1).ToArray()); 51 | else 52 | GM.Log($"The command '{cmd}' does not exist"); 53 | 54 | Console.Clear(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /Scripts/Msc/UINotifyError.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | public class UINotifyError : Control 4 | { 5 | [Export] public readonly NodePath NodePathErrorCount; 6 | [Export] public readonly NodePath NodePathAnimationPlayer; 7 | 8 | private Label ErrorCount { get; set; } 9 | private AnimationPlayer AnimationPlayer { get; set; } 10 | 11 | public int Count { get; set; } 12 | 13 | public override async void _Ready() 14 | { 15 | ErrorCount = GetNode