private void OnClickSoldierSelect(IUIObject obj) { NewListBox newListBox = obj as NewListBox; if (obj == null || null == newListBox) { return; } IUIListObject selectedItem = newListBox.SelectedItem; UIListItemContainer uIListItemContainer = (UIListItemContainer)selectedItem; if (null == uIListItemContainer) { return; } if (uIListItemContainer.data != null) { this.m_SelectSolID = (long)uIListItemContainer.Data; } if (this.m_pkParentDlg == null || !this.m_pkParentDlg.Visible) { this.CloseForm(null); } Protocol_Item.Item_Use(this.m_pkEquipItem, this.m_SelectSolID); this.Close(); }
public void SetTextureEvent(eCharImageType type, int kind, int solgrade) { this.SetTexture(type, kind, solgrade, string.Empty); UIListItemContainer uIListItemContainer = base.gameObject.AddComponent <UIListItemContainer>(); if (uIListItemContainer == null) { return; } GameObject gameObject = new GameObject("EventMark"); if (gameObject == null) { return; } DrawTexture drawTexture = gameObject.AddComponent <DrawTexture>(); if (drawTexture != null) { drawTexture.SetUseBoxCollider(false); drawTexture.gameObject.layer = GUICamera.UILayer; drawTexture.SetTexture("Win_I_Notice05"); drawTexture.SetSize(this.width * 0.45f, this.height * 0.45f); drawTexture.SetAnchor(SpriteRoot.ANCHOR_METHOD.UPPER_LEFT); uIListItemContainer.MakeChild(drawTexture.gameObject); drawTexture.gameObject.transform.localPosition = new Vector3(this.width * 0.8f, this.height * 0.1f); drawTexture.Visible = true; } }
private void ClickList(IUIObject obj) { ListBox listBox = (ListBox)obj; UIListItemContainer selectedItem = listBox.SelectedItem; this.m_CurQuest = (CQuest)selectedItem.Data; }
void RefreshParent(string parentName) { List <IUIListObject> parentLists; if (allParents.TryGetValue(parentName, out parentLists)) { foreach (IUIListObject item in parentLists) { list.RemoveItem(item, false); } UIListItemContainer parent = null; foreach (UIListItemContainer item in allParContainers) { if (item != null && item.gameObject.name == parentName) { parent = item; break; } } if (parent != null) { UIListItemContainer parContainer = parent.GetComponent <UIListItemContainer>(); for (int i = 1; i <= parentLists.Count; i++) { IUIListObject item = parentLists[i - 1]; list.InsertItem(item, parContainer.Index + i); } } } }
public void ClickDetailInfo(IUIObject obj) { UIListItemContainer selectItem = this.m_nlbItemList.GetSelectItem(); if (null == selectItem) { return; } if (selectItem.Data == null) { return; } ITEM iTEM = selectItem.data as ITEM; if (iTEM != null) { AuctionMainDlg.ShowItemDetailInfo(iTEM, (G_ID)base.WindowID); } else { NkSoldierInfo nkSoldierInfo = selectItem.data as NkSoldierInfo; if (nkSoldierInfo != null) { AuctionMainDlg.ShowSolDetailInfo(nkSoldierInfo, this); } } }
private static int CompareGradeASC2(UIListItemContainer l, UIListItemContainer r) { NkSoldierInfo a = (NkSoldierInfo)l.Data; NkSoldierInfo b = (NkSoldierInfo)r.Data; return(SolComposeListDlg.CompareGrade_Low(a, b)); }
public void ClickSellList(IUIObject obj) { if (this.m_nlbSellList.GetSelectItem() == null) { Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("227"), SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE); return; } UIListItemContainer selectItem = this.m_nlbSellList.GetSelectItem(); if (selectItem == null) { return; } if (selectItem.Data == null) { return; } AGIT_MERCHANT_SUB_INFO aGIT_MERCHANT_SUB_INFO = (AGIT_MERCHANT_SUB_INFO)selectItem.Data; if (aGIT_MERCHANT_SUB_INFO == null) { return; } this.SelectMerchantItem(aGIT_MERCHANT_SUB_INFO); }
public void DragDrop(EZDragDropParams a_sDragDropParams) { if (a_sDragDropParams.evt == EZDragDropEvent.Dropped && a_sDragDropParams.dragObj.DropTarget != null) { ImageSlot imageSlot = a_sDragDropParams.dragObj.Data as ImageSlot; if (imageSlot != null && !(imageSlot.c_oItem is ITEM)) { return; } UIListItemContainer component = a_sDragDropParams.dragObj.DropTarget.GetComponent <UIListItemContainer>(); if (component == null) { return; } ImageSlot imageSlot2 = component.Data as ImageSlot; if (imageSlot2 == null) { return; } if (imageSlot2.c_bDisable) { return; } G_ID windowID = (G_ID)imageSlot2.WindowID; if (windowID == G_ID.INVENTORY_DLG) { Inventory_Dlg inventory_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.INVENTORY_DLG) as Inventory_Dlg; if (inventory_Dlg != null) { } } } }
public void InsertChildNode(TreeView.TreeNode childRoot, int index) { foreach (TreeView.TreeNode current in childRoot.Children) { if (0 < current.Children.Count) { string text = base.Count.ToString(); GameObject gameObject = new GameObject("ChildNode_Index" + text); UIListItemContainer uIListItemContainer = gameObject.AddComponent <UIListItemContainer>(); uIListItemContainer.gameObject.layer = GUICamera.UILayer; uIListItemContainer.Data = current; this.MakeLineItem(ref uIListItemContainer, text, current); base.InsertItemDonotPosionUpdate(uIListItemContainer, index + this.addCount, null, true); this.addCount++; if (current.IsOpen) { this.InsertChildNode(current, index); } } else if (current != null) { string text2 = base.Count.ToString(); GameObject gameObject2 = new GameObject("ChildNode_Index" + text2); UIListItemContainer uIListItemContainer2 = gameObject2.AddComponent <UIListItemContainer>(); uIListItemContainer2.gameObject.layer = GUICamera.UILayer; uIListItemContainer2.Data = current; this.MakeLineItem(ref uIListItemContainer2, text2, current); base.InsertItemDonotPosionUpdate(uIListItemContainer2, index + this.addCount, null, true); this.addCount++; } } }
private void OnSoldierView(IUIListObject obj) { UIListItemContainer uIListItemContainer = (UIListItemContainer)obj; if (null == uIListItemContainer) { return; } long num = -1L; if (uIListItemContainer.data != null) { num = (long)uIListItemContainer.data; } if (num != 0L) { return; } SolMilitarySelectDlg solMilitarySelectDlg = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.SOLMILITARYSELECT_DLG) as SolMilitarySelectDlg; if (solMilitarySelectDlg != null) { solMilitarySelectDlg.SetLocationByForm(this); solMilitarySelectDlg.SetFocus(); solMilitarySelectDlg.SolSortType = 2; solMilitarySelectDlg.SetSortList(); } }
public void ChangeTURNState(TOURNAMENT_MATCH_LIST pkMatch) { for (int i = 0; i < this.m_liMatchList.Count; i++) { UIListItemContainer item = this.m_lbBattleMatchInfo.GetItem(i); if (item != null) { TextField textField = item.GetElement(this.PLAYER1) as TextField; if (textField != null && textField.GetText().Equals(pkMatch.m_szPlayer[0])) { Label label = item.GetElement(this.TURN) as Label; if (label != null) { if (pkMatch.m_nStartTurnAlly == 0) { label.SetText(pkMatch.m_szPlayer[0]); } else if (pkMatch.m_nStartTurnAlly == 1) { label.SetText(pkMatch.m_szPlayer[1]); } else { label.SetText("RANDOM"); } } } } } }
public void SetRecruitButtonEnable(bool bEnable) { if (bEnable) { if (this.m_fRecruitPassCheckTime > 0f) { this.bRecruitPassCheck = true; return; } } else { this.m_fRecruitPassCheckTime = Time.time; } for (int i = 0; i < this.m_TicketList.Count; i++) { UIListItemContainer item = this.m_TicketList.GetItem(i); if (item != null) { UIButton uIButton = item.GetElement(3) as UIButton; if (uIButton != null) { uIButton.SetEnabled(bEnable); } } } }
private AutoSpriteControlBase GetCharKindContainer(UIListItemContainer item, int pTargetCharKind) { if (item == null) { return(null); } int objCount = item.GetObjCount(); for (int i = 0; i < objCount; i++) { object elementObject = item.GetElementObject(i); if (elementObject != null) { if (elementObject is NrCharKindInfo) { NrCharKindInfo nrCharKindInfo = (NrCharKindInfo)elementObject; if (nrCharKindInfo.GetCharKind() == pTargetCharKind) { return(item.GetElement(i)); } } } } return(null); }
private UIListItemContainer GetMoveTargetItem_By_MySolID(NewListBox costumeListBox, NkSoldierInfo selectedMySolInfo) { if (costumeListBox == null) { return(null); } if (selectedMySolInfo == null) { return(null); } for (int i = 0; i < costumeListBox.Count; i++) { UIListItemContainer item = costumeListBox.GetItem(i); if (!(item == null)) { if (item.Data != null) { NkSoldierInfo nkSoldierInfo = (NkSoldierInfo)item.Data; if (nkSoldierInfo != null) { if (nkSoldierInfo.GetSolID() == selectedMySolInfo.GetSolID()) { return(item); } } } } } return(null); }
protected override void OnUpdate() { if (waiting && Planetarium.GetUniversalTime() > completionTime) { waiting = false; SetComplete(); } // Every time the clock ticks over, make an attempt to update the contract window // notes. We do this because otherwise the window will only ever read the notes once, // so this is the only way to get our fancy timer to work. else if (waiting && trackedVessel != null && Planetarium.GetUniversalTime() - lastUpdate > 1.0f) { lastUpdate = Planetarium.GetUniversalTime(); // Go through all the list items in the contracts window UIScrollList list = ContractsApp.Instance.cascadingList.cascadingList; for (int i = 0; i < list.Count; i++) { // Try to find a rich text control that matches the expected text UIListItemContainer listObject = (UIListItemContainer)list.GetItem(i); SpriteTextRich richText = listObject.GetComponentInChildren <SpriteTextRich>(); if (richText != null && noteTracker.ContainsKey(richText.Text)) { // Clear the noteTracker, and replace the text noteTracker.Clear(); richText.Text = notePrefix + GetNotes(); } } } }
public virtual void Clear() { this.reserveItems.Clear(); base.ClearList(true); if (this.autoListBox) { for (int i = 0; i < this.maxLine; i++) { GameObject gameObject = new GameObject("ListItem"); UIListItemContainer uIListItemContainer = gameObject.AddComponent <UIListItemContainer>(); uIListItemContainer.isDraggable = true; uIListItemContainer.AutoFindOuterEdges = false; string backButtonName = UIScrollList.backButtonName; UIButton uIButton; if (string.Empty != this.selectStyle) { uIButton = UICreateControl.Button(backButtonName, this.selectStyle, this.viewableArea.x, this.lineHeight); } else { uIButton = UICreateControl.Button(backButtonName, "Com_B_ListBtnH", this.viewableArea.x, this.lineHeight); } uIButton.IsListButton = true; uIButton.allwaysPlayAnim = true; uIListItemContainer.MakeChild(uIButton.gameObject); uIListItemContainer.SetControlIsEnabled(false); base.InsertItemDonotPosionUpdate(uIListItemContainer, i, null, true); } base.DonotCountRepositionItems(); } this.callRepositionItems = false; this.clipWhenMoving = true; this.startIndex = 0; }
private void SetGuildMark() { for (int i = 0; i < this.m_nlbWarList.Count; i++) { UIListItemContainer item = this.m_nlbWarList.GetItem(i); if (!(item == null)) { GUILDWAR_MATCH_INFO gUILDWAR_MATCH_INFO = item.Data as GUILDWAR_MATCH_INFO; if (gUILDWAR_MATCH_INFO != null) { UIButton[] componentsInChildren = item.GetComponentsInChildren <UIButton>(); if (gUILDWAR_MATCH_INFO.SUB_INFO.i64GuildID[0] == NrTSingleton <NewGuildManager> .Instance.GetGuildID() || gUILDWAR_MATCH_INFO.SUB_INFO.i64GuildID[1] == NrTSingleton <NewGuildManager> .Instance.GetGuildID()) { NrTSingleton <FormsManager> .Instance.AttachEffectKey("FX_UI_GUILDMARK", componentsInChildren[0], componentsInChildren[0].GetSize()); } } DrawTexture[] componentsInChildren2 = item.GetComponentsInChildren <DrawTexture>(); for (int j = 0; j < componentsInChildren2.Length; j++) { if (componentsInChildren2[j].data != null) { long num = (long)componentsInChildren2[j].data; if (num > 0L) { string guildPortraitURL = NrTSingleton <NkCharManager> .Instance.GetGuildPortraitURL(num); WebFileCache.RequestImageWebFile(guildPortraitURL, new WebFileCache.ReqTextureCallback(this.ReqWebImageCallback), componentsInChildren2[j]); } } } } } }
private UIListItemContainer GetMoveTargetItem_By_SolCostume(NewListBox costumeListBox, NkSoldierInfo solInfo) { if (costumeListBox == null) { return(null); } if (solInfo == null) { return(null); } for (int i = 0; i < costumeListBox.Count; i++) { UIListItemContainer item = costumeListBox.GetItem(i); if (!(item == null)) { if (item.Data != null) { CharCostumeInfo_Data charCostumeInfo_Data = (CharCostumeInfo_Data)item.Data; if (charCostumeInfo_Data != null) { if (charCostumeInfo_Data.m_costumeUnique == (int)solInfo.GetSolSubData(eSOL_SUBDATA.SOL_SUBDATA_COSTUME)) { return(item); } } } } } return(null); }
private void ChangeSolInfo(IUIObject obj, int index) { if (index >= this.mSortList.Count) { return; } NkSoldierInfo nkSoldierInfo = this.mSortList[index]; if (nkSoldierInfo == null) { return; } NewListItem newListItem = this.UpdateSolList(nkSoldierInfo); if (newListItem == null) { return; } this.ComposeNewListBox.UpdateContents(index, newListItem); int index2 = index % this.ComposeNewListBox.Count; UIListItemContainer item = this.ComposeNewListBox.GetItem(index2); if (null != item) { if (this.IsContainSelect(nkSoldierInfo.GetSolID())) { item.SetSelected(true); } else { item.SetSelected(false); } } }
private static int CompareCombatPowerASC2(UIListItemContainer l, UIListItemContainer r) { NkSoldierInfo nkSoldierInfo = (NkSoldierInfo)l.Data; NkSoldierInfo nkSoldierInfo2 = (NkSoldierInfo)r.Data; return(nkSoldierInfo.GetCombatPower().CompareTo((long)nkSoldierInfo2.GetFightPower())); }
public void UpdateTournamentMatchInfoFromListBox(TOURNAMENT_MATCH_LIST pkMatch) { for (int i = 0; i < this.m_liMatchList.Count; i++) { UIListItemContainer item = this.m_lbBattleMatchInfo.GetItem(i); if (item != null) { Label label = item.GetElement(this.MATCHINDEX) as Label; if (label != null) { int num = int.Parse(label.GetText()); if (num == pkMatch.nIndex) { TextField textField = item.GetElement(this.PLAYER1) as TextField; if (textField != null && !textField.GetText().Equals(pkMatch.m_szPlayer[0])) { pkMatch.m_szPlayer[0] = textField.GetText(); } textField = (item.GetElement(this.PLAYER2) as TextField); if (textField != null && !textField.GetText().Equals(pkMatch.m_szPlayer[1])) { pkMatch.m_szPlayer[1] = textField.GetText(); } textField = (item.GetElement(this.OBSERVER) as TextField); if (textField != null && !textField.GetText().Equals(pkMatch.m_szObserver)) { pkMatch.m_szObserver = textField.GetText(); } } } } } }
private static int CompareLevelASC2(UIListItemContainer l, UIListItemContainer r) { NkSoldierInfo nkSoldierInfo = (NkSoldierInfo)l.Data; NkSoldierInfo nkSoldierInfo2 = (NkSoldierInfo)r.Data; return(nkSoldierInfo.GetLevel().CompareTo(nkSoldierInfo2.GetLevel())); }
public void Init() { itemContainer = gameObject.GetComponent(typeof(UIListItemContainer)) as UIListItemContainer; button.spriteText.maxWidth = button.width - (button.width * GameValues.buttonTextPaddingPercentage); costText.maxWidth = button.width - (button.width * GameValues.buttonTextPaddingPercentage); }
public void ShowUIGuide(string param1, string param2, int winID) { if (this.ComposeNewListBox == null || this.ComposeNewListBox.Count == 0) { return; } this.guideWinID = winID; UIListItemContainer item = this.ComposeNewListBox.GetItem(0); if (item == null) { return; } if (this._Touch == null) { this._Touch = UICreateControl.Button("touch", "Main_I_Touch01", 196f, 154f); this._Touch.PlayAni(true); } if (this._Touch == null) { return; } this._Touch.gameObject.transform.parent = item.gameObject.transform; this._Touch.transform.position = new Vector3(item.transform.position.x, item.transform.position.y, item.transform.position.z - 3f); BoxCollider component = this._Touch.gameObject.GetComponent <BoxCollider>(); if (null != component) { UnityEngine.Object.Destroy(component); } }
List <IUIListObject> GetParent(string parName) { List <IUIListObject> parent; if (!allParents.TryGetValue(parName, out parent)) { IUIListObject newItem = list.CreateItem(parentPrefab, parName); newItem.gameObject.name = parName; UIStateToggleBtn radioBtn = newItem.gameObject.GetComponent <UIStateToggleBtn>(); if (radioBtn != null) { radioBtn.AddValueChangedDelegate(ParentValueChanged); } UIListItemContainer container = newItem.gameObject.GetComponent <UIListItemContainer>(); if (container != null) { allParContainers.Add(container); } parent = new List <IUIListObject>(); allParents.Add(parName, parent); } return(parent); }
private void OnMoveSlider(IUIObject obj) { HorizontalSlider horizontalSlider = obj as HorizontalSlider; if (horizontalSlider == null) { return; } int num = -1; if (obj.Data != null) { num = (int)obj.Data; } if (num > -1 && num < this.m_SoldierInfoSortList.Count && this.m_oldHSInittiativeValue[num] != horizontalSlider.Value) { int num2 = (int)(horizontalSlider.Value * 100f); if (num2 != this.m_SolInitiativeList[num]) { this.m_SolInitiativeList[num] = num2; UIListItemContainer item = this.InitiativeNewListBox.GetItem(num); if (item != null) { Label label = item.GetElement(11) as Label; if (label != null) { label.SetText(this.m_SolInitiativeList[num].ToString()); } } } } }
private void CountSolInitiativeValue(long SolID, int AddValue) { if (0L < SolID) { int index = this.m_SoldierInfoSortList.FindIndex((NkSoldierInfo value) => value.GetSolID() == SolID); int num = this.m_SolInitiativeList[index] + AddValue; if (num < 0) { num = 0; } else if (num >= 100) { num = 100; } if (num != this.m_SolInitiativeList[index]) { this.m_SolInitiativeList[index] = num; UIListItemContainer selectItem = this.InitiativeNewListBox.GetSelectItem(); if (selectItem != null) { Label label = selectItem.GetElement(11) as Label; if (label != null) { label.SetText(num.ToString()); } float num2 = (float)num / 100f; HorizontalSlider horizontalSlider = selectItem.GetElement(12) as HorizontalSlider; horizontalSlider.CallChangeDelegate = false; horizontalSlider.defaultValue = num2; horizontalSlider.Value = num2; this.m_oldHSInittiativeValue[index] = num2; } } } }
public void SetText(string text) { Transform transform = base.transform.FindChild("ChatText"); if (transform != null) { this.emoticonContainer = transform.GetComponent <UIListItemContainer>(); if (this.emoticonContainer == null) { this.emoticonContainer = transform.gameObject.AddComponent <UIListItemContainer>(); } this.emoticonContainer.Delete(); float num = 0f; EmoticonInfo.ParseAdEmoticon(ref this.emoticonContainer, text, this.fEmoticonScale, ref num); } if (text.Length > 0) { this.fCreateTime = Time.time; this.bReadyData = true; } else { this.fCreateTime = 0f; this.bReadyData = false; } }
private void SetCurrentShowHide(bool bShow) { Transform transform = base.transform.FindChild("ChatPlane"); if (transform != null) { MeshRenderer component = transform.GetComponent <MeshRenderer>(); if (component) { component.enabled = (bShow && this.bRenderPlane); } } Transform transform2 = base.transform.FindChild("ChatPlaneArrow"); if (transform2 != null) { MeshRenderer component2 = transform2.GetComponent <MeshRenderer>(); if (component2) { component2.enabled = (bShow && this.bRenderPlane); } } Transform transform3 = base.transform.FindChild("ChatText"); if (transform3 != null) { UIListItemContainer component3 = transform3.GetComponent <UIListItemContainer>(); if (null != component3) { component3.Visible = (bShow && this.bRenderText); } } this.bRenderEnabled = bShow; }
public void SetPlaneKey(string imageKey, ref float addY) { Transform transform = base.transform.FindChild("ChatPlane"); if (transform != null) { SimpleSprite component = transform.GetComponent <SimpleSprite>(); if (component != null) { Transform transform2 = base.transform.FindChild("ChatText"); if (transform2 != null) { UIListItemContainer component2 = transform2.GetComponent <UIListItemContainer>(); if (null != component2) { Vector2 vector = (Vector2)component2.Data; float num = vector.x + 20f; float h = vector.y + 10f; component.Setup(num, h, imageKey); component.SetColor(new Color(1f, 1f, 1f, 0.8f)); component.transform.rotation = base.transform.rotation; component.transform.localScale = new Vector3(this.fBackImageScaleX, this.fBackImageScaleY, 1f); component2.transform.localPosition = new Vector3(-(num * this.fEmoticonScale) / 2f + 20f * this.fEmoticonScale / 2f, vector.y * this.fEmoticonScale / 2f, 0f); } } else { component.Hide(true); } } } }
public void UpdateTime() { for (int i = 0; i < this.m_nlbNPCList.Count; i++) { UIListItemContainer item = this.m_nlbNPCList.GetItem(i); if (!(item == null)) { if (item.Data != null) { AGIT_NPC_SUB_DATA aGIT_NPC_SUB_DATA = item.Data as AGIT_NPC_SUB_DATA; if (aGIT_NPC_SUB_DATA != null) { Label label = item.GetElement(5) as Label; if (label != null) { long i64Time = aGIT_NPC_SUB_DATA.i64NPCEndTime - PublicMethod.GetCurTime(); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strTime, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1763"), "timestring", this.GetTimeToString(i64Time) }); label.SetText(this.m_strTime); } } } } } }
void Awake() { listContatiner = transform.parent.GetComponent<UIListItemContainer>(); m_Gold = 0; if( textName != null && textGold != null) { textName.Text = ""; m_TextName = ""; textGold.Text = ""; } }
public void Init() { itemContainer = GetComponent(typeof(UIListItemContainer)) as UIListItemContainer; }