Ejemplo n.º 1
0
        private void DrawRecord(Rectangle bounds, SpriteBatch sb, DeathRowDatabaseDaemon.DeathRowEntry entry)
        {
            bounds.X     += 2;
            bounds.Width -= 2;
            bool drawShadow = TextItem.DrawShadow;

            TextItem.DrawShadow = false;
            int height = 850;

            ScrollablePanel.beginPanel(98302836, new Rectangle(bounds.X, bounds.Y, bounds.Width, height), this.recordScrollPosition);
            int     num1      = bounds.Width - 16;
            Vector2 vector2_1 = new Vector2(5f, 5f);

            GuiData.spriteBatch.Draw(DeathRowDatabaseDaemon.Logo, new Rectangle((int)vector2_1.X, (int)vector2_1.Y, 60, 60), Color.White);
            vector2_1.X += 70f;
            TextItem.doFontLabel(vector2_1, "DEATH ROW : EXECUTED OFFENDERS LISTING", GuiData.titlefont, new Color?(this.themeColor), (float)(num1 - 80), 45f, false);
            vector2_1.Y += 22f;
            if (Button.doButton(98102855, (int)vector2_1.X, (int)vector2_1.Y, bounds.Width / 2, 25, "Return", new Color?(Color.Black)))
            {
                this.SelectedIndex = -1;
            }
            vector2_1.X  = 5f;
            vector2_1.Y += 55f;
            TextItem.doFontLabel(vector2_1, "RECORD " + entry.RecordNumber, GuiData.titlefont, new Color?(Color.White), (float)(num1 - 4), 60f, false);
            vector2_1.Y += 70f;
            int seperatorHeight = 18;
            int margin          = 12;

            vector2_1 = this.DrawCompactLabel(LocaleTerms.Loc("Name") + ":", entry.LName + ", " + entry.FName, vector2_1, margin, seperatorHeight, num1);
            vector2_1 = this.DrawCompactLabel(LocaleTerms.Loc("Age") + ":", entry.Age, vector2_1, margin, seperatorHeight, num1);
            int     num2      = 20;
            int     num3      = 20;
            Vector2 vector2_2 = Vector2.Zero;

            TextItem.doFontLabel(vector2_1, LocaleTerms.Loc("Incident Report") + ":", GuiData.smallfont, new Color?(this.themeColor), (float)num1, float.MaxValue, false);
            vector2_1.Y        += (float)num2;
            TextItem.DrawShadow = false;
            Vector2 vector2_3 = TextItem.doMeasuredSmallLabel(vector2_1, Utils.SmartTwimForWidth(entry.IncidentReport, num1, GuiData.smallfont), new Color?(Color.White));

            vector2_1.Y += Math.Max(vector2_3.Y, (float)num2);
            vector2_1.Y += (float)num3;
            TextItem.doFontLabel(vector2_1, LocaleTerms.Loc("Final Statement") + ":", GuiData.smallfont, new Color?(this.themeColor), (float)num1, float.MaxValue, false);
            vector2_1.Y += (float)num2;
            vector2_2    = TextItem.doMeasuredSmallLabel(vector2_1, Utils.SmartTwimForWidth(entry.Statement, num1, GuiData.smallfont), new Color?(Color.White));
            vector2_1.Y += (float)num3;
            this.recordScrollPosition = ScrollablePanel.endPanel(98302836, this.recordScrollPosition, bounds, (float)(height - bounds.Height), true);
            TextItem.DrawShadow       = drawShadow;
        }
Ejemplo n.º 2
0
        private string ConvertFilesToOutput()
        {
            string str1 = "\r\n###%%##%%##%%##\r\n";
            string str2 = "#";
            string str3 = "";

            this.records.files.Sort((Comparison <FileEntry>)((f1, f2) => string.Compare(f1.name, f2.name)));
            for (int index = 0; index < this.records.files.Count; ++index)
            {
                DeathRowDatabaseDaemon.DeathRowEntry record = this.ConvertStringToRecord(this.records.files[index].data);
                if (record.RecordNumber != null)
                {
                    string str4 = record.FName + str2 + record.LName + str2 + record.RecordNumber + str2 + record.Age + str2 + record.Date + str2 + record.Country + str2 + record.PriorRecord + str2 + record.IncidentReport + str2 + record.Statement + str1;
                    str3 += str4;
                }
            }
            return(str3);
        }
