示例#1
0
 // Use this for initialization
 void Start()
 {
     //ply = FindObjectOfType<Player>();
     diceRoll = FindObjectOfType <DiceRollCtrl>();
     //		UIrollPlane.SetActive (false);
     msgUI = msgGO.GetComponent <MessageUI>();
 }
示例#2
0
        protected override async Task OnInitializedAsync()
        {
            messageUI = new MessageUI(MessageDataService, mapper, UserName);
            messages  = await messageUI.GetList();

            MessageCount = messages.Count();
        }
示例#3
0
    void DisplayPlayerMessage(Channel MessageChannel, string MessageContent)
    {
        GameObject message;

        message = GameObject.Instantiate(MessageChannel.OutgoingMessagePrefab, MessageChannel.ContentPanel.transform);
        MessageUI M = message.GetComponent <MessageUI>();

        //Player messages don't have a name or portrait to worry about
        M.MessageText.text = MessageContent;
        M.MessageText.ForceMeshUpdate();
        M.CharacterName         = "Player";
        M.BackgroundImage.color = PlayerMessageColor;
        //Canvas.ForceUpdateCanvases();
        float TextHeight = M.MessageText.preferredHeight;
        int   linecount  = M.MessageText.textInfo.lineCount;

        //Debug.Log("Message height: " + TextHeight + " line count: " + linecount);
        //This is here to work around a bug in TMP where it doesn't always provide an accurate linecount/height if text is very close to the limit
        //A character count is a terribly rough way to do this, but worst case is it makes extra-wide messages when they're not needed, which is
        //better than overflowing
        if (linecount == 1 && MessageContent.Length >= 36)
        {
            TextHeight *= 2;
        }
        RectTransform rt = M.gameObject.transform as RectTransform;

        rt.sizeDelta = new Vector2(rt.rect.width, TextHeight + 10);
        CleanCanvases(MessageChannel);
        MessageChannel.PlayerTextArea.text = "";
        WaitingForPlayerInput = false;
        //audio player sends message
        AkSoundEngine.PostEvent("Reply", gameObject);
    }
 // Use this for initialization
 void Start()
 {
     ply    = FindObjectOfType <Player>();
     msgUI  = FindObjectOfType <MessageUI>();
     rollUI = FindObjectOfType <RollDiceUIManager>();
     isRoll = false;
 }
 public void OnCursorEnter()
 {
     //Debug.Log (IsOpen);
     if (IsOpen)
     {
         //Debug.Log ("enter");
         if (!m_repeat && IsClose)
         {
             return;
         }
         m_isTrigger = true;
         CursorManager.SetCursor(m_cursor);
                     #if UNITY_STANDALONE_WIN || UNITY_EDITOR
         if (!string.IsNullOrEmpty(m_hint))
         {
             m_msgCtr = MessageUI.AutoShowMessage(m_hint, false, () => {
                 if (null != m_msgCtr)
                 {
                     GameObject.Destroy(m_msgCtr.gameObject);
                     m_msgCtr = null;
                 }
             }, 1);
         }
                     #endif
     }
 }
示例#6
0
 // Use this for initialization
 void Start()
 {
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     bagUIManager    = FindObjectOfType <BagUIManager>();
     messageUI       = FindObjectOfType <MessageUI>();
     mouseMoveManger = FindObjectOfType <MouseMoveManger>();
 }
示例#7
0
    IEnumerator EndAnimation(MessageUI MUI)
    {
        yield return(new WaitForSeconds(MUI.AnimationWaitTime));

        StartCoroutine(PreFinishAnimation(MUI));
        //audio
        AkSoundEngine.PostEvent("StopIsTyping", gameObject);
    }
        protected override async Task OnInitializedAsync()
        {
            doctorUI = new DoctorUI(DoctorDataService);
            Doctors  = await doctorUI.GetList();

            messageUI = new MessageUI(MessageDataService, mapper, UserName);
            ResetDialog();
        }
示例#9
0
 public void Activate()
 {
     isDeactivated = false;
     gameObject.SetActive(true);
     if (SimulationSession.Current.simulationMode == SimulationMode.Manual)
     {
         MessageUI.DisplayMessage("Cortinas de luz reactivadas");
     }
 }
