示例#1
0
        public AbstactPanelForm()
        {
            InitializeComponent();
            AbstractPanel panel = new AbstractPanel();

            propertyGrid1.SelectedObject = panel;
        }
示例#2
0
 /// <summary>
 /// 注册UI面板
 /// </summary>
 void RegisterUiPanels()
 {
     AbstractPanel.RegisterPanel <BattlePanel>(PanelName.battlePanel);
     AbstractPanel.RegisterPanel <PackagePanel>(PanelName.packagePanel);
     AbstractPanel.RegisterPanel <ShopPanel>(PanelName.shopPanel);
     AbstractPanel.RegisterPanel <LoadingPanel>(PanelName.loadingPanel);
 }
 protected override void OnEnd(AbstractPanel panelBefore, AbstractPanel newPanel)
 {
     newPanel.m_TransFrom.position = GlobalVar.GCanvasObj.transform.position;
     if (panelBefore != null && panelBefore.IsVisable())
     {
         panelBefore.Disable();
     }
 }
示例#4
0
 public override void OnBegin(AbstractPanel panelBefore, AbstractPanel newPanel)
 {
     if (panelBefore != null)
     {
         this.time *= 0.5f;
     }
     PanelFadeOut(panelBefore, this.time, () => PanelFadeIn(newPanel, this.time));
 }
示例#5
0
        public void OpenPanel(AbstractPanel panel)
        {
            if (m_CurrentPanel == null || panel.name != m_CurrentPanel?.name)
            {
                panel.OpenPanel();

                m_CurrentPanel?.ClosePanel();
                m_CurrentPanel = panel;
            }
        }
示例#6
0
 void RegisterUI()
 {
     AbstractPanel.RegisterPanel <StartPanel>(UIName.start);
     AbstractPanel.RegisterPanel <AfterP1Panel>(UIName.afterP1);
     AbstractPanel.RegisterPanel <AfterP2Pane2>(UIName.afterP2);
     AbstractPanel.RegisterPanel <Player1Panel>(UIName.Player1Win);
     AbstractPanel.RegisterPanel <Player2Panel>(UIName.Player2Win);
     AbstractPanel.RegisterPanel <Pause1Panel>(UIName.Player1pause);
     AbstractPanel.RegisterPanel <Pause2Panel>(UIName.Player2pause);
 }
示例#7
0
    // Use this for initialization
    void Start()
    {
        if (m_Panel == null)
        {
            m_Panel = gameObject.GetComponent <AbstractPanel>();
        }

        EventSystem.S.UnRegister(EngineEventID.OnPanelUpdate, OnPanelUpdate);

        time = DateTime.Now;
    }
示例#8
0
    private void Awake()
    {
        Game.Global.GlobalVar.InitGlovalVar();
        this.gameObject.AddComponent <MainLoop>();


        AbstractPanel.RegisterPanel <WelcomePanel>(UIName.WelComePanel);
        AbstractPanel.RegisterPanel <WordPanel>(UIName.WordPanel);
        AbstractPanel.RegisterPanel <AlarmClockPanel>(UIName.AlarmClock);
        AbstractPanel.RegisterPanel <BreakfastPanel>(UIName.BreakfastPanel);
    }
        public override void Initialize()
        {
            // Because of `Celeste.Tags.Initialize` of all things
            // We create a static CrystalStaticSpinner which needs to access Tags.TransitionUpdate
            // Which wouldn't be loaded in time for EverestModule.Load
            TimedTriggerSpikes.LoadDelayed();

            // Register CustomCassetteBlock types
            CustomCassetteBlock.Initialize();

            // We may hook methods in other mods, so this needs to be done after they're loaded
            AbstractPanel.LoadDelayed();
        }
        public override void Load()
        {
            Everest.Events.Level.OnLoadEntity += Level_OnLoadEntity;
            Everest.Events.CustomBirdTutorial.OnParseCommand += CustomBirdTutorial_OnParseCommand;

            RegisterOptionalDependencies();
            Everest.Events.Everest.OnRegisterModule += OnRegisterModule;

            DashStateRefill.Load();
            DreamTunnelDash.Load();
            SeekerDash.Load();

            DreamBlockDummy.Load();

            CustomDreamBlock.Load();
            // Individual Dream Blocks hooked in CustomDreamBlock.Load

            DreamDashCollider.Load();

            AbstractPanel.Load();
            // Panel-specific hooks loaded from AbstractPanel.Load

            ConnectedSwapBlockHooks.Hook();
            CustomCassetteBlock.Hook();

            AttachedWallBooster.Hook();
            MoveBlockRedirect.Load();
            MoveBlockRedirectable.Load();
            MoveSwapBlock.Load();

            AbstractInputController.Load();
            // Controller-specific hooks loaded from AbstractInputController.Load
            CassetteJumpFixController.Load();
            // TimedTriggerSpikes hooked in Initialize

            UnderwaterMusicController.Load();

            HeartGemShard.Load();
            CustomSummitGem.Load();

            CustomBooster.Load();

            DreamJellyfish.Load();
            DreamJellyfishRenderer.Load();

            ChainedKevin.Load();
        }
