private void OnSelectItem(GameObject go) { MultiPlayAPIRoom dataOfClass = DataSource.FindDataOfClass <MultiPlayAPIRoom>(go, (MultiPlayAPIRoom)null); if (dataOfClass == null) { return; } GlobalVars.SelectedMultiPlayRoomID = dataOfClass.roomid; GlobalVars.SelectedMultiPlayRoomPassCodeHash = dataOfClass.pwd_hash; GlobalVars.SelectedMultiTowerFloor = dataOfClass.floor; DebugUtility.Log("Select RoomID:" + (object)GlobalVars.SelectedMultiPlayRoomID + " PassCodeHash:" + GlobalVars.SelectedMultiPlayRoomPassCodeHash); FlowNode_GameObject.ActivateOutputLinks((Component)this, 101); Transform transform1 = go.get_transform().Find("cursor"); if (!Object.op_Inequality((Object)transform1, (Object)null)) { return; } for (int index = 0; index < this.mRoomList.Count; ++index) { Transform transform2 = this.mRoomList[index].get_transform().Find("cursor"); if (Object.op_Inequality((Object)transform2, (Object)null)) { ((Component)transform2).get_gameObject().SetActive(false); } } ((Component)transform1).get_gameObject().SetActive(true); }
private bool IsChooseRoom(MultiPlayAPIRoom room) { GameManager instance = MonoSingleton <GameManager> .Instance; PlayerData player = instance.Player; PartyData party = player.Partys[2]; QuestParam quest = instance.FindQuest(room.quest.iname); bool flag = false; if (room.limit == 0) { return(true); } if (party != null) { flag = true; for (int index = 0; index < (int)quest.unitNum; ++index) { long unitUniqueId = party.GetUnitUniqueID(index); if (unitUniqueId <= 0L) { flag = false; break; } UnitData unitDataByUniqueId = player.FindUnitDataByUniqueID(unitUniqueId); if (unitDataByUniqueId == null) { flag = false; break; } flag &= unitDataByUniqueId.CalcLevel() >= room.unitlv; } } return(flag); }
private void RefreshItems() { Transform transform = ((Component)this).get_transform(); for (int index = transform.get_childCount() - 1; index >= 0; --index) { Transform child = transform.GetChild(index); if (!Object.op_Equality((Object)child, (Object)null) && ((Component)child).get_gameObject().get_activeSelf()) { Object.DestroyImmediate((Object)((Component)child).get_gameObject()); } } if (Object.op_Equality((Object)this.ItemTemplate, (Object)null)) { return; } MultiPlayAPIRoom[] multiPlayApiRoomArray = FlowNode_MultiPlayAPI.RoomList != null ? FlowNode_MultiPlayAPI.RoomList.rooms : (MultiPlayAPIRoom[])null; if (multiPlayApiRoomArray == null) { return; } for (int index = 0; index < multiPlayApiRoomArray.Length; ++index) { MultiPlayAPIRoom data1 = multiPlayApiRoomArray[index]; if (data1 != null && data1.quest != null && !string.IsNullOrEmpty(data1.quest.iname)) { QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(data1.quest.iname); if (quest != null && quest.IsMultiEvent == GlobalVars.SelectedMultiPlayQuestIsEvent && (GlobalVars.SelectedMultiPlayArea == null || quest.ChapterID.Equals(GlobalVars.SelectedMultiPlayArea))) { GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate); ((Object)gameObject).set_hideFlags((HideFlags)52); Json_Unit[] jsonUnitArray = data1.owner != null ? data1.owner.units : (Json_Unit[])null; if (jsonUnitArray != null && jsonUnitArray.Length > 0) { UnitData data2 = new UnitData(); data2.Deserialize(jsonUnitArray[0]); DataSource.Bind <UnitData>(gameObject, data2); } DataSource.Bind <MultiPlayAPIRoom>(gameObject, data1); DataSource.Bind <QuestParam>(gameObject, quest); DebugUtility.Log("found roomid:" + (object)data1.roomid + " room:" + data1.comment + " iname:" + quest.iname + " playerNum:" + (object)quest.playerNum + " unitNum:" + (object)quest.unitNum); ListItemEvents component = (ListItemEvents)gameObject.GetComponent <ListItemEvents>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem); component.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail); component.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail); } gameObject.get_transform().SetParent(transform, false); gameObject.get_gameObject().SetActive(true); } } } GameParameter.UpdateAll(((Component)transform).get_gameObject()); }
private void OnSelectItem(GameObject go) { MultiPlayAPIRoom dataOfClass = DataSource.FindDataOfClass <MultiPlayAPIRoom>(go, (MultiPlayAPIRoom)null); if (dataOfClass == null) { return; } GlobalVars.SelectedMultiPlayRoomID = dataOfClass.roomid; GlobalVars.SelectedMultiPlayRoomPassCodeHash = dataOfClass.pwd_hash; DebugUtility.Log("Select RoomID:" + (object)GlobalVars.SelectedMultiPlayRoomID + " PassCodeHash:" + GlobalVars.SelectedMultiPlayRoomPassCodeHash); FlowNode_GameObject.ActivateOutputLinks((Component)this, 101); }
private void SetSelectablParam(GameObject obj, MultiPlayAPIRoom room, bool isChoose) { SRPG_Button component1 = (SRPG_Button)obj.GetComponent <SRPG_Button>(); Transform child1 = obj.get_transform().FindChild("fil"); Transform child2 = obj.get_transform().FindChild("basewindow"); if (isChoose) { if (Object.op_Inequality((Object)component1, (Object)null)) { ((Selectable)component1).set_interactable(true); } if (Object.op_Inequality((Object)child1, (Object)null)) { ((Component)child1).get_gameObject().SetActive(false); } if (!Object.op_Inequality((Object)child2, (Object)null)) { return; } Image component2 = (Image)((Component)child2).GetComponent <Image>(); if (!Object.op_Inequality((Object)component2, (Object)null)) { return; } ((Graphic)component2).set_color(this.EnableColor); } else { if (Object.op_Inequality((Object)component1, (Object)null)) { ((Selectable)component1).set_interactable(false); } if (Object.op_Inequality((Object)child1, (Object)null)) { ((Component)child1).get_gameObject().SetActive(true); } if (!Object.op_Inequality((Object)child2, (Object)null)) { return; } Image component2 = (Image)((Component)child2).GetComponent <Image>(); if (!Object.op_Inequality((Object)component2, (Object)null)) { return; } ((Graphic)component2).set_color(this.DisableColor); } }
private void RefreshItems(bool isSelect) { Transform transform = ((Component)this).get_transform(); int num = 0; GameManager instance = MonoSingleton <GameManager> .Instance; for (int index = 0; index < this.mRoomList.Count; ++index) { Object.DestroyImmediate((Object)this.mRoomList[index]); } this.mRoomList.Clear(); if (Object.op_Equality((Object)this.ItemTemplate, (Object)null)) { return; } MultiPlayAPIRoom[] multiPlayApiRoomArray = FlowNode_MultiPlayAPI.RoomList != null ? FlowNode_MultiPlayAPI.RoomList.rooms : (MultiPlayAPIRoom[])null; if (multiPlayApiRoomArray == null) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 200); } else if (multiPlayApiRoomArray.Length == 0) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 200); } else { RoomList.MultiTowerFilterMode multiTowerFilterMode = RoomList.MultiTowerFilterMode.Default; string s = FlowNode_Variable.Get("MT_ROOM_FILTER_MODE"); if (!string.IsNullOrEmpty(s)) { multiTowerFilterMode = (RoomList.MultiTowerFilterMode) int.Parse(s); } for (int index = 0; index < multiPlayApiRoomArray.Length; ++index) { MultiPlayAPIRoom multiPlayApiRoom = multiPlayApiRoomArray[index]; if (multiPlayApiRoom != null && multiPlayApiRoom.quest != null && !string.IsNullOrEmpty(multiPlayApiRoom.quest.iname)) { QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(multiPlayApiRoom.quest.iname); if (quest != null && quest.IsMultiEvent == GlobalVars.SelectedMultiPlayQuestIsEvent) { switch (multiTowerFilterMode) { case RoomList.MultiTowerFilterMode.Cleared: if (multiPlayApiRoom.is_clear != 0) { break; } continue; case RoomList.MultiTowerFilterMode.NotClear: if (multiPlayApiRoom.is_clear == 0) { break; } continue; } bool isChoose = this.IsChooseRoom(multiPlayApiRoom); if ((isChoose || !isSelect) && (multiPlayApiRoom.clear == 0 || instance.FindQuest(multiPlayApiRoom.quest.iname).state == QuestStates.Cleared)) { GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate); ((Object)gameObject).set_hideFlags((HideFlags)52); Json_Unit[] jsonUnitArray = multiPlayApiRoom.owner != null ? multiPlayApiRoom.owner.units : (Json_Unit[])null; if (jsonUnitArray != null && jsonUnitArray.Length > 0) { UnitData data = new UnitData(); data.Deserialize(jsonUnitArray[0]); DataSource.Bind <UnitData>(gameObject, data); } DataSource.Bind <MultiPlayAPIRoom>(gameObject, multiPlayApiRoom); DataSource.Bind <QuestParam>(gameObject, quest); DebugUtility.Log("found roomid:" + (object)multiPlayApiRoom.roomid + " room:" + multiPlayApiRoom.comment + " iname:" + quest.iname + " playerNum:" + (object)quest.playerNum + " unitNum:" + (object)quest.unitNum); ListItemEvents component = (ListItemEvents)gameObject.GetComponent <ListItemEvents>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem); component.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnOpenItemDetail); component.OnCloseDetail = new ListItemEvents.ListItemEvent(this.OnCloseItemDetail); } gameObject.get_transform().SetParent(transform, false); gameObject.get_gameObject().SetActive(true); this.mRoomList.Add(gameObject); this.SetSelectablParam(gameObject, multiPlayApiRoom, isChoose); ++num; } } } } GameParameter.UpdateAll(((Component)transform).get_gameObject()); FlowNode_GameObject.ActivateOutputLinks((Component)this, num != 0 ? 201 : 200); } }