示例#10
0
    void Awake()
    {
        constructTowerMenu = constructTowerMenuPublic;
        turretDetailMenu   = turretDetailMenuPublic;
        currencyUI         = currencyUIPublic;
        messageUI          = messageUIPublic;
        livesUI            = livesUIPublic;
        winLoseUI          = winLoseUIPublic;

        menus = new Menu[] { constructTowerMenu, turretDetailMenu };
    }
示例#11
0
 private void Awake()
 {
     Message = this;
     //text.gameObject.SetActive(false);
     back.gameObject.SetActive(false);
     tColor  = text.color;
     bColor  = back.color;
     b2Color = back2.color;
     messageImage.gameObject.SetActive(false);
     imageBack.gameObject.SetActive(false);
 }
示例#12
0
    IEnumerator PreFinishAnimation(MessageUI MUI)
    {
        //Debug.Log("PreFinishAnim " + MUI.MessageText.text);
        MUI.animator.StopPlayback();
        MUI.animator.enabled = false;
        MUI.TypingPrefab.SetActive(false);
        MUI.MessagePrefab.SetActive(true);
        yield return(new WaitForEndOfFrame());

        OnAnimationFinished(MUI);
    }
示例#13
0
    // Use this for initialization
    void Start()
    {
        eventController = FindObjectOfType <EventController>();

        roundController = FindObjectOfType <RoundController>();

        roomContraller = FindObjectOfType <RoomContraller>();

        camCtrl = FindObjectOfType <CameraCtrl>();

        msgUI = FindObjectOfType <MessageUI>();
    }
示例#14
0
 // Use this for initialization
 void Start()
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setIsEmpty(false);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemTask(ItemConstant.ITEM_CODE_SPEC_Y0006
                                    , ItemDesConstant.ITEM_CODE_SPEC_Y0006_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0006_NAME);
     this.setThingCode(ThingConstant.COMPUTER_01_CODE);
 }
示例#15
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            MessageUI MessageUI = new MessageUI();

            MessageUI.Description = txtDescription.Text;

            if (IsNewMode)
            {
                List <string> SendTo = new List <string>();
                foreach (ListItem item in ddlSendTo.Items)
                {
                    if (item.Selected)
                    {
                        SendTo.Add(item.Value);
                    }
                }

                MessageId = MessagesController.CreateNewMessage(MessageUI);

                if ((SendTo.Count == 1 && SendTo[0] == "Suppliers") || SendTo.Count == 0 || SendTo.Count == 2)
                {
                    SupplierNotification.SendNotificationNewMessage(MessageUI.Description);
                }
                if ((SendTo.Count == 1 && SendTo[0] == "AppUsers") || SendTo.Count == 0 || SendTo.Count == 2)
                {
                    //  int results = FcmService.SendFcmNotification(MessageUI.Description);
                    // Notification.SendNotificationNewMessageToAllDevices(MessageUI.Description);
                    //var result =  FcmService.SendFcmNotification(MessageUI.Description);
                }
            }

            if (IsNewMode)
            {
                string successMessage = MessagesStrings.GetText(@"MessageMessageCreated");
                string url            = @"EditMessage.aspx?ID=" + MessageId.ToString();
                url += @"&message-success=" + Server.UrlEncode(successMessage);
                Response.Redirect(url, true);
            }
            else
            {
                string successMessage = MessagesStrings.GetText(@"MessageMessageSaved");

                string url = @"EditMessage.aspx?message-success=" + Server.UrlEncode(successMessage);
                url += @"&ID=" + MessageId.ToString();
                Response.Redirect(url, true);
            }
        }
示例#16
0
    public static MessageUI AutoShowMessage(string msg, bool hasMask, MessageCallbackEvent e, float showTime)
    {
        //Debug.Log("msg uui");
        if (null == prefab)
        {
            prefab = Resources.Load("MessageCanvas") as GameObject;
        }
        GameObject go    = GameObject.Instantiate(prefab);
        MessageUI  uiCtr = go.GetComponent <MessageUI> ();

        uiCtr.ShowMessage(msg, hasMask, e, showTime);
        return(uiCtr);
    }
