CrabUI
Loading...
Searching...
No Matches
State.cs
1// using System;
2// using System.Reflection;
3// using System.Runtime.CompilerServices;
4// using System.Collections.Generic;
5// using System.Collections.Immutable;
6// using System.Linq;
7
8// using Barotrauma;
9// using HarmonyLib;
10// using Microsoft.Xna.Framework;
11// using Microsoft.Xna.Framework.Graphics;
12
13// using CrabUI;
14
15// namespace CrabUITest
16// {
17// public partial class PropTest : FillMethods
18// {
19
20// public static void State(CUIComponent Main)
21// {
22// CUIFrame frame = new CUIFrame(0.4f, 0.2f, 0.2f, 0.2f);
23
24// frame["grid"] = new CUIGrid()
25// {
26// Relative = new CUINullRect(0, 0, 1, 1),
27// GridTemplateColumns = "50% 50%",
28// GridTemplateRows = "10% 10% 10% 70%",
29// };
30
31// frame["grid"]["save"] = new CUIButton("save")
32// {
33// AddOnClick = (e) => frame.SaveStateAs("123"),
34// GridCell = new Point(0, 0),
35// };
36
37// frame["grid"]["load"] = new CUIButton("load")
38// {
39// AddOnClick = (e) => frame.LoadState("123"),
40// GridCell = new Point(1, 0),
41// };
42
43// frame["grid"]["color"] = new CUIButton("change color")
44// {
45// AddOnClick = (e) => frame.BackgroundColor = CUIExtensions.RandomColor(),
46// GridCell = new Point(0, 1),
47// };
48
49// frame["grid"]["colpalette blueor"] = new CUIButton("palette blue")
50// {
51// AddOnClick = (e) => CUIPalette = CUIPalette.DarkBlue,
52// GridCell = new Point(0, 2),
53// };
54
55// frame["grid"]["palette red"] = new CUIButton("palette red")
56// {
57// AddOnClick = (e) => CUIPalette = CUIPalette.DarkRed,
58// GridCell = new Point(1, 2),
59// };
60
61// Main.Append(frame);
62// }
63
64
65// }
66// }