// 照相同时切换场景会崩溃 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 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 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 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); } }
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 OnRepairBtn() { if (mRepairItem == null || mRepairItem.ItemObj == null) { return; } MessageBox_N.ShowYNBox(PELocalization.GetString(8000098), this.Repair); }
void OnQuitGameBtn() { Hide(); //if(GameConfig.IsMultiMode) // Application.Quit(); //else MessageBox_N.ShowYNBox(PELocalization.GetString(8000081), Application.Quit, Show); }
void OnTriggerEnter(Collider other) { PeEntity entity = other.GetComponentInParent <PeEntity>(); if (null != entity && entity == MainPlayer.Instance.entity) { MessageBox_N.ShowYNBox(PELocalization.GetString(descriptionID), Do); } }
void OnIsoDeleteClick(int index) { if (index == -1) { return; } _deleteIndex = index; MessageBox_N.ShowYNBox(PELocalization.GetString(8000501), OnSureToDeleteIso); }
public void Invitation(PlayerNetwork _inviter) { if (_inviter == null) { return; } mInviter = _inviter; string _content = string.Format(PELocalization.GetString(8000504), _inviter.RoleName); MessageBox_N.ShowYNBox(_content, OnYes); }
//void OnWorkClick () //{ // if (m_ActiveNpc != null) // m_ActiveNpc.WorkNow(); // else // Debug.LogWarning("The Active Npc is not exist!"); //} //void OnRestClick () //{ // if (m_ActiveNpc != null) // m_ActiveNpc.Rest(); // else // Debug.LogWarning("The Active Npc is not exist!"); //} void OnFollowMeClick() { if (m_ActiveNpc != null) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000096), SetActiveNpcFollow); } else { Debug.LogWarning("The Active Npc is not exist!"); } }
public void OnClearBtn() { if (!plant.mDead) { MessageBox_N.ShowYNBox(UIMsgBoxInfo.mRemovePlantConfirm.GetString(), OnClear); } else { OnClear(); } }
void BtnMainMenuOnClick() { if (Input.GetMouseButtonUp(0)) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000052), delegate { StopCoroutine(UpdatePlayerInfo()); StopCoroutine(UpdateRoomInfo()); PeSceneCtrl.Instance.GotoMainMenuScene(); }); } }
void OnMainMenuBtn() { Hide(); if (GameConfig.IsMultiMode) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000079), PeSceneCtrl.Instance.GotoMainMenuScene, Show); } else { MessageBox_N.ShowYNBox(PELocalization.GetString(8000080), PeSceneCtrl.Instance.GotoMainMenuScene, Show); } }
void OnTriggerEnter(Collider target) { if (null == target.GetComponentInParent <Pathea.MainPlayerCmpt>()) { return; } if (isShow == true) { return; } isShow = true; MessageBox_N.ShowYNBox(PELocalization.GetString(82209002), SceneTranslate, SetFalse); }
void OnOKBtn() { if (m_CurType == CSConst.etEnhance) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000097), StartToWork); } else if (m_CurType == CSConst.etRepair) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000098), StartToWork); } else if (m_CurType == CSConst.etRecyle) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000099), StartToWork); } }
void BtnDeleteOnClick() { if (null != mSelectedDetail) { float curVersion = 0f; float newVersion = float.Parse(SteamWorkShop.NewVersionTag); if (float.TryParse(mSelectedDetail.m_rgchTags, out curVersion)) { if (curVersion >= newVersion) { MessageBox_N.ShowOkBox(string.Format(PELocalization.GetString(8000492), newVersion)); return; } } MessageBox_N.ShowYNBox(PELocalization.GetString(8000015), () => mMyWorkShopMgr.DeleteMyIsoFile(mSelectedDetail)); } }
void BtnDeleteOnClick() { Debug.Log("btnDelete OnClick"); if (MLPlayerInfo.Instance.GetRoleInfo(rc.GetSelectedIndex()) == null) { return; } deleteRoleIndex = rc.GetSelectedIndex(); string msg = PELocalization.GetString(8000590) + MLPlayerInfo.Instance.GetRoleInfo(deleteRoleIndex).name + "'?"; MessageBox_N.ShowYNBox(msg, BtnOKOnClick, BtnCancelOnClick); if (BtnDelete != null) { BtnDelete(); } }
void BtnDeleteOnClick() { if (Input.GetMouseButtonUp(0)) { if (mList.mSelectedIndex == -1) { return; } if (mList.mSelectedIndex >= mList.mItems.Count) { return; } string serverName = mList.mItems[mList.mSelectedIndex].mData[0]; string strText = UIMsgBoxInfo.mCZ_DeleteSrever.GetString() + "'" + serverName + "'"; MessageBox_N.ShowYNBox(strText, OnBtnDelete, null); } }
void OnTriggerEnter(Collider target) { //if(Application.isEditor) { Debug.Log("Exit dungen"); if (null == target.GetComponentInParent <Pathea.MainPlayerCmpt>()) { return; } if (isShow == true) { return; } isShow = true; MessageBox_N.ShowYNBox(PELocalization.GetString(DungenMessage.EXIT_DUNGEN), SceneTranslate, SetFalse); } }
void SetKey(bool state) { this.m_OpKeyBtnsParent.SetActive(state); if (!state && _bApply) { // set key into _keySetting if (_keyToSet != KeyCode.None && _keyToSet != _keySetting._key) { #if ConflictMsgOn KeySettingItem itemConflict = UIOption.Instance.TestConflict(this, _keyToSet, s_keyAccessor); if (itemConflict != null) { //if(_keyToSet != KeyCode.Mouse0 && _keyToSet != KeyCode.Mouse1) //{ // //lw:2017.7.10:快捷键冲突时,忽略玩家输入,即设置必定不成功 // MessageBox_N.ShowOkBox(PELocalization.GetString(8000178)); //} //else //{ MessageBox_N.ShowYNBox(PELocalization.GetString(8000178), () => { s_keyAccessor.Set(this, _keyToSet); }); // } } else { s_keyAccessor.Set(this, _keyToSet); } #else if (!UIOption.Instance.TrySetKey(this, _keyToSet, s_keyAccessor)) { if (OptionUIHintFadeCtrl.Instance != null) { OptionUIHintFadeCtrl.Instance.AddOneHint(PELocalization.GetString(8000172)); } } #endif } } else { _keyToSet = _keySetting._key; } mKeyContent.text = _keySetting._key.ToStr(); }
public void OnRightMouseCliked(Grid_N grid) { if (grid.ItemObj == null) { return; } if (grid.ItemObj.GetCount() == 0) { new PeTipMsg(PELocalization.GetString(82209007), PeTipMsg.EMsgLevel.Warning); return; } if (mSellOpLayer.gameObject.activeSelf) { return; } ActiveWnd(); SelectItem_N.Instance.SetItem(null); mOpGrid = grid; //lz-2016.10.27 购买所有的时候提示加上购买所有的价格 int count = mOpGrid.Item.GetCount(); int price; if (mRepurchaseList.Contains(mOpGrid.ItemObj)) { price = mOpGrid.ItemObj.GetSellPrice(); } else { price = mOpGrid.ItemObj.GetBuyPrice(); } string name = mOpGrid.Item.protoData.GetName(); string msgStr = string.Format("{0} {1}\n{2} {3}", PELocalization.GetString(8000077), name + " X " + count, PELocalization.GetString(8000253), (count * price)); MessageBox_N.ShowYNBox(msgStr, BuyAll); }
private void OnRightMouseCliked(Grid_N grid) { if (grid.ItemObj == null) { return; } if (mSellOpLayer.gameObject.activeSelf) { return; } if (grid.ItemObj.GetCount() == 0) { new PeTipMsg(PELocalization.GetString(82209007), PeTipMsg.EMsgLevel.Warning); return; } SelectItem_N.Instance.SetItem(null); m_CurOpItem = grid.ItemObj; //lz-2016.10.27 购买所有的时候提示加上购买所有的价格 int count = m_CurOpItem.GetCount(); int price = 0; if (m_CurPackTab == 0) { price = Mathf.RoundToInt(m_CurOpItem.GetBuyPrice() * (1 + ColonyConst.TRADE_POST_CHARGE_RATE)); } else { price = m_CurOpItem.GetSellPrice(); //赎回的价格等于卖出的价格 } string name = m_CurOpItem.protoData.GetName(); string msgStr = string.Format("{0} {1}\n{2} {3}", PELocalization.GetString(8000077), name + " X " + count, PELocalization.GetString(8000253), (count * price)); MessageBox_N.ShowYNBox(msgStr, BuyAll, ResetOpInfo); }
void OnTriggerEnter(Collider target) { if (null == target.GetComponentInParent <Pathea.MainPlayerCmpt>()) { return; } if (isShow == true) { return; } isShow = true; if (MissionManager.Instance.HadCompleteMission(756)) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000505), SceneTranslate, SetFalse); } else { MessageBox_N.ShowYNBox(PELocalization.GetString(8000506), SceneTranslate, SetFalse); } }
void BtnRandomOnClick() { if (haschanged) { haschanged = !haschanged; MessageBox_N.ShowYNBox(PELocalization.GetString(8000173), BtnSaveOnClick, BtnRandomOnClick); return; } int headCount = mMetaData.GetHeadCount(); int headIndex = UnityEngine.Random.Range(0, headCount); mCurrent.mNude.SetPart(AvatarData.ESlot.Head, mMetaData.GetHead(headIndex).modelPath); int hairCount = mMetaData.GetHairCount(); int hairIndex = UnityEngine.Random.Range(0, hairCount); string[] HairPath = mMetaData.GetHair(hairIndex).modelPath; mCurrent.mNude.SetPart(AvatarData.ESlot.HairF, HairPath[0]); mCurrent.mNude.SetPart(AvatarData.ESlot.HairT, HairPath[1]); mCurrent.mNude.SetPart(AvatarData.ESlot.HairB, HairPath[2]); mCurrent.mAppearData.mHairColor = new Color(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), 1f); mCurrent.mAppearData.mEyeColor = new Color(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), 1f); mCurrent.mAppearData.mSkinColor = new Color(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), 1f); mCurrent.mAppearData.RandomMorphWeight(); ResetBuildUIValue(); RebuildModel(); }
public override void OnGetBtn() { //base.OnGetBtn (); //if (!GameConfig.IsMultiMode) //{ CSEntityObject ceo = GetComponent <CSEntityObject>(); if (ceo == null) { return; } if (EntityMonsterBeacon.IsRunning()) { PeTipMsg.Register(PELocalization.GetString(8000622), PeTipMsg.EMsgLevel.Warning); CloseOn(); return; } if (ceo.m_Entity.BaseData.m_Durability < ceo.m_Entity.m_Info.m_Durability * 0.15f) { MessageBox_N.ShowOkBox(PELocalization.GetString(8000084)); } else { if (ceo as CSDwellingsObject != null) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000085), GetOn, CloseOn); } else { MessageBox_N.ShowYNBox(PELocalization.GetString(8000086), GetOn, CloseOn); } } //} }
void OnMissionDeleteClick(UIMissionGoalNode node) { //MessageBox_N.ShowYNBox("Sure to") _deleteMissionId = -1; // Main Stroy if (missionWnd.MissionType == 0) { _deleteMissionId = m_MainStoryIds[node.index]; } else if (missionWnd.MissionType == 1) { _deleteMissionId = m_SideQuestIdes[node.index]; } if (_deleteMissionId != -1) { MissionProperty mp = PeCustomScene.Self.scenario.missionMgr.GetMissionProperty(_deleteMissionId); if (mp != null) { if (mp.canAbort) { MessageBox_N.ShowYNBox(PELocalization.GetString(8000066), DeleteMissionOk); } else { //lz-2016.10.31 The mission can't be aborted. new PeTipMsg(PELocalization.GetString(8000850), PeTipMsg.EMsgLevel.Warning); } } else { Debug.LogError("Get the Deleted Mission property is error"); } } }
private void OnBack() { MessageBox_N.ShowYNBox(PELocalization.GetString(8000075), PeSceneCtrl.Instance.GotoLobbyScene); }
static void OnLobbyDisconnected() { MessageBox_N.ShowYNBox(PELocalization.GetString(8000035), PeSceneCtrl.Instance.GotoMainMenuScene); }
public void OnWarpYes() { string strMes; if (MissionManager.Instance != null) { if (MissionManager.Instance.HasTowerDifMission()) { strMes = PELocalization.GetString(8000002); MessageBox_N.ShowOkBox(strMes); return; } if (GameUI.Instance.playerMoney < mMoneyCost) { strMes = PELocalization.GetString(8000003); MessageBox_N.ShowOkBox(strMes); return; } if (PeCreature.Instance.mainPlayer.passengerCmpt.IsOnCarrier()) { strMes = PELocalization.GetString(8000004); MessageBox_N.ShowOkBox(strMes); return; } int misID = -1; if (PeGameMgr.IsMulti) { misID = MissionManager.Instance.HasFollowMissionNet(); } else { misID = MissionManager.Instance.HasFollowMission(); } if (misID != -1) { strMes = PELocalization.GetString(8000005); mOpMissionID = misID; MessageBox_N.ShowYNBox(strMes, FailureMission); return; } } if (!PeGameMgr.IsMulti) { if (onTravel != null) { onTravel.Invoke(); } FastTravel(); } else { if (null != PlayerNetwork.mainPlayer) { //if (-1 == campId || campId == PlayerNetwork.MainPlayer.TeamId) // PlayerNetwork.MainPlayer.RequestFastTravel(0, travelPos, mMoneyCost); //else // MessageBox_N.ShowOkBox("This flag is not yours"); GameUI.Instance.mUIWorldMap.Hide(); int type = iconId == PeMap.MapIcon.FlagIcon ? 1 : 0; PlayerNetwork.mainPlayer.RequestFastTravel(type, travelPos, mMoneyCost); Hide(); } } }