Example #1
0
        private void AddHighlightEvent(TouchLocation touch)
        {
            //add a highlight event at that location
            var coord = ConvertCoordinate(touch.Position);

            Highlights.Add(new HighlightEventArgs(coord, this));
        }
Example #2
0
        public List <PdfString> RegexSearch(PDFDoc doc, string pattern, bool ifWholeWord, int startPage, int endPage, bool ignoreCase)
        {
            List <PdfString> result         = new List <PdfString>();
            Int32            page_num       = 0;
            string           result_str     = "";
            string           ambient_string = "";
            Highlights       hlts           = new Highlights();

            Int32 mode = (Int32)(TextSearch.SearchMode.e_reg_expression | TextSearch.SearchMode.e_highlight);

            if (ifWholeWord)
            {
                mode |= (Int32)TextSearch.SearchMode.e_whole_word;
            }
            if (ignoreCase)
            {
                mode |= (Int32)TextSearch.SearchMode.e_case_sensitive;
            }

            int pageCount = doc.GetPageCount();

            if (endPage > pageCount)
            {
                endPage = pageCount;
            }

            TextSearch txt_search = new TextSearch();

            txt_search.Begin(doc, pattern, mode, startPage, endPage);

            while (true)
            {
                TextSearch.ResultCode code = txt_search.Run(ref page_num, ref result_str, ref ambient_string, hlts);

                if (code == TextSearch.ResultCode.e_found)
                {
                    hlts.Begin(doc);
                    double[] box  = null;
                    string   temp = result_str;

                    while (hlts.HasNext())
                    {
                        box = hlts.GetCurrentQuads();
                        if (box.Length != 8)
                        {
                            hlts.Next();
                            continue;
                        }

                        result.Add(new PdfString(result_str, new Rect(box[0], box[1], box[4], box[5]), page_num));
                        hlts.Next();
                    }
                }
                else if (code == TextSearch.ResultCode.e_done)
                {
                    break;
                }
            }
            return(result);
        }
Example #3
0
        /// <summary>
        /// Update the mouse manager.
        /// </summary>
        public override void Update(bool isActive)
        {
            //clear out the taps & touches
            Clicks.Clear();
            Highlights.Clear();
            Drags.Clear();
            Drops.Clear();
            Flicks.Clear();
            Pinches.Clear();

            if (null != Pinch)
            {
                //reset the pinch delta
                Pinch.Delta = 0f;
            }

            if (isActive)
            {
                TouchCollection = TouchPanel.GetState();

                //get the new taps & touches
                GetGestures();
                GetTouches();
            }

            //Add the pinch event if there is an ongoing gesture
            if (null != Pinch)
            {
                Pinches.Add(new PinchEventArgs(Pinch.Delta));
            }
        }
 public override void AfterStart()
 {
     if (!HighlightsController.IsHighlightsInitialized)
     {
         HighlightsController.HighlightTypes = new List <HighlightsController.HighlightType>()
         {
             new HighlightsController.HighlightType("hlid_killing_spree", "Killing Spree", "grpid_incidents", -2010, 3000, 0.25f, float.MaxValue, true),
             new HighlightsController.HighlightType("hlid_high_ranged_shot_difficulty", "Sharpshooter", "grpid_incidents", -5000, 3000, 0.25f, float.MaxValue, true),
             new HighlightsController.HighlightType("hlid_archer_salvo_kills", "Death from Above", "grpid_incidents", -5004, 3000, 0.5f, 150f, false),
             new HighlightsController.HighlightType("hlid_couched_lance_against_mounted_opponent", "Lance A Lot", "grpid_incidents", -5000, 3000, 0.25f, float.MaxValue, true),
             new HighlightsController.HighlightType("hlid_cavalry_charge_first_impact", "Cavalry Charge First Impact", "grpid_incidents", -5000, 5000, 0.25f, float.MaxValue, false),
             new HighlightsController.HighlightType("hlid_headshot_kill", "Headshot!", "grpid_incidents", -5000, 3000, 0.25f, 150f, true),
             new HighlightsController.HighlightType("hlid_burning_ammunition_kill", "Burn Baby", "grpid_incidents", -5000, 3000, 0.25f, 100f, true),
             new HighlightsController.HighlightType("hlid_throwing_weapon_kill_against_charging_enemy", "Throwing Weapon Kill Against Charging Enemy", "grpid_incidents", -5000, 3000, 0.25f, 150f, true)
         };
         Highlights.Initialize();
         foreach (HighlightsController.HighlightType highlightType in HighlightsController.HighlightTypes)
         {
             Highlights.AddHighlight(highlightType.Id, highlightType.Description);
         }
         HighlightsController.IsHighlightsInitialized = true;
     }
     foreach (string highlightGroupId in this._highlightGroupIds)
     {
         Highlights.OpenGroup(highlightGroupId);
     }
     this._highlightSaveQueue    = new List <HighlightsController.Highlight>();
     this._playerKillTimes       = new List <float>();
     this._archerSalvoKillTimes  = new List <float>();
     this._cavalryChargeHitTimes = new List <float>();
     this._savedHighlightGroups  = new List <string>();
 }
        /*--------------------------------------------------------------------------------------------*/
        protected virtual void AddLatestHighlightsAndFindNearest()
        {
            float minDist = float.MaxValue;
            List <ICursorData> cursors = CursorDataProvider.Cursors;
            int cursorCount            = cursors.Count;

            for (int i = 0; i < cursorCount; i++)
            {
                ICursorData cursor = cursors[i];

                if (!cursor.CanCauseSelections)
                {
                    continue;
                }

                Highlight high = CalculateHighlight(cursor);
                high.IsNearestAcrossAllItems = vIsNearestForCursorTypeMap.Contains(cursor.Type);
                Highlights.Add(high);

                if (high.Distance >= minDist)
                {
                    continue;
                }

                minDist          = high.Distance;
                NearestHighlight = high;
            }

            IsNearestAcrossAllItemsForAnyCursor = (vIsNearestForCursorTypeMap.Count > 0);
        }
