public static void ShowAlert(string content, bool showConfirm = true, bool showCancel = false, bool showClose = false, Action confirm = null, Action cancel = null, string confirmText = "", string cancelText = "") { ShowImmediatelyAsync("window_alert", null, window => { Window_Alert alert = window as Window_Alert; if (alert == null) { //打开错误的时候关闭界面 if (window != null) { window.gameObject.SetActive(false); } return; } if (showCancel && cancel == null) { cancel = () => { } } ; alert.content.text = content.Replace("\\n", "\n");//Util.Format(@"{0}", content); alert.SetButtonVisible(showConfirm, showCancel, showClose); alert.SetButtonCallback(confirm, cancel); alert.ChangeButtonText(confirmText, cancelText); }); }
public void Enter() { if (bordlandTime == null) { return; } if (Level.current && Level.current is Level_Bordlands) { moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.BorderlandUIText, 33)); return; } moduleGuide.needEnterBordland = false; if (!isValidBordland && bordlandsSettlementReward == null) { string content = ConfigText.GetDefalutString(TextForMatType.BorderlandUIText, 17); Window_Alert.ShowAlert(content); return; } if (isLeaveBordland) { SendEnterBordLand(); } else { Game.LoadLevel(BORDERLAND_LEVEL_ID); } }
private void OnReturnBtnClick(GameObject sender) { Window_Alert.ShowAlertDefalut(ConfigText.GetDefalutString(TextForMatType.AlertUIText, 5), () => { moduleBordlands.SendExitBordland(); }, () => { }); }
public void GetAward(PWeflareAward info, int index) { if (info == null) { return; } if (info.state == 3) { var cost = moduleWelfare.GetCostMoney(info); if (cost == 0) { moduleWelfare.SendBuyReward(index); return; } Window_Alert.ShowAlert(string.Format(ConfigText.GetDefalutString(211, 25), cost), true, true, true, () => { moduleWelfare.SendBuyReward(index); }, null, "", ""); } else if (info.state == 1) { moduleWelfare.SendGetReward(index); } }
private static void ShowWarningDialog(string rMessage) { #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) #endif Window_Alert.ShowAlertDefalut(rMessage, () => { Module_Login.instance.LogOut(false); }, null, "", "", false); Logger.LogError(rMessage); }
private void OnConfirmClick() { var t = ConfigManager.Get <ConfigText>((int)TextForMatType.AlertUIText); if (!t) { return; } Window_Alert.ShowAlert(t[1], true, true, true, OnConfirmCallback, null, "", t[2]); }
private void CheckOpenQuitPanel() { var rewardWindow = GetOpenedWindow <Window_RandomReward>(); if (!moduleBordlands.isValidBordland && (!rewardWindow || !rewardWindow.actived)) { string msg = ConfigText.GetDefalutString(TextForMatType.BorderlandUIText, 16); Window_Alert.ShowAlert(msg, true, false, false, () => { Game.GoHome(); }); } }
private void SetBLack() { if (Module_Active.instance.CheckCoop(PlayerId)) { Module_Global.instance.ShowMessage(218, 63); } else { Window_Alert.ShowAlert(ConfigText.GetDefalutString(218, 65), true, true, true, () => { Module_Friend.instance.SendShieDing(PlayerId); }, null, "", ""); } }
protected override void OnBecameVisible(bool oldState, bool forward) { moduleAwakeMatch.enterGame = false; if (!teamWindow.Initialize()) { Window_Alert.ShowAlertDefalut(Util.Format(ConfigText.GetDefalutString(68001), moduleAwakeMatch.StageId), () => { Hide(); }, null, string.Empty, string.Empty, false); return; } moduleGlobal.ShowGlobalLayerDefault(1, false); }
private void OnExchange() { var prop = ConfigManager.Get <PropItemInfo>(_content.itemId); if (prop == null) { return; } Window_Alert.ShowAlertDefalut(Util.Format(ConfigText.GetDefalutString(199, 0), BuyCount * prop.diamonds, BuyCount, prop.itemName), () => { moduleShop.FreeBuy((ushort)_content.itemId, (uint)BuyCount); }, () => {}, ConfigText.GetDefalutString(199, 1), ConfigText.GetDefalutString(199, 2)); }
private void OnSelectItemClick(PreviewMatItem item) { List <PItem> items = moduleEquip.GetBagProps(PropType.IntentyProp); //没有道具就弹出警告窗口 if (items == null || items.Count == 0) { Window_Alert.ShowAlert(ConfigText.GetDefalutString(TextForMatType.AlertUIText, 4)); } else { m_selectPanel.RefreshPanel(data, equipType, m_swallowMats, items); } }
private void OnCancelRequest(PetTaskItem obj) { Window_Alert.ShowAlertDefalut(ConfigText.GetDefalutString(TextForMatType.PetTrainFastComplete, 6), () => { var msg = PacketObject.Create <CsPetTaskOperator>(); msg.operatorCode = 1; msg.taskId = obj.Task.ID; session.Send(msg); }, () => { }, ConfigText.GetDefalutString(TextForMatType.PetTrainFastComplete, 4), ConfigText.GetDefalutString(TextForMatType.PetTrainFastComplete, 5)); }
private void SetReleaseClick(RectTransform rt, PropItemInfo info) { if (info == null) { return; } if (moduleUnion.ReleaseTime == 0) { moduleGlobal.ShowMessage(631, 18); return; } Window_Alert.ShowAlert(string.Format(ConfigText.GetDefalutString(631, 19), info.itemName, info.rewardnum), true, true, true, () => { moduleUnion.ReleaseSelfTask(info.ID); }, null, "", ""); }
private void OnExcuteMulti() { var error = Module_Chase.CheckMoppingUp(task, SingleMoppingUpMax); if (error == MoppingUpException.None) { Window_Alert.ShowAlertDefalut(Util.Format(ConfigText.GetDefalutString(TextForMatType.MoppingUpUI, 0), task.taskConfigInfo.fatigueCount * SingleMoppingUpMax, SingleMoppingUpMax), () => { //TODO: 开始扫荡 moduleChase.RequestMoppingUp((ushort)task.taskConfigInfo.ID, SingleMoppingUpMax); }, null, ConfigText.GetDefalutString(TextForMatType.MoppingUpUI, 1), ConfigText.GetDefalutString(TextForMatType.MoppingUpUI, 2)); } else { ProcessException(error); } }
private void OnMatchSuccess(ScTeamPveMatchSuccess msg) { if (msg.result == 3) { Window_Alert.ShowAlertDefalut(ConfigText.GetDefalutString((int)TextForMatType.AwakeStage, 10), () => { moduleAwakeMatch.Request_EnterRoom(false, currentTask); }, () => Hide()); return; } if (msg.result != 0) { moduleGlobal.ShowMessage(9806, msg.result); return; } Hide(); ShowAsync <Window_TeamMatch>(); }
private void SetBtnClick(ulong id, int title) { m_removeBtn.onClick.RemoveAllListeners(); m_presidentBtn.onClick.RemoveAllListeners(); m_vicePresidentBtn.onClick.RemoveAllListeners(); m_blackBtn?.onClick.RemoveAllListeners(); m_removeBlack?.onClick.RemoveAllListeners(); m_blackBtn?.onClick.AddListener(delegate { if (Module_Active.instance.CheckCoop(id)) { Module_Global.instance.ShowMessage(218, 63); } else { Window_Alert.ShowAlert(ConfigText.GetDefalutString(218, 65), true, true, true, () => { Module_Friend.instance.SendShieDing(id); }, null, "", ""); } }); m_removeBtn.onClick.AddListener(delegate { Window_Alert.ShowAlert(ConfigText.GetDefalutString(242, 169), true, true, true, () => { Module_Union.instance.KickedPlayer(id); }, null, "", ""); }); m_presidentBtn.onClick.AddListener(delegate { Window_Alert.ShowAlert(ConfigText.GetDefalutString(242, 170), true, true, true, () => { Module_Union.instance.ChangeTitle((long)id, 0); }, null, "", ""); }); m_vicePresidentBtn.onClick.AddListener(delegate { if (title == 1) { Window_Alert.ShowAlert(ConfigText.GetDefalutString(242, 171), true, true, true, () => { Module_Union.instance.ChangeTitle((long)id, 2); }, null, "", ""); } else if (title == 2) { Window_Alert.ShowAlert(ConfigText.GetDefalutString(242, 172), true, true, true, () => { Module_Union.instance.ChangeTitle((long)id, 1); }, null, "", ""); } }); m_removeBlack?.onClick.AddListener(delegate { Window_Alert.ShowAlert(ConfigText.GetDefalutString(218, 66), true, true, true, () => { Module_Friend.instance.RecoverShieDing(id); }, null, "", ""); }); }
private void OnDecompose() { if (decomposeDict.Count == 0) { moduleGlobal.ShowMessage((int)TextForMatType.DecomposeUI, 4); return; } var num = 0; foreach (var kv in decomposeDict) { num += kv.Value.count; } Window_Alert.ShowAlertDefalut(Util.Format(ConfigText.GetDefalutString(TextForMatType.DecomposeUI, 2), num), () => { moduleFurnace.RequestComposeItem(new List <DecomposePair>(decomposeDict.Values)); }, null, ConfigText.GetDefalutString(TextForMatType.DecomposeUI, 0), ConfigText.GetDefalutString(TextForMatType.DecomposeUI, 1)); }
public void Request_EnterRoom(bool enter, ChaseTask task) { if (task == null) { return; } if (!enter && !moduleGlobal.CheckSourceMd5(false)) { var ct = ConfigManager.Get <ConfigText>(25); Window_Alert.ShowAlertDefalut(ct[2], () => { Internal_RequestEnterRoom(enter, task); }, Game.Quit, ct[3], ct[4], false); return; } //if (task.Equals(CurrentTask)) // return; Internal_RequestEnterRoom(enter, task); }
private void OnBuyClick() { if (m_chargeItem == null || m_rewards == null) { return; } var day = Module_Charge.CalcCardDays(m_chargeItem.info.endTime); if (day < m_rewards.oneinfo.Length) { var t = Util.GetDateTime((long)m_chargeItem.info.endTime); Window_Alert.ShowAlertDefalut(Util.Format(ConfigText.GetDefalutString(TextForMatType.RechargeUIText, 28), t.Month, t.Day), () => { moduleCharge.RequestBuyProduct(m_chargeItem); }, () => {}); return; } moduleCharge.RequestBuyProduct(m_chargeItem); }
public void RefreshVocationItem(int vocationID, bool isSpecial, float _special, float _normal, Action OnClickConfirmBtn) { Initialized(); var targetSize = new Vector2(isSpecial ? _special : _normal, transform.rectTransform().sizeDelta.y); DOTween.To(() => transform.rectTransform().sizeDelta, x => transform.rectTransform().sizeDelta = x, targetSize, tweenTime).SetEase(curve); var professionInfo = ConfigManager.Get <ProfessionInfo>(vocationID); if (!professionInfo) { tip_btn.enabled = true; tip_btn.onClick.RemoveAllListeners(); tip_btn.onClick.AddListener(() => Module_Global.instance.ShowMessage(ConfigText.GetDefalutString(TextForMatType.ProfessionText, 8))); return; } tip_btn.enabled = false; Util.SetText(_name, professionInfo.professionNameID); Util.SetText(_identity, professionInfo.identity); Util.SetText(_dub, professionInfo.dub); Util.SetText(_desc, professionInfo.desc); Util.SetText(_identityLittle, professionInfo.identity); _confirmBtn.onClick.RemoveAllListeners(); _confirmBtn.onClick.AddListener(() => { var t = ConfigManager.Get <ConfigText>((int)TextForMatType.AlertUIText); if (!t) { return; } Module_Login.instance.createGender = professionInfo.gender; Module_Login.instance.roleProto = professionInfo.ID; Window_Alert.ShowAlert(t[1], true, true, true, OnClickConfirmBtn, null, "", t[7]); }); }
public void Friedreplay(bool isMd5Diffrent = false) { //成功加载后就不能再处理加载失败操作了。(如果对方同意邀请后,再次收到邀请会返回邀请失败) if (modulePVP.loading) { return; } //没有好友同意到我的邀请 isbaning = true; DispatchModuleEvent(EventInvationFailed, isMd5Diffrent); if (isMd5Diffrent) { var ct = ConfigManager.Get <ConfigText>(25); if (moduleGlobal.CheckSourceMd5(false)) { Window_Alert.ShowAlertDefalut(ct[6], () => { }); } else { Window_Alert.ShowAlertDefalut(ct[7], Game.Quit, () => {}, ct[4], ct[8], false); } } }
private void SetRight() { m_downOpen = false; m_diedEnd = false; m_rightTip.gameObject.SetActive(false); m_openBossBtn.gameObject.SetActive(false); m_enterBossBtn.gameObject.SetActive(false); m_closeBossObj.gameObject.SetActive(false); m_openBossObj.gameObject.SetActive(false); m_enterBossBtn.interactable = false; if (moduleUnion.m_bossStage == null || moduleUnion.m_bossReward == null || moduleUnion.BossInfo == null) { Logger.LogError("confige is error"); return; } //取boss对应的配置 for (int i = 0; i < m_diffcutType.Count; i++) { m_diffcutType[i].SetActive(i == (moduleUnion.m_bossStage.diffcut - 1)); } UIDynamicImage.LoadImage(m_openIcon.gameObject, moduleUnion.m_bossStage.bossIcon); UIDynamicImage.LoadImage(m_closeIcon.gameObject, moduleUnion.m_bossStage.bossIcon); if (moduleUnion.BossInfo.bossstate == 0)//未开启 { m_getRewardBtn.gameObject.SetActive(false); m_closeBossObj.gameObject.SetActive(true); m_openBossObj.gameObject.SetActive(false); if (moduleUnion.inUnion == 0 || moduleUnion.inUnion == 1)//如果自己是管理层 { m_openBossBtn.gameObject.SetActive(true); if (moduleUnion.BossInfo.remaintimes == 0)//0 今日可开 1 今日不可开 { m_openBossBtn.interactable = true; } } else { Util.SetText(m_enterTxt, ConfigText.GetDefalutString(242, 193)); m_enterBossBtn.gameObject.SetActive(true); } if (moduleUnion.BossInfo.remaintimes == 1)//0 未打过 1 打过 { m_rightTip.gameObject.SetActive(true); m_openBossBtn.interactable = false; m_enterBossBtn.interactable = false; Util.SetText(m_rightTipTxt, ConfigText.GetDefalutString(242, 174)); } else { m_tipTxt = ConfigText.GetDefalutString(242, 121); CountDown(0); } } else if (moduleUnion.BossInfo.bossstate == 1)//开启 { m_closeBossObj.gameObject.SetActive(false); m_openBossObj.gameObject.SetActive(true); m_enterBossBtn.gameObject.SetActive(true); if (moduleUnion.m_onlyInfo.cooltime > 0)//如果在死亡冷却时间 { m_enterBossBtn.interactable = false; m_rightTip.gameObject.SetActive(true); Util.SetText(m_enterTxt, ConfigText.GetDefalutString(242, 119)); m_tipTxt = ConfigText.GetDefalutString(242, 122); CountDown(1); } else { Util.SetText(m_enterTxt, ConfigText.GetDefalutString(242, 119)); m_enterBossBtn.interactable = true; } if (moduleUnion.BossInfo.remianblood <= 0) { m_enterBossBtn.interactable = false; } } m_openBossBtn.onClick.RemoveAllListeners(); m_enterBossBtn.onClick.RemoveAllListeners(); m_openBossBtn.onClick.AddListener(delegate { Window_Alert.ShowAlert(ConfigText.GetDefalutString(242, 173), true, true, true, () => { moduleUnion.OpenBoss(); }, null, "", ""); //管理层开启boss活动 ; }); m_enterBossBtn.onClick.AddListener(delegate { //请求进入打boss moduleUnion.EnterBoss(); }); m_rightSet.gameObject.SetActive(false); if (moduleUnion.inUnion == 0 || moduleUnion.inUnion == 1)//如果自己是管理层 { m_rightSet.gameObject.SetActive(true); } }
private void OpenInfo(int progressvalue, short taskid) { ItemInfo.Clear(); ItemInfo.Add(itemone); ItemInfo.Add(itemtwo); ItemInfo.Add(itemthree); TaskInfo task = ConfigManager.Get <TaskInfo>(taskid); if (task == null) { Logger.LogError("can not find config id" + taskid); return; } Util.SetText(detail, task.desc); Util.SetText(progress, pettask_txt[5], progressvalue); progress_bar.fillAmount = (float)progressvalue / (float)100; explore.onClick.RemoveAllListeners(); explore.onClick.AddListener(() => { if (Module_Home.instance.m_showBossTip) { Window_Alert.ShowAlert(pettask_txt[11], true, true, true, () => { Module_Home.instance.Entermodule(taskid); }, null, "", ""); } else { Module_Home.instance.Entermodule(taskid); } }); for (int i = 0; i < ItemInfo.Count; i++) { ItemInfo[i].gameObject.SetActive(false); } StageInfo stage = ConfigManager.Get <StageInfo>(task.stageId); if (stage == null) { return; } if (stage.previewRewardItemId.Length == 0) { return; } List <PropItemInfo> awardinfo = GetAllAward(stage.previewRewardItemId); if (awardinfo.Count <= 0) { Logger.LogDetail("no award can find "); return; } for (int i = 0; i < awardinfo.Count; i++) { if (i < ItemInfo.Count) { Util.SetItemInfo(ItemInfo[i], awardinfo[i]); ItemInfo[i].gameObject.SetActive(true); OnlickSet(ItemInfo[i], (ushort)awardinfo[i].ID); } } }
void _ME(ModuleEvent <Module_Union> e) { switch (e.moduleEvent) { case Module_Union.EventUnionBuyEffect: var effId = Util.Parse <int>(e.param1.ToString()); if (m_tipPlane.gameObject.activeInHierarchy) { SetTipPlane(effId); } SetEffect(); CountDown(1); break; case Module_Union.EventUnionBossOpen: //开启 SetLeft(); SetRight(); m_rightTip.gameObject.SetActive(false); break; case Module_Union.EventUnionBossClose: //关闭 if (!actived || moduleUnion.EnterBossTask) { return; } moduleUnion.SetNewBoss(); SetLeft(); SetRight(); break; case Module_Union.EventUnionBossChange: //设置更改 SetBossSet(); SetLeft(); SetRight(); m_setPlane.gameObject.SetActive(false); break; case Module_Union.EventUnionBossHurt: //刷新伤害值 SetLeft(); break; case Module_Union.EventUnionBossCanGet: //有奖励发生变化 SetLeft(); break; case Module_Union.EventUnionBossSortHurt: //查看排行榜 SetRankInfo(); break; case Module_Union.EventUnionBossKillCool: //冷却时间完成 //m_diedEnd = false; //m_enterBossBtn.interactable = true; //m_rightTip.gameObject.SetActive(false); //m_openBossBtn.gameObject.SetActive(false); //m_enterBossBtn.gameObject.SetActive(true); break; case Module_Union.EventUnionRewardGet: //奖励领取成功 var reward = e.param1 as PItem2[]; var boxid = Util.Parse <int>(e.param2.ToString()); ShowSuccedReward(reward, boxid); break; case Module_Union.EventUnionBossOver: m_diedEnd = true; break; case Module_Union.EventUnionSelfExit: //自己被踢出或者自己退出 var type = Util.Parse <int>(e.param1.ToString()); var pos = Util.Parse <int>(e.param2.ToString()); if (type != 0 || pos == 0) { GetMyUnionExit(); } else if (actived) { Window_Alert.ShowAlertDefalut(ConfigText.GetDefalutString(242, 210), () => { GetMyUnionExit(); }, () => { GetMyUnionExit(); }); } break; } }
private void RemoveBlack() { Window_Alert.ShowAlert(ConfigText.GetDefalutString(218, 66), true, true, true, () => { Module_Friend.instance.RecoverShieDing(PlayerId); }, null, "", ""); }
public void SetInfo(PCooperateInfo info, Action <CooperationTask> monShow) { if (info == null) { Logger.LogError("server info is null"); return; } CooperationTask task = Module_Active.instance.coopTaskBase.Find(a => a.ID == info.taskId); if (task == null) { Logger.LogError("configuration is not have this id"); return; } Get(); monShowList = monShow; Util.SetText(m_name, task.name); if (string.IsNullOrEmpty(task.icon)) { Logger.LogError(" this task no icon"); } UIDynamicImage.LoadImage(m_monsterImg, task.icon); Util.SetText(m_invateTxt, ConfigText.GetDefalutString(223, 38), task.limitLevel); m_taskOne.gameObject.SetActive(true); m_coop.gameObject.SetActive(task.type == 1); m_taskTwo.gameObject.SetActive(task.type == 1); m_invate.gameObject.SetActive(info.friendId == 0 && task.type == 1 && info.state == 0); m_player.gameObject.SetActive(info.friendId != 0 && task.type == 1 && info.state == 0); m_reward.gameObject.SetActive(info.state == 1); m_offPlane.gameObject.SafeSetActive(info.state == 2); AwardGetSucced succed = m_showReward.GetComponentDefault <AwardGetSucced>(); succed.SetAward(task.reward, showReward, false); if (task.conditions == null || task.conditions.Length < 1) { Logger.LogError("monster info is error"); return; } if (task.type == 2 && task.conditions.Length >= 1) { SetValue(task.conditions[0], 0, m_oneTxt, m_oneSlider, m_oneValue, info.selfFinishVal); } else if (task.type == 1 && task.conditions.Length > 1) { var self = task.conditions[0]; var friend = task.conditions[1]; var ids = info.friendId; var selfValue = info.selfFinishVal; var fValue = info.assistFinishVal; if (Module_Player.instance.id_ != info.ownerId) { self = task.conditions[1]; friend = task.conditions[0]; ids = info.ownerId; selfValue = info.assistFinishVal; fValue = info.selfFinishVal; } SetValue(self, 0, m_oneTxt, m_oneSlider, m_oneValue, selfValue); SetValue(friend, 1, m_twoTxt, m_twoSlider, m_twoValue, fValue); if (ids != 0) { var f = Module_Friend.instance.FriendList.Find(a => a.roleId == ids); if (f != null) { m_invateName.text = f.name; headBoxFriend headBox = m_HeadBox.gameObject.GetComponentDefault <headBoxFriend>(); headBox.HeadBox(f.headBox); Module_Avatar.SetClassAvatar(m_HeadAvatar, f.proto, false, f.gender); } } } m_invateBtn.onClick.RemoveAllListeners(); m_invateBtn.onClick.AddListener(delegate { Module_Active.instance.CheckTaskID = info.uid; Module_Active.instance.GetCanInvate(info.taskId); }); m_monsterBtn.onClick.RemoveAllListeners(); m_monsterBtn.onClick.AddListener(delegate { //出现怪物详情界面 if (!Module_Active.instance.collTask.ContainsKey(task.ID)) { var idnex = 0; if (Module_Player.instance.id_ != info.ownerId) { idnex = 1; } Module_Active.instance.GetMonsterShow(task.ID, task.conditions[idnex].monsterId); } Module_Active.instance.CoopShowList.Clear(); Module_Active.instance.GetAllMonsterStage(task.ID); monShowList(task); }); m_rewardBtn.onClick.RemoveAllListeners(); m_rewardBtn.onClick.AddListener(delegate { Module_Active.instance.GetCoopReward(info.uid); }); m_playerBtn.onClick.RemoveAllListeners(); m_playerBtn.onClick.AddListener(delegate { if (Module_Player.instance.id_ != info.ownerId) { Module_Global.instance.ShowMessage(223, 46); //无权踢出 } else { if (CanKickedOut(info.acceptTime) && info.state == 0) { Window_Alert.ShowAlert(ConfigText.GetDefalutString(223, 40), true, true, true, () => { Module_Active.instance.KickedOutFriend(info.uid, info.friendId); }, null, "", ""); } else { Module_Global.instance.ShowMessage(223, 43); //未到时间 或者 已经可领取 } } }); }
private void OnCreateRoleClick() { Window_Alert.ShowAlertDefalut(ConfigText.GetDefalutString(TextForMatType.SelectRoleUI, 8), () => { moduleSelectRole.CreateRole(); }); }
private void PlayerDetailsInfo(PPlayerInfo details, bool world)//加载玩家的详情 { if (details == null) { return; } Module_Avatar.SetClassAvatar(details_headbg, details.proto, false, details.gender); headBoxFriend detaibox = Details_box.GetComponentDefault <headBoxFriend>(); detaibox.HeadBox(details.headBox); is_compare.interactable = true; Util.SetText(details_name, details.name); Util.SetText(details_id, ConfigText.GetDefalutString(218, 36), details.index); Util.SetText(details_introduce, Module_Set.instance.SetSignTxt(details.intro)); string formatText = ConfigText.GetDefalutString(218, 2) + details.level.ToString(); Util.SetText(details_level, formatText); is_compare.onClick.RemoveAllListeners(); is_compare.onClick.AddListener(delegate { var canshow = Module_Guide.instance.IsActiveFunction(HomeIcons.Fight); if (canshow) { canshow = Module_Guide.instance.IsActiveFunction(HomeIcons.PVP); } if (!canshow) { Module_Global.instance.ShowMessage(ConfigText.GetDefalutString(223, 12)); return; } int remain = Module_Match.instance.CanInvation(details.roleId); if (remain > 0) { Module_Global.instance.ShowMessage(ConfigText.GetDefalutString(218, 51)); return; } if (details.state == 1) { Module_PVP.instance.opType = OpenWhichPvP.FriendPvP; Window.ShowAsync("window_pvp"); List <ulong> this_F = new List <ulong>(); this_F.Add(details.roleId); Module_Match.instance.FriendFree(this_F); var inKey = "invation" + PlayerId; PlayerPrefs.SetString(inKey, Util.GetServerLocalTime().ToString()); } else if (details.state == 0) { Module_Global.instance.ShowMessage(218, 46); } else { Module_Global.instance.ShowMessage(218, 47); } }); m_invateUnion.onClick.RemoveAllListeners(); m_invateUnion.onClick.AddListener(delegate { if (Module_Friend.instance.CanInviteUnion == 0) { Window_Alert.ShowAlert(ConfigText.GetDefalutString(248, 2), true, true, true, () => { SetInvate(); }, null, "", ""); } else if (Module_Friend.instance.CanInviteUnion == 1) { Module_Global.instance.ShowMessage(218, 55); } else if (Module_Friend.instance.CanInviteUnion == 2) { Module_Global.instance.ShowMessage(218, 57); } else if (Module_Friend.instance.CanInviteUnion == 3) { Module_Global.instance.ShowMessage(218, 56); } }); is_delete.onClick.RemoveAllListeners(); not_add.onClick.RemoveAllListeners(); m_blackBtn?.onClick.RemoveAllListeners(); m_removeBtn?.onClick.RemoveAllListeners(); m_blackBtn?.onClick.AddListener(SetBLack); m_removeBtn?.onClick.AddListener(RemoveBlack); is_delete.onClick.AddListener(SetDelete); not_add.onClick.AddListener(DeltailAdd); if (world) { is_compare.SafeSetActive(false); is_chat.onClick.RemoveAllListeners(); is_chat.onClick.AddListener(delegate { gameObject.SafeSetActive(false); Module_Friend.instance.m_friendOpenType = OpenFriendType.World; Window.ShowAsync("window_friend"); }); } }
void _ME(ModuleEvent <Module_NPCDating> e) { if (!actived) { return; } switch (e.moduleEvent) { case Module_NPCDating.EventEnterDatingPanel: if (moduleNPCDating.forceSettlement) { moduleNPCDating.forceSettlement = false; Window_Alert.ShowAlert(ConfigText.GetDefalutString(TextForMatType.NpcDating, 24), true, false, false, () => { Window.ShowAsync <Window_Home>(); }); RefreshPanel(); moduleNPCDating.ClearDatingData(); } else if (moduleNPCDating.isNpcBattelSettlement) { moduleNPCDating.isNpcBattelSettlement = false; //助战导致约会结算,开始一个特殊的结算事件流程,特殊id需要配表 moduleNPCDating.DoDatingEvent(GeneralConfigInfo.defaultConfig.datingEndEventId); } else { bool needReconnect = moduleNPCDating.CheckDatingReconnect(EnumNPCDatingSceneType.DatingHall); if (!needReconnect) { moduleNPCDating.ContinueBehaviourCallBack(RefreshPanel); } } break; case Module_NPCDating.EventRealEnterDatingScene: //点击娱乐街场景按钮 switch ((sbyte)e.param1) { case 0: //成功 int sceneId = moduleNPCDating.enterSceneData.sceneId; Game.LoadLevel(sceneId); moduleNPCDating.isEnterSceneMark = true; break; case 1: //当前没有约会Npc,请选择Npc moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.NpcDating, 4)); break; case 2: //已经进入过该场景 moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.NpcDating, 5)); break; case 3: //约会已经结束 moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.NpcDating, 6)); break; case 4: //图书馆答错,未去其他场景再进图书馆提示 moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.NpcDating, 20)); break; case 5: //Npc体力不足,无法进行约会 string str = ConfigText.GetDefalutString(TextForMatType.NpcDating, 23); moduleGlobal.ShowMessage(Util.Format(str, moduleNPCDating.curDatingNpcMsg == null ? "": moduleNPCDating.curDatingNpcMsg.name)); break; default: break; } break; case Module_NPCDating.EventClickDatingBuild: OpenSecondScenePanel((EnumNPCDatingSceneType)e.param1); break; } }