示例#11
0
        public static RectTransform FindTransformInPanel(string targetPanelName, string targetUINodePath)
        {
            UIData data = UIDataTable.Get(targetPanelName);

            if (data == null)
            {
                return(null);
            }
            //string panelName = string.Format("{0}(Clone)", targetPanelName);
            int uiId = UIMgr.S.FindTopPanel <IConvertible>();//UIMgr.S.uiRoot.panelRoot.Find(targetPanelName);

            if (uiId != data.uiID)
            {
                return(null);
            }

            AbstractPanel panel = UIMgr.S.FindPanel(data.uiID);

            if (panel == null)
            {
                return(null);
            }

            Transform targetPanel = panel.transform;

            if (targetPanel == null)
            {
                //Log.w("# FindTransformInPanel Not Find Panel:" + panelName);
                return(null);
            }

            if (string.IsNullOrEmpty(targetUINodePath))
            {
                return(targetPanel as RectTransform);
            }

            RectTransform result = targetPanel.Find(targetUINodePath) as RectTransform;

            if (result == null || !result.gameObject.activeSelf)
            {
                //Log.w(string.Format("# FindTransformInPanel Not Find Node:{0}/{1}", panelName, targetUINodePath));
                return(null);
            }

            return(result);
        }
        public override void Unload()
        {
            Everest.Events.Level.OnLoadEntity -= Level_OnLoadEntity;
            Everest.Events.CustomBirdTutorial.OnParseCommand -= CustomBirdTutorial_OnParseCommand;

            Everest.Events.Everest.OnRegisterModule -= OnRegisterModule;

            DashStateRefill.Unload();
            DreamTunnelDash.Unload();
            SeekerDash.Unload();

            DreamBlockDummy.Unload();

            CustomDreamBlock.Unload();
            // Individual Dream Blocks unhooked in CustomDreamBlock.Unload

            AbstractPanel.Unload();
            DreamDashCollider.Unload();

            ConnectedSwapBlockHooks.Unhook();
            CustomCassetteBlock.Unhook();

            AttachedWallBooster.Unhook();
            MoveBlockRedirect.Unload();
            MoveBlockRedirectable.Unload();
            MoveSwapBlock.Unload();
            AbstractInputController.Unload();
            CassetteJumpFixController.Unload();
            TimedTriggerSpikes.Unload();

            UnderwaterMusicController.Unload();

            HeartGemShard.Unload();
            CustomSummitGem.Unload();

            CustomBooster.Unload();

            DreamJellyfish.Unload();
            DreamJellyfishRenderer.Unload();

            ChainedKevin.Unload();
        }
示例#13
0
        public void PushPanel(AbstractPanel newPanel)
        {
            var panelBefore = PanelMgr.CurrentPanel as AbstractPanel;

            MainLoop.Instance.ExecuteLater(() =>
            {
                OnBegin(panelBefore, newPanel);
                if (onBegin != null)
                {
                    onBegin(panelBefore, newPanel);
                }
                MainLoop.Instance.ExecuteLater(() =>
                {
                    OnEnd(panelBefore, newPanel);
                    if (onEnd != null)
                    {
                        onEnd(panelBefore, newPanel);
                    }
                }, this.time);
            }, this.delay);
        }