Example #6
0
        // Gathers text decorations set on scoping highlights.
        // If no highlight properties are found, returns null
        private static TextDecorationCollection GetHighlightTextDecorations(StaticTextPointer highlightPosition)
        {
            TextDecorationCollection textDecorations = null;
            Highlights highlights = highlightPosition.TextContainer.Highlights;

            if (highlights == null)
            {
                return(textDecorations);
            }

            //
            // Speller
            //
            textDecorations = highlights.GetHighlightValue(highlightPosition, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection;

            //
            // IME composition
            //
#if UNUSED_IME_HIGHLIGHT_LAYER
            TextDecorationCollection imeTextDecorations = highlights.GetHighlightValue(highlightPosition, LogicalDirection.Forward, typeof(FrameworkTextComposition)) as TextDecorationCollection;
            if (imeTextDecorations != null)
            {
                textDecorations = imeTextDecorations;
            }
#endif

            return(textDecorations);
        }
Example #7
0
    public static void MakeTile(int x, int z) // remember to make Highlight g static later
    {
        float xPos;
        float zPos;

        xPos = x * horzDistance;
        zPos = z * vertDistance;
        if (x % 2 == 1)
        {
            zPos -= vertDistance * 0.5f;
        }
        GameObject g = (GameObject)GameObject.Instantiate(Resources.Load("prefabs/HexFab"), new Vector3(xPos, 0f, -zPos), Quaternion.Euler(0, 0, 0));

        Map[z, x] = g.gameObject.GetComponent <HexCell>();
        Map[z, x].SetCoord(x, z);
        g.transform.parent = gMap.transform;

        if (Map[z, x].R >= 2 && Map[z, x].R <= 3)
        {
            Highlights.HighlightGameObject(g, 2);
        }
        else if (Map[z, x].R >= map_radius - 4 && Map[z, x].R <= map_radius - 3)
        {
            Highlights.HighlightGameObject(g, 3);
        }
    }
        /*--------------------------------------------------------------------------------------------*/
        private void AddLatestHighlightsAndFindNearest()
        {
            float minDist = float.MaxValue;
            List <ICursorData> cursors = CursorDataProvider.Cursors;
            int cursorCount            = cursors.Count;

            for (int i = 0; i < cursorCount; i++)
            {
                ICursorData cursor = cursors[i];

                if (!cursor.CanCauseSelections)
                {
                    continue;
                }

                Highlight high = CalculateHighlight(cursor);
                Highlights.Add(high);

                if (high.Distance >= minDist)
                {
                    continue;
                }

                minDist          = high.Distance;
                NearestHighlight = high;
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("HighlightId,Title,Description,NewTab,StatusId,DateUpdated,DateCreated")] Highlights highlights)
        {
            if (id != highlights.HighlightId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(highlights);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HighlightsExists(highlights.HighlightId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StatusId"] = new SelectList(_context.Statuses, "StatusId", "Title", highlights.StatusId);
            return(View(highlights));
        }
Example #10
0
        public static int SetupNVHighlights()
        {
            if (InitHighlightsSDK(false) < 0)
            {
                return(-1);
            }

            Highlights.RequestPermissions(configStepCallback);
            // Configure Highlights
            Highlights.HighlightDefinition[] highlightDefinitions =
            {
                new()
                {
                    Id                   = "SAVE",
                    HighlightTags        = Highlights.HighlightType.Achievement,
                    Significance         = Highlights.HighlightSignificance.Good,
                    UserDefaultInterest  = true,
                    NameTranslationTable = new[]{ new Highlights.TranslationEntry("en-US",                                  "Save!"),                 }
                },
                new()
                {
                    Id                   = "SCORE",
                    HighlightTags        = Highlights.HighlightType.Achievement,
                    Significance         = Highlights.HighlightSignificance.Good,
                    UserDefaultInterest  = true,
                    NameTranslationTable = new[]{ new Highlights.TranslationEntry("en-US",                                  "Goal!"),                 }
                },
                new()
                {
                    Id                   = "INTERCEPTION",
                    HighlightTags        = Highlights.HighlightType.Achievement,
                    Significance         = Highlights.HighlightSignificance.Good,
                    UserDefaultInterest  = false,
                    NameTranslationTable = new[]{ new Highlights.TranslationEntry("en-US",                                  "Interception!"),         }
                },
                new()
                {
                    Id                   = "STEAL_SAVE",
                    HighlightTags        = Highlights.HighlightType.Achievement,
                    Significance         = Highlights.HighlightSignificance.Good,
                    UserDefaultInterest  = true,
                    NameTranslationTable = new[]{ new Highlights.TranslationEntry("en-US",                                  "Steal counts as Save!"), }
                },
                new()
                {
                    Id                   = "ASSIST",
                    HighlightTags        = Highlights.HighlightType.Achievement,
                    Significance         = Highlights.HighlightSignificance.Good,
                    UserDefaultInterest  = true,
                    NameTranslationTable = new[]{ new Highlights.TranslationEntry("en-US",                                  "Scoring Assist!"),       }
                },
                new()
                {
                    Id                   = "BIG_BOOST",
                    HighlightTags        = Highlights.HighlightType.Achievement,
                    Significance         = Highlights.HighlightSignificance.Good,
                    UserDefaultInterest  = false,
                    NameTranslationTable = new[]{ new Highlights.TranslationEntry("en-US",                                  "Big boost!"),            }
                },
            };
Example #11
0
        /// <summary>
        /// Deal the find results when some record is found out.
        /// </summary>
        /// <param name="hlts">The hightlights information</param>
        /// <param name="_pdfDoc">The pdf document object</param>
        /// <param name="lowRange">The beginning location for finding</param>
        /// <param name="verifyRegex">The regex for veritying key words</param>
        /// <returns>If the result is defined,return a LinePos object,otherwise return null</returns>
        LinePos GetLinePos(string regex, Highlights hlts, LinePos lowRange)
        {
            List <Rect> lineRects = GetLineRect(hlts);

            int pageNum = hlts.GetCurrentPageNumber();

            foreach (Rect lineRect in lineRects)
            {
                if (pageNum <= GetLowPage(lowRange) && !IsBelow(lineRect, lowRange))
                {
                    continue;
                }

                string text = ReadTextFromRect(pageNum, lineRect);

                string trimText = text.RemoveBlankSpace();

                if (!Regex.IsMatch(trimText, regex))
                {
                    continue;
                }

                LinePos linePos = new LinePos()
                {
                    PageNum   = pageNum,
                    AxisValue = GetAxisBoundValue(true, lineRect),
                    TrimText  = trimText,
                    AxisValueWithLineHeight = GetAxisBoundValue(false, lineRect),
                };
                return(linePos);
            }
            return(null);
        }
 public void ShowSummary()
 {
     if (!this.IsAnyHighlightSaved)
     {
         return;
     }
     Highlights.OpenSummary(this._savedHighlightGroups);
 }
Example #13
0
        public void Highlights_are_added_for_multiple_matches()
        {
            // When
            box.Text = "MISS, HIT, MISS, HIT, HIT, MISS";

            // Then
            Highlights.Should().HaveCount(3);
        }
Example #14
0
        public void A_highlight_is_added_for_a_match_even_with_whitespace()
        {
            // When
            box.Text = "    HIT  \r\n\t  ,MISS,MISS";

            // Then
            Highlights.Should().HaveCount(1);
        }
Example #15
0
        public void No_highlights_added_for_no_matches()
        {
            // When
            box.Text = "MISS, MISS, MISS";

            // Then
            Highlights.Should().BeEmpty();
        }
Example #16
0
        // Performs all the necessary setup for the Highlights feature. It includes
        // creating the SDK, configuring all the highlights needed for the game, requesting
        // permissions and opening all highlight groups that would be used in the session.
        void SetupHighlights()
        {
            // Create Highlights SDK
            Highlights.HighlightScope[] RequiredScopes = new Highlights.HighlightScope[3] {
                Highlights.HighlightScope.Highlights,
                Highlights.HighlightScope.HighlightsRecordVideo,
                Highlights.HighlightScope.HighlightsRecordScreenshot
            };
            System.String AppName = "Tanks";
            if (Highlights.CreateHighlightsSDK(AppName, RequiredScopes) != Highlights.ReturnCode.SUCCESS)
            {
                Debug.LogError("Failed to initialize highlights");
                return;
            }

            // Request Permissions
            Highlights.RequestPermissions();

            // Configure Highlights
            Highlights.HighlightDefinition[] highlightDefinitions = new Highlights.HighlightDefinition[3];
            highlightDefinitions[0].Id                   = "HURT_ME_PLENTY";
            highlightDefinitions[0].HighlightTags        = Highlights.HighlightType.Achievement;
            highlightDefinitions[0].Significance         = Highlights.HighlightSignificance.Good;
            highlightDefinitions[0].UserDefaultInterest  = true;
            highlightDefinitions[0].NameTranslationTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Hurt Me Plenty"),
            };
            highlightDefinitions[1].Id                   = "KABOOM";
            highlightDefinitions[1].HighlightTags        = Highlights.HighlightType.Incident;
            highlightDefinitions[1].Significance         = Highlights.HighlightSignificance.Good;
            highlightDefinitions[1].UserDefaultInterest  = true;
            highlightDefinitions[1].NameTranslationTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Kaboom!"),
            };
            highlightDefinitions[2].Id                   = "HEAVY_DUTY_TRAVELER";
            highlightDefinitions[2].HighlightTags        = Highlights.HighlightType.Achievement;
            highlightDefinitions[2].Significance         = Highlights.HighlightSignificance.Good;
            highlightDefinitions[2].UserDefaultInterest  = true;
            highlightDefinitions[2].NameTranslationTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Heavy Duty Traveler"),
            };
            Highlights.ConfigureHighlights(highlightDefinitions);

            // Open Groups
            Highlights.OpenGroupParams ogp1 = new Highlights.OpenGroupParams();
            ogp1.Id = "SHOT_HIGHLIGHT_GROUP";
            ogp1.GroupDescriptionTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Shot Highlight Group"),
            };
            Highlights.OpenGroup(ogp1);

            Highlights.OpenGroupParams ogp2 = new Highlights.OpenGroupParams();
            ogp2.Id = "MISC_GROUP";
            ogp2.GroupDescriptionTable = new Highlights.TranslationEntry[] {
                new Highlights.TranslationEntry("en-US", "Misc Group"),
            };
            Highlights.OpenGroup(ogp2);
        }
