public void updateViewByUpgradeSuccess(int unit_idx)
    {
        if (InventoryVC.checkInst())
        {
            InventoryVC inventory = InventoryVC.Inst;
            inventory.FrameMain.SetActive(true);

            setData();
            frameScroll.SetActive(true);
            if (SubViewUpgrade.checkInst() == true)
            {
                Destroy(SubViewUpgrade.Inst.gameObject);
            }
            resetScroll();
            int update_unit_arr_idx = 0;
            for (int i = 0; i < EquipmentList[(int)selectedMenu].Count; i++)
            {
                if (EquipmentList[(int)selectedMenu][i].index == unit_idx)
                {
                    update_unit_arr_idx = i;
                    break;
                }
            }

            scrollList.SetContentOffset(update_unit_arr_idx);
            scrollList.ScrollViewDidScroll();
            updateDetailInfo(update_unit_arr_idx);
        }
    }
    public void updateSelectedUnitInfo()
    {
        if (selected_unit_idx < 0 || selected_unit_idx >= total_item_num)
        {
            DebugLog.Log(false, "Invalid select_unit_idx by scrollmove select");
            return;
        }

        if (LobbyManager.Inst.popupState == POPUP_STATE.Servant)
        {
            bool none_subview = true;
            if (SubViewDeconstruction.checkInst() || SubViewEquipment.checkInst() || SubViewUpgrade.checkInst())
            {
                none_subview = false;
            }

            if (PartyInfoVC.checkInst() && none_subview)
            {
                PartyInfoVC partyInfo = PartyInfoVC.Inst;
                if (partyInfo.selectedMenu == PartyInfoVC.menu_type.SERVANT || partyInfo.selectedMenu == PartyInfoVC.menu_type.MONSTER)
                {
                    if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.SERVANT_INFO || partyInfo.currentScrollType == PartyInfoVC.scroll_type.MONSTER_INFO)
                    {
                        partyInfo.updateDetailInfo(selected_main_idx);
                    }
                }
            }
        }
        else if (LobbyManager.Inst.popupState == POPUP_STATE.Weapon)
        {
            if (InventoryVC.checkInst())
            {
                if (InventoryVC.Inst.selectedMenu == Inventory_Menu_Type.ITEM)
                {
                    if (ItemInfoManager.Inst.ItemList.Count > 0)
                    {
                        ItemInfoManager.Inst.updateItemDetailInfo(selected_main_idx);
                    }
                }
                else
                {
                    bool none_subview = true;
                    if (SubViewDeconstruction.checkInst() || SubViewEquipment.checkInst() || SubViewUpgrade.checkInst())
                    {
                        none_subview = false;
                    }

                    if (InventoryVC.checkInst() && none_subview)
                    {
                        if (EquipmentInfoManager.Inst.EquipmentList[(int)EquipmentInfoManager.Inst.GetSelectedMenu()].Count > 0)
                        {
                            EquipmentInfoManager.Inst.updateDetailInfo(selected_main_idx);
                        }
                    }
                }
            }
        }
    }
Example #3
0
    public void ShowUpgrade()
    {
        FrameMain.SetActive(false);

        GameObject objSubView = Instantiate(Resources.Load("UI/Lobby/SubViewUpgrade")) as GameObject;

        objSubView.name = "SubViewUpgrade";
        objSubView.transform.SetParent(FrameSubView.transform);
        objSubView.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
        SubViewUpgrade s_upgrade = objSubView.GetComponent <SubViewUpgrade>();

        s_upgrade.SetUpgradeType(UPGRADE_TYPE.EQUIPMENT);
    }
    //강화 완료(서버에서 응답) 후 화면 전체 갱신
    public void updateViewByUpgradeFail()
    {
        if (InventoryVC.checkInst())
        {
            InventoryVC inventory = InventoryVC.Inst;
            inventory.FrameMain.SetActive(true);

            updateAllView();

            if (SubViewUpgrade.checkInst() == true)
            {
                Destroy(SubViewUpgrade.Inst.gameObject);
            }
        }
    }
