//	public delegate void TriggerEvent(GameObject go);
//	public TriggerEvent onEnterTrigger;


    void OnTriggerEnter(Collider target)
    {
        if ((Pathea.PeGameMgr.IsSingleAdventure && Pathea.PeGameMgr.yirdName == Pathea.AdventureScene.MainAdventure.ToString()) ||
            Pathea.PeGameMgr.IsMultiAdventure)
        {
            Debug.Log("enter dungen");
            if (null == target.GetComponentInParent <Pathea.MainPlayerCmpt>())
            {
                return;
            }
            if (isShow == true)
            {
                return;
            }
//
            isShow = true;
            if (level >= DungeonConstants.TASK_LEVEL_START)
            {
                ob = MessageBox_N.ShowYNBox(PELocalization.GetString(DungenMessage.TASK_ENTER_DUNGEN), SceneTranslate, SetFalse);
            }
            else
            {
                ob = MessageBox_N.ShowYNBox(CSUtils.GetNoFormatString(PELocalization.GetString(DungenMessage.ENTER_DUNGEN), level.ToString()), SceneTranslate, SetFalse);
            }
        }
    }
Exemplo n.º 2
0
 public void TryStartProcessing(object sender, int index)
 {
     if (!IsRunning)
     {
         return;
     }
     if (PeGameMgr.IsMulti)
     {
         _ColonyObj._Network.RPCServer(EPacketType.PT_CL_PRC_Start, index);
     }
     else
     {
         if (mTaskTable[index] == null)
         {
             return;
         }
         int errorCode;
         if (mTaskTable[index].CanStart(out errorCode))
         {
             StartProcessing(index);
         }
         else
         {
             if (errorCode > 0)
             {
                 CSUI_MainWndCtrl.ShowStatusBar(PELocalization.GetString(errorCode));
                 CSUI_MainWndCtrl.Instance.GoToPersonnelWorkWnd();
             }
         }
         UpdateSelectedTask();
     }
 }
