Example #1
0
 void OnHuntingGridUpdate(UIGridBase grid, int index)
 {
     if (grid is UIHuntingListGrid)
     {
         HuntingDataBase data = huntingDataList[index];
         if (data != null)
         {
             UIHuntingListGrid listGrid = grid as UIHuntingListGrid;
             listGrid.SetGridData(data);
             listGrid.SetHightLight(false);
         }
     }
     if (grid is UITabGrid)
     {
         UITabGrid g = grid as UITabGrid;
         g.SetName(toggleDic[(uint)index + 1]);
         g.TabID = index + 1;
     }
 }
Example #2
0
 void OnHuntingGridUIEvent(UIEventType eventType, object data, object param)
 {
     switch (eventType)
     {
     case UIEventType.Click:
         if (data is UIHuntingListGrid)
         {
             UIHuntingListGrid huntingGrid = data as UIHuntingListGrid;
             if (huntingGrid != null)
             {
                 SetActiveMonsterGrid(huntingGrid.MonsterID, false);
             }
         }
         if (data is UITabGrid)
         {
             UITabGrid g = data as UITabGrid;
             SetActiveTab(g.TabID);
         }
         break;
     }
 }
Example #3
0
    void SetActiveMonsterGrid(uint monsterID, bool needFocus = true)
    {
        if (m_ctor_ListScrollView != null)
        {
            UIHuntingListGrid monGrid = m_ctor_ListScrollView.GetGrid <UIHuntingListGrid>(monsterIDs.IndexOf(defaultMonsterID));
            if (null != monGrid)
            {
                monGrid.SetHightLight(false);
            }
            if (needFocus)
            {
                m_ctor_ListScrollView.FocusGrid(monsterIDs.IndexOf(monsterID));
            }
            monGrid = m_ctor_ListScrollView.GetGrid <UIHuntingListGrid>(monsterIDs.IndexOf(monsterID));
            if (monGrid != null)
            {
                monGrid.SetHightLight(true);
            }
            defaultMonsterID = monsterID;

            HuntingDataBase data = huntingDataList[monsterIDs.IndexOf(monsterID)];
            onClickHuntingGrid(data);
        }
    }