Example #5
0
    public void OnClickSortType(int btn_idx)
    {
        sortType = (SORT_TYPE)btn_idx;
        updateSortView();

        if (PartyInfoVC.checkInst())
        {
            if (SubViewEquipment.checkInst())
            {
                DebugLog.Log(false, "Reset Equip List");
                SubViewEquipment.Inst.ResetScrollListBySortType(sortType);
            }
            else if (SubViewDeconstruction.checkInst())
            {
                DebugLog.Log(false, "Reset deconstruct List");
                SubViewDeconstruction.Inst.ResetScrollListBySortType(sortType);
            }
            else if (SubViewUpgrade.checkInst())
            {
                DebugLog.Log(false, "Reset SubViewUpgrade List");
                SubViewUpgrade.Inst.ResetScrollListBySortType(sortType);
            }
            else
            {
                DebugLog.Log(false, "Reset Partyinfo List");
                PartyInfoVC.Inst.ResetScrollListBySortType(sortType);
            }
        }
        else if (InventoryVC.checkInst())
        {
            if (SubViewDeconstruction.checkInst())
            {
                DebugLog.Log(false, "Reset deconstruct List");
                SubViewDeconstruction.Inst.ResetScrollListBySortType(sortType);
            }
            else if (SubViewUpgrade.checkInst())
            {
                DebugLog.Log(false, "Reset SubViewUpgrade List");
                SubViewUpgrade.Inst.ResetScrollListBySortType(sortType);
            }
            else
            {
                DebugLog.Log(false, "Reset Inven List");
                EquipmentInfoManager.Inst.ResetScrollListBySortType(sortType);
            }
        }
    }
    public void ShowUpgrade()
    {
        //Upgrade는 몬스터일때만
        if (selectedMenu == menu_type.MONSTER)
        {
            frameScroll.SetActive(false);

            GameObject objSubView = Instantiate(Resources.Load("UI/Lobby/SubViewUpgrade")) as GameObject;
            objSubView.name = "SubViewUpgrade";
            objSubView.transform.SetParent(FrameSubView.transform);
            objSubView.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
            SubViewUpgrade s_upgrade = objSubView.GetComponent <SubViewUpgrade>();
            s_upgrade.SetUpgradeType(UPGRADE_TYPE.MONSTER);
        }
        else
        {
            DebugLog.Log(false, "Warning : Montser upgrade only");
        }
    }
    //강화 완료(서버에서 응답) 후 화면 전체 갱신
    public void updateViewFinishRequest(int unit_idx)
    {
        setData();
        frameScroll.SetActive(true);
        if (SubViewUpgrade.checkInst() == true)
        {
            Destroy(SubViewUpgrade.Inst.gameObject);
        }
        resetScroll();
        int update_unit_arr_idx = 0;

        for (int i = 0; i < MonsterList.Count; i++)
        {
            if (MonsterList[i].index == unit_idx)
            {
                update_unit_arr_idx = i;
                break;
            }
        }

        scrollList.SetContentOffset(update_unit_arr_idx);
        scrollList.ScrollViewDidScroll();
        updateDetailInfo(update_unit_arr_idx);
    }
Example #8
0
    public override void UpdateUnit(int _main_idx)
    {
        main_idx = _main_idx;

        partyInfo = PartyInfoVC.Inst;

        int chracter_unit_idx = 0;

        //Todo :set Image
        if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.SERVANT_INFO)
        {
            int selected_idx;
            if (SubViewDeconstruction.checkInst() && unit_controller.Equals(SubViewDeconstruction.Inst))
            {
                selected_idx      = SubViewDeconstruction.Inst.scrollListData[main_idx];
                chracter_unit_idx = partyInfo.ServantList[SubViewDeconstruction.Inst.scrollListData[main_idx]].index;
            }
            else
            {
                selected_idx      = main_idx;
                chracter_unit_idx = partyInfo.ServantList[main_idx].index;
            }

            ImageGrade.sprite      = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)partyInfo.ServantList[selected_idx].grade);
            imageCharacter.sprite  = CSVData.Inst.GetServantData(partyInfo.ServantList[selected_idx].id).servantIcon;
            textCharacterName.text = CSVData.Inst.GetServantData(partyInfo.ServantList[selected_idx].id).name;
            textLevel.text         = string.Format("{0}", partyInfo.ServantList[selected_idx].level);
            textPower.text         = string.Format("{0}", Calculator.GetPower(partyInfo.ServantList[selected_idx].status, partyInfo.ServantList[selected_idx].level));
            textUpgrade.text       = string.Format(" ");
            imageClass.sprite      = CSVData.Inst.GetSpriteServantJob(partyInfo.ServantList[selected_idx].jobType);
            imageType.gameObject.SetActive(false);

            //TODO:나중에 파티가 여러개일 경우, 수정이 필요할 수 있음
            if (partyInfo.ServantList[selected_idx].partyIndex > 0)
            {
                GetComponent <Image>().color = Color.cyan;
            }
            else
            {
                GetComponent <Image>().color = Color.white;
            }
        }
        else if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.MONSTER_INFO)
        {
            int selected_idx;
            if (SubViewUpgrade.checkInst() && unit_controller.Equals(SubViewUpgrade.Inst))
            {
                selected_idx = SubViewUpgrade.Inst.scrollListData[main_idx];
            }
            else if (SubViewDeconstruction.checkInst() && unit_controller.Equals(SubViewDeconstruction.Inst))
            {
                selected_idx      = SubViewDeconstruction.Inst.scrollListData[main_idx];
                chracter_unit_idx = partyInfo.MonsterList[SubViewDeconstruction.Inst.scrollListData[main_idx]].index;
            }
            else
            {
                selected_idx      = main_idx;
                chracter_unit_idx = partyInfo.MonsterList[main_idx].index;
            }

            ImageGrade.sprite      = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)partyInfo.MonsterList[selected_idx].grade);
            imageCharacter.sprite  = CSVData.Inst.GetMonsterData(partyInfo.MonsterList[selected_idx].id).monsterIcon;
            textCharacterName.text = CSVData.Inst.GetMonsterData(partyInfo.MonsterList[selected_idx].id).name;
            textLevel.text         = string.Format("{0}", partyInfo.MonsterList[selected_idx].level);
            textPower.text         = string.Format("{0}", Calculator.GetPower(partyInfo.MonsterList[selected_idx].status, partyInfo.MonsterList[selected_idx].level));
            string upgrade = string.Format(" ");
            if (partyInfo.MonsterList[selected_idx].upgrade > 0)
            {
                upgrade = string.Format("+{0}", partyInfo.MonsterList[selected_idx].upgrade);
            }
            textUpgrade.text = upgrade;

            imageClass.sprite = CSVData.Inst.GetSmallSpriteTribeType(partyInfo.MonsterList[selected_idx].tribeType);
            imageType.gameObject.SetActive(true);
            imageType.sprite = CSVData.Inst.GetSpriteElementType(partyInfo.MonsterList[selected_idx].elementType);

            //TODO:나중에 파티가 여러개일 경우, 수정이 필요할 수 있음
            if (partyInfo.MonsterList[selected_idx].partyIndex > 0)
            {
                GetComponent <Image>().color = Color.cyan;
            }
            else
            {
                GetComponent <Image>().color = Color.white;
            }
        }

        if (partyInfo.selectedMenu == PartyInfoVC.menu_type.FORMATION && chracter_unit_idx != 0)
        {
            if (partyInfo.checkSetFormationUnit(chracter_unit_idx))
            {
                GetComponent <Image>().color = Color.cyan;
            }
            else
            {
                GetComponent <Image>().color = Color.white;
            }
        }
        if (SubViewDeconstruction.checkInst())
        {
            if (SubViewDeconstruction.Inst.checkInsertedUnit(chracter_unit_idx))
            {
                GetComponent <Button>().interactable = false;
                imageDisable.SetActive(true);
            }
            else
            {
                GetComponent <Button>().interactable = true;
                imageDisable.SetActive(false);
            }
        }
    }
