It's dead for now
GUI framework for barotrauma C# and Lua modders
Should be much easier to use than vanilla barotrauma GUI
Looks as shrimple as that
CUIFrame frame = new CUIFrame()
{
Relative = new CUINullRect(w: 0.2f, h: 0.2f),
Anchor = CUIAnchor.Center,
};
frame["guh button"] = new CUIButton("Press me")
{
Anchor = CUIAnchor.Center,
AddOnMouseDown = (e) => CUI.Log("Guh"),
};
CUI.Main.Append(frame);Some documentation is here
Changelog is here
Currently luatrauma workshop dependency system is broken
When IFactory fixes it, using CUI will be as simple as subscribing to a mod
But here's hacky install steps if you want to try it now:
- Download main branch of this repository
- Copy
CSharp\Client\CrabUIfolder intoCSharp/Clientif it's a source code mod, and intoClientSourceif it's an assembly mod - Copy
Assetsfolder into your mod folder / Make MSBuild copy it into your mod folder (idk how, lol) , you can put it anywhere, rename it, whatever
- find mod folder
- Set
CUI.ModDir = "found Mod folder"; - Set
CUI.AssetsPath = "Path to assets folder with cui stuff which i told you to copy"; - Run
CUI.Initialize();
- Run
CUI.Dispose();
Check CSharp\Client\Mod.cs for example
I highly recommend you to set CUI.UseCursedPatches to false and then set CUI.HookIdentifier to some name and add AdditionalHooks.lua to Lua/Autorun to avoid curse
- Copy entire
CSharpfolder into your mod folder - Copy
Assetsfolder into your mod folder - Go to
CSharp\Client\Mod.csand change public static string PackageName = "CrabUI"; to the name of your mod as infilelist.xml - Modify
public static string AssetsPath => Path.Combine(ModDir, "Assets");if you changed the name or location ofAssetsfolder
