Exemple #1
0
        private void DrawRecord(Rectangle bounds, SpriteBatch sb, DeathRowEntry entry)
        {
            bounds.X     += 2;
            bounds.Width -= 2;
            var flag = TextItem.DrawShadow;

            TextItem.DrawShadow = false;
            var height = 850;

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

            GuiData.spriteBatch.Draw(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, themeColor,
                                 num1 - 80, 45f);
            vector2_1.Y += 22f;
            if (Button.doButton(98102855, (int)vector2_1.X, (int)vector2_1.Y, bounds.Width / 2, 25, "Return",
                                Color.Black))
            {
                SelectedIndex = -1;
            }
            vector2_1.X  = 5f;
            vector2_1.Y += 55f;
            TextItem.doFontLabel(vector2_1, "RECORD " + entry.RecordNumber, GuiData.titlefont, Color.White, num1 - 4,
                                 60f);
            vector2_1.Y += 70f;
            var seperatorHeight = 18;
            var margin          = 12;
            var drawPos         = DrawCompactLabel("Name:", entry.LName + ", " + entry.FName, vector2_1, margin, seperatorHeight,
                                                   num1);
            var pos  = DrawCompactLabel("Age:", entry.Age, drawPos, margin, seperatorHeight, num1);
            var num2 = 20;
            var num3 = 20;
            var zero = Vector2.Zero;

            TextItem.doFontLabel(pos, "Incident Report:", GuiData.smallfont, themeColor, num1, float.MaxValue);
            pos.Y += num2;
            TextItem.DrawShadow = false;
            var vector2_2 = TextItem.doMeasuredSmallLabel(pos,
                                                          Utils.SmartTwimForWidth(entry.IncidentReport, num1, GuiData.smallfont), Color.White);

            pos.Y += Math.Max(vector2_2.Y, num2);
            pos.Y += num3;
            TextItem.doFontLabel(pos, "Final Statement:", GuiData.smallfont, themeColor, num1, float.MaxValue);
            pos.Y    += num2;
            vector2_2 = TextItem.doMeasuredSmallLabel(pos,
                                                      Utils.SmartTwimForWidth(entry.Statement, num1, GuiData.smallfont), Color.White);
            pos.Y += num3;
            recordScrollPosition = ScrollablePanel.endPanel(98302836, recordScrollPosition, bounds,
                                                            height - bounds.Height, true);
            TextItem.DrawShadow = flag;
        }
Exemple #2
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            var text = new string[records.files.Count];

            for (var index = 0; index < records.files.Count; ++index)
            {
                try
                {
                    text[index] =
                        records.files[index].name.Substring(0, records.files[index].name.IndexOf('['))
                        .Replace("_", ", ");
                }
                catch (Exception ex)
                {
                    text[index] = "UNKNOWN" + index;
                }
            }
            var width = bounds.Width / 3;
            var num   = SelectedIndex;

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

            bounds1.X     += width;
            bounds1.Width -= width + 1;
            if (SelectedIndex >= 0 && SelectedIndex < records.files.Count)
            {
                entry = ConvertStringToRecord(records.files[SelectedIndex].data);
            }
            if (entry.RecordNumber != null)
            {
                DrawRecord(bounds1, sb, entry);
            }
            else
            {
                DrawTitleScreen(bounds1, sb);
            }
        }
 private DeathRowEntry ConvertStringToRecord(string data)
 {
     var strArray = data.Split(new string[2]
     {
         "#\n",
         "#"
     }, StringSplitOptions.None);
     var deathRowEntry = new 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;
 }
