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); } }
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 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, "", ""); } }
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 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 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, "", ""); }); }
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]); }); }
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); } }
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 RemoveBlack() { Window_Alert.ShowAlert(ConfigText.GetDefalutString(218, 66), true, true, true, () => { Module_Friend.instance.RecoverShieDing(PlayerId); }, null, "", ""); }
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"); }); } }
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_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; } }