Exemplo n.º 3
0
    void Init()
    {
        //lz-2016.06.28 悬浮在gamemenu按钮上提示快捷键
        mBtnCollider.gameObject.AddComponent <ShowToolTipItem_N>().mTipContent = PELocalization.GetString(2000060) + "[4169e1][~][-]";
        //str = new PeInput.KeyJoySettingPair(PeInput.SettingsAll[0][(int)PeInput.ESettingsGeneral.GameMenu])._key.ToStr();

        mInfoList.Clear();
        if (Pathea.PeGameMgr.IsMulti)
        {
            mInfoList.Add(new MenuItemInfo(NewUIText.mMenuOnline.GetString(), MenuItemFlag.Flag_Online, MenuItemFlag.Flag_Null, IcoStr_OnLine));

            if (!Pathea.PeGameMgr.IsSurvive)
            {
                //mInfoList.Add(new MenuItemInfo(NewUIText.mMenuStorage.GetString(),MenuItemFlag.Flag_Storage,MenuItemFlag.Flag_Online,IcoStr_Storage));
            }
            mInfoList.Add(new MenuItemInfo(NewUIText.mMenuAdmin.GetString(), MenuItemFlag.Flag_Admin, MenuItemFlag.Flag_Online, IcoStr_Admin));
            mInfoList.Add(new MenuItemInfo(NewUIText.mMenuWorkshop.GetString(), MenuItemFlag.Flag_Workshop, MenuItemFlag.Flag_Online, IcoStr_Workshop));
            mInfoList.Add(new MenuItemInfo(NewUIText.mMenuInformation.GetString(), MenuItemFlag.Flag_Infomation, MenuItemFlag.Flag_Online, IcoStr_Infomation));
            //lz-2016.11.10 取消商店菜单显示
            //mInfoList.Add(new MenuItemInfo(NewUIText.mMenuMall.GetString(), MenuItemFlag.Flag_Mall, MenuItemFlag.Flag_Online, IcoStr_Mall));
            mInfoList.Add(new MenuItemInfo(NewUIText.mMenuFriend.GetString(), MenuItemFlag.Flag_Friend, MenuItemFlag.Flag_Online, IcoStr_Friend, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.FriendsMenu));
        }

        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuFollower.GetString(), MenuItemFlag.Flag_Follower, MenuItemFlag.Flag_Null, IcoStr_Follower, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.FollowersMenu));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuCharacter.GetString(), MenuItemFlag.Flag_Character, MenuItemFlag.Flag_Null, IcoStr_Character, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.CharacterStats));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuMission.GetString(), MenuItemFlag.Flag_Mission, MenuItemFlag.Flag_Null, IcoStr_Mission, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.Mission));

        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuPhone.GetString(), MenuItemFlag.Flag_Phone, MenuItemFlag.Flag_Null, IcoStr_Phone, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.HandheldPC));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuHelp.GetString(), MenuItemFlag.Flag_Help, MenuItemFlag.Flag_Phone, IcoStr_Help));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuScan.GetString(), MenuItemFlag.Flag_Scan, MenuItemFlag.Flag_Phone, IcoStr_Scan));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuMonoRail.GetString(), MenuItemFlag.Flag_MonoRail, MenuItemFlag.Flag_Phone, IcoStr_MonoRail));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuDiplomacy.GetString(), MenuItemFlag.Flag_Diplomacy, MenuItemFlag.Flag_Phone, IcoStr_Diplomacy));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuMessage.GetString(), MenuItemFlag.Flag_Message, MenuItemFlag.Flag_Phone, IcoStr_Message));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuSpeciesWiki.GetString(), MenuItemFlag.Flag_SpeciesWiki, MenuItemFlag.Flag_Phone, IcoStr_SpiciesWiki));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuRadio.GetString(), MenuItemFlag.Flag_Radio, MenuItemFlag.Flag_Phone, IcoStr_Radio));

        //lz-2016.08.03 教程, Custom 模式禁止打开基地UI
        if (!Pathea.PeGameMgr.IsTutorial && !Pathea.PeGameMgr.IsCustom && !Pathea.PeGameMgr.IsMultiCustom)
        {
            mInfoList.Add(new MenuItemInfo(NewUIText.mMenuColony.GetString(), MenuItemFlag.Flag_Colony, MenuItemFlag.Flag_Null, IcoStr_Colony, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.ColonyMenu));
        }
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuReplicator.GetString(), MenuItemFlag.Flag_Replicatror, MenuItemFlag.Flag_Null, IcoStr_Replicatror, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.ReplicationMenu));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuCreation.GetString(), MenuItemFlag.Flag_Creation, MenuItemFlag.Flag_Null, IcoStr_Creation, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.CreationSystem));

        if (Pathea.PeGameMgr.IsAdventure)
        {
            if (RandomMapConfig.useSkillTree)
            {
                mInfoList.Add(new MenuItemInfo(NewUIText.mMenuSkill.GetString(), MenuItemFlag.Flag_Skill, MenuItemFlag.Flag_Null, IcoStr_Skill, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.SkillMenu));
            }
        }

        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuInventory.GetString(), MenuItemFlag.Flag_Inventory, MenuItemFlag.Flag_Null, IcoStr_Inventory, UIOption.KeyCategory.Common, (int)PeInput.ESettingsGeneral.Inventory));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuBuild.GetString(), MenuItemFlag.Flag_Build, MenuItemFlag.Flag_Null, IcoStr_Build, UIOption.KeyCategory.Construct, (int)PeInput.ESettingsBuildMd.BuildMode));
        mInfoList.Add(new MenuItemInfo(NewUIText.mMenuOptions.GetString(), MenuItemFlag.Flag_Options, MenuItemFlag.Flag_Null, IcoStr_Options, UIOption.KeyCategory.Common));

        InitMenuList();

        mMenuList.RefreshHotKeyName();
    }
Exemplo n.º 4
0
    // 照相同时切换场景会崩溃
    void EnterLobby()
    {
        bool isEditor = false;

#if UNITY_EDITOR
        isEditor = true;
#endif
        if (isEditor)
        {
            CustomData.RoleInfo _Role = MLPlayerInfo.Instance.GetRoleInfo(rc.GetSelectedIndex()).mRoleInfo;
            if (!SystemSettingData.Instance.Tutorialed && _Role.name.Equals("tutorial"))
            {
                string msg = PELocalization.GetString(8000986) + "'?";
                MessageBox_N.ShowYNBox(msg, BtnYOnClick, BtnNoOnClick);
            }
            else
            {
                BtnNoOnClick();
            }
        }
        else
        {
            if (!SystemSettingData.Instance.Tutorialed)
            {
                string msg = PELocalization.GetString(8000986) + "'?";
                MessageBox_N.ShowYNBox(msg, BtnYOnClick, BtnNoOnClick);
            }
            else
            {
                BtnNoOnClick();
            }
        }
    }