Example #17
0
        public static void      DrawHighlightLayout(string id, EditorWindow window, Highlights highlights = XGUIHighlightManager.Highlights.Glow | Highlights.Wave)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            XGUIHighlightManager.DrawHighlight(id, window, GUILayoutUtility.GetLastRect(), true, highlights);
        }
        public string GetHighlightedTextForField(string fieldName)
        {
            if (string.IsNullOrEmpty(fieldName) || !Highlights.ContainsKey(fieldName) || Highlights[fieldName].Count < 1)
            {
                return(null);
            }

            return(Highlights[fieldName][0]);
        }
Example #19
0
        public void OnApplicationQuit()
        {
            if (Plugin.CurrentSettings.Enabled && Plugin.CurrentSettings.ShowSummaryOnExit)
            {
                Highlight.ShowSummary();
            }

            Highlights.ReleaseHighlightsSDK();
        }
 private void SaveVideo(string highlightID, string groupID, int startDelta, int endDelta)
 {
     Highlights.SaveVideo(highlightID, groupID, startDelta, endDelta);
     if (this._savedHighlightGroups.Contains(groupID))
     {
         return;
     }
     this._savedHighlightGroups.Add(groupID);
 }
Example #21
0
        public void HighlightPattern(ICancellable cnc, Highlights highlights, string pattern, int selectionStart, int selectionEnd, Segment visibleSegment)
        {
            int par_size     = 1;
            int bracket_size = 1;

            Regex regex = GetCachedHighlightingRegex( );

            HighlightHelper.CommonHighlighting(cnc, highlights, pattern, selectionStart, selectionEnd, visibleSegment, regex, par_size, bracket_size);
        }
