예제 #1
0
        protected bool FindSearchOriginAndCamera(bool autoSetFirstObject)
        {
            if (GUIManager.Get.HasActiveInterface && GUIManager.Get.TopInterface.SupportsControllerSearch)
            {
                SearchCamera = GUIManager.Get.ActiveCamera;
                if (CurrentActiveInterface == null || CurrentActiveInterface != GUIManager.Get.TopInterface)
                {
                    //if this interface isn't the same as the top interface
                    //start over from the top right
                    FrontiersInterface lastInterface = CurrentActiveInterface;
                    CurrentActiveInterface = GUIManager.Get.TopInterface;
                    if (lastInterface != CurrentActiveInterface && autoSetFirstObject)
                    {
                        //get the first interface element
                        FrontiersInterface.Widget w = CurrentActiveInterface.FirstInterfaceObject;
                        if (!w.IsEmpty && w.BoxCollider != CurrentSearch.Widget.BoxCollider)
                        {
                            SelectWidget(w);
                            return(false);
                        }
                    }
                    CurrentSearch.Widget       = CurrentActiveInterface.FirstInterfaceObject;
                    CurrentSearch.ScreenBounds = new Bounds(ScreenSearchOrigin, Vector3.one * 0.1f);
                }
            }
            else if (Cutscene.IsActive && Cutscene.CurrentCutscene.HasActiveInterfaces)
            {
                SearchCamera = Cutscene.CurrentCutscene.ActiveCamera;
            }
            else if (VRManager.VRMode && GUIManager.ShowCursor)
            {
                SearchCamera = VRManager.Get.NGUICamera;
            }
            else
            {
                SearchCamera = null;
                return(false);
            }

            ScreenSearchOrigin   = Frontiers.InterfaceActionManager.MousePosition;          //Input.mousePosition;
            ScreenSearchOrigin.z = 0f;
            WorldSearchOrigin    = SearchCamera.ScreenToWorldPoint(ScreenSearchOrigin);

            if (UICamera.hoveredObject != null && (CurrentSearch.Widget.IsEmpty || CurrentSearch.Widget.BoxCollider.gameObject != UICamera.hoveredObject.gameObject))
            {
                WidgetSearch s = new WidgetSearch();
                s.Widget.BoxCollider  = UICamera.hoveredObject.GetComponent <Collider> ();
                s.Widget.SearchCamera = GUIManager.Get.ActiveCamera;
                SetCurrentSearch(s);
            }

            if (CurrentSearch.Widget.IsEmpty)
            {
                CurrentSearch.ScreenBounds = new Bounds(ScreenSearchOrigin, Vector3.one * 0.1f);
            }

            RefreshScreenSettings();

            return(true);
        }
예제 #2
0
        public override void GetActiveInterfaceObjects(List <FrontiersInterface.Widget> currentObjects, int flag)
        {
            if (QuickCreateMode)
            {
                return;
            }

            if (flag < 0)
            {
                flag = GUIEditorID;
            }

            FrontiersInterface.Widget w = new FrontiersInterface.Widget(flag);

            if (WaitingForNextPage)
            {
                FrontiersInterface.GetActiveInterfaceObjectsInTransform(NextPageGroup.transform, NGUICamera, currentObjects, flag);
            }
            else if (CurrentChooser != null)
            {
                FrontiersInterface.GetActiveInterfaceObjectsInTransform(CurrentChooser.transform, NGUICamera, currentObjects, flag);
                if (LastChoiceMade == "Age")
                {
                    w.SearchCamera = NGUICamera;
                    w.BoxCollider  = AgeSlider.foreground.GetComponent <BoxCollider>();
                    currentObjects.Add(w);
                }
            }

            w.Flag         = QuickCharacterCreationID;
            w.SearchCamera = NGUICamera;
            w.BoxCollider  = QuickCreateButton.GetComponent <BoxCollider>();
            currentObjects.Add(w);
        }
예제 #3
0
 public void DisplayDetail(FrontiersInterface user, string name, string detailText, string iconName, UIAtlas iconAtlas, Color iconColor, Color iconBackgroundColor)
 {
     ScrollBar.scrollValue = 0f;
     Show();
     NameLabel.text        = name;
     DetailTextLabel.color = Colors.Get.MenuButtonTextColorDefault;
     DetailTextLabel.text  = detailText;
     if (string.IsNullOrEmpty(iconName) || iconAtlas == null)
     {
         Icon.enabled           = false;
         IconBackground.enabled = false;
     }
     else
     {
         Icon.enabled           = true;
         IconBackground.enabled = true;
         Icon.atlas             = iconAtlas;
         Icon.spriteName        = iconName;
         Icon.color             = iconColor;
         IconBackground.color   = iconBackgroundColor;
     }
     ShowDoppleganger = false;
     RefreshDoppleganger();
     LastUser = user;
 }
예제 #4
0
        public void Hide()
        {
            LastUser               = null;
            Visible                = false;
            Panel.enabled          = false;
            ScrollingPanel.enabled = false;
            enabled                = false;
            DetailTextLabel.text   = string.Empty;
            Icon.enabled           = false;
            IconBackground.enabled = false;
            DopplegangerButton.SetActive(false);
            RefreshDoppleganger();

            gameObject.SetActive(false);
        }
