2using System.Collections.Generic;
4using System.Reflection;
5using System.Diagnostics;
6using System.Runtime.CompilerServices;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Input;
12using Microsoft.Xna.Framework.Graphics;
20 public partial class CUITest
22 public static string ModDir => Mod.ModDir;
23 public static string PNGAssetsPath => Path.Combine(ModDir,
@"Assets2\Png");
24 public static string DataPath = Path.Combine(ModDir,
@"CSharp\Client\CUI Test\Data");
25 public static string IgnoredDataPath = Path.Combine(DataPath,
@"Ignore");
29 public static AutomaticTestRunner automaticTestRunner;
30 public static FakeModRunner fakeModRunner;
32 public static void CreateTestChamber()
37 BackgroundSprite =
new CUISprite(Path.Combine(PNGAssetsPath,
"TestChamber.png")),
38 Border =
new CUIBorder(Color.Transparent, 0),
42 {
"BackgroundColor",
"200,200,200"},
44 AKA =
"test chamber background",
48 public static void ClearTestChamber()
50 TestChamber.RemoveAllChildren();
53 public static void OpenTestChamber() =>
CUI.
Main.
Append(TestChamber);
54 public static void CloseTestChamber() =>
CUI.
Main.RemoveChild(TestChamber);
56 public static void Autorun()
58 automaticTestRunner.GUI.Opened =
true;
69 public static void Initialize()
71 CUI.PGNAssets = PNGAssetsPath;
73 automaticTestRunner =
new AutomaticTestRunner();
74 fakeModRunner =
new FakeModRunner();
79 public static void Dispose()
82 automaticTestRunner =
null;
87 public static string WrapInColor(
object o,
string cl)
89 return $
"‖color:{cl}‖{o}‖end‖";
92 public static void Log(
object msg, Color? cl =
null)
95 LuaCsLogger.LogMessage($
"{msg ?? "null"}", cl * 0.8f, cl);
Base class for all components.
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
CUIRect Real
Calculated prop, position on real screen in pixels Should be fully calculated after CUIMainComponent....
In fact a static class managing static things.
static CUIMainComponent Main
Orchestrates Drawing and updates, there could be only one CUI.Main is located under vanilla GUI.
It's a debug tool, you can use it with cuimg command, it's very fps comsuming.
Wrapper Containing link to texture and drawing settings, like SourceRedt, DrawMode,...
In Fact just an observable dict.
Defining Boundaries, not the same as rect containing min/max x, y, z.