Example #22
0
    public void ShowHighlightSummaryWindows()
    {
        Highlights.GroupView[] groupViews = new Highlights.GroupView[1];
        groupViews[0]                    = new Highlights.GroupView();
        groupViews[0].GroupId            = "Recorded_Group";
        groupViews[0].SignificanceFilter = Highlights.HighlightSignificance.Good;
        groupViews[0].TagFilter          = Highlights.HighlightType.Achievement;

        Highlights.OpenSummary(groupViews, Highlights.DefaultOpenSummaryCallback);
    }
        public void SetUp()
        {
            theGameState = new StubGameState();
            theSettings = HighlightSettings.Default();

            theHighlighter = new Highlights(new IHighlighter[] {
                new BoldHighlighter(theSettings),
                new RoomNameHighlighter(theGameState, theSettings)
            });
        }
Example #24
0
        public void Single_highlight_rectangle_is_positioned_correctly(string text, int index)
        {
            // When
            box.Text = text;

            // Then
            var positionRect = PositionRect(index, 3);

            Highlights.First().Should().BeAtPosition(positionRect);
        }
Example #25
0
    public void Record()
    {
        Highlights.VideoHighlightParams param = new Highlights.VideoHighlightParams();
        param.highlightId = "Record";
        param.groupId     = "Recorded_Group";
        param.startDelta  = -(int)(Time.realtimeSinceStartup * 1000);
        //param.startDelta = -10000;
        param.endDelta = 1000;

        Highlights.SetVideoHighlight(param, Highlights.DefaultSetVideoCallback);
    }
        // Token: 0x060066A1 RID: 26273 RVA: 0x001CCD98 File Offset: 0x001CAF98
        private static TextDecorationCollection GetHighlightTextDecorations(StaticTextPointer highlightPosition)
        {
            TextDecorationCollection result = null;
            Highlights highlights           = highlightPosition.TextContainer.Highlights;

            if (highlights == null)
            {
                return(result);
            }
            return(highlights.GetHighlightValue(highlightPosition, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection);
        }
Example #27
0
        public void HighlightPattern(ICancellable cnc, Highlights highlights, string pattern, int selectionStart, int selectionEnd, Segment visibleSegment)
        {
            var helper = OptionsControl.CreateOnigurumaHelper( );

            int par_size     = helper.IsONIG_SYN_OP_ESC_LPAREN_SUBEXP ? 2 : 1;
            int bracket_size = 1;

            Regex regex = GetCachedHighlightingRegex(helper);

            HighlightHelper.CommonHighlighting(cnc, highlights, pattern, selectionStart, selectionEnd, visibleSegment, regex, par_size, bracket_size);
        }
 public static void RemoveHighlights()
 {
     if (!HighlightsController.IsHighlightsInitialized)
     {
         return;
     }
     foreach (HighlightsController.HighlightType highlightType in HighlightsController.HighlightTypes)
     {
         Highlights.RemoveHighlight(highlightType.Id);
     }
 }
 public override void HandleOnCloseMission()
 {
     foreach (string highlightGroupId in this._highlightGroupIds)
     {
         Highlights.CloseGroup(highlightGroupId);
     }
     this._highlightSaveQueue     = (List <HighlightsController.Highlight>)null;
     this._lastSavedHighlightData = (Tuple <float, float>)null;
     this._playerKillTimes        = (List <float>)null;
     this._archerSalvoKillTimes   = (List <float>)null;
     this._cavalryChargeHitTimes  = (List <float>)null;
 }
Example #30
0
        public async Task <IActionResult> Create([Bind("HighlightId,Title,Description,NewTab,StatusId,DateUpdated,DateCreated")] Highlights highlights)
        {
            if (ModelState.IsValid)
            {
                _context.Add(highlights);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StatusId"] = new SelectList(_context.Statuses, "StatusId", "Title", highlights.StatusId);
            return(View(highlights));
        }
 public static void AddHighlightType(HighlightsController.HighlightType highlightType)
 {
     if (HighlightsController.HighlightTypes.Any <HighlightsController.HighlightType>((Func <HighlightsController.HighlightType, bool>)(h => h.Id == highlightType.Id)))
     {
         return;
     }
     if (HighlightsController.IsHighlightsInitialized)
     {
         Highlights.AddHighlight(highlightType.Id, highlightType.Description);
     }
     HighlightsController.HighlightTypes.Add(highlightType);
 }
Example #32
0
 private void Highlight(Highlights highlight) {
     switch (highlight) {
         case Highlights.Focused:
             ShowCircle(true, Highlights.Focused);
             break;
         case Highlights.None:
             ShowCircle(false, Highlights.Focused);
             break;
         case Highlights.Selected:
         case Highlights.SelectedAndFocus:
         case Highlights.General:
         case Highlights.FocusAndGeneral:
         default:
             throw new NotImplementedException(ErrorMessages.UnanticipatedSwitchValue.Inject(highlight));
     }
 }
Example #33
0
 public void SetUp()
 {
     theHighlighters = new List<IHighlighter>();
     theHighlights = new Highlights(theHighlighters);
 }
Example #34
0
 private void Highlight(bool toShow, Highlights highlight) {
     _systemHighlightRenderer.gameObject.SetActive(toShow);
     switch (highlight) {
         case Highlights.Focused:
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Main, UnityDebugConstants.FocusedColor.ToUnityColor());
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Outline, UnityDebugConstants.FocusedColor.ToUnityColor());
             break;
         case Highlights.Selected:
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Main, UnityDebugConstants.SelectedColor.ToUnityColor());
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Outline, UnityDebugConstants.SelectedColor.ToUnityColor());
             break;
         case Highlights.SelectedAndFocus:
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Main, UnityDebugConstants.GeneralHighlightColor.ToUnityColor());
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Outline, UnityDebugConstants.GeneralHighlightColor.ToUnityColor());
             break;
         case Highlights.None:
             // nothing to do as the highlighter should already be inactive
             break;
         case Highlights.General:
         case Highlights.FocusAndGeneral:
         default:
             throw new NotImplementedException(ErrorMessages.UnanticipatedSwitchValue.Inject(highlight));
     }
 }
 public DataSet getallHiglights(int siteid, int contid)
 {
     Highlights high = new Highlights();
     return high.getAllHighlights(siteid, contid);
 }
 protected virtual void ShowCircle(bool toShow, Highlights highlight) {
     ShowCircle(toShow, highlight, _transform);
 }