示例#14
0
        private void PanelFadeOut(AbstractPanel panelBefore, float time, Action endCall)
        {
            CanvasGroup cg;

            if (panelBefore != null)
            {
                cg = panelBefore.m_TransFrom.GetComponent <CanvasGroup>();
                if (cg == null)
                {
                    cg = panelBefore.m_TransFrom.gameObject.AddComponent <CanvasGroup>();
                }
                MainLoop.Instance.UpdateForSeconds(() => { cg.alpha -= Time.deltaTime / time; }, time,
                                                   () =>
                {
                    cg.alpha = 1;
                    if (panelBefore.IsVisable())
                    {
                        panelBefore.Disable();
                    }
                    endCall();
                });
            }
        }
示例#15
0
        private void PanelFadeIn(AbstractPanel newPanel, float time)
        {
            Assert.IsTrue(newPanel != null);

            if (newPanel.IsVisable() == false)
            {
                newPanel.Enable();
            }

            CanvasGroup cg;

            cg = newPanel.m_TransFrom.GetComponent <CanvasGroup>();

            if (cg == null)
            {
                cg = newPanel.m_TransFrom.gameObject.AddComponent <CanvasGroup>();
            }
            cg.alpha = 0;
            MainLoop.Instance.UpdateForSeconds(() =>
            {
                if (!newPanel.IsVisable())
                {
                    return;
                }
                cg.alpha += Time.deltaTime / time;
            },
                                               time,
                                               () =>
            {
                if (!newPanel.IsVisable())
                {
                    return;
                }
                newPanel.m_TransFrom.position = GlobalVar.G_Canvas.transform.position;
            });
        }
示例#16
0
 public void OnClose()
 {
     m_CurrentPanel?.ClosePanel();
     m_CurrentPanel = null;
 }
示例#17
0
 public void OnBack()
 {
     m_CurrentPanel.Back();
     m_CurrentPanel = m_CurrentPanel.ParentPanel;
 }
 public static void RegisterUi(Type outType)
 {
     AbstractPanel.RegisterPanels(outType);
 }
示例#19
0
 public override void OnEnd(AbstractPanel panelbefore, AbstractPanel newPanel)
 {
 }
