void Start() { UIEventListener.Get(ReturnBtn).onClick = OnReturn; UIEventListener.Get(SearchBtn).onClick = OnSearch; sortMethod.Clear(); sortMethod.AddItem("升序"); sortMethod.AddItem("降序"); sortMethod.value = "降序"; sortType.Clear(); sortType.AddItem("团队棋牌盈亏"); sortType.AddItem("团队棋牌返点"); sortType.value = "团队棋牌返点"; }
public void Show(MSG_GP_USER_GETPLAYMAXPOINTRESULT para) { gameObject.SetActive(true); savePara = para; AccountInput.value = ""; passwordInput.value = ""; confirmInput.value = ""; tikuanpswdInput.value = ""; tikuanConfirmInput.value = ""; xiajifandian.value = "0.0"; wangyefandian.value = "0.0"; webPointLabel.text = string.Format("当前网页注册返点:{0}", para.GetdWebPoint()); urlList.Clear(); for (int i = 0; i < para.GetUrlList().Count; i++) { urlList.AddItem(para.GetUrlList()[i] + "/reg/?user="******"代理"; shengyupeieLabel.text = para.GetDescribe(); }
protected override void DealShowData() { if (Data is Dictionary <string, object> ) { ExtractData data = new ExtractData(Data, GetType()); if (ShowArea) { var visible = data.Visible; ShowArea.SetActive(visible); if (visible) { if (Option) { _dataDic = data.DataDic; Option.Clear(); foreach (var item in data.DataDic) { Option.AddItem(item.Key); } if (Option.items.Count > 0) { var showName = Option.items[0]; Option.Set(showName); _curCostType = showName; _curCostData = _dataDic[showName] as ExtractItemData; } else { YxDebug.LogError("Extract types count is zero,please check again!"); } } } } } }
/// <summary> /// 设置指定的数据进行显示 /// </summary> /// <param name="UIRecord">User interface record.</param> public void SetValue(UserInfoRecord UIRecord) { Logger.Instance.WriteLog("显示用户相关信息"); this.UIRecord = UIRecord; if (UIRecord.GInfo.Name == "超级管理员" || UIRecord.UBInfo.UserName == DataStore.UserInfo.UserName) { ForbiddenModify(); } GroupDao gpDao = new GroupDao(); gpDao.Select003(); List <GroupInfo> gpInfos = gpDao.Result; foreach (GroupInfo info in gpInfos) { PPLRole.AddItem(info.Name); } PPLRole.value = UIRecord.GInfo.Name; LBLAccount.text = UIRecord.UBInfo.UserName; LBLCreateTime.text = System.DateTime.Parse(UIRecord.UBInfo.CreateTime).ToString("yyyy年MM月dd日"); LBLPassword.text = "**********"; IPTAddress.value = UIRecord.UBInfo.Address; IPTRealName.text = UIRecord.UBInfo.RealName; IPTTelphone.value = UIRecord.UBInfo.Telphone; IPTMemo.value = UIRecord.UBInfo.Memo; if (UIRecord.UBInfo.Status == "禁用") { BtnContainer.transform.FindChild("BtnForbidden").GetComponentInChildren <UILabel>().text = "启用"; } }
static public int AddItem(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 2) { UIPopupList self = (UIPopupList)checkSelf(l); System.String a1; checkType(l, 2, out a1); self.AddItem(a1); pushValue(l, true); return(1); } else if (argc == 3) { UIPopupList self = (UIPopupList)checkSelf(l); System.String a1; checkType(l, 2, out a1); System.Object a2; checkType(l, 3, out a2); self.AddItem(a1, a2); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
private static int AddItem(IntPtr L) { int result; try { int num = LuaDLL.lua_gettop(L); if (num == 2 && TypeChecker.CheckTypes(L, 1, typeof(UIPopupList), typeof(string))) { UIPopupList uIPopupList = (UIPopupList)ToLua.ToObject(L, 1); string text = ToLua.ToString(L, 2); uIPopupList.AddItem(text); result = 0; } else if (num == 3 && TypeChecker.CheckTypes(L, 1, typeof(UIPopupList), typeof(string), typeof(object))) { UIPopupList uIPopupList2 = (UIPopupList)ToLua.ToObject(L, 1); string text2 = ToLua.ToString(L, 2); object data = ToLua.ToVarObject(L, 3); uIPopupList2.AddItem(text2, data); result = 0; } else { result = LuaDLL.luaL_throw(L, "invalid arguments to method: UIPopupList.AddItem"); } } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
static int AddItem(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 2) { UIPopupList obj = (UIPopupList)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIPopupList"); string arg0 = LuaScriptMgr.GetLuaString(L, 2); obj.AddItem(arg0); return(0); } else if (count == 3) { UIPopupList obj = (UIPopupList)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIPopupList"); string arg0 = LuaScriptMgr.GetLuaString(L, 2); object arg1 = LuaScriptMgr.GetVarObject(L, 3); obj.AddItem(arg0, arg1); return(0); } else { LuaDLL.luaL_error(L, "invalid arguments to method: UIPopupList.AddItem"); } return(0); }
public void Show() { StartDateInput.value = TimeHelper.GetTimeStrFromUlong(XiajiTouZhuMingXiPanel.startDate); EndDateInput.value = TimeHelper.GetTimeStrFromUlong(XiajiTouZhuMingXiPanel.endDate); LotteryConfigLoader cfgLoader = ConfigManager.Instance.GetLotteryCfgLoader(); lcfgs = cfgLoader.lotteryConfigs; TouZhuLeiXingList.Clear(); TouZhuLeiXingList.value = "全部"; TouZhuLeiXingList.AddItem("全部"); for (int i = 0; i < lcfgs.Count; ++i) { TouZhuLeiXingList.AddItem(lcfgs[i].name); } gameObject.SetActive(true); }
static int AddItem(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UIPopupList), typeof(string))) { UIPopupList obj = (UIPopupList)ToLua.ToObject(L, 1); string arg0 = ToLua.ToString(L, 2); obj.AddItem(arg0); return(0); } else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(UIPopupList), typeof(string), typeof(object))) { UIPopupList obj = (UIPopupList)ToLua.ToObject(L, 1); string arg0 = ToLua.ToString(L, 2); object arg1 = ToLua.ToVarObject(L, 3); obj.AddItem(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UIPopupList.AddItem")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Start() { UIEventListener.Get(ReturnBtn).onClick = OnReturn; UIEventListener.Get(SearchBtn).onClick = OnSearch; sortMethod.Clear(); sortMethod.AddItem("升序"); sortMethod.AddItem("降序"); sortMethod.value = "降序"; sortType.Clear(); sortType.AddItem("注册时间"); sortType.AddItem("返点%"); sortType.AddItem("余额"); sortType.AddItem("最后登录时间"); sortType.value = "注册时间"; }
private void Localization() { lblUp.text = GameManager.localization.GetText("Hero_Inventory_btnUpgradeITem"); lblUpgradeType.text = GameManager.localization.GetText("ItemUpgrade_UpgradeType"); cboUpgradeType.AddItem(GameManager.localization.GetText("ItemUpgrade_White")); cboUpgradeType.AddItem(GameManager.localization.GetText("ItemUpgrade_Green")); cboUpgradeType.AddItem(GameManager.localization.GetText("ItemUpgrade_Blue")); cboUpgradeType.AddItem(GameManager.localization.GetText("ItemUpgrade_Yellow")); cboUpgradeType.value = cboUpgradeType.items[0]; }
// Use this for initialization void Start() { panel = transform.Find("Camera").Find("Panel").GetComponent <UIPanel>(); LogLabel = panel.transform.Find("LogLabel").GetComponent <UILabel>(); popupList = panel.transform.Find("PopupList").GetComponent <UIPopupList>(); eventDelegate = new EventDelegate(OnSelectChange); popupList.onChange.Add(eventDelegate); popupList.AddItem(NetworkCommand.DEFAULT); }
public void Show() { StartDateInput.value = TimeHelper.GetTimeStrFromUlong(YingKuiRecordPanel.startDate); EndDateInput.value = TimeHelper.GetTimeStrFromUlong(YingKuiRecordPanel.endDate); LeiXingList.Clear(); dic.Clear(); LeiXingList.value = "全部"; LeiXingList.AddItem("全部"); for (var i = 0; i < 20; i++) { dic.Add(names[i], values[i]); } foreach (var name in names) { LeiXingList.AddItem(name); } gameObject.SetActive(true); }
void showItemsInCategory(string aCategory,UIPopupList aList) { aList.Clear(); BetterList<MoveAnimationLibItem> items = MovesAnimationLib.REF.items; for(int i = 0 ;i<items.size;i++) { if(items[i].category==aCategory) { aList.AddItem(items[i].name,items[i]); } } }
// Use this for initialization void Start () { popList = GetComponent<UIPopupList>(); if(popList == null) return; popList.Clear(); List<DataTable> tableList = ConstDataManager.Instance.ListTables(); foreach(DataTable table in tableList) { popList.AddItem(table.Name); } }
void Start() { IPTPassword.value = "1234567"; GroupDao gpDao = new GroupDao(); gpDao.Select003(); Groups = gpDao.Result; foreach (GroupInfo info in Groups) { PPLGroup.AddItem(info.Name); } }
private UISlider changVolume; //调解音量 void Start() { selectMusic = transform.FindChild("SelectMusic").GetComponent<UIPopupList>(); selectMusic.Clear(); AudioClip[] bgMusics = Resources.LoadAll<AudioClip>("BgMusic"); for (int i = 0; i < bgMusics.Length; i++) { selectMusic.AddItem(bgMusics[i].name); } EventDelegate.Add(selectMusic.onChange, OnMusicChange); changVolume = transform.FindChild("VolumeSolider").GetComponent<UISlider>(); EventDelegate.Add(changVolume.onChange, OnChangeVolume); }
void OnClick() { // if (waiting != null) { // waiting.SetActive(true); // } //清空登录/游戏信息List HallTransfer.Instance.logonRecordList.Clear(); HallTransfer.Instance.gameRecordList.Clear(); //发送消息 if (HallTransfer.Instance.uiConfig.page_gameRecord_mask != null) { HallTransfer.Instance.uiConfig.page_gameRecord_mask.SetActive(true); } if (HallTransfer.Instance.ncSafetyCenter != null) { HallTransfer.Instance.ncSafetyCenter(); } //初始化日期下拉菜单 //GameObject tempDateList =HallTransfer.Instance.uiConfig.window_Security.transform.FindChild("front_panel").FindChild("content").FindChild("datePopup_list").gameObject; if (m_gDateList != null) { m_gDateList.Clear(); m_gDateList.value = DateTime.Now.ToString("yyyy-MM-dd"); for (int i = 4; i >= 0; i--) { dt = DateTime.Now.AddDays(-i); m_gDateList.AddItem(dt.ToString("yyyy-MM-dd")); } } //初始化游戏类型下拉菜单 if (!HallTransfer.Instance.uiConfig.MobileEdition) { GameObject tempGameList = HallTransfer.Instance.uiConfig.window_Security.transform.FindChild("front_panel").FindChild("content").FindChild("gamePopup_list").gameObject; // tempGameList.GetComponent<UIPopupList>().Clear(); // tempGameList.GetComponent<UIPopupList>().value = "ALL"; // tempGameList.GetComponent<UIPopupList>().AddItem( "ALL" ); // for(int i = 0; i <HallTransfer.Instance.uiConfig.hallGameIds.Length; i++) // { // tempGameList.GetComponent<UIPopupList>().AddItem(HallTransfer.Instance.uiConfig.hallGameIds[i].ToString() ); // } tempGameList.SetActive(false); } // this.gameObject.GetComponent<UIButton> ().isEnabled = false; // Invoke("onResumeBtn",3.0f); }
void LoadStageNames() { stageNames.Clear(); string[] stages = System.IO.Directory.GetFiles(filePath, "*.json"); if (stages.Length == 0) { stageNames.AddItem("NO STAGES"); selectedIndex = -1; //display warning noStagesWarning.SetActive(true); return; } for (int i = 0; i < stages.Length; i++) { stagePaths.Add(stages[i]); string[] trimmedName = stages[i].Split('/'); //TODO check for other OS string stageNameJson = trimmedName[trimmedName.Length - 1]; string stageNameNoJson = stageNameJson.Substring(0, stageNameJson.Length - 5); stageNames.AddItem(stageNameNoJson); } }
private void Localization() { lblHeader.text = GameManager.localization.GetText("Shop_Card_Header"); series.defaultText = GameManager.localization.GetText("Shop_Card_Series"); number.defaultText = GameManager.localization.GetText("Shop_Card_CardNumber"); lblBtnOK.text = GameManager.localization.GetText("Shop_Card_Button"); lblBtnEnd.text = GameManager.localization.GetText("Shop_Card_Response"); cardType.transform.FindChild("Label").GetComponent <UILabel>().text = GameManager.localization.GetText("Shop_Card_CardType"); for (int i = 1; i < (int)CardType.Count; i++) { cardType.AddItem(((CardType)i).ToString()); } }
void GetLobbyInfo() { object[] lobbyInfo; string errInfo; if (NetCmdTranslator.Request(out errInfo, out lobbyInfo, BR_Common.NetCmd.GetLobbyInfo, null)) { LobbyList.Clear(); for (int i = 0; i < lobbyInfo.Length; i++) { LobbyList.AddItem(string.Format("Lobby{0}: ({1})", i, (byte)lobbyInfo[i])); } } else { Debug.LogError("获取Lobby信息错误:" + errInfo); } }
private UIToggle isContinue; //是否继续上次游戏 void Start() { nameInput = transform.FindChild("NameInput/Label").GetComponent<UILabel>(); //下拉菜单 selectPattern = transform.FindChild("SelcetStyle").GetComponent<UIPopupList>(); selectPattern.Clear(); string[] patterns = System.Enum.GetNames(typeof(GamePattern)); for (int i = 0; i < patterns.Length; i++) { selectPattern.AddItem(patterns[i]); } //当下拉菜单值发生变化时,通知OnPatternChange方法 EventDelegate.Add(selectPattern.onChange, OnPatternChange); //单选框 isContinue = transform.FindChild("Continue").GetComponent<UIToggle>(); //当单选框值发生变化时,通知OnIsContinue方法 EventDelegate.Add(isContinue.onChange, OnIsContinue); }
/// <summary> /// 从数据库加载巡逻方案的数据 /// </summary> /// <returns>The video patrol plan record.</returns> IEnumerator LoadVideoPatrolPlanRecord() { Logger.Instance.WriteLog("从数据库加载巡逻方案的数据"); VideoPatrolPlanDao vppDao = new VideoPatrolPlanDao(); vppDao.Select001(); VideoPatrolPlanInfos = vppDao.Result; UIPopupList PopuList = PatrolPlanPopuplist.GetComponent <UIPopupList>(); PopuList.Clear(); foreach (VideoPatrolPlanInfo info in VideoPatrolPlanInfos) { PopuList.AddItem(info.Name); } if (VideoPatrolPlanInfos.Count > 0) { PopuList.value = VideoPatrolPlanInfos[0].Name; } yield return(null); }
public void Show(IUInfoModel uinfoModel, MSG_GP_USER_GetUserInfoBack userbaseInfo) { gameObject.SetActive(true); TiKuanZhangHaoLabel.text = uinfoModel.GetUserName(); //提款账号 UIDLabel.text = uinfoModel.GetUserID().ToString(); //账号ID KaiHuHangList.value = ""; KaiHuHangList.Clear(); foreach (var backName in userbaseInfo.GetChQkBackInfos()) { if (!string.IsNullOrEmpty(backName.Trim())) { if (string.IsNullOrEmpty(KaiHuHangList.value)) { KaiHuHangList.value = backName; } KaiHuHangList.AddItem(backName); } } if (userbaseInfo.isLockBank == 1) //锁定处理 { KaiHuMingLabel.enabled = false; KaiHuMingLabel.value = userbaseInfo.GetTrueName(); //开户名 KaiHuDiZhiLabel.enabled = false; KaiHuDiZhiLabel.value = userbaseInfo.GetBackAddress(); //开户地址 KaiHuHangList.enabled = false; KaiHuHangList.value = userbaseInfo.GetBackName(); //开户行 BankCodeLabel.enabled = false; BankCodeLabel.value = userbaseInfo.GetBackAccount(); //银行卡号 QuKuanPWDLabel.enabled = false; QuKuanPWDLabel.value = "********"; //取款密码 } }
void printFile(bool first) { list.Clear(); if (File.Exists("config/hosts.conf") == false) { File.Create("config/hosts.conf").Close(); } string txtString = File.ReadAllText("config/hosts.conf"); string[] lines = txtString.Replace("\r", "").Split("\n"); for (int i = 0; i < lines.Length; i++) { if (i == 0) { if (first) { readString(lines[i]); } } list.AddItem(lines[i]); } }
protected override void OnFreshCRCView(ItemData itemData) { NameLabel.text = itemData.Name; PopList.Clear(); var arr = itemData.Options.Split(','); var arrLen = arr.Length; int index; var selecteItem = ""; int.TryParse(itemData.Value, out index); for (var i = 0; i < arrLen; i++) { var option = arr[i]; if (i == index) { selecteItem = option; } PopList.AddItem(option); } PopList.value = selecteItem; UpdateWidget(itemData.Width, itemData.Height); }
public void show(List <GetBankInfo> infos, IUInfoModel uinfoModel) { gameObject.SetActive(true); this.uinfoModel = uinfoModel; _Myinfos.Clear(); ZhiFuFangShiList.Clear(); ZhiFuFangShiList.value = ""; for (int i = 0; i < infos.Count; ++i) { infos[i].BankName = (i + 1).ToString() + "." + infos[i].BankName; _Myinfos.Add(infos[i]); ZhiFuFangShiList.AddItem(infos[i].BankName); if (i == 0 && string.IsNullOrEmpty(ZhiFuFangShiList.value)) { ZhiFuFangShiList.value = infos[i].BankName; selectedInfo = infos[i]; FillContent(); } } }
protected override void DealShowData() { if (Data is Dictionary <string, object> ) { ExtractData data = new ExtractData(Data, GetType()); ViewVisible = data.ExtractVisible; RecordVisible = data.RecordVisible; BindCouldChange = data.CouldChangeBind; if (gameObject.activeInHierarchy) { StartCoroutine(OnVisibleAction.WaitExcuteCalls()); } ExtracNotice.TrySetComponentValue(data.ExtractNotice); if (ViewVisible) { _dataDic = data.DataDic; if (Option) { Option.Clear(); foreach (var item in data.DataDic) { Option.AddItem(item.Key); } if (Option.items.Count > 0) { var showName = Option.items[0]; Option.Set(showName); _curCostType = showName; _curCostData = _dataDic[showName] as ExtractItemData; } else { YxDebug.LogError("Extract types count is zero,please check again!"); } } else { var tabWindow = MainYxView as YxTabPageWindow; if (tabWindow) { List <TabData> datas = new List <TabData>(); foreach (var item in data.DataDic) { var itemData = item.Value as ExtractItemData; var tabName = itemData != null ? itemData.PlatformType: item.Key; TabData tabData = new TabData() { Name = item.Key, UpStateName = string.Format(TabUpFormat, tabName), DownStateName = string.Format(TabDownFormat, tabName), Data = item.Key }; datas.Add(tabData); } tabWindow.TabDatas = datas.ToArray(); tabWindow.UpdateView(); } } } } }
public override void AddItem(string item) { PopupLIist.AddItem(item); }
public void ShowKingdomInfo(KingdomTest kingdom) { currentlySelectedKingdom = kingdom; warDropdownMenu.Clear(); peaceDropdownMenu.Clear(); for (int i = 0; i < PoliticsPrototypeManager.Instance.kingdoms.Count; i++) { if (PoliticsPrototypeManager.Instance.kingdoms[i].kingdom.id != kingdom.id) { warDropdownMenu.AddItem(PoliticsPrototypeManager.Instance.kingdoms[i].kingdom.kingdomName); } } for (int i = 0; i < kingdom.kingdomsAtWarWith.Count; i++) { peaceDropdownMenu.AddItem(kingdom.kingdomsAtWarWith[i].kingdom.kingdomName); } lblKingdomInfo.text = ""; lblKingdomName.text = kingdom.kingdomName + "\t # of cities: " + kingdom.cities.Count; lblKingdomInfo.text += "Current Lord: " + kingdom.assignedLord.name + "\n"; lblKingdomInfo.text += "Next in line: \n"; int succession = 5; if (kingdom.royaltyList.successionRoyalties.Count < succession) { succession = kingdom.royaltyList.successionRoyalties.Count; } for (int i = 0; i < succession; i++) { lblKingdomInfo.text += (i + 1).ToString() + ". " + kingdom.royaltyList.successionRoyalties [i].name + "\n"; } lblKingdomInfo.text += "Kingdoms at war with: \n"; for (int i = 0; i < kingdom.kingdomsAtWarWith.Count; i++) { lblKingdomInfo.text += (i + 1).ToString() + ". " + kingdom.kingdomsAtWarWith[i].kingdom.kingdomName + "\n"; } RoyaltyListItem[] children = royaltyGrid.GetComponentsInChildren <RoyaltyListItem>(); for (int i = 0; i < children.Length; i++) { Destroy(children[i].gameObject); } for (int i = 0; i < kingdom.royaltyList.allRoyalties.Count; i++) { GameObject royaltyGO = null; if (kingdom.royaltyList.allRoyalties[i].id == kingdom.assignedLord.id) { if (kingdom.royaltyList.allRoyalties[i].spouse != null && !kingdom.royaltyList.allRoyalties[i].spouse.isDead && !kingdom.royaltyList.allRoyalties.Contains(kingdom.royaltyList.allRoyalties[i].spouse)) { royaltyGO = Instantiate(royaltyPrefab, royaltyGrid.transform) as GameObject; royaltyGO.transform.localPosition = Vector3.zero; royaltyGO.transform.localScale = Vector3.one; royaltyGO.GetComponent <RoyaltyListItem>().SetRoyalty(kingdom.royaltyList.allRoyalties[i].spouse); } } if (kingdom.royaltyList.allRoyalties[i].kingdom.id != currentlySelectedKingdom.id) { continue; } royaltyGO = Instantiate(royaltyPrefab, royaltyGrid.transform) as GameObject; royaltyGO.transform.localPosition = Vector3.zero; royaltyGO.transform.localScale = Vector3.one; royaltyGO.GetComponent <RoyaltyListItem>().SetRoyalty(kingdom.royaltyList.allRoyalties[i]); } if (kingdom.cities.Count >= 4) { revoltBtn.isEnabled = true; } else { revoltBtn.isEnabled = false; } royaltyGrid.GetComponent <UIGrid>().enabled = true; kingdomInfoWindowGO.SetActive(true); HideRoyaltyInfo(); }
public void SetContinentSelection() { if (continentList != null) { labelContinet.text = continentList.value; areaList.Clear(); switch (continentList.value) { case "아르테미스": foreach (var item in MC_TableBuilder.Instance.are) { areaList.AddItem(item); } break; case "유디아": foreach (var item in MC_TableBuilder.Instance.udia) { areaList.AddItem(item); } break; case "루테란서부": foreach (var item in MC_TableBuilder.Instance.luteranWest) { areaList.AddItem(item); } break; case "루테란동부": foreach (var item in MC_TableBuilder.Instance.luteranEast) { areaList.AddItem(item); } break; case "애니츠": foreach (var item in MC_TableBuilder.Instance.anits) { areaList.AddItem(item); } break; case "아르데타인": foreach (var item in MC_TableBuilder.Instance.arde) { areaList.AddItem(item); } break; case "슈샤이어": foreach (var item in MC_TableBuilder.Instance.sh) { areaList.AddItem(item); } break; case "베른북부": foreach (var item in MC_TableBuilder.Instance.bernNorth) { areaList.AddItem(item); } break; case "대항해": foreach (var item in MC_TableBuilder.Instance.greatVoyage) { areaList.AddItem(item); } break; default: foreach (var item in MC_TableBuilder.Instance.are) { areaList.AddItem(item); } break; } } }
public void appendItem(string item) { mPopupList.AddItem(item); }
public void Show(ShowBehavior behavior, Transform showGrid, bool repeat) { showBehavior = behavior; popupList.items.Clear(); popupList.AddItem("近战"); popupList.AddItem("远程"); popupList.AddItem("攻城"); OKButton.onClick.Clear(); returnButton.onClick.Clear(); EventDelegate.Add(returnButton.onClick, () => Hide()); if (!repeat) { BlackShow.GetInstance().Show(true); PlayerController.GetInstance().obj.SetActive(false); EnemyController.GetInstance().obj.SetActive(false); obj.SetActive(true); } switch (showBehavior) { case ShowBehavior.draw: label.text = "请选择要打出的牌"; goto default; case ShowBehavior.show: label.text = "显示卡牌"; goto default; case ShowBehavior.leader: label.text = "领导牌"; PlayerLeaderBehavior leaderBehavior = LeaderController.GetInstance().obj[0].GetComponent <PlayerLeaderBehavior>(); messageLabel.text = leaderBehavior.message; messageLabel.gameObject.SetActive(true); popupList.gameObject.SetActive(false); OKButton.gameObject.SetActive(true); OKButton.GetComponent <UIButton>().isEnabled = leaderBehavior.IsEnabled; EventDelegate.Add(OKButton.onClick, () => leaderBehavior.Play()); break; case ShowBehavior.replace: label.text = string.Format("请选择要替换的牌 {0}/2", replaceInt); EventDelegate.Add(returnButton.onClick, () => GameController.GetInstance().StartGame()); goto default; case ShowBehavior.nurse: label.text = "从墓地中打出卡牌"; totalGrid = showGrid; messageLabel.gameObject.SetActive(false); popupList.gameObject.SetActive(false); OKButton.gameObject.SetActive(false); EventDelegate.Add(returnButton.onClick, () => CoroutineManager.GetInstance().AddTask(EnemyController.GetInstance().Play(EnemyController.GetInstance().grids[1]))); break; case ShowBehavior.dummy: label.text = "请选择要替换的牌"; messageLabel.gameObject.SetActive(false); popupList.gameObject.SetActive(true); OKButton.gameObject.SetActive(false); break; case ShowBehavior.warhorn: label.text = "战争号角"; messageLabel.gameObject.SetActive(false); popupList.gameObject.SetActive(true); OKButton.gameObject.SetActive(true); OKButton.GetComponent <UIButton>().isEnabled = true; EventDelegate.Add(OKButton.onClick, () => WarhornController.GetInstance().Warhorn()); break; case ShowBehavior.agile: label.text = "请选择出牌的排"; messageLabel.gameObject.SetActive(false); popupList.gameObject.SetActive(true); popupList.items.Remove("攻城"); OKButton.gameObject.SetActive(true); OKButton.GetComponent <UIButton>().isEnabled = true; EventDelegate.Add(OKButton.onClick, () => AgileController.GetInstance().Agile()); break; default: totalGrid = showGrid; messageLabel.gameObject.SetActive(false); popupList.gameObject.SetActive(false); OKButton.gameObject.SetActive(false); break; } if (repeat) { grid.DestroyChildren(); } for (int i = 0; i < showGrid.childCount; i++) { GameObject cardObject = Instantiate(showGrid.GetChild(i).gameObject, grid); UISprite sprite = cardObject.GetComponent <UISprite>(); sprite.width = 250; sprite.height = 450; UIButton cardButton = cardObject.GetComponent <UIButton>(); switch (showBehavior) { case ShowBehavior.draw: EventDelegate.Add(cardButton.onClick, () => cardObject.GetComponent <CardBehavior>().Play()); cardButton.enabled = true; break; case ShowBehavior.show: cardButton.enabled = false; break; case ShowBehavior.replace: EventDelegate.Add(cardButton.onClick, () => cardObject.GetComponent <CardBehavior>().Replace()); cardButton.enabled = true; break; case ShowBehavior.nurse: EventDelegate.Add(cardButton.onClick, () => cardObject.GetComponent <CardBehavior>().Play()); cardButton.enabled = true; break; case ShowBehavior.dummy: EventDelegate.Add(cardButton.onClick, () => cardObject.GetComponent <CardBehavior>().Dummy()); cardButton.enabled = true; break; case ShowBehavior.warhorn: cardButton.enabled = false; break; case ShowBehavior.agile: cardButton.enabled = false; break; } cardObject.GetComponent <UIDragScrollView>().scrollView = scrollView; cardObject.GetComponent <BoxCollider>().size = new Vector3(250, 450, 1); } grid.GetComponent <UIGrid>().Reposition(); }
void printFile() { string deckInUse = Config.Get("deckInUse", "miaowu"); superScrollView.clear(); FileInfo[] fileInfos = (new DirectoryInfo("deck")).GetFiles(); if (Config.Get(sort, "1") == "1") { Array.Sort(fileInfos, UIHelper.CompareTime); } else { Array.Sort(fileInfos, UIHelper.CompareName); } for (int i = 0; i < fileInfos.Length; i++) { if (fileInfos[i].Name.Length > 4) { if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".ydk") { if (fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4) == deckInUse) { superScrollView.add(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4)); } } } } for (int i = 0; i < fileInfos.Length; i++) { if (fileInfos[i].Name.Length > 4) { if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".ydk") { if (fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4) != deckInUse) { superScrollView.add(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4)); } } } } list_aideck.Clear(); fileInfos = (new DirectoryInfo("ai/ydk")).GetFiles(); Array.Sort(fileInfos, UIHelper.CompareName); list_aideck.AddItem(suiji); for (int i = 0; i < fileInfos.Length; i++) { if (fileInfos[i].Name.Length > 4) { if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".ydk") { list_aideck.AddItem(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4)); } } } list_airank.Clear(); fileInfos = (new DirectoryInfo("ai")).GetFiles(); Array.Sort(fileInfos, UIHelper.CompareName); for (int i = 0; i < fileInfos.Length; i++) { if (fileInfos[i].Name.Length > 4) { if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".lua") { list_airank.AddItem(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4)); } } } }