Ejemplo n.º 1
0
    bool CheckUnlockByPageSelect(PageSelect pageSelect)
    {
        //lz-2016.06.12 这几种的开启条件都可以写在这里检测
        switch (pageSelect)
        {
        case PageSelect.Page_Help:
            return(true);

        case PageSelect.Page_Scan:
            return(true);

        case PageSelect.Page_Rail:
            return(true);

        case PageSelect.Page_Diplomacy:
            //lz-2016.09.19 Adventure模式声望系统常开
            if (PeGameMgr.IsAdventure)
            {
                return(true);
            }
            else if (ReputationSystem.Instance != null && PeCreature.Instance.mainPlayer != null && PeGameMgr.IsStory)
            {
                return(ReputationSystem.Instance.GetActiveState((int)PeCreature.Instance.mainPlayer.GetAttribute(AttribType.DefaultPlayerID)));
            }
            return(false);

        case PageSelect.Page_Message:
            return(true);

        case PageSelect.Page_MonsterHandbook:
            //lz-2016.10.18 Adventure默认开启,Story检测开启
            if (PeGameMgr.IsAdventure || (PeGameMgr.IsStory && null != StroyManager.Instance && StroyManager.Instance.enableBook))
            {
                return(true);
            }
            else
            {
                return(false);
            }

        case PageSelect.Page_Radio:
            return(CheckOpenRadio());

        case PageSelect.Max:
            return(false);
        }
        return(false);
    }
Ejemplo n.º 2
0
        public ActionResult Index(PageSelect model)
        {
            //page._pages = LoadPages();

            /*
             * var selectedItem = page._pages.Find(p => p.Value == page._pageID.ToString());
             * if (selectedItem != null)
             * {
             *  selectedItem.Selected = true;
             *  ViewBag.Message = "Selezionato: " + selectedItem.Text;
             * }
             * return View(page);
             */
//            var pages = GetAllPages();
//            model._pages = GetSelectListItems(pages);
            if (ModelState.IsValid)
            {
                Session["PageSelect"] = model;
                return(RedirectToAction("Done"));
            }
            return(View("Index", model));
        }
Ejemplo n.º 3
0
 public override void OnPageSelected(int position)
 {
     base.OnPageSelected(position);
     PageSelect?.Invoke(this, position);
 }
Ejemplo n.º 4
0
 public void Show(PageSelect page)
 {
     base.Show();
     UpdateCksActiveState();
     ChangePage(page);
 }
Ejemplo n.º 5
0
    void ChangePage(PageSelect page)
    {
        if (!this.CheckUnlockByPageSelect(page))
        {
            return;
        }

        if (selectPage != null)
        {
            selectPage.Hide();
        }
        CurSelectPage = page;

        if (null != UIRecentDataMgr.Instance)
        {
            //lz-2016.12.20 存储玩家操作的是那个页面
            UIRecentDataMgr.Instance.SetIntValue(SELECTPAGEKEY, (int)page);
        }

        switch (page)
        {
        case PageSelect.Page_Help:
        {
            //			if (mUIScan.isShow)
            //				mUIScan.Hide();
            //			if (mUIRail.isShow)
            //				mUIRail.Hide();

            mUIHelp.Show();
            selectPage = mUIHelp;
            if (!mCkHelp.isChecked)
            {
                mCkHelp.isChecked = true;
            }
        } break;

        case PageSelect.Page_Scan:
        {
            //			if (mUIHelp.isShow)
            //				mUIHelp.Hide();
            //			if (mUIRail.isShow)
            //				mUIRail.Hide();
            mUIScan.Show();
            selectPage = mUIScan;
            if (!mCkScan.isChecked)
            {
                mCkScan.isChecked = true;
            }
        } break;

        case PageSelect.Page_Rail:
        {
            //			if (mUIHelp.isShow)
            //				mUIHelp.Hide();
            //			if (mUIScan.isShow)
            //				mUIScan.Hide();

            mUIRail.Show();
            selectPage = mUIRail;
            if (!mCkRail.isChecked)
            {
                mCkRail.isChecked = true;
            }
        } break;

        case PageSelect.Page_Diplomacy:
        {
            curDiplomacyWnd.Show();
            selectPage = curDiplomacyWnd;
            if (!mCkCamp.isChecked)
            {
                mCkCamp.isChecked = true;
            }
        } break;

        case PageSelect.Page_Message:
        {
            mUIMessage.Show();
            selectPage       = mUIMessage;
            mCkMsg.isChecked = true;
        }
        break;

        case PageSelect.Page_MonsterHandbook:
        {
            mUIMonsterHandbook.Show();
            selectPage      = mUIMonsterHandbook;
            mCkMh.isChecked = true;
        }
        break;

        case PageSelect.Page_Radio:
        {
            mUIRadioCtrl.Show();
            selectPage         = mUIRadioCtrl;
            mCkRadio.isChecked = true;
        }
        break;

        default:
            break;
        }
    }
Ejemplo n.º 6
0
    protected override void InitWindow()
    {
        base.InitWindow();
        InitRadioData();

        CurSelectPage = PageSelect.Page_Help;

        if (null != UIRecentDataMgr.Instance)
        {
            //lz-2016.12.20 恢复玩家操作的页面
            int selectIntPage = UIRecentDataMgr.Instance.GetIntValue(SELECTPAGEKEY, (int)PageSelect.Page_Help);
            if (selectIntPage > (int)PageSelect.Null && selectIntPage < (int)PageSelect.Max)
            {
                CurSelectPage = (PageSelect)selectIntPage;
                if (!CheckUnlockByPageSelect(CurSelectPage))
                {
                    //lz-2016.12.20 如果恢复的页面没有解锁,就设回帮助页面
                    CurSelectPage = PageSelect.Page_Help;
                }
            }
        }

        curDiplomacyWnd = (PeGameMgr.IsStory ? (UIBaseWidget)mUICamp : (UIBaseWidget)mUIAlliance);
        CancelAllCkStartsChecked();
        switch (CurSelectPage)
        {
        case PageSelect.Page_Help:
            mCkHelp.startsChecked = true;
            selectPage            = mUIHelp;
            break;

        case PageSelect.Page_Scan:
            mCkScan.startsChecked = true;
            selectPage            = mUIScan;
            break;

        case PageSelect.Page_Rail:
            mCkRail.startsChecked = true;
            selectPage            = mUIRail;
            break;

        case PageSelect.Page_Diplomacy:
            mCkCamp.startsChecked = true;
            selectPage            = mUICamp;
            break;

        case PageSelect.Page_Message:
            mCkMsg.startsChecked = true;
            selectPage           = mUIMessage;
            break;

        case PageSelect.Page_MonsterHandbook:
            mCkMh.startsChecked = true;
            selectPage          = mUIMonsterHandbook;
            break;

        case PageSelect.Page_Radio:
            mCkRadio.startsChecked = true;
            selectPage             = mUIRadioCtrl;
            break;

        default:
            break;
        }
        m_StartTime = Time.realtimeSinceStartup;
    }