// 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); } } }
void OnDestroy() { if (ob != null) { MessageBox_N.CancelMessage(ob); } }
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); } } }
public void JoinToServerByInvite() { if (mInviteServerData == null) { MessageBox_N.ShowOkBox(UIMsgBoxInfo.mRoomIsClose.GetString()); return; } bool mNeedPaseWord = (mInviteServerData.PasswordStatus == 1); if (mNeedPaseWord) { mPassWordWnd.SetActive(true); } else { ConnectServer(false, mInviteServerData); //SteamFriendPrcMgr.Instance.InviteClear(); } ServerRegistered mServerData = _curServerList.Find( delegate(ServerRegistered sr) { return(sr.ServerUID == roomUID); }); if (mServerData != null) { mRecentRoom_M.AddItem(mServerData.ServerUID, mServerData.ServerName, mServerData.ServerMasterName, mServerData.ServerVersion); } }
void OnLineNameChange(string text) { if ("" != text.Trim() && isConnectLine) { UIRailLine line = mRailLineList.Find( delegate(UIRailLine li) { return(li.mRoute.id == mSelectedLineId); }); if (line != null && line.mRoute.name != text) { if (!Railway.Manager.Instance.IsRouteNameExist(text)) { line.mRoute.name = text; mTitleLineName.text = text; if (null != e_ResetRouteName) { e_ResetRouteName(line.mRoute.id, text); } } else { MessageBox_N.ShowOkBox(UIMsgBoxInfo.ReNameNotice.GetString()); } mLineName.text = line.mRoute.name; } } }
public void EnterDungen(Vector3 entrancePos, int dungeonDataId) { RandomDungenMgrData.Clear(); MissionManager.Instance.m_PlayerMission.AbortFollowMission(); RandomDungenMgrData.AddServants(); LoadDataFromId(dungeonDataId); SetWaterType(entrancePos); if (PeGameMgr.IsMulti) { MessageBox_N.ShowMaskBox(MsgInfoType.DungeonGeneratingMask, "Generating", 20f); RandomDungenMgrData.entrancePos = entrancePos; RandomDungenMgrData.enterPos = PeCreature.Instance.mainPlayer.position; PlayerNetwork.mainPlayer.RequestEnterDungeon(entrancePos); } else { isActive = true; //UILoadScenceEffect.Instance.EnableProgress(false); MissionManager.Instance.yirdName = AdventureScene.Dungen.ToString(); //origin RandomDungenMgrData.SetPosByEnterPos(entrancePos); MissionManager.Instance.transPoint = RandomDungenMgrData.revivePos; //test // MissionManager.Instance.transPoint = new Vector3(enterPos.x,-100,enterPos.z); // RandomDungenMgrData.RevivePos = MissionManager.Instance.transPoint; // RandomDungenMgrData.genPos = RandomDungenMgrData.RevivePos+new Vector3 (0,0,-2); //TransFollower(RandomDungenMgrData.enterPos); MissionManager.Instance.SceneTranslate(); } }
// login game public void FirstToTutorial() { //lw:多人出教程后,进入lobby TutorialExit.type = Pathea.PeGameMgr.playerType == Pathea.PeGameMgr.EPlayerType.Multiple ? TutorialExit.TutorialType.MultiLobby : TutorialExit.TutorialType.Story; SystemSettingData.Instance.Tutorialed = true; string nickname = mNameInput.text; if (string.IsNullOrEmpty(nickname)) { MessageBox_N.ShowOkBox(PELocalization.GetString(8000051)); return; } CustomDataMgr.Instance.Current = CreateCustomData(); CustomDataMgr.Instance.Current.charactorName = nickname; Pathea.PeGameMgr.playerType = Pathea.PeGameMgr.EPlayerType.Tutorial; Pathea.PeGameMgr.sceneMode = Pathea.PeGameMgr.ESceneMode.Tutorial; Pathea.PeGameMgr.tutorialMode = Pathea.PeGameMgr.ETutorialMode.DigBuild; Pathea.PeFlowMgr.Instance.LoadScene(Pathea.PeFlowMgr.EPeScene.GameScene); }
void uLink_OnDisconnectedFromServer(uLink.NetworkDisconnection mode) { MessageBox_N.CancelMask(MsgInfoType.ServerLoginMask); if (mode == uLink.NetworkDisconnection.LostConnection) { if (LogFilter.logDebug) { Debug.Log("Lost connection"); } else if (LogFilter.logDebug) { Debug.Log("Disconnected. Mode:" + mode); } } RolesInGame.Clear(); if (null != OnDisconnectEvent) { OnDisconnectEvent(); } Cursor.lockState = Screen.fullScreen? CursorLockMode.Confined: CursorLockMode.None; Cursor.visible = true; PeCamera.SetVar("ForceShowCursor", true); }
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(); }
//void OnNpcStateChangedListener (CSPersonnel csp, int prvState) //{ // if (ActiveNpcGrid == null || ActiveNpcGrid.m_Npc != csp) // return; // string npcName = csp.Name; // string str = "The " + npcName; // if (csp.State == CSConst.pstIdle) // str += " is wandering aroud."; // else if (csp.State == CSConst.pstPrepare) // str += " is going to destination"; // else if (csp.State == CSConst.pstRest) // str += " is resting, he will restore health."; // else if (csp.State == CSConst.pstFollow) // str += " is following you."; // else if (csp.State == CSConst.pstDead) // str += " died"; // else if (csp.State == CSConst.pstWork) // str += " is working in the " + csp.WorkRoom.Name; // else if (csp.State == CSConst.pstAtk) // str += " is Fighting for the monster."; // else // str = ""; // CSUI_MainWndCtrl.ShowStatusBar(str); //} // NPC Grid DestroySelf void OnNPCGridDestroySelf(CSUI_NPCGrid grid) { if (grid != null && grid.m_Npc != null) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000101), grid.m_Npc.KickOut); } }
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); }
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"); }
public void OnArmorPartEquiped(bool success) { if (!success) { MessageBox_N.ShowOkBox("/\\__/\\"); } }
void RPC_S2C_EnterDungeon(uLink.BitStream stream, uLink.NetworkMessageInfo info) { bool success = stream.Read <bool>(); if (!success) { MessageBox_N.CancelMask(MsgInfoType.DungeonGeneratingMask); return; } Vector3 genPlayerPos = stream.Read <Vector3>(); int seed = stream.Read <int>(); int dungeonId = stream.Read <int>(); int dungeonDataId = stream.Read <int>(); RandomDungenMgr.Instance.LoadDataFromId(dungeonDataId); //UILoadScenceEffect.Instance.EnableProgress(true); RandomDungenMgrData.DungeonId = dungeonId; RandomDungenMgrData.SetPosByGenPlayerPos(genPlayerPos); int failCount = 0; while (!RandomDungenMgr.Instance.GenDungeon(seed)) { failCount++; Debug.Log("generation failed: " + failCount); } RandomDungenMgr.Instance.LoadPathFinding(); RequestFastTravel(0, RandomDungenMgrData.revivePos, 0); // FastTravel.TravelTo(RandomDungenMgrData.revivePos); }
void RPC_L2C_CloseServer(uLink.BitStream stream, LobbyMessageInfo info) { string msg = stream.Read <string>(); MessageBox_N.CancelMask(MsgInfoType.ServerDeleteMask); MessageBox_N.ShowOkBox(msg); }
// 照相同时切换场景会崩溃 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(); } } }
void Update() { if (mPointGui.IsOpen()) { if (mInputSel && !mPointGui.mNameInput.selected && null != mOpPoint && mPointGui.PointName != mOpPoint.name && mPointGui.PointName.Trim() != "") { if (Railway.Manager.Instance.IsPointNameExist(mPointGui.mNameInput.text)) { MessageBox_N.ShowOkBox(UIMsgBoxInfo.ReNameNotice.GetString()); } else { mOpPoint.name = mPointGui.mNameInput.text; } mPointGui.PointName = mOpPoint.name; } mInputSel = mPointGui.mNameInput.selected; if (null != GameUI.Instance.mMainPlayer && null != mOpPoint && Vector3.Distance(GameUI.Instance.mMainPlayer.position, mOpPoint.position) > 30f) { mPointGui.Hide(); } } }
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)); } }
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); }
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; }
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(); }
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); }
public void PublishFinishCellBack(int _upLoadindex, ulong publishID, ulong hash) { string path = ""; if (mUpLoadMap.ContainsKey(_upLoadindex)) { path = mUpLoadMap[_upLoadindex]; path = path.Replace('\\', '/'); path = path.Replace(mDefoutIcoPath, "[ISO]/"); } string text = ""; if (path.Length > 0 && publishID != 0) { mUpLoadStateMap[mUpLoadMap[_upLoadindex]] = 101; text = "'" + path + "' " + UIMsgBoxInfo.mCZ_WorkShopUpLoadIso.GetString(); } else { mUpLoadStateMap[mUpLoadMap[_upLoadindex]] = -1; text = "'" + path + "' " + UIMsgBoxInfo.mCZ_WorkShopUpLoadIsoFailed.GetString(); MessageBox_N.ShowOkBox(PELocalization.GetString(8000491)); } if (null != m_UploadingIsoHashList && m_UploadingIsoHashList.Contains(hash)) { m_UploadingIsoHashList.Remove(hash); } UpdateDownLoadInfo(); SetInfoMsg(text); }
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)); } }
void RPC_L2C_RepeatLogin(uLink.BitStream stream, LobbyMessageInfo info) { Disconnect(); MessageBox_N.ShowOkBox(PELocalization.GetString(8000041)); // if (null != LoginGui_N.Instance) // LoginGui_N.Instance.HideMask(); }
void OnRepairBtn() { if (mRepairItem == null || mRepairItem.ItemObj == null) { return; } MessageBox_N.ShowYNBox(PELocalization.GetString(8000098), this.Repair); }
void OnDeletBtn() { Pathea.ArchiveMgr.Instance.Delete((Pathea.ArchiveMgr.ESave)mIndex); MessageBox_N.ShowOkBox(PELocalization.GetString(8000030)); UpdateArchiveList(); }
// void uLink_OnMasterServerEvent(uLink.MasterServerEvent e) // { // switch (e) // { // case uLink.MasterServerEvent.HostListReceived: // if (null != HostListReceivedEvent) // HostListReceivedEvent(this, EventArgs.Empty); // break; // // default: // break; // } // } //void uLink_OnPreBufferedRPCs(uLink.NetworkBufferedRPC[] bufferedArray) //{ // foreach (uLink.NetworkBufferedRPC rpc in bufferedArray) // { // if (rpc.isInstantiate) // rpc.DontExecuteOnConnected(); // } //} void uLink_OnConnectedToServer() { if (LogFilter.logDebug) { Debug.Log("Server connected"); } MessageBox_N.CancelMask(MsgInfoType.ServerLoginMask); }
void OnQuitGameBtn() { Hide(); //if(GameConfig.IsMultiMode) // Application.Quit(); //else MessageBox_N.ShowYNBox(PELocalization.GetString(8000081), Application.Quit, Show); }
static void OnResponse(object sender, PeEvent.EventArg arg) { if (!NetworkInterface.IsClient && arg is Pathea.PeLauncher.LoadFinishedArg) { MessageBox_N.ShowOkBox(PELocalization.GetString(8000048), PeSceneCtrl.Instance.GotoLobbyScene); Pathea.PeLauncher.Instance.eventor.Unsubscribe(OnResponse); } }