Exemple #1
0
 private void Init(Computer c, OS os, string name, DatabaseDaemon.DatabasePermissions permissions, string DataTypeIdentifier, string Foldername, Color themeColor)
 {
     this.sideEffect         = new MovingBarsEffect();
     this.Permissions        = permissions;
     this.State              = DatabaseDaemon.DatabaseState.Welcome;
     this.DataTypeIdentifier = DataTypeIdentifier;
     this.DataType           = ObjectSerializer.GetTypeForName(DataTypeIdentifier);
     this.ScrollPanel        = new ScrollableSectionedPanel(26, GuiData.spriteBatch.GraphicsDevice);
     this.TextRegion         = new ScrollableTextRegion(GuiData.spriteBatch.GraphicsDevice);
     this.Foldername         = Foldername == null ? "Database" : Foldername;
     this.ThemeColor         = themeColor;
     if (DataTypeIdentifier.EndsWith("NeopalsAccount"))
     {
         this.WildcardAssets.Add((object)Neopal.PetType.Blundo, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Blundo"));
         this.WildcardAssets.Add((object)Neopal.PetType.Chisha, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Chisha"));
         this.WildcardAssets.Add((object)Neopal.PetType.Jubdub, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Jubdub"));
         this.WildcardAssets.Add((object)Neopal.PetType.Kachici, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Kachici"));
         this.WildcardAssets.Add((object)Neopal.PetType.Kyrill, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Kyrill"));
         this.WildcardAssets.Add((object)Neopal.PetType.Myncl, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Myncl"));
         this.WildcardAssets.Add((object)Neopal.PetType.Pageri, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Pageri"));
         this.WildcardAssets.Add((object)Neopal.PetType.Psybunny, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Psybunny"));
         this.WildcardAssets.Add((object)Neopal.PetType.Scorchum, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Scorchum"));
         this.WildcardAssets.Add((object)Neopal.PetType.Unisam, os.content.Load <Texture2D>("DLC/Sprites/Neopals/Unisam"));
     }
     this.PlaceholderSprite = os.content.Load <Texture2D>("Sprites/Chip");
     this.Triangle          = os.content.Load <Texture2D>("DLC/Sprites/Triangle");
 }
Exemple #2
0
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            PatternDrawer.draw(new Rectangle(bounds.X + 1, bounds.Y + 1, bounds.Width - 2, bounds.Height - 2), 0.28f, Color.Transparent, this.themeColor * 0.1f, sb, PatternDrawer.thinStripe);
            this.drawTopBar(bounds, sb);
            if (!this.hasSysfile())
            {
                if (Button.doButton(800003, bounds.X + 10, bounds.Y + this.topBar.Height + 10, 300, 30, LocaleTerms.Loc("Exit"), new Color?(this.themeColor)))
                {
                    this.os.display.command = "connect";
                }
                PatternDrawer.draw(new Rectangle(bounds.X + 1, bounds.Y + 1 + 64, bounds.Width - 2, bounds.Height - 2 - 64), 1f, Color.Transparent, this.os.lockedColor, sb, PatternDrawer.errorTile);
                int num1 = bounds.X + 20;
                int num2 = bounds.Y + bounds.Height / 2 - 20;
                TextItem.doLabel(new Vector2((float)num1, (float)num2), LocaleTerms.Loc("CRITICAL ERROR"), new Color?());
                int num3 = num2 + 40;
                TextItem.doSmallLabel(new Vector2((float)num1, (float)num3), "ERROR #4040408 - NULL_SYSFILE\nUnhandled Exception - IOException@L 2217 :R 28\nSystem Files Corrupted and/or Destroyed\nContact the System Administrator", new Color?());
            }
            else
            {
                switch (this.state)
                {
                case 0:
                    if (Button.doButton(800003, bounds.X + 10, bounds.Y + this.topBar.Height + 10, 300, 30, LocaleTerms.Loc("Exit"), new Color?(this.themeColor)))
                    {
                        this.os.display.command = "connect";
                    }
                    sb.Draw(this.logo, new Rectangle(bounds.X + 30, bounds.Y + 115, 128, 128), Color.White);
                    string text1 = string.IsNullOrWhiteSpace(this.listingTitle) ? string.Format(LocaleTerms.Loc("{0} Group"), (object)this.groupName) + "\n" + LocaleTerms.Loc("Message Board") : this.listingTitle;
                    TextItem.doFontLabel(new Vector2((float)(bounds.X + 40 + 128), (float)(bounds.Y + 115)), text1, GuiData.font, new Color?(), (float)(bounds.Width - 40), 60f, false);
                    if (!Button.doButton(800004, bounds.X + 30, bounds.Y + bounds.Height / 2, 300, 40, LocaleTerms.Loc("Login"), new Color?(this.themeColor)))
                    {
                        break;
                    }
                    this.startLogin();
                    this.state = 3;
                    break;

                case 1:
                    if (Button.doButton(800003, bounds.X + 10, bounds.Y + this.topBar.Height + 10, 300, 30, LocaleTerms.Loc("Exit"), new Color?(this.themeColor)))
                    {
                        this.os.display.command = "connect";
                    }
                    int num4 = bounds.X + 10;
                    int num5 = bounds.Y + this.topBar.Height + 50;
                    this.logoRect.X = num4;
                    this.logoRect.Y = num5;
                    sb.Draw(this.logo, this.logoRect, Color.White);
                    int x = num4 + (this.logoRect.Width + 5);
                    TextItem.doLabel(new Vector2((float)x, (float)num5), this.listingTitle, new Color?());
                    int y = num5 + 40;
                    for (int index = 0; index < this.missions.Count; ++index)
                    {
                        if (this.hasListingFile(this.missions[index].postingTitle))
                        {
                            Rectangle rectangle = new Rectangle(x, y, (int)((double)bounds.Width * 0.800000011920929), 30);
                            rectangle        = Utils.InsetRectangle(rectangle, 1);
                            rectangle.X     += 12;
                            rectangle.Width -= 12;
                            if (this.missions[index].postingTitle.StartsWith("#"))
                            {
                                PatternDrawer.draw(rectangle, 1f, Color.Black * 1f, Color.DarkRed * 0.3f, sb, PatternDrawer.warningStripe);
                            }
                            if (Button.doButton(87654 + index, x, y, (int)((double)bounds.Width * 0.800000011920929), 30, this.missions[index].postingTitle, new Color?()))
                            {
                                this.state       = 2;
                                this.targetIndex = index;
                            }
                            y += 35;
                        }
                    }
                    break;

                case 2:
                    if (Button.doButton(800003, bounds.X + 10, bounds.Y + this.topBar.Height + 10, 300, 30, LocaleTerms.Loc("Back"), new Color?(this.themeColor)))
                    {
                        this.state = 1;
                    }
                    int       num6 = 60;
                    int       num7 = 84;
                    Rectangle destinationRectangle = new Rectangle(bounds.X + 30, bounds.Y + this.topBar.Height + num6, num7, num7);
                    sb.Draw(this.logo, destinationRectangle, this.themeColor);
                    int num8 = num6 + 30;
                    TextItem.doFontLabel(new Vector2((float)(bounds.X + 34 + num7), (float)(bounds.Y + this.topBar.Height + num8)), this.missions[this.targetIndex].postingTitle, GuiData.font, new Color?(), (float)(bounds.Width - (36 + num7 + 6)), 40f, false);
                    int num9 = num8 + 40;
                    PatternDrawer.draw(new Rectangle(destinationRectangle.X + destinationRectangle.Width + 2, bounds.Y + this.topBar.Height + num9 - 8, bounds.Width - (destinationRectangle.X - bounds.X + destinationRectangle.Width + 10), PatternDrawer.warningStripe.Height / 2), 1f, Color.Transparent, this.themeColor, sb, PatternDrawer.warningStripe);
                    int    num10 = num9 + 36;
                    string text2 = Utils.SuperSmartTwimForWidth(this.missions[this.targetIndex].postingBody, bounds.Width - 60, GuiData.tinyfont);
                    if (this.TextRegion == null)
                    {
                        this.TextRegion = new ScrollableTextRegion(sb.GraphicsDevice);
                    }
                    this.TextRegion.Draw(new Rectangle(bounds.X + 30, bounds.Y + this.topBar.Height + num10, bounds.Width - 50, bounds.Height - num10 - this.topBar.Height - 10), text2, sb);
                    bool flag = this.os.currentFaction != null && this.os.currentFaction.idName.ToLower() == this.groupName.ToLower();
                    if (this.missionAssigner && this.os.currentMission == null && flag && Button.doButton(800005, bounds.X + bounds.Width / 2 - 10, bounds.Y + bounds.Height - 35, bounds.Width / 2, 30, LocaleTerms.Loc("Accept"), new Color?(this.os.highlightColor)))
                    {
                        this.os.currentMission = this.missions[this.targetIndex];
                        ActiveMission activeMission = (ActiveMission)ComputerLoader.readMission(this.missions[this.targetIndex].reloadGoalsSourceFile);
                        this.missions[this.targetIndex].sendEmail(this.os);
                        this.missions[this.targetIndex].ActivateSuppressedStartFunctionIfPresent();
                        this.removeMission(this.targetIndex);
                        this.state = 1;
                        break;
                    }
                    if (this.missionAssigner && this.os.currentMission != null)
                    {
                        if (this.os.currentMission.wasAutoGenerated && Button.doButton(8000105, bounds.X + 6, bounds.Y + bounds.Height - 29, 210, 25, LocaleTerms.Loc("Abandon Current Contract"), new Color?(this.os.lockedColor)))
                        {
                            this.os.currentMission = (ActiveMission)null;
                            this.os.currentFaction.contractAbbandoned((object)this.os);
                        }
                        TextItem.doFontLabel(new Vector2((float)(bounds.X + 10), (float)(bounds.Y + bounds.Height - 52)), LocaleTerms.Loc("Mission Unavailable") + " : " + (flag ? LocaleTerms.Loc("Complete Existing Contracts") : LocaleTerms.Loc("User ID Assigned to Different Faction") + " "), GuiData.smallfont, new Color?(), (float)(bounds.Width - 20), 30f, false);
                        break;
                    }
                    if (!this.missionAssigner || flag)
                    {
                        break;
                    }
                    TextItem.doFontLabel(new Vector2((float)(bounds.X + 10), (float)(bounds.Y + bounds.Height - 52)), LocaleTerms.Loc("Mission Unavailable") + " : " + LocaleTerms.Loc("User ID Assigned to Different Faction") + " ", GuiData.smallfont, new Color?(), (float)(bounds.Width - 20), 30f, false);
                    break;

                case 3:
                    this.doLoginDisplay(bounds, sb);
                    break;
                }
            }
        }
Exemple #3
0
 public MarkovTextDaemon(Computer c, OS os, string name, string corpusLoadPath)
     : base(c, name, os)
 {
     this.corpusFolderPath = corpusLoadPath;
     this.TextDisplay      = new ScrollableTextRegion(GuiData.spriteBatch.GraphicsDevice);
 }
Exemple #4
0
 public DisplayModule(Rectangle location, OS operatingSystem)
     : base(location, operatingSystem)
 {
     this.catTextRegion = new ScrollableTextRegion(GuiData.spriteBatch.GraphicsDevice);
 }