Example #37
0
 protected override void Highlight(Highlights highlight) {
     //D.Log("{0}.Highlight({1}) called. IsDiscernible = {2}, SystemHighlightRendererGO.activeSelf = {3}.",
     //gameObject.name, highlight, IsDiscernible, _systemHighlightRenderer.gameObject.activeSelf);
     switch (highlight) {
         case Highlights.Focused:
             _systemHighlightRenderer.gameObject.SetActive(true);
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Main, UnityDebugConstants.FocusedColor.ToUnityColor());
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Outline, UnityDebugConstants.FocusedColor.ToUnityColor());
             break;
         case Highlights.Selected:
             _systemHighlightRenderer.gameObject.SetActive(true);
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Main, UnityDebugConstants.SelectedColor.ToUnityColor());
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Outline, UnityDebugConstants.SelectedColor.ToUnityColor());
             break;
         case Highlights.SelectedAndFocus:
             _systemHighlightRenderer.gameObject.SetActive(true);
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Main, UnityDebugConstants.GeneralHighlightColor.ToUnityColor());
             _systemHighlightRenderer.material.SetColor(UnityConstants.MaterialColor_Outline, UnityDebugConstants.GeneralHighlightColor.ToUnityColor());
             break;
         case Highlights.None:
             _systemHighlightRenderer.gameObject.SetActive(false);
             break;
         case Highlights.General:
         case Highlights.FocusAndGeneral:
         default:
             throw new NotImplementedException(ErrorMessages.UnanticipatedSwitchValue.Inject(highlight));
     }
 }
