public override void Init(Texture2D appIcon, string postFix, float scaleFactor) { this.appIcon = appIcon; this.postFix = postFix; this.scaleFactor = scaleFactor; frameGroupConference = ((GameObject)Instantiate(prfbGUIFrameGroupConference)).GetComponent<FresviiGUIFrame>(); frameGroupConference.Init(appIcon, postFix, scaleFactor, FASGui.GuiDepthBase); frameGroupConference.transform.parent = this.transform; frameGroupConference.Position = Vector2.zero; CurrentFrame = frameGroupConference; }
public void GoToGroupChat(bool animation) { if (frameChat != null) Destroy(frameChat.gameObject); frameChat = ((GameObject)Instantiate(prfbFrameChat)).GetComponent<FresviiGUIFrame>(); frameChat.gameObject.GetComponent<FresviiGUIChat>().SetGroup(this.Group); frameChat.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, frameGroupMessage.GuiDepth - 1); frameChat.transform.parent = this.transform; frameChat.SetDraw(true); frameChat.PostFrame = frameGroupMessage; frameGroupMessage.ControlLock = true; if (frameGroupMessage.tabBar != null) { frameGroupMessage.tabBar.enabled = false; } if (animation) { frameGroupMessage.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), delegate() { frameGroupMessage.SetDraw(false); frameGroupMessage.ControlLock = false; }); frameChat.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, delegate() { }); } else { frameGroupMessage.Tween(new Vector2(-Screen.width, 0.0f), new Vector2(-Screen.width, 0.0f), delegate() { frameGroupMessage.SetDraw(false); frameGroupMessage.ControlLock = false; }); frameChat.Tween(Vector2.zero, Vector2.zero, delegate() { }); } frameChat.gameObject.GetComponent<FresviiGUIChat>().OnAddGroupMessage += OnAddGroupMessage; }
private void GoToGroupMessage(bool animation) { frameGroupList = ((GameObject)Instantiate(prfbGroupList)).GetComponent<FresviiGUIFrame>(); frameGroupList.transform.parent = this.transform; frameGroupList.Init(null, postFix, this.scaleFactor, this.GuiDepth - 1); frameGroupList.SetDraw(true); frameGroupList.PostFrame = this; if (animation) { this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), moveDelayTime, delegate() { this.SetDraw(false); }); frameGroupList.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, moveDelayTime, delegate() { }); } else { this.Position = new Vector2(-Screen.width, 0.0f); this.SetDraw(false); frameGroupList.Position = Vector2.zero; } }
void OnGUI() { GUI.DrawTextureWithTexCoords(backgroundRect, FresviiGUIColorPalette.Palette, textureCoordsBackground); if (isReady) { GUI.BeginGroup(baseRect); GUI.BeginGroup(scrollViewRect); // User Image if (Event.current.type == EventType.Repaint) { userMask.color = Color.white; Graphics.DrawTexture(userImagePosition, (textureMyProfile == null) ? textureMyProfileDefault : textureMyProfile, userMask); } Event e = Event.current; GUI.DrawTexture(userImagePosition, textureMyProfileCircle); // User Name GUI.Label(userNamePosition, userNameContent, guiStyleLabelUserName); // Holding - menu apper if (userNamePosition.Contains(e.mousePosition) && FASGesture.IsHolding && !FASGesture.IsDragging && !ControlLock) { List<string> buttons = new List<string>(); buttons.Add(FresviiGUIText.Get("Copy")); Vector2 postion = new Vector2(baseRect.x + scrollViewRect.x + userNamePosition.x + userNamePosition.width * 0.5f, baseRect.y + scrollViewRect.y + userNamePosition.y); ControlLock = true; popOverBalloonMenu = Fresvii.AppSteroid.Gui.PopOverBalloonMenu.Show(scaleFactor, postFix, this.GuiDepth - 30, postion, buttons.ToArray(), (selectedButton) => { ControlLock = false; if (selectedButton == FresviiGUIText.Get("Copy")) { Fresvii.AppSteroid.Util.Clipboard.SetText(currentUser.Name); } }); popOverBalloonMenu.Name = "UserName"; } // User Code GUI.Label(userCodePosition, userCodeContent, guiStyleLabelUserCode); // Holding - menu apper if (userCodePosition.Contains(e.mousePosition) && FASGesture.IsHolding && !FASGesture.IsDragging && !ControlLock) { List<string> buttons = new List<string>(); buttons.Add(FresviiGUIText.Get("Copy")); Vector2 postion = new Vector2(baseRect.x + scrollViewRect.x + userCodePosition.x + userCodePosition.width * 0.5f, baseRect.y + scrollViewRect.y + userCodePosition.y); ControlLock = true; popOverBalloonMenu = Fresvii.AppSteroid.Gui.PopOverBalloonMenu.Show(scaleFactor, postFix, this.GuiDepth - 30, postion, buttons.ToArray(), (selectedButton) => { ControlLock = false; if (selectedButton == FresviiGUIText.Get("Copy")) { Fresvii.AppSteroid.Util.Clipboard.SetText(currentUser.UserCode); } }); popOverBalloonMenu.Name = "UserCode"; } // User Description GUI.Label(userDescriptionPosition, currentUser.Description, guiStyleLabelUserProfile); // User FriendTitleBar GUI.DrawTextureWithTexCoords(friendMenuTitleBarPosition, palette, buttonFriendList.IsActive ? texCoordsFriendTitleBgH : texCoordsFriendTitleBg); GUI.Label(friendMenuTitleBarPosition, friendCountLabelContent, guiStyleFriendMenuTitle); GUI.DrawTexture(friendMenuRightIconPosition, textureRight); if (buttonFriendList.IsTap(e, friendMenuTitleBarPosition)) { frameFriendList = ((GameObject)Instantiate(prfbFriendList)).GetComponent<FresviiGUIFrame>(); frameFriendList.transform.parent = this.transform; frameFriendList.gameObject.GetComponent<FresviiGUIFriendList>().SetUser(currentUser); frameFriendList.Init(null, postFix, this.scaleFactor, this.GuiDepth - 1); frameFriendList.SetDraw(true); frameFriendList.PostFrame = this; this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), moveDelayTime, delegate() { this.SetDraw(false); }); frameFriendList.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, moveDelayTime, delegate() { }); } // RequestTitleBar GUI.DrawTextureWithTexCoords(requestTitleBarPosition, palette, buttonFriendshipRequestList.IsActive ? texCoordsFriendTitleBgH : texCoordsFriendTitleBg); GUI.Label(requestTitleBarPosition, requestLabelContent, guiStyleFriendMenuTitle); GUI.DrawTexture(requestRightIconPosition, textureRight); if (buttonFriendshipRequestList.IsTap(e, requestTitleBarPosition)) { GoToFriendRequests(); } #if UNITY_IOS // VideoTitleBar if (FASConfig.Instance.videoEnable) { GUI.DrawTextureWithTexCoords(videoTitleBarPosition, palette, buttonVideoList.IsActive ? texCoordsFriendTitleBgH : texCoordsFriendTitleBg); GUI.Label(videoTitleBarPosition, videoListLabelContent, guiStyleFriendMenuTitle); GUI.DrawTexture(videoRightIconPosition, textureRight); if (buttonVideoList.IsTap(e, videoTitleBarPosition)) { GoToVideoList(true); } } #endif // DirectMessageTitleBar GUI.DrawTextureWithTexCoords(directMessageTitleBarPosition, palette, buttonDirectMessageList.IsActive ? texCoordsFriendTitleBgH : texCoordsFriendTitleBg); GUI.Label(directMessageTitleBarPosition, directMessageListLabelContent, guiStyleFriendMenuTitle); GUI.DrawTexture(directMessageRightIconPosition, textureRight); if (buttonDirectMessageList.IsTap(e, directMessageTitleBarPosition)) { GoToDirectMessageList(true); } GUI.EndGroup(); // scroll view rect GUI.EndGroup(); // base rect // Notification if (RequestedFriendsListMeta != null) { if (RequestedFriendsListMeta.TotalCount > 0) { GUI.DrawTextureWithTexCoords(friendNotificationPosition, palette, texCoordsNotificationBg); string friendRequestMessage = FresviiGUIText.Get("FriendRequestCount").Replace("#", RequestedFriendsListMeta.TotalCount.ToString()); GUI.Label(friendNotificationPosition, friendRequestMessage, guiStyleFriendNotification); if (buttonFriendNotification.IsTap(Event.current, friendNotificationPosition)) { GoToFriendRequests(); } } } } }
public override void Init(Texture2D appIcon, string postFix, float scaleFactor, int guiDepth) { this.GuiDepth = guiDepth; this.scaleFactor = scaleFactor; this.postFix = postFix; textureCoordsBackground = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.MainBackground); userProfileTopMenu = GetComponent<FresviiGUIMyProfileTopMenu>(); tabBar = GetComponent<FresviiGUITabBar>(); if (Application.platform == RuntimePlatform.IPhonePlayer) { guiStyleLabelUserName.font = null; guiStyleLabelUserName.fontStyle = FontStyle.Bold; guiStyleLabelUserProfile.font = null; guiStyleButtonFriend.font = null; guiStyleButtonMessage.font = null; guiStyleFriendNotification.font = null; guiStyleFriendMenuTitle.font = null; guiStyleFriendMenuTitle.fontStyle = FontStyle.Bold; guiStyleLabelUserCode.font = null; } palette = FresviiGUIColorPalette.Palette; userProfileTopMenu.Init(appIcon, postFix, scaleFactor,this, GuiDepth - 1); tabBar.Init(postFix, scaleFactor, this.GuiDepth - 1); sideMargin *= scaleFactor; vMargin *= scaleFactor; margin *= scaleFactor; miniMargin *= scaleFactor; profileImageBgMargin *= scaleFactor; myProfileImageSize *= scaleFactor; topMargin *= scaleFactor; friendNotificationHeight *= scaleFactor; friendMenuTitleBarHeight *= scaleFactor; hMargin *= scaleFactor; loadingSpinnerSize *= scaleFactor; profileImageSize *= scaleFactor; guiStyleLabelUserName.fontSize = (int)(guiStyleLabelUserName.fontSize * scaleFactor); guiStyleLabelUserName.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.ProfileUserName); guiStyleLabelUserCode.fontSize = (int)(guiStyleLabelUserCode.fontSize * scaleFactor); guiStyleLabelUserCode.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.ProfileUserName); guiStyleLabelUserProfile.fontSize = (int)(guiStyleLabelUserProfile.fontSize * scaleFactor); guiStyleLabelUserProfile.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.ProfileDescription); guiStyleFriendNotification.fontSize = (int)(guiStyleFriendNotification.fontSize * scaleFactor); guiStyleFriendNotification.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.ProfileNotificationText); guiStyleFriendMenuTitle.fontSize = (int)(guiStyleFriendMenuTitle.fontSize * scaleFactor); guiStyleFriendMenuTitle.normal.textColor = FresviiGUIColorPalette.GetColor(FresviiGUIColorPalette.ProfileFriendBarText); guiStyleFriendMenuTitle.padding = FresviiGUIUtility.RectOffsetScale(guiStyleFriendMenuTitle.padding, scaleFactor); textureMyProfileDefault = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.UserTextureName + postFix, false); texCoordsNotificationBg = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.ProfileNotificationBackground); texCoordsFriendTitleBg = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.ProfileFriendBarBackground); texCoordsFriendTitleBgH = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.ProfileFriendBarBackgroundH); texCoordsFriendTitleLine = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.ProfileFriendBarLine); textureRight = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.RightIconTextureName + postFix, false); scrollPosition = Vector2.zero; frameMyProfileEdit = ((GameObject)Instantiate(prfbGUIFrameMyProfileEdit)).GetComponent<FresviiGUIFrame>(); guiEdit = frameMyProfileEdit.gameObject.GetComponent<FresviiGUIMyProfileEdit>(); frameMyProfileEdit.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, GuiDepth - 20); frameMyProfileEdit.GetComponent<FresviiGUIMyProfileEdit>().SetGUIMyProfile(this); frameMyProfileEdit.transform.parent = this.transform; frameMyProfileEdit.SetDraw(false); textureMyProfileCircle = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.UserCircleTextureName + postFix, false); loadingSpinnerPosition = new Rect(Screen.width * 0.5f - loadingSpinnerSize.x * 0.5f, Screen.height * 0.5f - loadingSpinnerSize.y * 0.5f, loadingSpinnerSize.x, loadingSpinnerSize.y); loadingSpinner = Fresvii.AppSteroid.Gui.LoadingSpinner.Show(loadingSpinnerPosition, FASGui.GuiDepthBase); GetAccout(); SetScrollSlider(scaleFactor * 2.0f); requestLabelContent = new GUIContent(FresviiGUIText.Get("FriendRequests")); friendCountLabelContent = new GUIContent(FresviiGUIText.Get("Friends")); videoListLabelContent = new GUIContent(FresviiGUIText.Get("Videos")); directMessageListLabelContent = new GUIContent(FresviiGUIText.Get("DirectMessages")); }
public void GoToFriendRequests() { frameFriendRequests = ((GameObject)Instantiate(prfbGUIFrameFriendRequests)).GetComponent<FresviiGUIFriendRequests>(); frameFriendRequests.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, GuiDepth - 10); frameFriendRequests.GetComponent<FresviiGUIFriendRequests>().SetGUIMyProfile(this); frameFriendRequests.transform.parent = this.transform; frameFriendRequests.SetDraw(true); tabBar.enabled = false; this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), moveDelayTime, delegate() { this.SetDraw(false); }); frameFriendRequests.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, moveDelayTime, delegate() { }); }
private void GoToVideoList(bool animation) { frameVideoList = ((GameObject)Instantiate(prfbGUIFrameVideoList)).GetComponent<FresviiGUIFrame>(); FresviiGUIVideoList fresviiGUIVideoList = frameVideoList.gameObject.GetComponent<FresviiGUIVideoList>(); fresviiGUIVideoList.IsModal = false; fresviiGUIVideoList.mode = FresviiGUIVideoList.Mode.Share; frameVideoList.transform.parent = this.transform; frameVideoList.Init(null, postFix, this.scaleFactor, this.GuiDepth - 1); frameVideoList.SetDraw(true); frameVideoList.PostFrame = this; if (animation) { this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), moveDelayTime, delegate() { this.SetDraw(false); }); frameVideoList.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, moveDelayTime, delegate() { }); } else { frameVideoList.Position = Vector2.zero; this.SetDraw(false); } }
public void OnProfileTapped() { if (Group.Pair) { frameProfile = ((GameObject)Instantiate(prfbGUIFrameUserProfile)).GetComponent<FresviiGUIFrame>(); if (Other != null) { frameProfile.gameObject.GetComponent<FresviiGUIUserProfile>().SetUser(Other); } else { foreach (Fresvii.AppSteroid.Models.Member member in Group.Members) { if (member.Id != FAS.CurrentUser.Id) { Other = member.ToUser(); } } frameProfile.gameObject.GetComponent<FresviiGUIUserProfile>().SetUser(Other); } Debug.Log(Other.Id + ", " + Other.ProfileImageUrl); frameProfile.Init(null, postFix, scaleFactor, this.GuiDepth - 10); frameProfile.transform.parent = this.transform; frameProfile.SetDraw(true); frameProfile.PostFrame = this; this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), delegate() { this.SetDraw(false); }); frameProfile.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, delegate() { }); } }
public override void Init(Texture2D appIcon, string postFix, float scaleFactor, int guiDepth) { this.GuiDepth = guiDepth; textureCoordsBackground = FresviiGUIColorPalette.GetTextureCoods(FresviiGUIColorPalette.MainBackground); loadingSpinnerPlace = LoadingSpinnerPlace.Center; loadingSpinnerPosition = new Rect(Screen.width * 0.5f - loadingSpinnerSize.x * 0.5f, Screen.height * 0.5f - loadingSpinnerSize.y * 0.5f, loadingSpinnerSize.x, loadingSpinnerSize.y); loadingSpinner = Fresvii.AppSteroid.Gui.LoadingSpinner.Show(loadingSpinnerPosition, FASGui.GuiDepthBase); forumTopMenu = GetComponent<FresviiGUIForumTopMenu>(); tabBar = GetComponent<FresviiGUITabBar>(); forumTopMenu.Init(appIcon, postFix, scaleFactor, FresviiGUIText.Get("Forum")); tabBar.Init(postFix, scaleFactor, this.GuiDepth - 1); this.scaleFactor = scaleFactor; this.verticalMargin = verticalMargin * scaleFactor; this.reloadHeight *= scaleFactor; this.sideMargin *= scaleFactor; this.loadingSpinnerSize *= scaleFactor; this.postFix = postFix; TexForumCommentS = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumCommentSTextureName + postFix, false); TexForumCommentSH = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumCommentSHTextureName + postFix, false); TexForumLikeS = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumLikeSTextureName + postFix, false); TexForumLikeSH = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumLikeSHTextureName + postFix, false); TexForumCommentL = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumCommentLTextureName + postFix, false); TexForumCommentLH = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumCommentLHTextureName + postFix, false); TexForumLikeL = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumLikeLTextureName + postFix, false); TexForumLikeLH = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumLikeLHTextureName + postFix, false); TexForumLikeM = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumLikeMTextureName + postFix, false); TexForumLikeMH = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumLikeMHTextureName + postFix, false); TexForumMenu = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumMenuTextureName + postFix, false); TexForumMenuH = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.ForumMenuHTextureName + postFix, false); TexVideoPlaybackIcon = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.VideoPlaybackIconTextureName, false); TexVideoIcon = FresviiGUIManager.Instance.resourceManager.LoadTextureFromResource(FresviiGUIConstants.ResouceTextureFolderName + "/" + FresviiGUIConstants.VideoIconTextureName, false); FASForum.GetForumThreadsFromCache(OnGetForumThreads); GetForumThreads(); Initialized = true; frameCreateThread = ((GameObject)Instantiate(prfbGUIFrameCreateThread)).GetComponent<FresviiGUIFrame>(); frameCreateThread.transform.parent = this.transform; frameCreateThread.Init(appIcon, postFix, scaleFactor, this.GuiDepth - 10); frameCreateThread.PostFrame = this; frameCreateThread.SetDraw(false); tabBar.GuiDepth = this.GuiDepth - 1; SetScrollSlider(scaleFactor * 2.0f); }
public void OnCreateButtonTapped() { ControlLock = true; frameGroupMessageCreate = ((GameObject)Instantiate(prfbGUIFrameGroupMessageCreate)).GetComponent<FresviiGUIGroupMessageCreate>(); frameGroupMessageCreate.transform.parent = this.transform; frameGroupMessageCreate.PostFrame = this; frameGroupMessageCreate.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, this.GuiDepth - 10); frameGroupMessageCreate.SetDraw(true); frameGroupMessageCreate.Tween(new Vector2(0.0f, Screen.height), Vector2.zero, delegate() { this.SetDraw(false); ControlLock = false; }); }
public void Draw(Rect position, bool drawSeperateLine) { if (user != null) { if (!userIconLoaded && !userIconLoading) { StartCoroutine(UserIconLoad()); } else if (userIconLoaded && user.ProfileImageUrl != userProfileUrl) { StartCoroutine(UserIconLoad()); } } CalcLayout(position.width); Event e = Event.current; if (position.Contains(e.mousePosition) && FASGesture.IsHolding && !FASGesture.IsDragging && !frameEditGroupMembers.ControlLock) { List<string> buttons = new List<string>(); buttons.Add(FresviiGUIText.Get("Delete")); frameEditGroupMembers.ControlLock = true; actionSheet = Fresvii.AppSteroid.Gui.ActionSheet.Show(this.scaleFactor, this.postFix, frameEditGroupMembers.GuiDepth - 10, buttons.ToArray(), (selectedButton) => { frameEditGroupMembers.ControlLock = false; if (selectedButton == FresviiGUIText.Get("Delete")) { if (ValidateDelete()) { if (!(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)) { OnCardGone(); } else { Fresvii.AppSteroid.Util.DialogManager.Instance.SetLabel(FresviiGUIText.Get("Delete"), FresviiGUIText.Get("Cancel"), FresviiGUIText.Get("Close")); Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSelectDialog(FresviiGUIText.Get("ConfirmRemoveMember"), delegate(bool del) { if (del) { OnCardGone(); } }); } } } }); } isSlide = (FASGesture.IsTouching && position.Contains(e.mousePosition) && FASGesture.DragDirec == FASGesture.DragDirection.Horizontal); if (FASGesture.IsTouchBegin && cardXOffset > 0 && !position.Contains(e.mousePosition)) { isClose = true; isSlide = false; } Rect slidedPosition = new Rect(position.x - cardXOffset, position.y, position.width + cardXOffset, position.height); GUI.DrawTextureWithTexCoords(position, palette, texCoordsBackground); GUI.BeginGroup(slidedPosition); // Delete button buttonDeletePostion = new Rect(slidedPosition.width - deleteButtonWidth, 0, deleteButtonWidth, cardHeight); GUI.DrawTextureWithTexCoords(buttonDeletePostion, palette, textureCoordsDelete); if(!isDelete && cardXOffset > 0) GUI.Label(buttonDeletePostion, FresviiGUIText.Get("Delete"), guiStyleDelete); if (cardXOffset == deleteButtonWidth) { if (e.type == EventType.MouseUp && buttonDeletePostion.Contains(e.mousePosition) && !FASGesture.IsDragging && !isDelete && !frameEditGroupMembers.ControlLock) { e.Use(); if (ValidateDelete()) { DeleteAnimation(); } else { isClose = true; } } } if (e.type == EventType.MouseUp && cardPosition.Contains(e.mousePosition) && !FASGesture.IsDragging && !isDelete && !frameEditGroupMembers.ControlLock) { e.Use(); if (cardXOffset > 0) { isClose = true; } else if(!frameEditGroupMembers.CardIsOpen) { if (this.user != null) { if (nextFrameProfile == null) { nextFrameProfile = ((GameObject)Instantiate(prfbGUIFrameUserProfile)).GetComponent<FresviiGUIFrame>(); nextFrameProfile.gameObject.GetComponent<FresviiGUIUserProfile>().SetUser(user); nextFrameProfile.Init(null, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, FASGui.GuiDepthBase); nextFrameProfile.transform.parent = this.transform; } nextFrameProfile.SetDraw(true); nextFrameProfile.PostFrame = frameEditGroupMembers; frameEditGroupMembers.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), delegate() { frameEditGroupMembers.SetDraw(false); }); nextFrameProfile.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, delegate() { }); } } } GUI.DrawTextureWithTexCoords(cardPosition, palette, texCoordsBackground); GUI.DrawTexture(buttonRightPosition, buttonRightIcon); if(drawSeperateLine) GUI.DrawTextureWithTexCoords(seperateLinePosition, palette, textureCoordsSeparateLine); // UserIcon ----------------------- if (Event.current.type == EventType.Repaint) { userMask.color = new Color(1f, 1f, 1f, 1.0f); Graphics.DrawTexture(userIconPosition, ((userIcon == null) ? userIconDefault : userIcon), userMask); } // User name ----------------------- GUI.Label(userNamePosition, contentUserName, guiStyleUserName); GUI.EndGroup(); }
void OnGUI() { GUI.DrawTextureWithTexCoords(backgroundRect, FresviiGUIColorPalette.Palette, textureCoordsBackground); if(user == null) return; if (!hasError) { GUI.depth = GuiDepth; GUI.BeginGroup(baseRect); GUI.BeginGroup(scrollViewRect); // User Image GUI.DrawTexture(userImagePosition, (textureUserProfile == null) ? textureUserProfileDefault : textureUserProfile, ScaleMode.ScaleToFit); Color tmp = GUI.color; GUI.color = bgColor; GUI.DrawTexture(userImagePosition, textureUserProfileMask, ScaleMode.ScaleToFit); GUI.color = tmp; GUI.DrawTexture(userImagePosition, textureUserProfileCircle, ScaleMode.ScaleToFit); // User name GUI.Label(userNamePosition, userNameContent, guiStyleLabelUserName); if (!string.IsNullOrEmpty(user.Description)) { GUI.Label(userDescriptionPosition, userDescriptionContent, guiStyleLabelUserProfile); } if (user.Official) { GUI.EndGroup(); GUI.EndGroup(); return; } Event e = Event.current; // Holding - menu apper if (userNamePosition.Contains(e.mousePosition) && FASGesture.IsHolding && !FASGesture.IsDragging && !ControlLock) { List<string> buttons = new List<string>(); buttons.Add(FresviiGUIText.Get("Copy")); Vector2 postion = new Vector2(baseRect.x + scrollViewRect.x + userNamePosition.x + userNamePosition.width * 0.5f, baseRect.y + scrollViewRect.y + userNamePosition.y); ControlLock = true; popOverBalloonMenu = Fresvii.AppSteroid.Gui.PopOverBalloonMenu.Show(scaleFactor, postFix, this.GuiDepth - 30, postion, buttons.ToArray(), (selectedButton) => { ControlLock = false; if (selectedButton == FresviiGUIText.Get("Copy")) { Fresvii.AppSteroid.Util.Clipboard.SetText(user.Name); } }); popOverBalloonMenu.Name = "UserName"; } // User Code GUI.Label(userCodePosition, userCodeContent, guiStyleLabelUserCode); // Holding - menu apper if (userCodePosition.Contains(e.mousePosition) && FASGesture.IsHolding && !FASGesture.IsDragging && !ControlLock) { List<string> buttons = new List<string>(); buttons.Add(FresviiGUIText.Get("Copy")); Vector2 postion = new Vector2(baseRect.x + scrollViewRect.x + userCodePosition.x + userCodePosition.width * 0.5f, baseRect.y + scrollViewRect.y + userCodePosition.y); ControlLock = true; popOverBalloonMenu = Fresvii.AppSteroid.Gui.PopOverBalloonMenu.Show(scaleFactor, postFix, this.GuiDepth - 30, postion, buttons.ToArray(), (selectedButton) => { ControlLock = false; if (selectedButton == FresviiGUIText.Get("Copy")) { Fresvii.AppSteroid.Util.Clipboard.SetText(user.UserCode); } }); popOverBalloonMenu.Name = "UserCode"; } if (userInfoEnable) { #region Friend button if (user.FriendStatus == Fresvii.AppSteroid.Models.User.FriendStatuses.Requesting) { guiStyleButtonFriend.normal.textColor = btnNegativeColor; buttonFriend.IsTap(e, friendButtonPosition, friendButtonPosition, FresviiGUIButton.ButtonType.FrameAndLabel, textureButton03, textureButton03, textureButton03, FresviiGUIText.Get("RequestSent"), guiStyleButtonFriend); } /*else if (user.FriendStatus == User.FriendStatuses.Requested) { guiStyleButtonFriend.normal.textColor = btnNegativeColor; buttonFriend.IsTap(e, friendButtonPosition, friendButtonPosition, FresviiGUIButton.ButtonType.FrameAndLabel, textureButton03, textureButton03, textureButton03, FresviiGUIText.Get("Requested"), guiStyleButtonFriend); }*/ else if (user.FriendStatus == Fresvii.AppSteroid.Models.User.FriendStatuses.Friend) { guiStyleButtonFriend.normal.textColor = btnPositiveColor; if (buttonFriend.IsTap(e, friendButtonPosition, friendButtonPosition, FresviiGUIButton.ButtonType.FrameAndLabel, textureButton01, textureButton01H, textureButton01H, FresviiGUIText.Get("Unfriend"), guiStyleButtonFriend)) { Fresvii.AppSteroid.Util.DialogManager.Instance.SetLabel(FresviiGUIText.Get("Unfriend"), FresviiGUIText.Get("Cancel"), FresviiGUIText.Get("Close")); Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSelectDialog(FresviiGUIText.Get("ConfirmUnfriend"), delegate(bool del) { #if UNITY_EDITOR if (true) #else if(del) #endif { if (Application.internetReachability == NetworkReachability.NotReachable) { Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("Offline"), delegate(bool _del) { }); } else { FASFriendship.UnFriend(this.user.Id, delegate(Fresvii.AppSteroid.Models.Error error) { if (error == null) { user.SetFriendStatus(Fresvii.AppSteroid.Models.FriendshipRequest.Statuses.none.ToString()); DeletePairGroupMessages(user.Id, deleteGroupRetryCount, deleteGroupRetryInterval); } else { if (FASConfig.Instance.logLevel <= FAS.LogLevels.Error) { Debug.LogError(error.ToString()); } Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("UnknownError"), delegate(bool _del) { }); } }); } } }); } } else { guiStyleButtonFriend.normal.textColor = btnPositiveColor; if (buttonFriend.IsTap(e, friendButtonPosition, friendButtonPosition, FresviiGUIButton.ButtonType.FrameAndLabel, textureButton01, textureButton01H, textureButton01H, FresviiGUIText.Get("AddFriend"), guiStyleButtonFriend)) { if (Application.internetReachability == NetworkReachability.NotReachable) { Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("Offline"), delegate(bool del) { }); } else { user.SetFriendStatus(Fresvii.AppSteroid.Models.FriendshipRequest.Statuses.requesting.ToString()); FASFriendship.SendFriendshipRequest(this.user.Id, delegate(Fresvii.AppSteroid.Models.FriendshipRequest friendshipRequest, Fresvii.AppSteroid.Models.Error error) { if (error == null) { user.SetFriendStatus(friendshipRequest.Status.ToString()); } else { if (FASConfig.Instance.logLevel <= FAS.LogLevels.Error) Debug.LogError(error.ToString()); Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("UnknownError"), delegate(bool del) { }); user.SetFriendStatus(Fresvii.AppSteroid.Models.FriendshipRequest.Statuses.none.ToString()); } }); } } } } #endregion #region Message button if (buttonMessage.IsTap(e, messageButtonPosition, messageButtonPosition, FresviiGUIButton.ButtonType.TextureOnly, textureIconMessage, textureIconMessage, textureIconMessage)) { if (Application.internetReachability == NetworkReachability.NotReachable) { Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("Offline"), delegate(bool del) { }); } else { FresviiGUIFrame framePairChat = ((GameObject)Instantiate(prfbGUIFramePairChat)).GetComponent<FresviiGUIFrame>(); framePairChat.transform.parent = this.transform; framePairChat.gameObject.GetComponent<FresviiGUIChat>().SetPairUser(this.user); framePairChat.Init(null, postFix, scaleFactor, this.GuiDepth - 1); framePairChat.SetDraw(true); framePairChat.PostFrame = this; this.tabBar.enabled = false; this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), moveDelayTime, delegate() { this.SetDraw(false); }); framePairChat.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, moveDelayTime, delegate() { }); } } GUI.Label(messageLabelPosition, messageLabelContent, guiStyleButtonLabel); #endregion #region Call button #if GROUP_CONFERENCE if (!user.Official) { bool isCalling = FASConference.IsCalling(); Texture2D textureCall = (isCalling) ? textureIconCallD : textureIconCall; if (buttonMessage.IsTap(e, callButtonPosition, callButtonPosition, FresviiGUIButton.ButtonType.TextureOnly, textureCall, textureCall, textureCall)) { #if !UNITY_EDITOR if (isCalling) { Fresvii.AppSteroid.Util.DialogManager.Instance.SetLabel(FresviiGUIText.Get("OK"), FresviiGUIText.Get("Cancel"), FresviiGUIText.Get("Close")); Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("VoiceChatAlredayExists"), delegate(bool del) { }); return; } #endif if (Application.internetReachability == NetworkReachability.NotReachable) { Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("Offline"), delegate(bool del) { }); } else { loadingSpinnerPosition = new Rect(Screen.width * 0.5f - loadingSpinnerSize.x * 0.5f, Screen.height * 0.5f - loadingSpinnerSize.y * 0.5f, loadingSpinnerSize.x, loadingSpinnerSize.y); loadingSpinner = Fresvii.AppSteroid.Gui.LoadingSpinner.Show(loadingSpinnerPosition, this.GuiDepth - 10); FASGroup.CreatePair(user.Id, delegate(Fresvii.AppSteroid.Models.Group group, Fresvii.AppSteroid.Models.Error error) { if (error != null) { loadingSpinner.Hide(); if (FASConfig.Instance.logLevel <= FAS.LogLevels.Error) { Debug.LogError("CreatePair : " + error.ToString()); } Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog("Error : CreatePair " + error.ToString(), delegate(bool del) { }); } else { loadingSpinner.Hide(); group.FetchMembers(delegate(Fresvii.AppSteroid.Models.Error error2) { if (error2 != null) { if (FASConfig.Instance.logLevel <= FAS.LogLevels.Error) { Debug.LogError("FetchMembers : " + error.ToString()); } Fresvii.AppSteroid.Util.DialogManager.Instance.SetLabel(FresviiGUIText.Get("OK"), FresviiGUIText.Get("Cancel"), FresviiGUIText.Get("Close")); if (error.Code == (int)Fresvii.AppSteroid.Models.Error.ErrorCode.NetworkNotReachable) { Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("Offline"), delegate(bool del) { }); } else { Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(error.Detail, delegate(bool del) { }); } } else { OnCallButtonTapped(group); } }); } }); } } GUI.Label(callLabelPosition, callLabelContent, guiStyleButtonLabel); } #endif #endregion // User FriendTitleBar if (friendCountLabelContent != null) { GUI.DrawTextureWithTexCoords(friendMenuTitleBarPosition, palette, buttonFriendList.IsActive ? texCoordsFriendTitleBgH : texCoordsFriendTitleBg); GUI.Label(friendMenuTitleBarPosition, friendCountLabelContent, guiStyleFriendMenuTitle); GUI.DrawTexture(friendMenuRightIconPosition, textureRight); } #if UNITY_IOS // VideoTitleBar if (FASConfig.Instance.videoEnable) { GUI.DrawTextureWithTexCoords(videoTitleBarPosition, palette, buttonVideoList.IsActive ? texCoordsFriendTitleBgH : texCoordsFriendTitleBg); GUI.Label(videoTitleBarPosition, videoListLabelContent, guiStyleFriendMenuTitle); GUI.DrawTexture(videoRightIconPosition, textureRight); if (buttonVideoList.IsTap(e, videoTitleBarPosition)) { GoToVideoList(true); } } #endif if(buttonFriendList.IsTap(e, friendMenuTitleBarPosition)) { frameFriendList = ((GameObject)Instantiate(prfbFriendList)).GetComponent<FresviiGUIFrame>(); frameFriendList.transform.parent = this.transform; frameFriendList.gameObject.GetComponent<FresviiGUIFriendList>().SetUser(this.user); frameFriendList.Init(null, postFix, scaleFactor, this.GuiDepth - 1); frameFriendList.SetDraw(true); frameFriendList.PostFrame = this; this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), delegate() { this.SetDraw(false); }); frameFriendList.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, delegate() { }); } GUI.EndGroup(); GUI.EndGroup(); } }
void OnCallButtonTapped(Fresvii.AppSteroid.Models.Group group) { #if !UNITY_EDITOR if(group.MembersCount > 4) { Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("GroupConferenceMemberLimitation"), delegate(bool del) { }); return; } #endif ControlLock = true; frameGroupConference = ((GameObject)Instantiate(prfbGUIFrameGroupCall)).GetComponent<FresviiGUIGroupConference>(); frameGroupConference.gameObject.GetComponent<FresviiGUIGroupConference>().SetGroup(group); frameGroupConference.transform.parent = this.transform; frameGroupConference.PostFrame = this; frameGroupConference.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, this.GuiDepth - 10); frameGroupConference.SetDraw(true); frameGroupConference.Tween(new Vector2(0.0f, Screen.height), Vector2.zero, delegate() { this.SetDraw(false); ControlLock = false; }); }
public void OnCallButtonTapped() { if (Group == null) return; if (!(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)) return; if(Group.MembersCount > 4) { Fresvii.AppSteroid.Util.DialogManager.Instance.SetLabel(FresviiGUIText.Get("OK"), FresviiGUIText.Get("Cancel"), FresviiGUIText.Get("Close")); Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSubmitDialog(FresviiGUIText.Get("GroupConferenceMemberLimitation"), delegate(bool del) { }); return; } //DialogManager.Instance.SetLabel(FresviiGUIText.Get("Yes"), FresviiGUIText.Get("No"), FresviiGUIText.Get("Close")); Fresvii.AppSteroid.Util.DialogManager.Instance.ShowSelectDialog(FresviiGUIText.Get("ConfirmToCall"), FresviiGUIText.Get("Yes"), FresviiGUIText.Get("No"), (del)=> //DialogManager.Instance.ShowSelectDialog(FresviiGUIText.Get("ConfirmToCall"), delegate(bool del) { if (del) { ControlLock = true; frameGroupConference = ((GameObject)Instantiate(prfbGUIFrameGroupCall)).GetComponent<FresviiGUIGroupConference>(); frameGroupConference.gameObject.GetComponent<FresviiGUIGroupConference>().SetGroup(this.Group); frameGroupConference.transform.parent = this.transform; frameGroupConference.PostFrame = this; frameGroupConference.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, this.GuiDepth - 10); frameGroupConference.SetDraw(true); frameGroupConference.Tween(new Vector2(0.0f, Screen.height), Vector2.zero, delegate() { this.SetDraw(false); ControlLock = false; frameGroupConference.ControlLock = false; }); } }); }
private IEnumerator WaitForSend(Fresvii.AppSteroid.Models.Group group) { while (imageSending || commentSending) yield return 1; loadingSpinner.Hide(); ControlLock = false; Back(); if (!IsCreateFromPairGroup) { PostFrame.gameObject.GetComponent<FresviiGUIGroupMessage>().GoToGroupChat(group); } else { if (frameChat != null) Destroy(frameChat); frameChat = ((GameObject)Instantiate(prfbFrameChat)).GetComponent<FresviiGUIFrame>(); frameChat.gameObject.GetComponent<FresviiGUIChat>().SetGroup(group); frameChat.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, this.PostFrame.GuiDepth - 1); frameChat.transform.parent = this.transform; frameChat.SetDraw(true); frameChat.PostFrame = this.PostFrame; this.ControlLock = true; this.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), delegate() { this.SetDraw(false); this.ControlLock = false; }); frameChat.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, delegate() { }); } }
public void GoToDirectMessage(bool animation) { if (frameDirectMessage != null) Destroy(frameDirectMessage.gameObject); frameDirectMessage = ((GameObject)Instantiate(prfbFrameDirectMessage)).GetComponent<FresviiGUIFrame>(); frameDirectMessage.gameObject.GetComponent<FresviiGUIDirectMessage>().DirectMessage = this.DirectMessage; frameDirectMessage.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, parentFrame.GuiDepth - 1); frameDirectMessage.transform.parent = this.transform; frameDirectMessage.SetDraw(true); frameDirectMessage.PostFrame = parentFrame; frameDirectMessage.ControlLock = true; /*if (parentFrame.tabBar != null) { frameGroupMessage.tabBar.enabled = false; }*/ parentFrame.Tween(Vector2.zero, new Vector2(-Screen.width, 0.0f), delegate() { parentFrame.SetDraw(false); parentFrame.ControlLock = false; }); frameDirectMessage.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, delegate() { }); if (DirectMessage.Unread) { DirectMessage.Unread = false; FresviiGUIManager.Instance.UnreadDirectMessageCount--; } }
public void OnEditMemberTapped() { if (Group == null) return; ControlLock = true; frameEditGroupMember = ((GameObject)Instantiate(prfbGUIFrameGroupEditMember)).GetComponent<FresviiGUIEditGroupMember>(); frameEditGroupMember.transform.parent = this.transform; frameEditGroupMember.PostFrame = this; frameEditGroupMember.GetComponent<FresviiGUIEditGroupMember>().Group = this.Group; frameEditGroupMember.Init(FresviiGUIManager.appIcon, FresviiGUIManager.postFix, FresviiGUIManager.scaleFactor, this.GuiDepth - 10); frameEditGroupMember.SetDraw(true); frameEditGroupMember.Tween(new Vector2(Screen.width, 0.0f), Vector2.zero, delegate() { this.SetDraw(false); ControlLock = false; }); }