Exemplo n.º 5
0
    void RPC_L2C_CreateRoleFailed(uLink.BitStream stream, LobbyMessageInfo info)
    {
        int _error;

        stream.TryRead <int>(out _error);
        if (_error == 1)//name used
        {
            MessageBox_N.ShowOkBox(PELocalization.GetString(ErrorMessage.NAME_HAS_EXISTED));
        }
        else if (_error == 2)//something must be wrong
        {
            RoleInfo[] _myRoles;
            stream.TryRead <RoleInfo[]>(out _myRoles);
            myRoles        = new List <RoleInfo>();
            myRolesExisted = new List <RoleInfo>();
            myRolesDeleted = new List <RoleInfo>();
            myRoles.AddRange(_myRoles);
            for (int m = 0; m < myRoles.Count; m++)
            {
                if (myRoles[m].deletedFlag != 1 && myRolesExisted.Count <= 3)
                {
                    myRolesExisted.Add(myRoles[m]);
                }
                else
                {
                    myRolesDeleted.Add(myRoles[m]);
                }
            }
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000496), PeSceneCtrl.Instance.GotoMultiRoleScene);
        }
        Debug.Log("Create Role Failed");
    }
Exemplo n.º 6
0
    public override bool OnPutDown()
    {
        if (GameConfig.IsMultiClient)
        {
            if (!Pathea.PeGameMgr.IsMultiCoop && VArtifactUtil.IsInTownBallArea(transform.position))
            {
                new PeTipMsg(PELocalization.GetString(8000864), PeTipMsg.EMsgLevel.Warning);
                return(true);
            }

            if (null != PlayerNetwork.mainPlayer)
            {
                PlayerNetwork.mainPlayer.RequestDragTower(itemDragging.itemObj.instanceId, transform.position, transform.rotation);
            }
        }
        else
        {
            DragTowerAgent towerAget = new DragTowerAgent(itemDragging, transform.position, transform.rotation);

            towerAget.Create();

            SceneMan.AddSceneObj(towerAget);
            PeMap.TowerMark towerMask = new PeMap.TowerMark();
            towerMask.position = transform.position;
            towerMask.ID       = itemObjectId;
            towerMask.text     = itemDragging.itemObj.protoData.GetName();
            towerMask.campId   = Mathf.RoundToInt(Pathea.MainPlayer.Instance.entity.GetAttribute(Pathea.AttribType.CampID));
            PeMap.LabelMgr.Instance.Add(towerMask);
            PeMap.TowerMark.Mgr.Instance.Add(towerMask);
            RemoveFromBag();
        }

        return(base.OnPutDown());
    }
Exemplo n.º 7
0
    void OnVoteCallBack(PublishedFileId_t p_id, bool bFor, bool bOK)
    {
        if (isActve == false)
        {
            return;
        }

        if (bOK)
        {
            if (bFor)
            {
                mVoteMap[p_id] = 1;
            }
            else
            {
                mVoteMap[p_id] = 2;
            }

            if (e_VoteDetailCallBack != null)
            {
                e_VoteDetailCallBack(p_id, bFor);
            }
        }
        else
        {
            mVoteMap[p_id] = 0;
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000491));
        }
    }
    public override bool OnPutDown()
    {
        if (!PeGameMgr.IsMulti)
        {
            DoodadEntityCreator.CreateRandTerDoodad(doodadID, transform.position, Vector3.one, transform.rotation);
            RemoveFromBag();
        }
        else
        {
            IntVector3 safePos = new IntVector3(transform.position + 0.1f * Vector3.down);

            if (VArtifactUtil.IsInTownBallArea(safePos))
            {
                new PeTipMsg(PELocalization.GetString(8000864), PeTipMsg.EMsgLevel.Warning);
                return(true);
            }

            if (null != PlayerNetwork.mainPlayer)
            {
                byte mTerrianType = VFVoxelTerrain.self.Voxels.SafeRead(safePos.x, safePos.y, safePos.z).Type;
                PlayerNetwork.mainPlayer.RequestDragOut(itemDragging.itemObj.instanceId, transform.position, transform.localScale, transform.rotation, mTerrianType);
            }
        }

        return(base.OnPutDown());
    }