Example #38
0
 private void ShowCircle(bool toShow, Highlights highlight) {
     D.Assert(highlight == Highlights.Focused || highlight == Highlights.Selected);
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = Screen.height * circleScaleFactor;
         _circles = new HighlightCircle("FleetCircles", _fleetCmd.transform, normalizedRadius, parent: DynamicObjectsFolder.Folder,
             isRadiusDynamic: false, maxCircles: 2);
         _circles.Colors = new GameColor[2] { UnityDebugConstants.FocusedColor, UnityDebugConstants.SelectedColor };
         _circles.Widths = new float[2] { 2F, 2F };
     }
     if (toShow) {
         //D.Log("Fleet attempting to show circle {0}.", highlight.GetName());
         if (!_circles.IsShowing) {
             StartCoroutine(_circles.ShowCircles((int)highlight));
         }
         else {
             _circles.AddCircle((int)highlight);
         }
     }
     else if (_circles.IsShowing) {
         _circles.RemoveCircle((int)highlight);
     }
 }
Example #39
0
 private void Highlight(bool toShowFleetIcon, Highlights highlight) {
     if (_fleetIcon != null) {
         _fleetIcon.gameObject.SetActive(toShowFleetIcon);
         //TODO audio on/off goes here
     }
     ShowVelocityRay(toShowFleetIcon);
     switch (highlight) {
         case Highlights.Focused:
             ShowCircle(false, Highlights.Selected);
             ShowCircle(true, Highlights.Focused);
             break;
         case Highlights.Selected:
             ShowCircle(true, Highlights.Selected);
             ShowCircle(false, Highlights.Focused);
             break;
         case Highlights.SelectedAndFocus:
             ShowCircle(true, Highlights.Selected);
             ShowCircle(true, Highlights.Focused);
             break;
         case Highlights.None:
             ShowCircle(false, Highlights.Selected);
             ShowCircle(false, Highlights.Focused);
             break;
         case Highlights.General:
         case Highlights.FocusAndGeneral:
         default:
             throw new NotImplementedException(ErrorMessages.UnanticipatedSwitchValue.Inject(highlight));
     }
 }