예제 #5
0
 public override void GetActiveInterfaceObjects(List <Widget> currentObjects, int flag)
 {
     if (flag < 0)
     {
         flag = GUIEditorID;
     }
     //add the player choices but not the character's choice
     FrontiersInterface.GetActiveInterfaceObjectsInTransform(PlayerDialogChoicesParent.transform, NGUICamera, currentObjects, flag);
     //also add the status keepers
     FrontiersInterface.Widget w = new Widget(flag);
     w.SearchCamera = NGUICamera;
     for (int i = 0; i < StatusKeepers.Count; i++)
     {
         w.BoxCollider = StatusKeepers [i].GetComponent <BoxCollider> ();
         currentObjects.Add(w);
     }
     if (LeaveButton.gameObject.activeSelf)
     {
         w.BoxCollider = LeaveButton.GetComponent <BoxCollider> ();
         currentObjects.Add(w);
     }
 }
예제 #6
0
        public void GetActiveInterfaceObjects(List <FrontiersInterface.Widget> currentObjects, int flag)
        {
            if (flag < 0)
            {
                flag = TabParent.Owner.GUIEditorID;
            }

            if (HasSubTabs)
            {
                SubTabs.GetActiveInterfaceObjects(currentObjects, flag);
            }
            else
            {
                for (int i = 0; i < Panels.Count; i++)
                {
                    if (Panels[i].gameObject.layer != Globals.LayerNumGUIRaycastIgnore)
                    {
                        FrontiersInterface.GetActiveInterfaceObjectsInTransform(Panels[i].transform, NGUICamera, currentObjects, flag);
                    }
                }
            }
        }
예제 #7
0
 public virtual void GetActiveInterfaceObjects(List <FrontiersInterface.Widget> currentObjects, int flag)
 {
     //use the default method
     FrontiersInterface.GetActiveInterfaceObjectsInTransform(transform, NGUICamera, currentObjects, flag);
 }
예제 #8
0
        public override void PushSelectedObjectToViewer()
        {
            mSelectedObject.GetPlayerAttention = false;
            //Missions.Get.MissionStateByName (mSelectedObject.Name);
            List <string> detailText = new List <string>();

            detailText.Add(mSelectedObject.Description);

            Color missionColor = Colors.Get.MessageInfoColor;

            if (mSelectedObject.ObjectivesCompleted)
            {
                if (Flags.Check((uint)mSelectedObject.Status, (uint)MissionStatus.Failed, Flags.CheckType.MatchAny))
                {
                    missionColor = Colors.Get.MessageDangerColor;
                }
                else
                {
                    missionColor = Colors.Get.MessageSuccessColor;
                }
            }
            else
            {
                if (Flags.Check((uint)mSelectedObject.Status, (uint)MissionStatus.Failed, Flags.CheckType.MatchAny))
                {
                    missionColor = Colors.Get.MessageDangerColor;
                }
                else if (Flags.Check((uint)mSelectedObject.Status, (uint)MissionStatus.Ignored, Flags.CheckType.MatchAny))
                {
                    missionColor = Colors.Get.MessageWarningColor;
                }
            }

            detailText.Add("_");                                    //divider

            foreach (ObjectiveState objectiveToDisplay in mSelectedObject.Objectives)
            {
                if (!objectiveToDisplay.Hidden && objectiveToDisplay.Status != MissionStatus.Dormant)
                {
                    Color objectiveColor = Colors.Get.MessageInfoColor;
                    if (objectiveToDisplay.Completed)
                    {
                        //Debug.Log ("Objective " + objectiveToDisplay.Name + " is completed");
                        if (Flags.Check((uint)objectiveToDisplay.Status, (uint)MissionStatus.Failed, Flags.CheckType.MatchAny))
                        {
                            objectiveColor = Colors.Get.MessageDangerColor;
                        }
                        else
                        {
                            //Debug.Log ("I'm turning you green");
                            objectiveColor = Colors.Get.MessageSuccessColor;
                        }
                    }
                    else if (objectiveToDisplay.Status != MissionStatus.Dormant)
                    {
                        //Debug.Log ("It's not completed, but it's not dormant either");
                        if (Flags.Check((uint)objectiveToDisplay.Status, (uint)MissionStatus.Failed, Flags.CheckType.MatchAny))
                        {
                            objectiveColor = Colors.Get.MessageDangerColor;
                        }
                        else if (Flags.Check((uint)objectiveToDisplay.Status, (uint)MissionStatus.Ignored, Flags.CheckType.MatchAny))
                        {
                            objectiveColor = Colors.Get.MessageWarningColor;
                        }
                    }

                    if (objectiveToDisplay.Completed)
                    {
                        detailText.Add(Colors.ColorWrap(objectiveToDisplay.Name.ToUpper(), objectiveColor));
                    }
                    else
                    {
                        detailText.Add(Colors.ColorWrap(objectiveToDisplay.Name.ToUpper() + ": ", Color.white) + Colors.ColorWrap(objectiveToDisplay.Description, objectiveColor));
                    }
                }
            }

            string             finalDetailText = string.Join("\n", detailText.ToArray());
            FrontiersInterface user            = this;

            if (!HasFocus)
            {
                user = GUILogInterface.Get;
            }
            GUIDetailsPage.Get.DisplayDetail(
                user,
                Frontiers.Data.GameData.InterpretScripts(mSelectedObject.Title, Profile.Get.CurrentGame.Character, null),
                Frontiers.Data.GameData.InterpretScripts(finalDetailText, Profile.Get.CurrentGame.Character, null),
                "IconMission",
                Mats.Get.IconsAtlas,
                missionColor,
                Color.white);
        }