Beispiel #1
0
        /// <summary>
        /// 如果拥有楼层传送器,开启选项窗口并默认选中一项
        /// </summary>
        /// <param name="data">选项索引</param>
        public override void Open(object data)
        {
            //如果有其他窗口,禁止开启
            if (MotaWorld.GetInstance().ExistSolo)
            {
                return;
            }

            int index = MotaWorld.GetInstance().MapManager.CurFloorIndex;

            if (data != null)
            {
                //拆箱转换
                index = (int)data;
            }

            if (MotaWorld.GetInstance().MapManager.CurHero.Pack.ExistProperty(PropName.楼层传送器))
            {
                //添加选项
                this.RemoveAllOptions();
                int sumFloor = MotaWorld.GetInstance().MapManager.Tower.MaxFloor;
                for (int i = 0; i < sumFloor; i++)
                {
                    //如果楼层抵达过,则为有效选项,否则为无效选项
                    FloorOption o = new FloorOption(MotaWorld.GetInstance().MapManager.Tower[i].FloorName, MotaWorld.GetInstance().MapManager.FloorReached[i], i);
                    AddOption(o);
                }

                //默认选中当前楼层
                base.Open(index);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 如果拥有楼层传送器,开启选项窗口并默认选中一项
        /// </summary>
        /// <param name="data">选项索引</param>
        public override void Open(object data)
        {
            //如果有其他窗口,禁止开启
            if (MotaWorld.GetInstance().ExistSolo)
            {
                return;
            }

            int index = MotaWorld.GetInstance().MapManager.CurFloorIndex;
            if (data != null)
            {
                //拆箱转换
                index = (int)data;
            }
            
            if (MotaWorld.GetInstance().MapManager.CurHero.Pack.ExistProperty(PropName.楼层传送器))
            {
                //添加选项
                this.RemoveAllOptions();
                int sumFloor = MotaWorld.GetInstance().MapManager.Tower.MaxFloor;
                for (int i = 0; i < sumFloor; i++)
                {
                    //如果楼层抵达过,则为有效选项,否则为无效选项
                    FloorOption o = new FloorOption(MotaWorld.GetInstance().MapManager.Tower[i].FloorName, MotaWorld.GetInstance().MapManager.FloorReached[i], i);
                    AddOption(o);
                }
            
                //默认选中当前楼层
                base.Open(index);
            }
        }