Exemple #4
0
        private DeathRowEntry ConvertStringToRecord(string data)
        {
            var strArray = data.Split(new string[2]
            {
                "#\n",
                "#"
            }, StringSplitOptions.None);
            var deathRowEntry = new 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);
        }
 private void DrawRecord(Rectangle bounds, SpriteBatch sb, DeathRowEntry entry)
 {
     bounds.X += 2;
     bounds.Width -= 2;
     var flag = TextItem.DrawShadow;
     TextItem.DrawShadow = false;
     var height = 850;
     ScrollablePanel.beginPanel(98302836, new Rectangle(bounds.X, bounds.Y, bounds.Width, height),
         recordScrollPosition);
     var num1 = bounds.Width - 16;
     var vector2_1 = new Vector2(5f, 5f);
     GuiData.spriteBatch.Draw(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, themeColor,
         num1 - 80, 45f);
     vector2_1.Y += 22f;
     if (Button.doButton(98102855, (int) vector2_1.X, (int) vector2_1.Y, bounds.Width/2, 25, "Return",
         Color.Black))
         SelectedIndex = -1;
     vector2_1.X = 5f;
     vector2_1.Y += 55f;
     TextItem.doFontLabel(vector2_1, "RECORD " + entry.RecordNumber, GuiData.titlefont, Color.White, num1 - 4,
         60f);
     vector2_1.Y += 70f;
     var seperatorHeight = 18;
     var margin = 12;
     var drawPos = DrawCompactLabel("Name:", entry.LName + ", " + entry.FName, vector2_1, margin, seperatorHeight,
         num1);
     var pos = DrawCompactLabel("Age:", entry.Age, drawPos, margin, seperatorHeight, num1);
     var num2 = 20;
     var num3 = 20;
     var zero = Vector2.Zero;
     TextItem.doFontLabel(pos, "Incident Report:", GuiData.smallfont, themeColor, num1, float.MaxValue);
     pos.Y += num2;
     TextItem.DrawShadow = false;
     var vector2_2 = TextItem.doMeasuredSmallLabel(pos,
         Utils.SmartTwimForWidth(entry.IncidentReport, num1, GuiData.smallfont), Color.White);
     pos.Y += Math.Max(vector2_2.Y, num2);
     pos.Y += num3;
     TextItem.doFontLabel(pos, "Final Statement:", GuiData.smallfont, themeColor, num1, float.MaxValue);
     pos.Y += num2;
     vector2_2 = TextItem.doMeasuredSmallLabel(pos,
         Utils.SmartTwimForWidth(entry.Statement, num1, GuiData.smallfont), Color.White);
     pos.Y += num3;
     recordScrollPosition = ScrollablePanel.endPanel(98302836, recordScrollPosition, bounds,
         height - bounds.Height, true);
     TextItem.DrawShadow = flag;
 }
 public override void draw(Rectangle bounds, SpriteBatch sb)
 {
     base.draw(bounds, sb);
     var text = new string[records.files.Count];
     for (var index = 0; index < records.files.Count; ++index)
     {
         try
         {
             text[index] =
                 records.files[index].name.Substring(0, records.files[index].name.IndexOf('['))
                     .Replace("_", ", ");
         }
         catch (Exception ex)
         {
             text[index] = "UNKNOWN" + index;
         }
     }
     var width = bounds.Width/3;
     var num = SelectedIndex;
     SelectedIndex = SelectableTextList.doFancyList(832190831, bounds.X + 1, bounds.Y + 4, width,
         bounds.Height - 8, text, SelectedIndex, themeColor, true);
     if (SelectedIndex != num)
         recordScrollPosition = Vector2.Zero;
     sb.Draw(Utils.white, new Rectangle(bounds.X + width - 1, bounds.Y + 1, 2, bounds.Height - 2), themeColor);
     var entry = new DeathRowEntry();
     var bounds1 = bounds;
     bounds1.X += width;
     bounds1.Width -= width + 1;
     if (SelectedIndex >= 0 && SelectedIndex < records.files.Count)
         entry = ConvertStringToRecord(records.files[SelectedIndex].data);
     if (entry.RecordNumber != null)
         DrawRecord(bounds1, sb, entry);
     else
         DrawTitleScreen(bounds1, sb);
 }