Example #9
0
    public override void OnClickUnit()
    {
        if (partyInfo != null)
        {
            if (SubViewDeconstruction.checkInst())
            {
                SubViewDeconstruction subview_deconstruction = SubViewDeconstruction.Inst;
                subview_deconstruction.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx);
                int chracter_unit_idx = 0;
                if (subview_deconstruction.GetDeconstructionType() == DECONSTRUCTION_TYPE.SERVANT)
                {
                    chracter_unit_idx = partyInfo.ServantList[subview_deconstruction.scrollListData[main_idx]].index;
                }
                else if (subview_deconstruction.GetDeconstructionType() == DECONSTRUCTION_TYPE.MONSTER)
                {
                    chracter_unit_idx = partyInfo.MonsterList[subview_deconstruction.scrollListData[main_idx]].index;
                }

                if (subview_deconstruction.checkInsertMax())
                {
                    DebugLog.Log(false, "Warning : 분해 슬롯 최대치!");
                    SimpleErrorPopupVC.Inst.UpdateErrorText("Max Burn List");
                }
                else
                {
                    if (subview_deconstruction.checkInsertedUnit(chracter_unit_idx))
                    {
                        DebugLog.Log(false, "Warning : 이미 분해 슬롯에 등록된 유닛 입니다.");
                        SimpleErrorPopupVC.Inst.UpdateErrorText("Already Listed");
                    }
                    else
                    {
                        GetComponent <Button>().interactable = false;
                        imageDisable.SetActive(true);
                        SubViewDeconstruction.Inst.InsertUnit(chracter_unit_idx);
                    }
                }
            }
            else if (SubViewUpgrade.checkInst())
            {
                SubViewUpgrade.Inst.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx);
                int selected_unit_idx = partyInfo.MonsterList[SubViewUpgrade.Inst.scrollListData[main_idx]].index;

                SubViewUpgrade.Inst.InsertUnit(selected_unit_idx);
            }
            else
            {
                partyInfo.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx);
                if (partyInfo.selectedMenu == PartyInfoVC.menu_type.SERVANT || partyInfo.selectedMenu == PartyInfoVC.menu_type.MONSTER)
                {
                    partyInfo.updateDetailInfo(getUnitIdx());
                }
                else if (partyInfo.selectedMenu == PartyInfoVC.menu_type.FORMATION)
                {
                    int chracter_unit_idx = 0;
                    if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.SERVANT_INFO)
                    {
                        chracter_unit_idx = partyInfo.ServantList[main_idx].index;
                    }
                    else if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.MONSTER_INFO)
                    {
                        chracter_unit_idx = partyInfo.MonsterList[main_idx].index;
                    }
                    partyInfo.InsertUnit(chracter_unit_idx);
                }
            }
        }
    }