Exemplo n.º 9
0
    void DeleteServer()
    {
        if (null == mServerCtrl)
        {
            return;
        }

        if (mServerCtrl.mList.mSelectedIndex == -1)
        {
            return;
        }

        int    index      = mServerCtrl.mList.mSelectedIndex;
        string serverName = mServerCtrl.mList.mItems[index].mData[0];
        int    sceneMode  = (int)MyServer.AdventureOrBuild(mServerCtrl.mList.mItems[index].mData[2]);

        try
        {
            if (LoadServer.DeleteServer(serverName, sceneMode))
            {
                mServerCtrl.mList.mItems.RemoveAt(index);
                mServerCtrl.mList.UpdateList();
            }
        }
        catch
        {
            Debug.Log("Server is running!");
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000497));
        }
    }
Exemplo n.º 10
0
    void OnRightMouseCliked(Grid_N grid)
    {
        ActiveWnd();
        GameUI.Instance.mItemPackageCtrl.Show();

        if (grid.ItemObj != null && playerPackage != null)
        {
            if (PeGameMgr.IsMulti)
            {
                if (_wareObj != null)
                {
                    _wareObj._objNet.GetItem(grid.ItemObj.instanceId);
                }
            }
            else
            {
                if (playerPackage.Add(grid.ItemObj))
                {
                    SetItemWithIndex(null, grid.ItemIndex);
                }
                else //lz-2016.09.14 提示背包已满
                {
                    PeTipMsg.Register(PELocalization.GetString(9500312), PeTipMsg.EMsgLevel.Warning);
                }
            }
        }
    }
Exemplo n.º 11
0
    public static void LoadDate()
    {
        s_tblMaskData = new List <MapMaskData>();
        SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("MapIcon");

        while (reader.Read())
        {
            MapMaskData fMaskData = new MapMaskData();
            fMaskData.mId          = Convert.ToInt32(reader.GetString(0));
            fMaskData.mDescription = PELocalization.GetString(Convert.ToInt32(reader.GetString(1)));
            string[] posStr = reader.GetString(2).Split(',');
            fMaskData.mPosition = new Vector3(Convert.ToSingle(posStr[0]), Convert.ToSingle(posStr[1]), Convert.ToSingle(posStr[2]));
            fMaskData.mIconId   = Convert.ToInt32(reader.GetString(3));
            fMaskData.mRadius   = Convert.ToSingle(reader.GetString(4));
            int itmp = Convert.ToInt32(reader.GetString(5));
            if (itmp == 1)
            {
                fMaskData.mIsCamp = true;
                //m_MapCampList.Add(fMaskData);
            }
            else
            {
                fMaskData.mIsCamp = false;
            }


            s_tblMaskData.Add(fMaskData);
        }
    }
Exemplo n.º 12
0
    public static void Connect()
    {
        MessageBox_N.ShowMaskBox(MsgInfoType.ServerLoginMask, PELocalization.GetString(8000062));
        ProxyServerRegistered proxyServer = MyServerManager.LocalHost as ProxyServerRegistered;

        if (null != proxyServer && !proxyServer.IsLan && proxyServer.UseProxy)
        {
            NetworkInterface.Connect(proxyServer.ProxyServer,
                                     MyServerManager.LocalPwd,
                                     GameClientLobby.role.steamId,
                                     GameClientLobby.role.roleID,
                                     GameClientLobby.role);
        }
        else
        {
            NetworkInterface.Connect(MyServerManager.LocalIp,
                                     MyServerManager.LocalPort,
                                     MyServerManager.LocalPwd,
                                     GameClientLobby.role.steamId,
                                     GameClientLobby.role.roleID,
                                     GameClientLobby.role);
        }

        OnDisconnectEvent += OnDisconnectFromServer;
    }