示例#17
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("More than one instance of MessageUI found");
            return;
        }
        instance = this;

        QuestEvents.OnGoalComplete  += GoalCompleted;
        QuestEvents.OnEnemyKilled   += EnemyKilled;
        QuestEvents.OnQuestComplete += QuestCompleted;
    }
 public override void Play(int eventID)
 {
     if (m_isPlaying)
     {
         return;
     }
     else
     {
         m_isPlaying = true;
     }
     MessageUI.AutoShowMessage(msg, true, OnShowMessageOver, 2);
     m_quiltGO.SetActive(false);
 }
 public void OnCursorExit()
 {
     //Debug.Log ("exit");
     if (m_isTrigger)
     {
         if (null != m_msgCtr)
         {
             GameObject.Destroy(m_msgCtr.gameObject);
             m_msgCtr = null;
         }
         m_isTrigger = false;
         CursorManager.SetCursor(CursorManager.CursorState.DEFAULT);
     }
 }
示例#20
0
    private void ShowCountdownUI()
    {
        CountdownUI = Instantiate <MessageUI>(MessageUITemplate);

        CountdownUI.Title     = "Get ready!";
        CountdownUI.Message   = "";
        CountdownUI.Countdown = "5";

        Vector3 uiPos     = new Vector3(0.0F, 5.0F, -8.0F);
        Vector3 uiForward = (uiPos - TargetManager.transform.position).normalized;

        CountdownUI.transform.gameObject.SetActive(true);
        CountdownUI.transform.gameObject.transform.position = uiPos;
        CountdownUI.transform.gameObject.transform.forward  = uiForward;
    }
 public void OnCursorSelect()
 {
     if (m_isTrigger)
     {
         if (!string.IsNullOrEmpty(m_triggerMsg))
         {
             m_triggerMsgCtr = MessageUI.AutoShowMessage(m_triggerMsg, true, () => {
                 if (null != m_triggerMsgCtr)
                 {
                     GameObject.Destroy(m_triggerMsgCtr.gameObject);
                     m_triggerMsgCtr = null;
                 }
             }, 2);
         }
         Play();
     }
 }
示例#22
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("There should only be one instance of MessageUI in the scene!");
            return;
        }

        instance = this;

        messages     = new Queue <Message>();
        messageLines = GetComponentsInChildren <Text>();

        for (int i = 0; i < messageLines.Length; i++)
        {
            messages.Enqueue(new Message("", Color.white));
        }
    }
示例#23
0
 // Use this for initialization
 void Start()
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     if (roundController.newOrLoad)
     {
         this.setIsEmpty(false);
     }
     else
     {
         loadInfo();
     }
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemTask(ItemConstant.ITEM_CODE_SPEC_Y0007
                                    , ItemDesConstant.ITEM_CODE_SPEC_Y0007_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0007_DES);
     this.setThingCode(ThingConstant.SAFE_BOX_01_CODE);
 }
示例#24
0
 public override void init(int[] xyz)
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setRoom(xyz);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemTask(ItemConstant.ITEM_CODE_SPEC_00001
                                    , "黑色的书", "带血的内容:你需要用活血的几十来开始剧情");
     this.setThingCode(ThingConstant.BOX_01_CODE);
     if (roundController.newOrLoad)
     {
         setIsEmpty(false);
     }
     else
     {
         this.loadInfo();
     }
 }
示例#25
0
 public override void init(int[] xyz)
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setRoom(xyz);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     this.setThingCode(ThingConstant.OPERATING_TABLE_01_CODE);
     item = new ItemPotion(ItemConstant.ITEM_CODE_SPEC_Y0003
                           , ItemDesConstant.ITEM_CODE_SPEC_Y0003_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0003_DES);
     if (roundController.newOrLoad)
     {
         this.setIsEmpty(false);
     }
     else
     {
         this.loadInfo();
     }
 }
