Exemplo n.º 1
0
 /// <summary>
 /// 设置流动商城当前活跃的商城
 /// </summary>
 /// <param name="activeStore"></param>
 /// <param name="force">是否强制刷新</param>
 public void SetBlackMarkeActiveStore(GameCmd.CommonStore activeStore, bool force = false)
 {
     if (blackMarketActiveStore == activeStore && !force)
     {
         return;
     }
     this.blackMarketActiveStore = activeStore;
     //重置活动页签
     this.blackMarketActiveTabIndex = 0;
     Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTBLACKACTIVESTORECHANGED, blackMarketActiveStore);
 }
Exemplo n.º 2
0
    /// <summary>
    /// 设置活动数据
    /// </summary>
    /// <param name="activeStore"></param>
    /// <param name="force"></param>
    private void SetActiveStore(GameCmd.CommonStore activeStore, bool force = false)
    {
        UIToggleGrid tog = null;

        if (null != m_dic_commontabs && m_dic_commontabs.TryGetValue(this.activeStore, out tog))
        {
            tog.SetHightLight(false);
        }
        this.activeStore = activeStore;
        if (null != m_dic_commontabs && m_dic_commontabs.TryGetValue(this.activeStore, out tog))
        {
            tog.SetHightLight(true);
        }
        this.activeStore = activeStore;
        this.activeTabId = 0;
        CreateTab();
    }
Exemplo n.º 3
0
    /// <summary>
    /// 获取流动商城刷新数据
    /// </summary>
    /// <param name="mallType"></param>
    /// <returns></returns>
    public MallDefine.BlackMarketRefreshData GetBlackMallRefreshData(int mallType = 0)
    {
        if (!MallReady)
        {
            InitMallData();
        }
        GameCmd.CommonStore targetStore = (mallType == 0)? blackMarketActiveStore
            : (GameCmd.CommonStore)mallType;
        MallDefine.BlackMarketRefreshData refreshData = new MallDefine.BlackMarketRefreshData();
        table.NobleDataBase ndb =
            GameTableManager.Instance.GetTableItem <table.NobleDataBase>(DataManager.Manager <Mall_HuangLingManager>().NobleID);
        if (null == ndb)
        {
            return(refreshData);
        }

        //刷新消费
        string refreshCostString =
            GameTableManager.Instance.GetGlobalConfig <string>(DYNASTORE_REFRESH_COST);

        if (null == refreshCostString)
        {
            return(refreshData);
        }
        string[] refreshCostStringArray = refreshCostString.Split(new char[] { '_' });
        if (null == refreshCostStringArray && refreshCostStringArray.Length != 5)
        {
            return(refreshData);
        }

        //刷新消费类型
        string refreshCostType =
            GameTableManager.Instance.GetGlobalConfig <string>(DYNASTORE_COST_TYPE);

        if (null == refreshCostString)
        {
            return(refreshData);
        }
        string[] refreshCostTypeArray = refreshCostType.Split(new char[] { '_' });
        if (null == refreshCostTypeArray && refreshCostTypeArray.Length != 5)
        {
            return(refreshData);
        }

        //刷新时间间隔
        string refreshGap =
            GameTableManager.Instance.GetGlobalConfig <string>(DYNASTORE_REFRESH_TIME);

        if (null == refreshCostString)
        {
            return(refreshData);
        }
        string[] refreshGapArray = refreshGap.Split(new char[] { '_' });
        if (null == refreshGapArray && refreshGapArray.Length != 5)
        {
            return(refreshData);
        }
        int type = 0;
        int num  = 0;

        switch (targetStore)
        {
        case GameCmd.CommonStore.CommonStore_HundredOne:
            //声望
        {
            refreshData.RefreshCount = (int)ndb.repRefCount;
            int.TryParse(refreshGapArray[0], out refreshData.RefreshGap);
            int.TryParse(refreshCostTypeArray[0], out type);
            int.TryParse(refreshCostStringArray[0], out num);
        }
        break;

        case GameCmd.CommonStore.CommonStore_HundredTwo:
            //积分
        {
            refreshData.RefreshCount = (int)ndb.scoreRefCount;
            int.TryParse(refreshGapArray[1], out refreshData.RefreshGap);
            int.TryParse(refreshCostTypeArray[1], out type);
            int.TryParse(refreshCostStringArray[1], out num);
        }
        break;

        case GameCmd.CommonStore.CommonStore_HundredThree:
            //黑市
        {
            refreshData.RefreshCount = (int)ndb.blackRefCount;
            int.TryParse(refreshGapArray[2], out refreshData.RefreshGap);
            int.TryParse(refreshCostTypeArray[2], out type);
            int.TryParse(refreshCostStringArray[2], out num);
        }
        break;

        case GameCmd.CommonStore.CommonStore_HundredFour:
            //战勋
        {
            refreshData.RefreshCount = (int)ndb.campScoreRefCount;
            int.TryParse(refreshGapArray[3], out refreshData.RefreshGap);
            int.TryParse(refreshCostTypeArray[3], out type);
            int.TryParse(refreshCostStringArray[3], out num);
        }
        break;

        case GameCmd.CommonStore.CommonStore_HundredFive:
            //战勋
        {
            refreshData.RefreshCount = (int)ndb.shouLieScoreRefCount;
            int.TryParse(refreshGapArray[4], out refreshData.RefreshGap);
            int.TryParse(refreshCostTypeArray[4], out type);
            int.TryParse(refreshCostStringArray[4], out num);
        }
        break;
        }
        refreshData.RefreshCost = new MallDefine.CurrencyData((MoneyType)
                                                              type, (uint)num);
        return(refreshData);
    }