コード例 #1
0
        private void AddToPendingCases()
        {
            if (!CourtSystem.PendingCourtCases.Contains(this))
            {
                if (CourtSystem.PublishedCourtCases.Contains(this))
                {
                    Menus.PublishedResultsList.Items.RemoveAt(CourtSystem.PublishedCourtCases.IndexOf(this));
                    if (Menus.PublishedResultsList.Items.Count == 0)
                    {
                        Menus.PublishedResultsList.Items.Add(new TabItem(" ")); ResultsMenuCleared = false;
                    }
                    Menus.PublishedResultsList.Index = 0;
                    CourtSystem.PublishedCourtCases.Remove(this);
                }
                CourtSystem.PendingCourtCases.Insert(0, this);
                string      CrimeString = char.ToUpper(Crime[0]) + Crime.ToLower().Substring(1);
                TabTextItem item        = new TabTextItem(MenuLabel(false), "Court Date Pending", MenuLabel(false) + ". ~n~Hearing is for: ~r~" + CrimeString + ".~s~~n~ Offence took place on ~b~"
                                                          + CrimeDate.ToShortDateString() + "~s~ at ~b~" + CrimeDate.ToShortTimeString() + "~s~~n~ Hearing date: ~y~" + ResultsPublishTime.ToShortDateString() + " " + ResultsPublishTime.ToShortTimeString()
                                                          + "~n~~n~~y~Select this case and press ~b~Insert ~s~to make the hearing take place immediately, or ~b~Delete ~y~to dismiss it.");
                Menus.PendingResultsList.Items.Insert(0, item);
                Menus.PendingResultsList.RefreshIndex();

                if (!PendingResultsMenuCleared)
                {
                    Game.LogTrivial("Emtpy items, clearing menu at index 1.");
                    Menus.PendingResultsList.Items.RemoveAt(1);
                    PendingResultsMenuCleared = true;
                }
                if (!CourtSystem.LoadingXMLFileCases)
                {
                    if (CourtSystem.OpenCourtMenuKey != Keys.None)
                    {
                        Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "~b~San Andreas Court", "~r~" + SuspectName, "You're now following a new pending court case. Press ~b~" + Albo1125.Common.CommonLibrary.ExtensionMethods.GetKeyString(CourtSystem.OpenCourtMenuKey, CourtSystem.OpenCourtMenuModifierKey) + ".");
                    }
                }
                ResultsPublished = false;
            }
        }
コード例 #2
0
        private void PublishCourtResults()
        {
            if (!CourtSystem.PublishedCourtCases.Contains(this))
            {
                if (CourtSystem.PendingCourtCases.Contains(this))
                {
                    Menus.PendingResultsList.Items.RemoveAt(CourtSystem.PendingCourtCases.IndexOf(this));
                    if (Menus.PendingResultsList.Items.Count == 0)
                    {
                        Menus.PendingResultsList.Items.Add(new TabItem(" ")); PendingResultsMenuCleared = false;
                    }
                    Menus.PendingResultsList.Index = 0;
                    CourtSystem.PendingCourtCases.Remove(this);
                }
                CourtSystem.PublishedCourtCases.Insert(0, this);
                string CrimeString = char.ToUpper(Crime[0]) + Crime.ToLower().Substring(1);
                if (GuiltyChance < 0)
                {
                    GuiltyChance = 0;
                }
                else if (GuiltyChance > 100)
                {
                    GuiltyChance = 100;
                }
                if (LSPDFRPlusHandler.rnd.Next(100) >= GuiltyChance && !ResultsPublishedNotificationShown)
                {
                    CourtVerdict = "Found not guilty and cleared of all charges.";
                }

                TabTextItem item = new TabTextItem(MenuLabel(false), "Court Result", MenuLabel(false) + "~s~. ~r~" + CrimeString + (Crime[Crime.Length - 1] == '.' ? "" : "~s~.")
                                                   + "~s~~n~ " + CourtVerdict + (CourtVerdict[CourtVerdict.Length - 1] == '.' ? "" : "~s~.")
                                                   + "~s~~n~ Offence took place on ~b~" + CrimeDate.ToShortDateString() + "~s~ at ~b~" + CrimeDate.ToShortTimeString()
                                                   + "~s~.~n~ Hearing was on ~b~" + ResultsPublishTime.ToShortDateString() + "~s~ at ~b~" + ResultsPublishTime.ToShortTimeString() + "."
                                                   + "~n~~n~~y~Select this case and press ~b~Delete ~y~to dismiss it.");

                Menus.PublishedResultsList.Items.Insert(0, item);
                Menus.PublishedResultsList.RefreshIndex();

                if (!ResultsMenuCleared)
                {
                    Game.LogTrivial("Emtpy items, clearing menu at index 1.");
                    Menus.PublishedResultsList.Items.RemoveAt(1);
                    ResultsMenuCleared = true;
                }
                ResultsPublished = true;
                if (!ResultsPublishedNotificationShown)
                {
                    if (CourtSystem.LoadingXMLFileCases)
                    {
                        GameFiber.StartNew(delegate
                        {
                            GameFiber.Wait(25000);
                            if (CourtSystem.OpenCourtMenuKey != Keys.None)
                            {
                                Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "~b~San Andreas Court", "~r~" + SuspectName, "A court case you're following has been heard. Press ~b~" + Albo1125.Common.CommonLibrary.ExtensionMethods.GetKeyString(CourtSystem.OpenCourtMenuKey, CourtSystem.OpenCourtMenuModifierKey) + ".");
                            }
                        });
                    }
                    else
                    {
                        if (CourtSystem.OpenCourtMenuKey != Keys.None)
                        {
                            Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "~b~San Andreas Court", "~r~" + SuspectName, "A court case you're following has been heard. Press ~b~" + Albo1125.Common.CommonLibrary.ExtensionMethods.GetKeyString(CourtSystem.OpenCourtMenuKey, CourtSystem.OpenCourtMenuModifierKey) + ".");
                        }
                    }
                    ResultsPublishedNotificationShown = true;
                    CourtSystem.OverwriteCourtCase(this);
                }
            }
        }