CrabUI
Loading...
Searching...
No Matches
Calculated.cs
1using System;
2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
6using System.Linq;
7
8using Barotrauma;
9using HarmonyLib;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Graphics;
12using System.IO;
13
14using CrabUI;
15
16namespace CrabUITest
17{
18 /// <summary>
19 /// Testing Serialization
20 /// </summary>
21 public partial class SerializationTest : FillMethods
22 {
23 [HideFromAutoTestRunner]
24 public static void Calculated(CUIComponent Main)
25 {
26 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.TopLeft });
27 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.TopCenter });
28 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.TopRight });
29 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.CenterLeft });
30 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.Center });
31 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.CenterRight });
32 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.BottomLeft });
33 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.BottomCenter });
34 Main.Append(new CUIFrame(null, null, 0.2f, 0.2f) { Anchor = CUIAnchor.BottomRight });
35
36 Main.MainComponent.Step();
37
38 string savePath = Path.Combine(CUITest.IgnoredDataPath, "123.xml");
39 Main.SaveToFile(savePath, CUIAttribute.Calculated);
40 }
41
42
43 }
44}
Base class for all components.
CUIMainComponent MainComponent
Link to CUIMainComponent, passed to children.
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
Draggable and resizable container for other components.
Definition CUIFrame.cs:16
void Step()
Forses 1 layout update step, even when Frozen.