private void OnScrollerChange(Transform childTrans, int index) { List <int> rankListSorted = Singleton <EndlessModule> .Instance.GetRankListSorted(); EndlessPlayerData playerEndlessData = Singleton <EndlessModule> .Instance.GetPlayerEndlessData(rankListSorted[index]); PlayerFriendBriefData playerBriefData = Singleton <EndlessModule> .Instance.GetPlayerBriefData(rankListSorted[index]); childTrans.GetComponent <MonoRankButton>().SetupView(index + 1, playerEndlessData, UIUtil.GetPlayerNickname(playerBriefData), this._selectPlayer == playerEndlessData, new Action <EndlessPlayerData>(this.OnRankRowButtonClick), this._selectToolData); }
public void SetupView(int rank, EndlessPlayerData endlessData, string playerName, bool isSelect = false, Action <EndlessPlayerData> buttonClickCallback = null, EndlessToolDataItem selectToolData = null) { this._endlessPlayerData = endlessData; this._clickCallBack = buttonClickCallback; this._selectToolData = selectToolData; this._interactable = (selectToolData != null) && !selectToolData.ApplyToSelf; base.transform.Find("Me").gameObject.SetActive(rank == Singleton <EndlessModule> .Instance.CurrentRank); base.transform.Find("Rank").GetComponent <Text>().text = rank.ToString(); base.transform.Find("PlayerName").GetComponent <Text>().text = playerName; base.transform.Find("FloorNum").GetComponent <Text>().text = (endlessData.get_progress() >= 1) ? endlessData.get_progress().ToString() : "-"; base.transform.Find("FloorLabel").gameObject.SetActive(endlessData.get_progress() >= 1); List <EndlessToolDataItem> range = new List <EndlessToolDataItem>(); foreach (EndlessWaitEffectItem item in this._endlessPlayerData.get_wait_effect_item_list()) { EndlessToolDataItem item2 = new EndlessToolDataItem((int)item.get_item_id(), 1); if (item2.ShowIcon) { range.Add(item2); } } if (range.Count > 5) { range = range.GetRange(range.Count - 5, 5); } Transform transform = base.transform.Find("ApplyedToolsList"); for (int i = 0; i < transform.childCount; i++) { Transform child = transform.GetChild(i); if (i >= range.Count) { child.gameObject.SetActive(false); } else { child.gameObject.SetActive(true); child.GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(range[(range.Count - i) - 1].GetSmallIconPath()); } } this.SetFrozenTime(); base.transform.Find("SelectedMask").gameObject.SetActive(isSelect); this.CheckInteractable(); }
public void SetupView(EndlessItem itemData, bool isSelect = false, EndlessPlayerData selectPlayer = null, Action <EndlessItem> clickCallback = null, Action useClickCallback = null) { this._itemData = itemData; this._itemDataItem = new EndlessToolDataItem((int)this._itemData.get_item_id(), (int)this._itemData.get_num()); this._itemClickCallback = clickCallback; this._itemUseClickCallback = useClickCallback; base.transform.Find("VerticalLayout/Icon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(this._itemDataItem.GetIconPath()); base.transform.Find("VerticalLayout/TopLine/NameRow/NameText").GetComponent <Text>().text = this._itemDataItem.GetDisplayTitle(); base.transform.Find("VerticalLayout/TopLine/NameRow/NumText").GetComponent <Text>().text = "x" + this._itemDataItem.number; base.transform.Find("VerticalLayout/TopLine/Target/Self").gameObject.SetActive(this._itemDataItem.ApplyToSelf); base.transform.Find("VerticalLayout/TopLine/Target/Other").gameObject.SetActive(!this._itemDataItem.ApplyToSelf); base.transform.Find("VerticalLayout/AbstractText").GetComponent <Text>().text = this._itemDataItem.GetDescription(); base.transform.Find("VerticalLayout/DescText").GetComponent <Text>().text = this._itemDataItem.GetDescription(); base.transform.Find("SelectMark").gameObject.SetActive(isSelect); base.transform.Find("VerticalLayout/DescText").gameObject.SetActive(false); base.transform.Find("VerticalLayout/UseBtn").gameObject.SetActive(isSelect); base.transform.Find("VerticalLayout/UseBtn/Use").gameObject.SetActive(isSelect); base.transform.Find("VerticalLayout/UseBtn/Tip").gameObject.SetActive(false); }
private void OnRankRowButtonClick(EndlessPlayerData playerEndlessData) { if (this._selectItem == null) { base.view.transform.Find("GroupPanel/Title/Label").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Title_SelectEndlessToolFirst", new object[0]); } else { if (this._selectPlayer == playerEndlessData) { this._selectPlayer = null; } else { this._selectPlayer = playerEndlessData; this.SetupUseToolConfirmDialog(this._selectToolData); } this.SetupRank(); this.SetupItemList(); } }
private void OnItemButtonClick(EndlessItem itemData) { if (this._selectItem == itemData) { this._selectItem = null; this._selectToolData = null; base.view.transform.Find("GroupPanel/Title/Label").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Title_SelectEndlessToolFirst", new object[0]); this._animator.SetBool(this.ANIMATOR_CAN_SELECT_PLAYER_BOOL_ID, false); } else { this._selectItem = itemData; this._selectToolData = new EndlessToolDataItem((int)itemData.get_item_id(), 1); if (this._selectToolData.ApplyToSelf || (this._selectToolData.ToolType == 3)) { this._animator.SetBool(this.ANIMATOR_CAN_SELECT_PLAYER_BOOL_ID, false); } } this._selectPlayer = null; this.SetRankListTitle(); this.SetupRank(); this.SetupItemList(); }
private void ClearSelectPlayer() { this._selectPlayer = null; this.SetupRank(); this.CheckSelectItemForPlayerPanel(); }
private void RequestUseTool() { Singleton <NetworkManager> .Instance.RequestUseEndlessItem(this._selectItem.get_item_id(), (this._selectPlayer != null)?((int)this._selectPlayer.get_uid()) : -1); this._selectPlayer = null; }