Add quick interactions locally

This commit is contained in:
2025-03-31 04:02:39 +02:00
parent 5bb7a207f2
commit b7d4531ec8
134 changed files with 15494 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Barotrauma;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
namespace QICrabUI
{
/// <summary>
/// Container for other components
/// Can have only 1 child
/// Sets component as it's only child when you open it (as a page)
/// </summary>
public class CUIPages : CUIComponent
{
public CUIComponent OpenedPage;
public bool IsOpened(CUIComponent p) => OpenedPage == p;
/// <summary>
/// Adds page as its only child
/// </summary>
/// <param name="page"></param>
public void Open(CUIComponent page)
{
RemoveAllChildren();
Append(page);
page.Relative = new CUINullRect(0, 0, 1, 1);
OpenedPage = page;
}
public CUIPages() : base()
{
BackgroundColor = Color.Transparent;
Border.Color = Color.Transparent;
CullChildren = false;
}
}
}