public void SetPlayerInfo()
 {
     GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
     this.stoneNum.text     = playerInfo.point.ToString();
     this.clusterNum.text   = StringFormat.Cluster(playerInfo.gamemoney);
     this.buildCostNum.text = string.Format(StringMaster.GetString("SystemFraction"), FarmUtility.GetBuildFacilityCount(), 2);
 }
    private void SetParams()
    {
        if (DataMng.Instance().RespDataUS_PlayerInfo == null || DataMng.Instance().RespDataUS_PlayerInfo.playerInfo == null)
        {
            return;
        }
        GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
        this.userName.text = playerInfo.nickname;
        TitleDataMng.SetTitleIcon(playerInfo.titleId, this.titleIcon);
        UserStamina componentInChildren = this.userStaminaPrefabFolder.Target.GetComponentInChildren <UserStamina>();

        if (null != componentInChildren)
        {
            componentInChildren.RefreshParams();
        }
        this.userDigiStone.text            = playerInfo.point.ToString();
        this.userCluster.text              = StringFormat.Cluster(playerInfo.gamemoney);
        this.userMeat.text                 = string.Format(StringMaster.GetString("SystemFraction"), playerInfo.meatNum, playerInfo.meatLimitMax);
        this.stoneShopButton.onTouchEnded += delegate(Touch touch, Vector2 pos, bool flag)
        {
            if (flag)
            {
                this.OpenStoneShop();
            }
        };
    }
Пример #3
0
 public static GameWebAPI.RespDataTL_GetUserTitleList.UserTitleList GetEquipedUserTitle()
 {
     GameWebAPI.RespDataTL_GetUserTitleList.UserTitleList result = null;
     if (TitleDataMng.userTitleList != null)
     {
         GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
         result = TitleDataMng.userTitleList.FirstOrDefault((GameWebAPI.RespDataTL_GetUserTitleList.UserTitleList item) => item.titleId == playerInfo.titleId);
     }
     return(result);
 }
Пример #4
0
    public void ShowDatas()
    {
        GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
        this.lbTX_Stone.text   = playerInfo.point.ToString();
        this.lbTX_Chip.text    = StringFormat.Cluster(playerInfo.gamemoney);
        this.lbTX_Meat.text    = string.Format(StringMaster.GetString("SystemFraction"), playerInfo.meatNum, playerInfo.meatLimitMax);
        this.lbTX_HQ_Meat.text = Singleton <UserDataMng> .Instance.GetUserItemNumByItemId(50001).ToString();

        base.SetReOpendAction(new Func <int, bool>(this.UpdatePlayerInfo));
    }
Пример #5
0
	public static void PayCost(string categoryID, string cost)
	{
		GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
		if (int.Parse(categoryID) == 4)
		{
			playerInfo.gamemoney = (int.Parse(playerInfo.gamemoney) - int.Parse(cost)).ToString();
		}
		else
		{
			playerInfo.point -= int.Parse(cost);
		}
		GUIPlayerStatus.RefreshParams_S(false);
	}
Пример #6
0
 public APIRequestTask RequestRecoverStamina(bool requestRetry = true)
 {
     GameWebAPI.RequestUS_RecoverLife request = new GameWebAPI.RequestUS_RecoverLife
     {
         OnReceived = delegate(WebAPI.ResponseData response)
         {
             GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
             int stamina = playerInfo.stamina;
             int num     = int.Parse(playerInfo.staminaMax);
             this.RecoveryUserStamina(stamina + num);
             this.AddDigiStone(-ConstValue.RECOVER_STAMINA_DIGISTONE_NUM);
         }
     };
     return(new APIRequestTask(request, requestRetry));
 }
    private APIRequestTask RequestHearvest()
    {
        RequestFA_FacilityHarvest requestFA_FacilityHarvest = new RequestFA_FacilityHarvest();

        requestFA_FacilityHarvest.SetSendData = delegate(FacilityHarvest param)
        {
            param.userFacilityId1 = this.userFacility.userFacilityId;
            param.userFacilityId2 = ((this.storehouse == null) ? 0 : this.storehouse.userFacilityId);
        };
        requestFA_FacilityHarvest.OnReceived = delegate(FacilityHarvestResult response)
        {
            GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
            playerInfo.meatNum = (int.Parse(playerInfo.meatNum) + response.harvestNum).ToString();
            GUIPlayerStatus.RefreshParams_S(false);
        };
        RequestFA_FacilityHarvest request = requestFA_FacilityHarvest;

        return(new APIRequestTask(request, false));
    }
Пример #8
0
 public static APIRequestTask RequestUpdateEquipedTitle(int titleId, bool requestRetry = true)
 {
     GameWebAPI.RequestTL_EditUserTitle request = new GameWebAPI.RequestTL_EditUserTitle
     {
         SetSendData = delegate(GameWebAPI.SendDataTL_EditUserTitle param)
         {
             param.titleId = titleId;
         },
         OnReceived = delegate(GameWebAPI.RespDataTL_EditUserTitle noop)
         {
             GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
             GameWebAPI.RespDataPRF_Profile.UserDataProf    userData   = DataMng.Instance().RespDataPRF_Profile.userData;
             if (playerInfo != null)
             {
                 playerInfo.titleId = titleId.ToString();
             }
             if (userData != null)
             {
                 userData.titleId = titleId.ToString();
             }
         }
     };
     return(new APIRequestTask(request, requestRetry));
 }
Пример #9
0
 private void UpdateClusterNum()
 {
     GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
     this.ngTXT_CHIP.text = StringFormat.Cluster(playerInfo.gamemoney);
     GUIPlayerStatus.RefreshParams_S(false);
 }
Пример #10
0
 private bool UpdatePlayerInfo(int noop)
 {
     GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
     this.lbTX_Chip.text = StringFormat.Cluster(playerInfo.gamemoney);
     return(false);
 }
 private void UpdateCluster()
 {
     GameWebAPI.RespDataUS_GetPlayerInfo.PlayerInfo playerInfo = DataMng.Instance().RespDataUS_PlayerInfo.playerInfo;
     this.clusterLabel.text = StringFormat.Cluster(playerInfo.gamemoney);
 }