Ejemplo n.º 3
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            string[] text = new string[this.records.files.Count];
            for (int index = 0; index < this.records.files.Count; ++index)
            {
                try
                {
                    text[index] = this.records.files[index].name.Substring(0, this.records.files[index].name.IndexOf('[')).Replace("_", ", ");
                }
                catch (Exception ex)
                {
                    text[index] = "UNKNOWN" + (object)index;
                }
            }
            int width         = bounds.Width / 3;
            int selectedIndex = this.SelectedIndex;

            this.SelectedIndex = SelectableTextList.doFancyList(832190831, bounds.X + 1, bounds.Y + 4, width, bounds.Height - 8, text, this.SelectedIndex, new Color?(this.themeColor), true);
            if (this.SelectedIndex != selectedIndex)
            {
                this.recordScrollPosition = Vector2.Zero;
            }
            sb.Draw(Utils.white, new Rectangle(bounds.X + width - 1, bounds.Y + 1, 2, bounds.Height - 2), this.themeColor);
            DeathRowDatabaseDaemon.DeathRowEntry entry = new DeathRowDatabaseDaemon.DeathRowEntry();
            Rectangle bounds1 = bounds;

            bounds1.X     += width;
            bounds1.Width -= width + 1;
            if (this.SelectedIndex >= 0 && this.SelectedIndex < this.records.files.Count)
            {
                entry = this.ConvertStringToRecord(this.records.files[this.SelectedIndex].data);
            }
            if (entry.RecordNumber != null)
            {
                this.DrawRecord(bounds1, sb, entry);
            }
            else
            {
                this.DrawTitleScreen(bounds1, sb);
            }
        }
Ejemplo n.º 4
0
 private DeathRowDatabaseDaemon.DeathRowEntry ConvertStringToRecord(string data)
 {
     string[] strArray = data.Split(new string[2] {
         "#\n", "#"
     }, StringSplitOptions.None);
     DeathRowDatabaseDaemon.DeathRowEntry deathRowEntry = new DeathRowDatabaseDaemon.DeathRowEntry();
     if (strArray.Length >= 9)
     {
         deathRowEntry.FName          = strArray[0];
         deathRowEntry.LName          = strArray[1];
         deathRowEntry.RecordNumber   = strArray[2];
         deathRowEntry.Age            = strArray[3];
         deathRowEntry.Date           = strArray[4];
         deathRowEntry.Country        = strArray[5];
         deathRowEntry.PriorRecord    = strArray[6];
         deathRowEntry.IncidentReport = strArray[7];
         deathRowEntry.Statement      = strArray[8];
     }
     return(deathRowEntry);
 }
Ejemplo n.º 5
0
        private void LoadRecords(string data = null)
        {
            string str1 = Utils.readEntireFile("Content/Post/DeathRow.txt");

            if (data != null)
            {
                str1 = data;
            }
            string str2 = Utils.readEntireFile("Content/Post/DeathRowSpecials.txt");

            string[] strArray = (str1 + str2).Split(new string[1] {
                "\r\n###%%##%%##%%##\r\n"
            }, StringSplitOptions.RemoveEmptyEntries);
            for (int index = 0; index < strArray.Length; ++index)
            {
                DeathRowDatabaseDaemon.DeathRowEntry record = this.ConvertStringToRecord(strArray[index]);
                if (record.FName != null)
                {
                    string nameEntry = record.LName + "_" + record.FName + "[" + record.RecordNumber + "]";
                    this.records.files.Add(new FileEntry(strArray[index].Replace("#", "#\n"), nameEntry));
                }
            }
            this.records.files.Sort((Comparison <FileEntry>)((f1, f2) => string.Compare(f1.name, f2.name)));
        }
Ejemplo n.º 6
0
        public DeathRowDatabaseDaemon.DeathRowEntry GetRecordForName(string fName, string lName)
        {
            string str = lName + "_" + fName;

            for (int index = 0; index < this.records.files.Count; ++index)
            {
                if (this.records.files[index].name.StartsWith(str))
                {
                    return(this.ConvertStringToRecord(this.records.files[index].data));
                }
                try
                {
                    DeathRowDatabaseDaemon.DeathRowEntry record = this.ConvertStringToRecord(this.records.files[index].data);
                    if (record.FName.ToLower() == fName.ToLower() && record.LName.ToLower() == lName.ToLower())
                    {
                        return(record);
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(new DeathRowDatabaseDaemon.DeathRowEntry());
        }