Beispiel #1
0
        public GUIPanel(string name, int layer) : base(name, layer)
        {
            System.Type  type       = GetType();
            MethodInfo[] allMethods = type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            foreach (MethodInfo method in allMethods)
            {
                object[] attributes = method.GetCustomAttributes(false);
                if (attributes.Length == 0)
                {
                    continue;
                }

                foreach (object obj in attributes)
                {
                    if (obj is GUIPageAttribute page)
                    {
                        Dictionary <int, MethodInfo> dict = null;
                        if (page.MethodType == GUIPageType.DrawMethod)
                        {
                            dict = allPages;
                        }
                        else if (page.MethodType == GUIPageType.DisableMethod)
                        {
                            dict = allDisableMethods;
                        }
                        else if (page.MethodType == GUIPageType.EnableMethod)
                        {
                            dict = allEnableMethods;
                        }
                        dict.Add(page.Page, method);
                        break;
                    }
                }
            }
            animator = new Animation.CenterAnimation(this, Helper.GetScreenMiddle(Style.WindowWidth, Style.WindowHeight));
        }
Beispiel #2
0
 public DebugPanel() : base(nameof(DebugPanel), 369)
 {
     animator = new Animation.CenterAnimation(this, Helper.GetScreenMiddle(Style.WindowWidth, Style.WindowHeight));
     messages = new List <LogMessage>();
     Application.RegisterLogCallback(Log);
 }
Beispiel #3
0
 public override void OnUpdateScaling()
 {
     animator = new Animation.CenterAnimation(this, Helper.GetScreenMiddle(Style.WindowWidth, Style.WindowHeight));
 }
Beispiel #4
0
 public PausePanel() : base(nameof(PausePanel), 20)
 {
     animator = new Animation.CenterAnimation(this, Helper.GetScreenMiddle(Width, Height), 200f, 400f);
 }
Beispiel #5
0
 public SkinsPanel() : base(nameof(SkinsPanel), -1)
 {
     animator = new Animation.CenterAnimation(this, Helper.GetScreenMiddle(Style.WindowWidth, Style.WindowHeight));
 }