Exemplo n.º 13
0
 //private int ProgressCount = 0;
 void UpdatePoogressBar()
 {
     if (!IsCompounding)
     {
         return;
     }
     if (mGraphCtrl.rootNode == null)
     {
         OnEndRepulicate();
         return;
     }
     Replicator.RunningReplicate runningReplicate = replicator.runningReplicate;
     if (null != runningReplicate)
     {
         mCompoundSlider.sliderValue = runningReplicate.runningTime / runningReplicate.formula.timeNeed;
         float allCount       = runningReplicate.requestCount * runningReplicate.formula.m_productItemCount;
         float allFinishCount = runningReplicate.leftCount * runningReplicate.formula.m_productItemCount;
         float curFinishCount = runningReplicate.finishCount * runningReplicate.formula.m_productItemCount;
         m_ProgressLbl.text     = string.Format("{0}/{1}", allCount - allFinishCount, allCount);
         m_AddToPackageLbl.text = PELocalization.GetString(8000690) + (allCount - allFinishCount - curFinishCount);
     }
     //        ProgressCount++;
     //        float value = Convert.ToSingle(ProgressCount) / Convert.ToSingle(CompoundFixedTimeCount);
     //        if (ProgressCount == CompoundFixedTimeCount)
     //            GetCompoundItem();
 }
Exemplo n.º 14
0
 void Start()
 {
     InitWindow();
     m_AllStr  = PELocalization.GetString(10055); //lz-2016.07.08 “All” 的语言映射
     mRootType = ItemLabel.Root.all;
     AfterLeftMeunChecked();
 }
Exemplo n.º 15
0
 public override void Do()
 {
     if (null != entityInfo && null != entityInfo.faceTex)
     {
         PeTipMsg.Register(PELocalization.GetString(contentIDs[Random.Range(0, contentIDs.Length)]), entityInfo.faceTex, PeTipMsg.EMsgLevel.Norm, PeTipMsg.EMsgType.Misc);
     }
 }
    public static void LoadData()
    {
        SqliteDataReader    reader = LocalDatabase.Instance.ReadFullTable("book");
        MonsterHandbookData info   = null;

        while (reader.Read())
        {
            int    id            = Convert.ToInt32(reader.GetString(reader.GetOrdinal("ID")));
            string monsterIDsStr = reader.GetString(reader.GetOrdinal("MonsterID"));
            int    modelID       = Convert.ToInt32(reader.GetString(reader.GetOrdinal("ModelID")));
            int    nameID        = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Name")));
            int    descriptionID = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Content")));

            string[] monsterIDsStrs = monsterIDsStr.Split(new char[] { ',' });
            int[]    monsterIDs     = new int[monsterIDsStrs.Length];
            for (int i = 0; i < monsterIDsStrs.Length; i++)
            {
                monsterIDs[i] = Convert.ToInt32(monsterIDsStrs[i]);
            }

            info = new MonsterHandbookData(id,
                                           monsterIDs,
                                           modelID,
                                           PELocalization.GetString(nameID),
                                           PELocalization.GetString(descriptionID));
            AllMonsterHandbookDataDic.Add(id, info);
            AllMonsterIDDic.Add(id, monsterIDs);
        }
    }
Exemplo n.º 17
0
    /// <summary>更新套装Buff提示</summary>
    void UpdateSuitBuffTips(List <SuitSetData.MatchData> datas)
    {
        string tips = "";

        if (null != datas && datas.Count > 0)
        {
            SuitSetData.MatchData data = new SuitSetData.MatchData();
            for (int i = 0; i < datas.Count; i++)
            {
                data = datas[i];
                if (null != data.tips && data.tips.Length > 0)
                {
                    for (int j = 0; j < data.tips.Length; j++)
                    {
                        if (0 != data.tips[j] && data.activeTipsIndex >= j)
                        {
                            tips += PELocalization.GetString(data.tips[j]) + "\n";
                        }
                    }
                }
            }
        }
        if (tips.Length > 0)
        {
            tips = tips.Substring(0, tips.Length - 1);
        }
        m_BuffStrsLb.text = tips;
        m_BuffStrsLb.MakePixelPerfect();
    }