示例#26
0
    void Awake()
    {
        self = this;

        if (messageUIs == null)
        {
            messageUIs = new MessageUI[Player.PLAYER_COUNT];
        }

        BirdSpawner spawner = this.gameObject.GetComponent <BirdSpawner>();

        messageUIs[spawner.playerIndex] = this;

        Image img = this.gameObject.GetComponent <Image>();

        img.color = Colors.midColors[spawner.playerIndex];

        wasdDir.GetComponent <Image> ().color    = Colors.lightColors[spawner.playerIndex];
        wasdAction.GetComponent <Image> ().color = Colors.lightColors[spawner.playerIndex];
    }
示例#27
0
    void OnAnimationFinished(MessageUI MUI)
    {
        //We also need to disable the animator component so that it doesn't activate again when the panel is reactivated

        //Debug.Log("OnAnimationFinished");

        //Here we need to calculate the proper size for the text box, because the text component will actually be active
        MUI.MessageText.ForceMeshUpdate();
        float TextHeight = MUI.MessageText.preferredHeight;
        float TextWidth  = MUI.MessageText.preferredWidth;
        //int linecount = MUI.MessageText.textInfo.lineCount;

        RectTransform rt = MUI.gameObject.transform as RectTransform;

        //Debug.Log("Message height: " + TextHeight + " line count: " + linecount + " rect width: " + rt.rect.width);
        rt.sizeDelta = new Vector2(rt.rect.width, TextHeight + 10);

        CleanCanvases(MUI.MessageChannel);
        LayoutRebuilder.ForceRebuildLayoutImmediate(MUI.MessageChannel.ContentPanel.transform as RectTransform);
    }
示例#28
0
 public override void init(int[] xyz)
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setRoom(xyz);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemPotion(ItemConstant.ITEM_CODE_POTION_10001
                                      , "速度回复药水", "模糊的字迹写着是哈尔滨六厂生产,蓝屏的钙");
     this.setThingCode(ThingConstant.BARREL_01_CODE);
     if (roundController.newOrLoad)
     {
         setIsEmpty(false);
     }
     else
     {
         this.loadInfo();
     }
 }
示例#29
0
 void ResizeAllMessagesInChannel(Channel MessageChannel)
 {
     foreach (Transform child in MessageChannel.ContentPanel.transform)
     {
         MessageUI MUI = child.GetComponent <MessageUI>();
         if (MUI != null)
         {
             if (MUI.MessageText != null)
             {
                 MUI.MessageText.ForceMeshUpdate();
                 float TextHeight = MUI.MessageText.preferredHeight;
                 //int linecount = MUI.MessageText.textInfo.lineCount;
                 //Debug.Log("Message height: " + TextHeight + " line count: " + linecount);
                 RectTransform rt = MUI.gameObject.transform as RectTransform;
                 rt.sizeDelta = new Vector2(rt.rect.width, TextHeight + 10);
             }
         }
     }
     CleanCanvases(MessageChannel);
 }
示例#30
0
        private void button3_Click(object sender, EventArgs e)
        {
            List <dynamic> files      = new List <dynamic>();
            List <Thread>  downloadTh = new List <Thread>();

            Thread th = new Thread(async() =>
            {
                foreach (UserM us in Bot.ActiveUsers)
                {
                    await us.DownloadImageToDirectory(Bot);
                    Image mg = Image.FromFile($"./UserPhotoes/{us.Id}.jpg");
                    files.Add(new { id = us.Id, Image = mg });
                }

                foreach (Telegram.Bot.Types.Message ms in Bot.MessagesLast)
                {
                    var afs = await Bot.getFileFrom(ms.Photo.ToList().First().FileId);
                    InvokeUI(() =>
                    {
                        if (ms.Type == Telegram.Bot.Types.Enums.MessageType.Text)
                        {
                            MessageUI mu = new MessageUI(files.Find(fs => ms.From.Id == fs.id).Image, ms.Text)
                            {
                                Width = flowLayoutPanel1.Width - 25
                            };
                            flowLayoutPanel1.Controls.Add(mu);
                        }

                        else if (ms.Type == Telegram.Bot.Types.Enums.MessageType.Photo)
                        {
                            MessageUIPhoto mu = new MessageUIPhoto(Image.FromStream(afs));
                            mu.Width          = flowLayoutPanel1.Width - 25;
                            flowLayoutPanel1.Controls.Add(mu);
                        }
                    });
                }
            });

            th.Start();
        }