示例#1
0
    void CleanUp()
    {
        m_ItemKind           = 0;
        m_nTurnID            = 0;
        m_AwardButtonState   = AwardState.AWARD_CANNNTHAVE;
        m_AwardInfoText.text = "";
        for (int nIndex = 0; nIndex < MaxItemCount; nIndex++)
        {
            m_ItemID[nIndex] = -1;
            if (m_ItemsDecText[nIndex])
            {
                m_ItemsDecText[nIndex].text = "";
            }
            if (m_Items[nIndex])
            {
                m_ItemsSprite[nIndex].spriteName = "";
                m_Items[nIndex].SetActive(false);
            }
            if (m_ItemsQualitySprite[nIndex])
            {
                m_ItemsQualitySprite[nIndex].spriteName = "";
            }
        }

        for (int i = 0; i < m_ItemDataID.Length; i++)
        {
            m_ItemType[i]   = ItemType.ITEM_MONEY;
            m_ItemDataID[i] = -1;
            m_ItemCount[i]  = 0;
        }

        m_ItemGrid.repositionNow = true;
    }
示例#2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (UserId != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (ActId != 0)
            {
                hash ^= ActId.GetHashCode();
            }
            if (StartState != 0)
            {
                hash ^= StartState.GetHashCode();
            }
            if (ImmediateFinishState != 0)
            {
                hash ^= ImmediateFinishState.GetHashCode();
            }
            if (AwardState != 0)
            {
                hash ^= AwardState.GetHashCode();
            }
            if (AcceptTime != 0L)
            {
                hash ^= AcceptTime.GetHashCode();
            }
            return(hash);
        }
示例#3
0
 public void UpdateAwardItemState(int nTurnID)
 {
     ActivenessAwardItem[] Item = m_ItemGrid.GetComponentsInChildren <ActivenessAwardItem>();
     for (int i = 0; i < Item.Length; ++i)
     {
         if (Item[i].TurnID == nTurnID)
         {
             Tab_ActivenessAward pAward = TableManager.GetActivenessAwardByID(nTurnID, 0);
             if (pAward == null)
             {
                 LogModule.DebugLog("ActivenessAward: ActivenessAward.txt can't find line " + nTurnID);
                 return;
             }
             AwardState awardState = AwardState.AWARD_CANNNTHAVE;
             bool       bFlag      = GameManager.gameManager.PlayerDataPool.AwardActivityData.GetActivenessAwardFlag(nTurnID);
             if (bFlag == false && Activeness > pAward.MiniActiveness)
             {
                 awardState = AwardState.AWARD_CANHAVE;
             }
             else if (bFlag == true)
             {
                 awardState = AwardState.AWARD_HAVEDONE;
             }
             else
             {
                 awardState = AwardState.AWARD_CANNNTHAVE;
             }
             Item[i].AwardButtonState = awardState;
             return;
         }
     }
 }
