예제 #1
0
    void OnTooltip(bool show)
    {
        Debug.Log("Tool Tip " + show);

        if (show && key != null)
        {
            string t = StringData.getString(key);

            if (name != null)
            {
                t = t.Replace("%s", name.text);
            }

            if (isDisableCheck != null && isDisableCheck.gameObject.activeSelf)
            {
                UITooltip.ShowText(null);
                return;
            }

            UITooltip.ShowText(t);
            return;
        }
        else
        {
            UITooltip.ShowText(null);
        }
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        tempMessageObj = null;
        instance       = this;

        if (label_message_num != null)
        {
            label_message_num.text = StringData.getString(StringData.label_message_num_key).Replace("%s", CMainData.message.Count.ToString());
        }

        foreach (Message temp in CMainData.message)
        {
            if (temp.Obj == null)
            {
                GameObject obj = Instantiate(messagePref, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
                obj.transform.parent     = messageGrid.transform;
                obj.transform.localScale = new Vector3(1f, 1f, 1f);
                ((MessageItem)obj.GetComponent("MessageItem")).SetMessageContext(temp.Type, temp.Sendder, temp.Fid);

                temp.Obj = obj;
            }
        }

        messageGrid.repositionNow = true;
    }
예제 #3
0
    public static void Callback(FBResult result)
    {
        if (SceneGameOver.g_instance != null)
        {
            SceneGameOver.g_instance.buttonClickable = true;
        }

        if (result.Error != null)
        {
            Debug.Log("Error Response:\n" + result.Error);
        }
        else
        {
            Debug.Log("Success Response:\n" + result.Text);

            if (!Util.DeserializeCallbackResult(result.Text).Contains("true"))
            {
                if (ServerConnection.g_instance != null && GameMessageBox.instance != null)
                {
                    ServerConnection.g_instance.ReceiveMessage(tempMessageObj, (int)RECEIVEMESSAGEACTIONTYPE.ACCEPT);

                    CMainData.message.Remove(tempMessageObj);
                    tempMessageObj.Obj.transform.parent = GameMessageBox.instance.gameObject.transform.parent;
                    Destroy(tempMessageObj.Obj);

                    if (GameMessageBox.instance.label_message_num != null)
                    {
                        GameMessageBox.instance.label_message_num.text = StringData.getString(StringData.label_message_num_key).Replace("%s", CMainData.message.Count.ToString());
                    }
                    GameMessageBox.instance.messageGrid.repositionNow = true;
                }
            }
        }
    }
예제 #4
0
    public void acceptMessage(string fid, int type)
    {
        SceneTitle.ButtonClickSound();

        foreach (Message temp in CMainData.message)
        {
            if (temp.Fid.Equals(fid) && temp.Type == type)
            {
                //Server로 데이터 전송

                /*if (Title_ServerConnection.g_instance != null)
                 * {
                 *  Title_ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.ACCEPT);
                 *
                 *  CMainData.message.Remove(temp);
                 *  temp.Obj.transform.parent = this.gameObject.transform.parent;
                 *  Destroy(temp.Obj);
                 * }*/

                if (type != 3)
                {
                    if (ServerConnection.g_instance != null)
                    {
                        ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.ACCEPT);

                        CMainData.message.Remove(temp);
                        temp.Obj.transform.parent = this.gameObject.transform.parent;
                        Destroy(temp.Obj);
                    }
                }
                else
                {
                    tempMessageObj = temp;
                    try
                    {
                        FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), temp.Fid, Callback);// + " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
                        //status = "Direct Request called";
                    }
                    catch (System.Exception e)
                    {
                        Debug.Log(e.Message);
                    }
                }

                break;
            }
        }
        if (label_message_num != null)
        {
            label_message_num.text = StringData.getString(StringData.label_message_num_key).Replace("%s", CMainData.message.Count.ToString());
        }
        messageGrid.repositionNow = true;
    }
예제 #5
0
    void Start()
    {
        if (SceneGameOver.ResultInstance != null)
        {
            //up - 내 기록으로 채운다.
            int myRanking = int.Parse(SceneGameOver.ResultInstance["ranking"].ToString());
            if (label_up_name != null)
            {
                label_up_name.text = CMainData.Username;
            }
            if (label_up_rank != null)
            {
                label_up_rank.text = myRanking.ToString();
            }
            if (label_up_score != null)
            {
                label_up_score.text = CMainData.UserScore.ToString();
            }
            texture_up_texture.fid = FB.UserId;

            //down 내가 추월한 user정보
            if (label_down_name != null)
            {
                label_down_name.text = SceneGameOver.ResultInstance["7_name"].ToString();
            }
            if (label_down_rank != null)
            {
                label_down_rank.text = (myRanking + 1).ToString();
            }
            if (label_down_score != null)
            {
                label_down_score.text = SceneGameOver.ResultInstance["7_score"].ToString();
            }
            if (label_message != null)
            {
                label_message.text = StringData.getString(StringData.RenewRanking_key).Replace("%s", SceneGameOver.ResultInstance["7_name"].ToString());
            }

            targetFid = SceneGameOver.ResultInstance["7_fid"].ToString();
            texture_down_texture.fid = targetFid;
            targetName = SceneGameOver.ResultInstance["7_name"].ToString();
        }
    }
