public static void writeHelp(OS os, int page = 0) { if (Helpfile.LoadedLanguage != Settings.ActiveLocale) { Helpfile.init(); } if (page == 0) { page = 1; } int num = (page - 1) * Helpfile.ITEMS_PER_PAGE; if (num >= Helpfile.help.Count) { num = 0; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(Helpfile.prefix.Replace("[PAGENUM]", string.Concat((object)page)).Replace("[TOTALPAGES]", string.Concat((object)Helpfile.getNumberOfPages())) + "\n"); for (int index = num; index < Helpfile.help.Count && index < num + Helpfile.ITEMS_PER_PAGE; ++index) { stringBuilder.Append((index == 0 ? " " : "") + Helpfile.help[index] + "\n \n "); } os.write(stringBuilder.ToString() + "\n" + Helpfile.postfix); }
protected override void Initialize() { sman = new ScreenManager(this); Components.Add(sman); graphics.PreferMultiSampling = true; NameGenerator.init(); Helpfile.init(); FileEntry.init(Content); PatternDrawer.init(Content); ProgramList.init(); Cube3D.Initilize(graphics.GraphicsDevice); base.Initialize(); }
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); }