private void OpenUpgradeDialog()
    {
        FacilityM    facilityMaster = FarmDataManager.GetFacilityMaster(this.farmObject.facilityID);
        UserFacility userFacility   = Singleton <UserDataMng> .Instance.GetUserFacility(this.farmObject.userFacilityID);

        if (userFacility != null && !string.IsNullOrEmpty(userFacility.completeTime))
        {
            return;
        }
        if (int.Parse(facilityMaster.maxLevel) <= userFacility.level)
        {
            return;
        }
        int level = userFacility.level + 1;
        FacilityUpgradeM facilityUpgradeMaster = FarmDataManager.GetFacilityUpgradeMaster(userFacility.facilityId, level);

        MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory)facilityUpgradeMaster.upgradeAssetCategoryId1.ToInt32();
        if (assetCategory == MasterDataMng.AssetCategory.TIP)
        {
            CMD_UpgradeConfirmation cmd_UpgradeConfirmation = GUIMain.ShowCommonDialog(null, "CMD_UpgradeConfirmation", null) as CMD_UpgradeConfirmation;
            cmd_UpgradeConfirmation.SetUserFacility(userFacility);
        }
        else
        {
            CMD_UpgradeConfirmationDigistone cmd_UpgradeConfirmationDigistone = GUIMain.ShowCommonDialog(null, "CMD_UpgradeConfirm_STONE", null) as CMD_UpgradeConfirmationDigistone;
            cmd_UpgradeConfirmationDigistone.SetUserFacility(userFacility);
        }
    }
Esempio n. 2
0
    private void OnPushedUpgradeButton()
    {
        FacilityM facilityMaster = FarmDataManager.GetFacilityMaster(this.userFacility.facilityId);

        if (!string.IsNullOrEmpty(this.userFacility.completeTime) || int.Parse(facilityMaster.maxLevel) <= this.userFacility.level)
        {
            return;
        }
        int level = this.userFacility.level + 1;
        FacilityUpgradeM facilityUpgradeMaster = FarmDataManager.GetFacilityUpgradeMaster(this.userFacility.facilityId, level);
        int num = facilityUpgradeMaster.upgradeAssetCategoryId1.ToInt32();

        if (num == 4)
        {
            CMD_UpgradeConfirmation cmd_UpgradeConfirmation = GUIMain.ShowCommonDialog(null, "CMD_UpgradeConfirmation", null) as CMD_UpgradeConfirmation;
            cmd_UpgradeConfirmation.SetUserFacility(this.userFacility);
        }
        else
        {
            CMD_UpgradeConfirmationDigistone cmd_UpgradeConfirmationDigistone = GUIMain.ShowCommonDialog(null, "CMD_UpgradeConfirm_STONE", null) as CMD_UpgradeConfirmationDigistone;
            cmd_UpgradeConfirmationDigistone.SetUserFacility(this.userFacility);
        }
        this.ClosePanel(true);
    }