Exemplo n.º 18
0
    public bool CheckEquipEnable(int type, int level)
    {
        if (CheckCommon(level))
        {
            return(true);
        }
        bool isLock = false;

        foreach (SkillTreeUnit iter in _learntSkills)
        {
            if (iter != null && iter.CheckLockItemType(type))
            {
                isLock = true;
            }
        }

        if (isLock)
        {
            foreach (SkillTreeUnit iter in _learntSkills)
            {
                if (iter != null && iter.CheckEquipEnable(type, level))
                {
                    return(true);
                }
            }

            //lz-2016.10.31 错误 #5336 提示修改为Insufficient skill to use this item
            new PeTipMsg(PELocalization.GetString(8000854), PeTipMsg.EMsgLevel.Norm, PeTipMsg.EMsgType.Misc);
            return(false);
        }
        else
        {
            return(true);
        }
    }
Exemplo n.º 19
0
    public bool RemoveEqByIndex(int index)
    {
        if (null != mEquipmentList && index >= 0 && index < mEquipmentList.Count && null != mEquipmentList[index].ItemObj)
        {
            if (GameConfig.IsMultiMode)
            {
                if (equipmentCmpt.TryTakeOffEquipment(mEquipmentList[index].ItemObj))
                {
                    return(true);
                }
            }
            else
            {
                if (equipmentCmpt.TakeOffEquipment(mEquipmentList[index].ItemObj, false))
                {
                    //lz-2016.08.30 脱下装备成功播放音效
                    GameUI.Instance.PlayTakeOffEquipAudio();
                    return(true);
                }
            }
        }

        //lz-2016.10.09 提示正在使用此装备,无法操作
        PeTipMsg.Register(PELocalization.GetString(8000594), PeTipMsg.EMsgLevel.Error);
        return(false);
    }
Exemplo n.º 20
0
    void MissionNodeOnDelete(object sender)
    {
        UIMissionNode node = sender as UIMissionNode;

        if (node == null)
        {
            return;
        }
        delView = node.mData as UIMissionMgr.MissionView;
        if (delView == null)
        {
            return;
        }

        MissionCommonData data = MissionManager.GetMissionCommonData(delView.mMissionID);

        if (data == null)
        {
            return;
        }
        //else
        //    MissionManager.Instance.m_PlayerMission.FailureMission(delView.mMissionID);

        if (!data.m_bGiveUp)
        {
            new PeTipMsg(PELocalization.GetString(8000174), PeTipMsg.EMsgLevel.Warning);
            return;
        }

        MessageBox_N.ShowYNBox(PELocalization.GetString(8000066), DeleteMissionOk);
    }
Exemplo n.º 21
0
 string GetStringByCurIndex()
 {
     if (UseLocalization)
     {
         int    strID;
         string str = mSelections[mIndex].Trim();
         if (str == string.Empty)
         {
             return(string.Empty);
         }
         else
         {
             if (int.TryParse(str, out strID))
             {
                 return(PELocalization.GetString(strID));
             }
             else
             {
                 Debug.Log("Not find localLization keyID:" + mSelections[mIndex]);
                 return(string.Empty);
             }
         }
     }
     return(mSelections[mIndex].ToString());
 }
Exemplo n.º 22
0
    void OnMetalSelected(object sender)
    {
        MetalScanItem_N item = sender as MetalScanItem_N;

        if (item == null)
        {
            return;
        }
        byte          voxelType = item.mType;
        MetalScanItem msi       = MetalScanData.GetItemByVoxelType(voxelType);

        if (null != msi)
        {
            mMetalSpr.spriteName = msi.mTexName;
            mMetalSpr.MakePixelPerfect();
            mMetalDes.text = PELocalization.GetString(msi.mDesID);
        }

        for (int i = 0; i < mMetalScanItemList.Count; ++i)
        {
            if (mMetalScanItemList[i] == item)
            {
                MetalScanData.m_ScanState[i] = item.mCheckBox.isChecked;
                break;
            }
        }
//		MetalScanData.m_ScanState[i] = true;
    }