Example #40
0
 private void Highlight(bool toShowShip, Highlights highlight) {
     if (toShowShip) {
         _shipRenderer.material.SetColor(UnityConstants.MaterialColor_Main, _originalMainShipColor);
         _shipRenderer.material.SetColor(UnityConstants.MaterialColor_Specular, _originalSpecularShipColor);
         //TODO audio on goes here
     }
     else {
         _shipRenderer.material.SetColor(UnityConstants.MaterialColor_Main, _hiddenShipColor);
         _shipRenderer.material.SetColor(UnityConstants.MaterialColor_Specular, _hiddenShipColor);
         //TODO audio off goes here
     }
     ShowVelocityRay(toShowShip);
     switch (highlight) {
         case Highlights.Focused:
             ShowCircle(false, Highlights.Selected);
             ShowCircle(true, Highlights.Focused);
             ShowCircle(false, Highlights.General);
             break;
         case Highlights.Selected:
             ShowCircle(true, Highlights.Selected);
             ShowCircle(false, Highlights.Focused);
             ShowCircle(false, Highlights.General);
             break;
         case Highlights.SelectedAndFocus:
             ShowCircle(true, Highlights.Selected);
             ShowCircle(true, Highlights.Focused);
             ShowCircle(false, Highlights.General);
             break;
         case Highlights.General:
             ShowCircle(false, Highlights.Selected);
             ShowCircle(false, Highlights.Focused);
             ShowCircle(true, Highlights.General);
             break;
         case Highlights.FocusAndGeneral:
             ShowCircle(false, Highlights.Selected);
             ShowCircle(true, Highlights.Focused);
             ShowCircle(true, Highlights.General);
             break;
         case Highlights.None:
             ShowCircle(false, Highlights.Selected);
             ShowCircle(false, Highlights.Focused);
             ShowCircle(false, Highlights.General);
             break;
         default:
             throw new NotImplementedException(ErrorMessages.UnanticipatedSwitchValue.Inject(highlight));
     }
 }
Example #41
0
 private void ShowCircle(bool toShow, Highlights highlight) {
     D.Assert(highlight == Highlights.Focused);
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = Screen.height * circleScaleFactor * _item.Size;
         _circles = new HighlightCircle("ItemCircle", Target, normalizedRadius, parent: DynamicObjectsFolder.Folder, isRadiusDynamic: true, maxCircles: 1, width: 3F, color: UnityDebugConstants.FocusedColor);
     }
     if (toShow) {
         //D.Log("Item attempting to show circle {0}.", highlight.GetName());
         if (!_circles.IsShowing) {
             StartCoroutine(_circles.ShowCircles((int)highlight));
         }
         else {
             _circles.AddCircle((int)highlight);
         }
     }
     else if (_circles.IsShowing) {
         _circles.RemoveCircle((int)highlight);
     }
 }