예제 #6
0
    public void NextStep()
    {
        if (tutorialString != null)
        {
            tutorialString.text = StringData.getString(StringData.Tutorial_key[m_nStep]);
            //tutorialString.text = UIString.TUTORIAL_STRING[m_nStep];
        }

        for (int i = 0; i < m_listObject.Count; i++)
        {
            if (m_nStep == i)
            {
                m_listObject[i].SetActive(true);
            }
            else
            {
                m_listObject[i].SetActive(false);
            }
        }

        m_nStep++;
    }
예제 #7
0
    public void closeMessage(string fid, int type)
    {
        SceneTitle.ButtonClickSound();

        foreach (Message temp in CMainData.message)
        {
            if (temp.Fid.Equals(fid) && temp.Type == type)
            {
                //Server로 데이터 전송

                /*if (Title_ServerConnection.g_instance != null)
                 * {
                 *  Title_ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.CANCLE);
                 *
                 *  CMainData.message.Remove(temp);
                 *  temp.Obj.transform.parent = this.gameObject.transform.parent;
                 *  Destroy(temp.Obj);
                 * }*/
                if (ServerConnection.g_instance != null)
                {
                    ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.CANCLE);

                    CMainData.message.Remove(temp);
                    temp.Obj.transform.parent = this.gameObject.transform.parent;
                    Destroy(temp.Obj);
                }
                break;
            }
        }

        if (label_message_num != null)
        {
            label_message_num.text = StringData.getString(StringData.label_message_num_key).Replace("%s", CMainData.message.Count.ToString());
        }
        messageGrid.repositionNow = true;
    }
예제 #8
0
    //private string sendderName = null;

    public void SetMessageContext(int type, string sendderName, string fid)
    {
        setenable = true;
        this.type = type;
        //this.sendderName = sendderName;
        this.fid    = fid;
        picture.fid = fid;
        if (!FaceBook.getfriendImages().ContainsKey(fid))
        {
            FacebookPictureDownloader.EnQueue(fid);
        }

        switch (type)
        {
        case 1:
            if (title != null)
            {
                //title.text = StringData.getType1_Title(sendderName);
                title.text = StringData.getString(StringData.Type1_Title_key).Replace("%s", sendderName);
            }
            if (subtitle != null)
            {
                //subtitle.text = StringData.getType1_Message(sendderName);
                subtitle.text = StringData.getString(StringData.Type1_Message_key).Replace("%s", sendderName);
            }
            if (label_acceptbutton != null)
            {
                //label_acceptbutton.text = StringData.Type1_AcceptButton;
                label_acceptbutton.text = StringData.getString(StringData.Type1_AcceptButton_key);
            }
            break;

        case 2:
            if (title != null)
            {
                //title.text = StringData.getType2_Title(sendderName);
                title.text = StringData.getString(StringData.Type2_Title_key).Replace("%s", sendderName);
            }
            if (subtitle != null)
            {
                //subtitle.text = StringData.getType2_Message(sendderName);
                subtitle.text = StringData.getString(StringData.Type2_Message_key).Replace("%s", sendderName);
            }
            if (label_acceptbutton != null)
            {
                //label_acceptbutton.text = StringData.Type2_AcceptButton;
                label_acceptbutton.text = StringData.getString(StringData.Type2_AcceptButton_key);
            }
            break;

        case 3:
            if (title != null)
            {
                //title.text = StringData.getType3_Title(sendderName);
                title.text = StringData.getString(StringData.Type3_Title_key).Replace("%s", sendderName);
            }
            if (subtitle != null)
            {
                //subtitle.text = StringData.getType3_Message(sendderName);
                subtitle.text = StringData.getString(StringData.Type3_Message_key).Replace("%s", sendderName);
            }
            if (label_acceptbutton != null)
            {
                //label_acceptbutton.text = StringData.Type3_AcceptButton;
                label_acceptbutton.text = StringData.getString(StringData.Type3_AcceptButton_key);
            }
            break;

        default:
            if (title != null)
            {
                title.text = StringData.getString(StringData.Type_Unknown_key);
                //title.text = "알수 없는 메시지";
            }
            if (subtitle != null)
            {
                subtitle.text = sendderName;
            }
            break;
        }
    }