示例#20
0
        public static void ApplyAccessControlOnPage(Type type, AbstractPanel form, GridPanel g, Button addButton, Button saveButton)
        {
            #region old
            //RecordRequest userReq = new RecordRequest();
            //userReq.RecordID = _systemService.SessionHelper.GetCurrentUserId();
            //RecordResponse<UserInfo> userResp = _systemService.ChildGetRecord<UserInfo>(userReq);
            //if (userResp.result != null && userResp.result.isAdmin)
            //    return;
            //UserPropertiesPermissions req = new UserPropertiesPermissions();
            //req.ClassId = classId;
            //req.UserId = _systemService.SessionHelper.GetCurrentUserId();
            //ListResponse<UC> resp = _accessControlService.ChildGetAll<UC>(req);
            //if (!resp.Success)
            //{
            //    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
            //   Common.errorMessage(resp);
            //    return;
            //}
            //bool classLevel = false;
            //int level = 0;
            //if (resp.Items.Count == 0)
            //{
            //    classLevel = true;
            //    ClassPermissionRecordRequest classReq = new ClassPermissionRecordRequest();
            //    classReq.ClassId = classId;
            //    classReq.UserId = _systemService.SessionHelper.GetCurrentUserId();
            //    RecordResponse<ModuleClass> modClass = _accessControlService.ChildGetRecord<ModuleClass>(classReq);
            //    level = (modClass.result == null) ? 0 : modClass.result.accessLevel;

            //}



            //List<ClassPropertyDefinition> properites = new List<ClassPropertyDefinition>();
            //properites.ForEach(x => { var results = resp.Items.Where(d => d.propertyId == x.propertyId).ToList(); if (results.Count > 0) results[0].index = x.index; });
            //bool alldisabled = true;
            //Type t = _masterService.ClassLookup[classId];

            //t.GetProperties().ToList<PropertyInfo>().ForEach(x => { if (x.GetCustomAttribute<PropertyID>() != null) { var results = resp.Items.Where(d => d.propertyId == x.GetCustomAttribute<PropertyID>().ID).ToList(); if (results.Count > 0) results[0].index = x.Name; } });
            //foreach (var item in form.Items)
            //{
            //    if (item is Field)
            //    {

            //        if (!classLevel)
            //        {
            //            var results = resp.Items.Where(x => x.index == (item as Field).Name || x.index == (item as Field).DataIndex).ToList();

            //            if (results.Count > 0)
            //            {
            //                level = results[0].accessLevel;
            //            }
            //            else
            //                continue;
            //        }
            //        switch (level)
            //        {
            //            case 0:

            //                (item as Field).InputType = InputType.Password;
            //                (item as Field).ReadOnly = true; break;
            //            case 1:
            //                (item as Field).ReadOnly = true; break;
            //            case 2:
            //                alldisabled = false; break;
            //            default:
            //                break;

            //        }
            //    }
            //}
            //foreach (var item in g.ColumnModel.Columns)
            //{

            //    var results = resp.Items.Where(x => x.index == item.DataIndex).ToList();
            //    if (results.Count > 0 && results[0].accessLevel < 1)
            //        item.Renderer.Handler = "return '*****';";

            //}

            //if (alldisabled)
            //{
            //    g.ColumnModel.Columns[g.ColumnModel.Columns.Count - 1].Renderer.Handler = "return '';";
            //}
            #endregion
            //New
            //if ((bool)_systemService.SessionHelper.Get("IsAdmin"))
            //    return;
            //ClassPermissionRecordRequest classReq = new ClassPermissionRecordRequest();
            //try
            //{
            //    classReq.ClassId = type.GetCustomAttribute<ClassIdentifier>().ClassID;
            //}
            //catch
            //{
            //    return;
            //}

            //classReq.UserId = _systemService.SessionHelper.GetCurrentUserId();
            //RecordResponse<ModuleClass> modClass = _accessControlService.ChildGetRecord<ModuleClass>(classReq);
            //if (modClass == null || modClass.result == null)
            //{
            //    throw new AccessDeniedException();
            //}
            //else
            //{
            //    switch (modClass.result.accessLevel)
            //    {
            //        case 0: throw new AccessDeniedException();
            //        case 1:
            //            if (g != null)
            //                g.ColumnModel.Columns[g.ColumnModel.Columns.Count - 1].Renderer.Handler = g.ColumnModel.Columns[g.ColumnModel.Columns.Count - 1].Renderer.Handler.Replace("deleteRender()", "' ' ");
            //            if (addButton != null)
            //                addButton.Disabled = true;
            //            if (saveButton != null)
            //                saveButton.Disabled = true;
            //            if (form != null)
            //                foreach (var item in form.Items)
            //                {
            //                    item.Disabled = true;
            //                }
            //            break;
            //        case 2:
            //            if(g!=null)
            //                g.ColumnModel.Columns[g.ColumnModel.Columns.Count - 1].Renderer.Handler = g.ColumnModel.Columns[g.ColumnModel.Columns.Count - 1].Renderer.Handler.Replace("deleteRender()", "' ' ");
            //            break;
            //        default: break;
            //    }
            //}
            //if (modClass.result.accessLevel == 3)
            //    return;
            //List<UC> properites = new List<UC>();



            //type.GetProperties().ToList<PropertyInfo>().ForEach(x =>
            //{
            //    if (x.GetCustomAttribute<PropertyID>() != null)
            //    {
            //        properites.Add(new UC() { index = x.Name, propertyId = x.GetCustomAttribute<PropertyID>().ID ,accessLevel= modClass.result.accessLevel });
            //    }
            //});

            //UserPropertiesPermissions req = new UserPropertiesPermissions();
            //req.ClassId = type.GetCustomAttribute<ClassIdentifier>().ClassID;
            //req.UserId = _systemService.SessionHelper.GetCurrentUserId();
            //ListResponse<UC> resp = _accessControlService.ChildGetAll<UC>(req);
            //resp.Items.ForEach(x =>
            //{
            //    properites.ForEach(y =>
            //    {
            //        if (x.propertyId == y.propertyId)
            //            y.accessLevel = x.accessLevel;

            //    });
            //});
            //int level = 2;
            //if (form != null)
            //{
            //    foreach (var item in form.Items)
            //    {
            //        if (item is Field)
            //        {

            //            var results = properites.Where(x => x.index == (item as Field).Name || x.index == (item as Field).DataIndex).ToList();

            //            if (results.Count > 0)
            //            {
            //                level = results[0].accessLevel;
            //            }
            //            else
            //                continue;

            //            switch (level)
            //            {
            //                case 0:

            //                    (item as Field).InputType = InputType.Password;
            //                    (item as Field).ReadOnly = true; break;
            //                case 1:
            //                    (item as Field).ReadOnly = true; break;
            //                case 2:
            //                    break;
            //                default:
            //                    break;

            //            }
            //        }
            //        else if (item is RadioGroup)
            //        {
            //            var results = properites.Where(x => x.index == (item as RadioGroup).GroupName).ToList();

            //            if (results.Count > 0)
            //            {
            //                level = results[0].accessLevel;
            //            }

            //            switch (level)
            //            {
            //                case 0:
            //                    item.LazyItems.ForEach(x => (x as Radio).Disabled = true);
            //                    break;
            //                case 1:
            //                    item.LazyItems.ForEach(x => (x as Radio).ReadOnly = true);
            //                    break;
            //                default: break;
            //            }

            //        }

            //    }
            //}
            //if (g != null)
            //{
            //    foreach (var item in g.ColumnModel.Columns)
            //    {

            //        var results = properites.Where(x => x.index == item.DataIndex).ToList();
            //        if (results.Count > 0 && results[0].accessLevel < 1)
            //            item.Renderer.Handler = "return '*****';";

            //    }
            //}
        }
        protected override void OnBegin(AbstractPanel panelBefore, AbstractPanel newPanel)
        {
            var speedX = Screen.width / this.time;
            var speedY = Screen.height / this.time;

            newPanel.Enable();

            switch (type)
            {
            case TransionType.PageDown:
                newPanel.m_TransFrom.position = GlobalVar.GCanvasButton;
                MainLoop.Instance.UpdateForSeconds(
                    () =>
                {
                    if (panelBefore != null)
                    {
                        panelBefore.m_TransFrom.Translate(Vector3.up * speedY * Time.deltaTime, Space.World);
                    }
                    newPanel.m_TransFrom.Translate(Vector3.up * speedY * Time.deltaTime, Space.World);
                },
                    this.time);
                break;

            case TransionType.PageRight:
                newPanel.m_TransFrom.position = GlobalVar.GCanvasRight;
                MainLoop.Instance.UpdateForSeconds(
                    () =>
                {
                    if (panelBefore != null)
                    {
                        panelBefore.m_TransFrom.Translate(Vector3.left * speedX * Time.deltaTime, Space.World);
                    }
                    newPanel.m_TransFrom.Translate(Vector3.left * speedX * Time.deltaTime, Space.World);
                },
                    this.time);
                break;

            case TransionType.PageUp:
                newPanel.m_TransFrom.position = GlobalVar.GCanvasTop;
                MainLoop.Instance.UpdateForSeconds(
                    () =>
                {
                    if (panelBefore != null)
                    {
                        panelBefore.m_TransFrom.Translate(Vector3.down * speedY * Time.deltaTime, Space.World);
                    }
                    newPanel.m_TransFrom.Translate(Vector3.down * speedY * Time.deltaTime, Space.World);
                },
                    this.time);
                break;

            case TransionType.PageLeft:
                newPanel.m_TransFrom.position = GlobalVar.GCanvasLeft;
                MainLoop.Instance.UpdateForSeconds(
                    () =>
                {
                    if (panelBefore != null)
                    {
                        panelBefore.m_TransFrom.Translate(Vector3.right * speedX * Time.deltaTime, Space.World);
                    }
                    newPanel.m_TransFrom.Translate(Vector3.right * speedX * Time.deltaTime, Space.World);
                },
                    this.time);
                break;
            }
        }