Example #42
0
 private void ShowCircle(bool toShow, Highlights highlight) {
     D.Assert(highlight == Highlights.Focused || highlight == Highlights.Selected || highlight == Highlights.General);
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = Screen.height * circleScaleFactor * _shipCaptain.Size;
         _circles = new HighlightCircle("ShipCircles", _shipCaptain.transform, normalizedRadius, parent: DynamicObjectsFolder.Folder,
             isRadiusDynamic: true, maxCircles: 3);
         _circles.Colors = new GameColor[3] { UnityDebugConstants.FocusedColor, UnityDebugConstants.SelectedColor, UnityDebugConstants.GeneralHighlightColor };
         _circles.Widths = new float[3] { 2F, 2F, 1F };
     }
     if (toShow) {
         D.Log("Ship {1} attempting to show circle {0}.", highlight.GetValueName(), _shipCaptain.Data.Name);
         if (!_circles.IsShowing) {
             StartCoroutine(_circles.ShowCircles((int)highlight));
         }
         else {
             _circles.AddCircle((int)highlight);
         }
     }
     else if (_circles.IsShowing) {
         _circles.RemoveCircle((int)highlight);
     }
 }
    //-------------------------------------------------------------
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        string imagePath = lbErrorHighlight.Text;
        linktopage = Convert.ToString(Request["txt_link"]);
        if (Convert.ToString(Request["rb_image_type"]) == "upload")
        {
            #region Upload first
            String UploadedFile = FUimage.PostedFile.FileName;
            if (Convert.ToString(UploadedFile) != "")
            {
                int ExtractPos = UploadedFile.LastIndexOf("\\") + 1;
                String UploadedFileName = UploadedFile.Substring(ExtractPos, UploadedFile.Length - ExtractPos);
                string addres = Convert.ToString(UploadedFileName);
                String lowuploadimage = UploadedFileName.ToLower();
                if (!(lowuploadimage.Contains(".jpg") || lowuploadimage.Contains(".png") || lowuploadimage.Contains(".gif")))
                {
                    return;
                }
                FUimage.PostedFile.SaveAs(Request.PhysicalApplicationPath + "\\" + strFolder + "\\" + UploadedFileName);
                imagePath = addres;
                hidePath.Value = Convert.ToString(addres);
            }
            #endregion
        }
        else if (Convert.ToString(Request["rb_image_type"]) == "url")
        {
            imagePath = Convert.ToString(Request["txt_image_url"]);
        }
        if (txt_Title.Text != "")
        {
            if (Session["HighId"] == null)
            {
                Highlights hig = new Highlights(Convert.ToInt32(Session["siteId"]), Convert.ToInt32(Session["contId"]), 0, txt_Title.Text, txt_Alt.Text, imagePath, linktopage, contnewpos, 1);
                addHighlights(hig);
                Response.Redirect("mnt_HighLights.aspx");

            }else{
                saveLandingPage();
                Highlights hig = new Highlights(Convert.ToInt32(Session["siteId"]), Convert.ToInt32(Session["contId"]), Convert.ToInt32(Session["HighId"]), txt_Title.Text, txt_Alt.Text, imagePath, linktopage, Convert.ToInt32(Request["hidepos"]), 1);
                updateHighlights(hig);
                Session["HighId"] = null;
                Response.Redirect("mnt_HighLights.aspx");
            }
        }
    }
Example #44
0
 protected void ShowCircle(bool toShow, Highlights highlight) {
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = calcNormalizedCircleRadius();
         string circlesTitle = "{0} Circle".Inject(gameObject.name);
         _circles = new HighlightCircle(circlesTitle, _transform, normalizedRadius, parent: DynamicObjectsFolder.Folder,
             isRadiusDynamic: _isCirclesRadiusDynamic, maxCircles: 3);
         _circles.Colors = new GameColor[3] { UnityDebugConstants.FocusedColor, UnityDebugConstants.SelectedColor, UnityDebugConstants.GeneralHighlightColor };
         _circles.Widths = new float[3] { 2F, 2F, 1F };
     }
     //string showHide = toShow ? "showing" : "not showing";
     //D.Log("{0} {1} circle {2}.", gameObject.name, showHide, highlight.GetName());
     _circles.Show(toShow, (int)highlight);
 }
        public void SetUp()
        {
            theSettings = HighlightSettings.Default();

            theHighlighter = new Highlights(new IHighlighter[]{ new BoldHighlighter(theSettings) });
        }
Example #46
0
 protected override void ShowCircle(bool toShow, Highlights highlight) {
     ShowCircle(toShow, highlight, _cmdIcon.WidgetTransform);
 }