コード例 #1
0
    private IEnumerator DoInitialize()
    {
        LoadingQueue load_queue             = new LoadingQueue(this);
        LoadObject   lo_quest_chatitem      = load_queue.Load(RESOURCE_CATEGORY.UI, "ChatItem", false);
        LoadObject   lo_chat_stamp_listitem = load_queue.Load(RESOURCE_CATEGORY.UI, "ChatStampListItem", false);

        talkerName = GetTalkerName(MonoBehaviourSingleton <FriendManager> .I.talkUser.userId);
        SetLabelText((Enum)UI.Title_U, talkerName);
        SetLabelText((Enum)UI.Title_D, talkerName);
        nowPage      = 0;
        loadedPage   = -1;
        itemListData = new MessageItemListData(GetCtrl(UI.OBJ_ROOM_ITEM_LIST_ROOT).get_gameObject());
        if (load_queue.IsLoading())
        {
            yield return((object)load_queue.Wait());
        }
        chatItemPrefab      = (lo_quest_chatitem.loadedObject as GameObject);
        chatStampListPrefab = (lo_chat_stamp_listitem.loadedObject as GameObject);
        SetSliderLimit();
        DummyDragScroll.width = 410;
        ResetStampIdList();
        Reset();
        postMessageList.Clear();
        UIScrollView scrollView = ScrollView;

        scrollView.onDragFinished = (UIScrollView.OnDragNotification)Delegate.Combine(scrollView.onDragFinished, new UIScrollView.OnDragNotification(OnDragFinished));
        ChatInputFrame inputFrame = InputFrame;

        inputFrame.onChange = (Action)Delegate.Combine(inputFrame.onChange, (Action) delegate
        {
            ((_003CDoInitialize_003Ec__Iterator3D) /*Error near IL_01ea: stateMachine*/)._003C_003Ef__this.OnInput();
        });
        ChatInputFrame inputFrame2 = InputFrame;

        inputFrame2.onSubmit = (Action)Delegate.Combine(inputFrame2.onSubmit, (Action) delegate
        {
            ((_003CDoInitialize_003Ec__Iterator3D) /*Error near IL_0216: stateMachine*/)._003C_003Ef__this.OnTouchPost();
        });
        if (MonoBehaviourSingleton <FriendManager> .I.talkUser.userId == 0)
        {
            GetCtrl(UI.SCR_STAMP_LIST).get_gameObject().SetActive(false);
            GetCtrl(UI.OBJ_POST_FRAME).get_gameObject().SetActive(false);
        }
        else
        {
            updateStampList = true;
            AppMain i = MonoBehaviourSingleton <AppMain> .I;
            i.onDelayCall = (Action)Delegate.Combine(i.onDelayCall, new Action(InitStampList));
        }
        base.Initialize();
    }
コード例 #2
0
 private void AddNextChatItem(Action <ChatItem> initializer, bool topPosition, bool forceScroll)
 {
     //IL_0027: Unknown result type (might be due to invalid IL or missing references)
     //IL_002d: Expected O, but got Unknown
     //IL_0061: Unknown result type (might be due to invalid IL or missing references)
     //IL_0076: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
     //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
     //IL_011d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0122: Unknown result type (might be due to invalid IL or missing references)
     //IL_0137: Unknown result type (might be due to invalid IL or missing references)
     //IL_013c: Unknown result type (might be due to invalid IL or missing references)
     //IL_0152: Unknown result type (might be due to invalid IL or missing references)
     //IL_0157: Unknown result type (might be due to invalid IL or missing references)
     //IL_016b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0170: Unknown result type (might be due to invalid IL or missing references)
     //IL_0186: Unknown result type (might be due to invalid IL or missing references)
     //IL_018b: Unknown result type (might be due to invalid IL or missing references)
     if (!(chatItemPrefab == null))
     {
         MessageItemListData messageItemListData = itemListData;
         ChatItem            chatItem            = null;
         chatItem = ResourceUtility.Realizes(chatItemPrefab, messageItemListData.rootObject.get_transform(), 5).GetComponent <ChatItem>();
         if (topPosition)
         {
             initializer(chatItem);
             float num = chatItem.height + 22f;
             messageItemListData.basePosY += num;
             chatItem.get_transform().set_localPosition(new Vector3(-15f, messageItemListData.basePosY, 0f));
             messageItemListData.currentTotalHeight += num;
         }
         else
         {
             if (messageItemListData.itemList.Count > 0)
             {
                 messageItemListData.currentTotalHeight += 22f;
             }
             float num2 = messageItemListData.currentTotalHeight - messageItemListData.basePosY;
             chatItem.get_transform().set_localPosition(new Vector3(-15f, 0f - num2, 0f));
             initializer(chatItem);
             messageItemListData.currentTotalHeight += chatItem.height;
         }
         UpdateDummyDragScroll();
         if (!topPosition && forceScroll)
         {
             float   currentTotalHeight = messageItemListData.currentTotalHeight;
             Vector4 baseClipRegion     = ScrollView.panel.baseClipRegion;
             float   num3            = currentTotalHeight + baseClipRegion.y;
             Vector4 baseClipRegion2 = ScrollView.panel.baseClipRegion;
             float   num4            = num3 - baseClipRegion2.w * 0.5f;
             Vector3 localPosition   = ScrollViewTrans.get_localPosition();
             float   y            = localPosition.y;
             Vector2 clipOffset   = ScrollView.panel.clipOffset;
             float   num5         = num4 + (y + clipOffset.y);
             Vector2 clipSoftness = ScrollView.panel.clipSoftness;
             float   num6         = num5 + clipSoftness.y;
             ForceScroll(num6 - messageItemListData.basePosY, true);
         }
         if (topPosition)
         {
             messageItemListData.itemList.Insert(0, chatItem);
         }
         else
         {
             messageItemListData.itemList.Add(chatItem);
         }
     }
 }