Exemplo n.º 23
0
 void InitSleepTime()
 {
     mMaxSleepTime.text       = SleepTime.MaxHours.ToString();
     mMinSleepTime.text       = SleepTime.MinHours.ToString();
     mSleepSlider.scrollValue = ((float)SleepTime.NormalHours) / SleepTime.MaxHours;
     mSleepTime.text          = string.Format(PELocalization.GetString(8000251), GetCurSleepTime());
 }
 public void OnCleanBtn()
 {
     if (!GameConfig.IsMultiMode)
     {
         plant.UpdateStatus();
         int needNum = (int)((plant.mPlantInfo.mCleanLevel[1] - plant.mClean) / VarPerOp);
         Pathea.PlayerPackageCmpt packageCmpt = Pathea.PeCreature.Instance.mainPlayer.GetCmpt <Pathea.PlayerPackageCmpt>();
         int haveNum = packageCmpt.GetItemCount(ProtoTypeId.INSECTICIDE);
         if (haveNum <= 0)
         {
             MessageBox_N.ShowOkBox(PELocalization.GetString(8000091));
         }
         else
         {
             plant.mClean += VarPerOp * Mathf.Min(haveNum, needNum);
             packageCmpt.Destory(ProtoTypeId.INSECTICIDE, Mathf.Min(haveNum, needNum));
             plant.UpdateStatus();
         }
     }
     else
     {
         if (null != PlayerNetwork.mainPlayer)
         {
             PlayerNetwork.mainPlayer.RPCServer(EPacketType.PT_InGame_Plant_Clean, plant.mPlantInstanceId);
         }
     }
     HideItemOpGui();
     //UpdateCmdList();
 }
Exemplo n.º 25
0
    void Lobby_OnFailedToConnect(LobbyConnectionError error)
    {
        MessageBox_N.CancelMask(MsgInfoType.LobbyLoginMask);

        switch (error)
        {
        case LobbyConnectionError.RSAPublicKeyMismatch:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000034));
            break;

        //lz-2016.10.31 ·­ÒëÁ¬½Ó´íÎóÂë
        case LobbyConnectionError.CreateSocketOrThreadFailure:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000860));
            break;

        case LobbyConnectionError.ConnectionTimeout:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000861));
            break;

        case LobbyConnectionError.ConnectionFailed:
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000862));
            break;

        default:
            MessageBox_N.ShowOkBox(error.ToString());
            break;
        }

        //LoginGui_N.Instance.HideMask();
        LogManager.Error("Failed to connect lobby server:", error);
    }
    bool OnWndStartClick()
    {
        if (mIsProcessCheck)
        {
            return(true);
        }

        if (selectWnd.selectedItem != null && !selectWnd.selectedItem.IsFile)
        {
            MapItemDescs          desc       = mMapItems[selectWnd.selectedItem.index];
            Pathea.CustomGameData customdata = Pathea.CustomGameData.Mgr.Instance.GetCustomData(desc.UID, desc.Path);
            if (customdata == null || customdata.humanDescs.Length == 0)
            {
                //lz-2016.10.31 Need a player to start
                MessageBox_N.ShowOkBox(PELocalization.GetString(8000859));
                return(true);
            }

            MapItemDescs           mid   = mMapItems[selectWnd.selectedItem.index];
            ScenarioIntegrityCheck check = ScenarioMapUtils.CheckIntegrityByPath(mid.Path);
            StartCoroutine(ProcessIntegrityCheck(check));
            selectWnd.HintBox.Msg          = "Checking";
            selectWnd.HintBox.isProcessing = true;
            selectWnd.HintBox.Open();
        }

        return(true);
    }
Exemplo n.º 27
0
    public static void LoadData()
    {
        SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("MessagesData");
        MessageData      info   = null;

        while (reader.Read())
        {
            int      id            = Convert.ToInt32(reader.GetString(reader.GetOrdinal("ID")));
            string   missionIDsStr = reader.GetString(reader.GetOrdinal("MissionID"));
            int      topicID       = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Topic")));
            string   fromAddress   = reader.GetString(reader.GetOrdinal("FromAddress"));
            string   toAddress     = reader.GetString(reader.GetOrdinal("ToAddress"));
            int      dateID        = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Date")));
            int      titleID       = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Title")));
            int      contentID     = Convert.ToInt32(reader.GetString(reader.GetOrdinal("Content")));
            int      endID         = Convert.ToInt32(reader.GetString(reader.GetOrdinal("End")));
            string[] strMissionIDs = missionIDsStr.Split(new char[] { ',' });
            int[]    missionIDs    = new int[strMissionIDs.Length];
            for (int i = 0; i < strMissionIDs.Length; i++)
            {
                missionIDs[i] = Convert.ToInt32(strMissionIDs[i]);
            }
            info = new MessageData(id,
                                   missionIDs,
                                   PELocalization.GetString(topicID),
                                   fromAddress,
                                   toAddress,
                                   PELocalization.GetString(dateID),
                                   PELocalization.GetString(titleID),
                                   PELocalization.GetString(contentID),
                                   PELocalization.GetString(endID));
            AllMsgDataDic.Add(id, info);
            AllMissionIDDic.Add(id, missionIDs);
        }
    }