示例#4
0
    void OnLoadAwardItem(GameObject gAwardItem)
    {
        if (null == gAwardItem)
        {
            LogModule.ErrorLog("can not load award activeItem");
            return;
        }
        int nMaxRecordCount = TableManager.GetActivenessAward().Count;

        for (int i = 0; i < nMaxRecordCount; i++)
        {
            Tab_ActivenessAward pAward = TableManager.GetActivenessAwardByID(i, 0);
            if (pAward == null)
            {
                LogModule.DebugLog("ActivenessAward: ActivenessAward.txt can't find line " + i);
                continue;
            }

            string     strName    = i.ToString();
            AwardState awardState = AwardState.AWARD_CANNNTHAVE;
            bool       bFlag      = GameManager.gameManager.PlayerDataPool.AwardActivityData.GetActivenessAwardFlag(i);
            if (bFlag == false && Activeness >= pAward.MiniActiveness)
            {
                awardState = AwardState.AWARD_CANHAVE;
            }
            else if (bFlag == false && Activeness < pAward.MiniActiveness)
            {
                awardState = AwardState.AWARD_NOTHAVEDONE;
            }
            else if (bFlag == true)
            {
                awardState = AwardState.AWARD_HAVEDONE;
            }
            else
            {
                awardState = AwardState.AWARD_CANNNTHAVE;
            }

            ActivenessAwardItem AwardItem = ActivenessAwardItem.CreateAwardItem(strName, m_ItemGrid.gameObject, gAwardItem);
            if (AwardItem)
            {
                AwardItem.AddAwardUI(pAward.Exp, pAward.Money, pAward.BindYuanbao, pAward.AwardSkillExp, pAward.AwardReputation);
                AwardItem.AddItemUI(pAward.ItemDataID, pAward.ItemCount);
                AwardItem.AddAwardUIRepution(pAward.AwardReputation);
                AwardItem.AwardInfoText    = StrDictionary.GetClientDictionaryString("#{1634}", pAward.MiniActiveness);
                AwardItem.AwardButtonState = awardState;
                AwardItem.TurnID           = pAward.Id;
            }
        }// end for

        m_ItemGrid.repositionNow = true;
        m_ItemGrid.sorted        = true;
    }
        protected void GridViewAwards_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            TextBox     txtYr1       = null;
            TextBox     txtYr2       = null;
            TextBox     txtAwardName = null;
            TextBox     txtAwardInst = null;
            ImageButton lnkEdit      = null;
            ImageButton lnkDelete    = null;
            HiddenField hdURI        = null;

            AwardState awardstate = null;

            try
            {
                e.Row.Cells[4].Attributes.Add("style", "border-left:0px;");
            }
            catch (Exception ex) { }

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                txtYr1       = (TextBox)e.Row.Cells[0].FindControl("txtYr1");
                txtYr2       = (TextBox)e.Row.Cells[1].FindControl("txtYr2");
                txtAwardName = (TextBox)e.Row.Cells[2].FindControl("txtAwardName");
                txtAwardInst = (TextBox)e.Row.Cells[3].FindControl("txtAwardInst");
                hdURI        = (HiddenField)e.Row.Cells[3].FindControl("hdURI");

                lnkEdit   = (ImageButton)e.Row.Cells[4].FindControl("lnkEdit");
                lnkDelete = (ImageButton)e.Row.Cells[4].FindControl("lnkDelete");

                awardstate  = (AwardState)e.Row.DataItem;
                hdURI.Value = awardstate.SubjectURI;

                if (awardstate.EditDelete == false)
                {
                    lnkDelete.Visible = false;
                }

                if (awardstate.EditExisting == false)
                {
                    lnkEdit.Visible = false;
                }
            }

            if (e.Row.RowType == DataControlRowType.DataRow && (e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit)
            {
                txtYr1.Text       = Server.HtmlDecode((string)txtYr1.Text);
                txtYr2.Text       = Server.HtmlDecode((string)txtYr2.Text);
                txtAwardName.Text = Server.HtmlDecode((string)txtAwardName.Text);
                txtAwardInst.Text = Server.HtmlDecode((string)txtAwardInst.Text);
            }
        }
示例#6
0
    public void UpdateItemState(AwardState ItemState)
    {
        if (ItemState == AwardState.AWARD_HAVEDONE)
        {
            m_HaveAwardSprite.gameObject.SetActive(true);
        }
        else if (ItemState == AwardState.AWARD_IDLE)
        {
            SetToIdleState();
        }
        else
        {
            //             bool bIsCanHave = (ItemState == AwardState.AWARD_CANHAVE)?true:false;
            //             for (int i = 0; i < m_EffectPoint.Length; i++)
            //             {
            //                 m_EffectPoint[i].SetActive(bIsCanHave);
            //             }

            m_HaveAwardSprite.gameObject.SetActive(false);
        }
    }
示例#7
0
    void SetAwardButtonState(AwardState state)
    {
        switch (state)
        {
        case AwardState.AWARD_CANNNTHAVE:
        {
            m_AwardButtonDec.text   = Utils.GetDicByID(1381);
            m_AwardButton.isEnabled = false;
        }
        break;

        case AwardState.AWARD_CANHAVE:
        {
            m_AwardButtonDec.text   = Utils.GetDicByID(1378);
            m_AwardButton.isEnabled = true;
        }
        break;

        case AwardState.AWARD_HAVEDONE:
        {
            m_AwardButtonDec.text   = Utils.GetDicByID(1380);
            m_AwardButton.isEnabled = false;
        }
        break;

        case AwardState.AWARD_NOTHAVEDONE:
        {
            m_AwardButtonDec.text   = Utils.GetDicByID(1379);
            m_AwardButton.isEnabled = false;
        }
        break;

        default:
            break;
        }
    }
示例#8
0
    //void Start()
    //{

    //}

    void Init(int nTurnID, AwardState state)
    {
        m_nTurnID          = nTurnID;
        m_AwardButtonState = state;
    }