Exemple #1
0
        public static void EndDLCSection(object osobj)
        {
            OS os = (OS)osobj;

            os.IsInDLCMode        = false;
            os.mailicon.isEnabled = true;
            os.Flags.AddFlag("dlc_complete");
            if (os.Flags.HasFlag("dlc_start_csec"))
            {
                os.Flags.AddFlag("dlc_complete_FromCSEC");
                ComputerLoader.loadMission("Content/DLC/Missions/BaseGameConnectors/Missions/CSEC_DLC_EndEmail.xml", false);
                os.allFactions.setCurrentFaction("hub", os);
                os.homeNodeID        = "mainHub";
                os.homeAssetServerID = "mainHubAssets";
                os.Flags.AddFlag("dlc_csec_end_facval:" + (object)os.currentFaction.playerValue);
            }
            else if (os.Flags.HasFlag("dlc_start_entropy"))
            {
                os.Flags.AddFlag("dlc_complete_FromEntropy");
                ComputerLoader.loadMission("Content/DLC/Missions/BaseGameConnectors/Missions/Entropy_DLC_EndEmail.xml", false);
                os.allFactions.setCurrentFaction("entropy", os);
                os.homeNodeID        = "entropy00";
                os.homeAssetServerID = "entropy01";
            }
            else
            {
                os.Flags.AddFlag("dlc_complete_FromUnknown");
                ComputerLoader.loadMission("Content/DLC/Missions/BaseGameConnectors/Missions/Entropy_DLC_EndEmail.xml", false);
                os.allFactions.setCurrentFaction("entropy", os);
                os.homeNodeID        = "entropy00";
                os.homeAssetServerID = "entropy01";
            }
            DLC1SessionUpgrader.ReDsicoverAllVisibleNodesInOSCache((object)os);
        }
        public override void draw(Rectangle bounds, SpriteBatch sb)
        {
            base.draw(bounds, sb);
            bounds = Utils.InsetRectangle(bounds, 1);
            int num1    = 90;
            int height1 = 30;

            TextItem.doCenteredFontLabel(new Rectangle(bounds.X, bounds.Y + height1, bounds.Width, num1 - height1), this.OverrideTitle == null ? LocaleTerms.Loc("Labyrinths Project") : this.OverrideTitle, GuiData.font, Color.White, false);
            Rectangle rectangle = new Rectangle(bounds.X, bounds.Y + num1 + height1, bounds.Width, bounds.Height - (num1 + 2 * height1));

            if (this.showingCredits)
            {
                this.timeInCredits += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds;
                float timeInCredits = this.timeInCredits;
                float num2          = ((double)timeInCredits > 5.0 ? timeInCredits - 4f : Utils.CubicInCurve(timeInCredits / 5f)) % 165f;
                Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f);
                float num3 = 20f;
                float num4 = (float)(rectangle.Y - height1 + rectangle.Height) - num2 * num3;
                for (int index = 0; index < this.CreditsData.Length; ++index)
                {
                    int        height2 = 22;
                    SpriteFont font    = GuiData.smallfont;
                    Color      color   = Color.LightGray * 0.9f;
                    string     text    = this.CreditsData[index];
                    if (text.StartsWith("%"))
                    {
                        text    = text.Substring(1);
                        height2 = 45;
                        font    = GuiData.font;
                        color   = Utils.AddativeWhite * 0.9f;
                    }
                    else if (text.StartsWith("^"))
                    {
                        text    = text.Substring(1);
                        height2 = 30;
                        font    = GuiData.font;
                        color   = Color.White;
                    }
                    if ((double)num4 >= (double)(rectangle.Y - height1))
                    {
                        TextItem.doCenteredFontLabel(new Rectangle(rectangle.X, (int)num4, rectangle.Width, height2), text, font, color, false);
                    }
                    num4 += (float)(height2 + 2);
                    if ((double)num4 > (double)(rectangle.Y + rectangle.Height))
                    {
                        break;
                    }
                }
                if ((double)this.timeInCredits > 40.0 && Button.doButton(18394902, rectangle.X + rectangle.Width / 4, rectangle.Y + rectangle.Height - 23, rectangle.Width / 2, 20, LocaleTerms.Loc("Proceed"), new Color?((double)this.timeInCredits > 65.0 ? this.os.highlightColor : Color.Black)))
                {
                    this.os.display.command = "connect";
                }
            }
            else if (this.isInResetSequence)
            {
                this.timeInReset += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds;
                if ((double)this.timeInReset >= 5.0)
                {
                    this.showingCredits = true;
                    PostProcessor.EndingSequenceFlashOutActive             = false;
                    PostProcessor.EndingSequenceFlashOutPercentageComplete = 0.0f;
                    if (!Settings.IsInExtensionMode)
                    {
                        this.EndDLC();
                        if (!this.hasCuedFinaleSong)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait(2.0), (Action)(() => MusicManager.playSongImmediatley("DLC\\Music\\DreamHead")));
                            this.hasCuedFinaleSong = true;
                        }
                        MediaPlayer.IsRepeating = true;
                        for (int index = 0; index < 9; ++index)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait((double)index / 7.0), (Action)(() => SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeWhite * 0.8f, 400f)));
                        }
                    }
                }
                else
                {
                    float num2 = Math.Min(this.timeInReset, 1f);
                    Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f * num2);
                    PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile);
                    this.AddRadialMailLine();
                    PostProcessor.EndingSequenceFlashOutActive             = true;
                    PostProcessor.EndingSequenceFlashOutPercentageComplete = num2;
                    if (!this.hasCuedBuildup && (double)this.timeInReset > 2.8)
                    {
                        this.buildup.Play();
                        this.hasCuedBuildup = true;
                    }
                    TextItem.doCenteredFontLabel(rectangle, LocaleTerms.Loc("Disabling..."), GuiData.font, Color.White, false);
                }
            }
            else
            {
                PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile);
                string text = this.OverrideButtonText == null?LocaleTerms.Loc("Disable Agent Monitoring") : this.OverrideButtonText;

                bool flag = this.OverrideButtonText != null;
                if (Button.doButton(38101920, rectangle.X + 50, rectangle.Y + rectangle.Height / 2 - 13, rectangle.Width - 100, 26, text, new Color?(this.os.highlightColor)))
                {
                    if (!flag)
                    {
                        this.isInResetSequence = true;
                        this.timeInReset       = 0.0f;
                        if (MusicManager.currentSongName == "DLC/Music/RemiDrone")
                        {
                            MusicManager.stop();
                        }
                        this.spindownImpact.Play();
                        if (this.spindown != null)
                        {
                            this.os.delayer.Post(ActionDelayer.Wait(1.1), (Action)(() => this.spindown.Play()));
                        }
                        DLC1SessionUpgrader.ReDsicoverAllVisibleNodesInOSCache((object)this.os);
                    }
                    else
                    {
                        this.isInResetSequence = false;
                        this.showingCredits    = true;
                        if (this.ConditionalActionsToLoadOnButtonPress != null)
                        {
                            RunnableConditionalActions.LoadIntoOS(this.ConditionalActionsToLoadOnButtonPress, (object)this.os);
                        }
                    }
                }
            }
            Rectangle destinationRectangle = new Rectangle(bounds.X, bounds.Y + num1, bounds.Width, height1);

            sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray);
            destinationRectangle.Y = bounds.Y + num1 + height1 + rectangle.Height;
            sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray);
        }
 private void EndDLC()
 {
     DLC1SessionUpgrader.EndDLCSection((object)this.os);
 }