Exemplo n.º 28
0
    void Update()
    {
        //死亡提示
        if (mLifeCmpt != null && mShowLifeTip)
        {
            if (mLifeCmpt.floatValue.percent == 0f)
            {
                mShowLifeTip = false;
                new PeTipMsg(PELocalization.GetString(8000177), PeTipMsg.EMsgLevel.HighLightRed);
            }
        }

        //能量消耗完提示
        if (mEnergyCmpt != null && mShowEnergyTip)
        {
            if (mEnergyCmpt.floatValue.percent == 0f)
            {
                mShowEnergyTip = false;
                new PeTipMsg(PELocalization.GetString(8000176), PeTipMsg.EMsgLevel.HighLightRed);
                new PeTipMsg(PELocalization.GetString(8000176), PeTipMsg.EMsgLevel.HighLightRed);
                new PeTipMsg(PELocalization.GetString(8000176), PeTipMsg.EMsgLevel.HighLightRed);
            }
        }

        // 为了处理玩家回收机器人后,不能触发事件的问题。
        if (!RobotController.playerFollower && mRobot.IsShow)
        {
            OnDeleteRobot();
        }

        Centent.localPosition = new Vector3(-UIMinMapCtrl.Instance.GetMinMapWidth() - 20, -5, -22);
    }
Exemplo n.º 29
0
    void SetJoy(bool state)
    {
        m_OpCtrlBtnsParent.SetActive(state);
        if (!state && _bApply)
        {
            // set joy into _keySetting
            if (_joyToSet != InputControlType.None && _joyToSet != _keySetting._joy)
            {
#if ConflictMsgOn
                KeySettingItem itemConflict = null;                // UIOption.Instance.TestConflict(this, _joyToSet, s_joyAccessor);
                if (itemConflict != null)
                {
                    MessageBox_N.ShowYNBox(PELocalization.GetString(8000178), () => { s_joyAccessor.Set(this, _joyToSet); });
                }
                else
                {
                    s_joyAccessor.Set(this, _joyToSet);
                }
#else
                if (!UIOption.Instance.TrySetKey(this, _joyToSet, s_joyAccessor))
                {
                    if (OptionUIHintFadeCtrl.Instance != null)
                    {
                        OptionUIHintFadeCtrl.Instance.AddOneHint(PELocalization.GetString(8000172));
                    }
                }
#endif
            }
        }
        else
        {
            _joyToSet = _keySetting._joy;
        }
        mCtrlContent.text = _keySetting._joy.ToString();
    }
Exemplo n.º 30
0
    void BtnDeleteOnClick()
    {
        if (Input.GetMouseButtonUp(0))
        {
            //if(LockRoomList)
            //	return;

            if (mRoomListPage == 0 || mRoomListPage == 1)
            {
                if (mRoomList.mSelectedIndex > -1 && mRoomList.mSelectedIndex < _curServerList.Count)
                {
                    if (!GameClientLobby.role.name.Equals(_curServerList[mRoomList.mSelectedIndex].ServerMasterName))
                    {
                        return;
                    }

                    LobbyInterface.LobbyRPC(ELobbyMsgType.CloseServer, _curServerList[mRoomList.mSelectedIndex].ServerID, SteamMgr.steamId.m_SteamID);
                    MessageBox_N.ShowMaskBox(MsgInfoType.ServerDeleteMask, PELocalization.GetString(8000058), 15f);
                }
            }
            else if (mRoomListPage == 2)
            {
                if (roomUID != 0)
                {
                    mRecentRoom_M.DeleteItem(roomUID);
                }
            }
            roomUID = 0;
            RefreshRoomList();
            if (checkIndex != -1)
            {
                roomListChickItem(checkIndex);
            }
        }
    }