示例#22
0
 protected abstract void OnEnd(AbstractPanel panelBefore, AbstractPanel newPanel);
示例#23
0
 public abstract void OnBegin(AbstractPanel panelBefore, AbstractPanel newPanel);
示例#24
0
        public static AbstractContext GetDefaultContext()
        {
            AbstractContext context = new AbstractContext();

            context.InstanceName      = "AbstractUI.DefaultUI.Context";
            context.Left              = new ComponentMeasurement(0, ComponentMeasurementUnit.Percentage);
            context.Top               = new ComponentMeasurement(0, ComponentMeasurementUnit.Percentage);
            context.Height            = new ComponentMeasurement(100, ComponentMeasurementUnit.Percentage);
            context.Width             = new ComponentMeasurement(100, ComponentMeasurementUnit.Percentage);
            context.PositioningMethod = ComponentPositioning.Absolute;

            #region Top panel components

            AbstractPanel panelTop = new AbstractPanel();
            panelTop.InstanceName    = "AbstractUI.DefaultUI.TopPanel";
            panelTop.Left            = new ComponentMeasurement(0, ComponentMeasurementUnit.Pixel);
            panelTop.Top             = new ComponentMeasurement(0, ComponentMeasurementUnit.Pixel);
            panelTop.Height          = new ComponentMeasurement(10, ComponentMeasurementUnit.Percentage);
            panelTop.Width           = new ComponentMeasurement(100, ComponentMeasurementUnit.Percentage);
            panelTop.ParentComponent = context;
            context.Controls.Add(panelTop);

            #endregion

            #region Left panel components

            AbstractPanel panelLeft = new AbstractPanel();
            panelLeft.InstanceName    = "AbstractUI.DefaultUI.LeftPanel";
            panelLeft.Left            = new ComponentMeasurement(0, ComponentMeasurementUnit.Pixel);
            panelLeft.Top             = new ComponentMeasurement(10, ComponentMeasurementUnit.Percentage);
            panelLeft.Height          = new ComponentMeasurement(90, ComponentMeasurementUnit.Percentage);
            panelLeft.Width           = new ComponentMeasurement(25, ComponentMeasurementUnit.Percentage);
            panelLeft.ParentComponent = context;
            context.Controls.Add(panelLeft);

            AbstractTreeView navigationTree = new AbstractTreeView();
            navigationTree.InstanceName    = "AbstractUI.DefaultUI.NafigationTree";         //;)
            navigationTree.Left            = new ComponentMeasurement(0, ComponentMeasurementUnit.Percentage);
            navigationTree.Top             = new ComponentMeasurement(0, ComponentMeasurementUnit.Percentage);
            navigationTree.Height          = new ComponentMeasurement(100, ComponentMeasurementUnit.Percentage);
            navigationTree.Width           = new ComponentMeasurement(100, ComponentMeasurementUnit.Percentage);
            navigationTree.ParentComponent = panelLeft;
            panelLeft.Controls.Add(navigationTree);

            #endregion

            #region Content panel components

            AbstractPanel panelContent = new AbstractPanel();
            panelContent.InstanceName    = "AbstractUI.DefaultUI.ContentPanel";
            panelContent.Left            = new ComponentMeasurement(25, ComponentMeasurementUnit.Percentage);
            panelContent.Top             = new ComponentMeasurement(10, ComponentMeasurementUnit.Percentage);
            panelContent.Height          = new ComponentMeasurement(90, ComponentMeasurementUnit.Percentage);
            panelContent.Width           = new ComponentMeasurement(75, ComponentMeasurementUnit.Percentage);
            panelContent.ParentComponent = context;
            context.Controls.Add(panelContent);

            #endregion

            //this is very-very important
            #region Providers

            StaticContentTreeNodeProvider staticContentProvider = new StaticContentTreeNodeProvider();
            staticContentProvider.InstanceName    = "AbstractUI.DefaultUI.NavigationTree.StaticContent";
            staticContentProvider.ParentComponent = context;
            navigationTree.NavigationListeners.Add(staticContentProvider);

            #endregion

            return(context);
        }
示例#25
0
 protected abstract void OnBegin(AbstractPanel panelBefore, AbstractPanel newPanel);
示例#26
0
 public abstract void OnEnd(AbstractPanel panelbefore, AbstractPanel newPanel);
示例#27
0
 public static void RegisterUi(Type rigisterType)
 {
     AbstractPanel.RegisterPanels(rigisterType);
 }