Exemple #4
0
        protected override void LoadContent()
        {
            if (!this.CanLoadContent)
            {
                return;
            }
            PortExploits.populate();
            this.sman.controllingPlayer = PlayerIndex.One;
            if (Settings.isConventionDemo)
            {
                this.setWindowPosition(new Vector2(200f, 200f));
            }
            this.LoadGraphicsContent();
            this.LoadRegenSafeContent();
            ContentManager content = this.Content;

            GuiData.font        = content.Load <SpriteFont>("Font23");
            GuiData.titlefont   = content.Load <SpriteFont>("Kremlin");
            GuiData.smallfont   = this.Content.Load <SpriteFont>("Font12");
            GuiData.UISmallfont = GuiData.smallfont;
            GuiData.tinyfont    = this.Content.Load <SpriteFont>("Font10");
            GuiData.UITinyfont  = this.Content.Load <SpriteFont>("Font10");
            GuiData.detailfont  = this.Content.Load <SpriteFont>("Font7");
            GuiData.spriteBatch = this.sman.SpriteBatch;
            GuiData.InitFontOptions(this.Content);
            GuiData.init(this.Window);
            DLC1SessionUpgrader.CheckForDLCFiles();
            VehicleInfo.init();
            WorldLocationLoader.init();
            ThemeManager.init(content);
            MissionGenerationParser.init();
            MissionGenerator.init(content);
            UsernameGenerator.init();
            MusicManager.init(content);
            SFX.init(content);
            OldSystemSaveFileManifest.Load();
            try
            {
                SaveFileManager.Init(true);
            }
            catch (UnauthorizedAccessException ex)
            {
                MainMenu.AccumErrors += " ---- WARNING ---\nHacknet cannot access the Save File Folder (Path Below) to read/write save files.\nNO PROGRESS WILL BE SAVED.\n";
                MainMenu.AccumErrors += "Check folder permissions, run Hacknet.exe as Administrator, and try again.\n";
                MainMenu.AccumErrors += "If Errors Persist, search for \"Hacknet Workaround\" for a steam forums thread with more options.\n";
                MainMenu.AccumErrors  = MainMenu.AccumErrors + ":: Error Details ::\n" + Utils.GenerateReportFromException((Exception)ex);
            }
            if (this.NeedsSettingsLocaleActivation)
            {
                if (!Settings.ForceEnglish)
                {
                    string forActiveLanguage = PlatformAPISettings.GetCodeForActiveLanguage(LocaleActivator.SupportedLanguages);
                    LocaleActivator.ActivateLocale(forActiveLanguage, this.Content);
                    Settings.ActiveLocale = forActiveLanguage;
                }
            }
            else if (SettingsLoader.didLoad && Settings.ActiveLocale != "en-us")
            {
                LocaleActivator.ActivateLocale(Settings.ActiveLocale, this.Content);
            }
            Helpfile.init();
            FileEntry.init(this.Content);
            this.HasLoadedContent = true;
            this.LoadInitialScreens();
            if (!WebRenderer.Enabled)
            {
                return;
            }
            XNAWebRenderer.XNAWR_Initialize("file:///nope.html", WebRenderer.textureUpdated, 512, 512);
            WebRenderer.setSize(512, 512);
        }