private IEnumerator Load() { string profile = ""; Info.text = "Loading configuration..."; using (ConfigFile file = new ConfigFile(Application.dataPath + "/Configuration/Settings.ini", ' ', false)) { file.Load(); file.AutoSave = false; string[] res = file.GetString("resolution").Split('x'); int width = Convert.ToInt32(res[0]); int height = Convert.ToInt32(res[1]); Screen.SetResolution(width, height, file.GetBool("fullscreen")); profile = file.GetString("profile"); int fps = file.GetInt("fps"); Application.targetFrameRate = fps >= 30 ? fps : -1; QualitySettings.SetQualityLevel(file.GetInt("graphics"), true); Localization.Language.SetLanguage(file.GetString("language")); Configuration.Settings.Load(); Configuration.VideoSettings.Apply(); } yield return(new WaitForSeconds(0.5f)); Info.text = "Loading RCAssets..."; yield return(StartCoroutine(RC.RCManager.DownloadAssets())); Optimization.Caching.Pool.Create(); yield return(new WaitForSeconds(0.5f)); Info.text = $"Loading profile({profile}).."; User.LoadProfile(profile); Localization.Language.UpdateFormats(); Localization.Locale loc = new Localization.Locale("GUI", true); GUI.LabelEnabled = loc["enabled"]; GUI.LabelDisabled = loc["disabled"]; yield return(new WaitForSeconds(0.5f)); Info.text = "Loading visuals.."; Style.Load(); Style.ResetScreenParameters(); UIManager.UpdateGUIScaling(); Optimization.Labels.Font = Style.Font; yield return(new WaitForSeconds(0.5f)); Info.text = "Enjoy!"; Optimization.Labels.VERSION = string.Format(UIMainReferences.VersionShow, AnarchyManager.AnarchyVersion.ToString()); textUpdate = false; Loading.text = "Loading complete"; yield return(new WaitForSeconds(2f)); Destroy(gameObject); AnarchyManager.Background.Enable(); }
private void DrawAnarchyPage() { rect.Reset(); rect.MoveY(); ModPage = SelectionGrid(rect, ModPage, ModLabels, ModLabels.Length, true); SmartRect[] rects = Helper.GetSmartRects(pagePosition, 2); switch (ModPage) { case AnarchyMain: { //Left column LabelCenter(rects[0], locale["anarchyMainDesc"], true); ToggleButton(rects[0], Settings.HideName, locale["hideOwnName"], true); ToggleButton(rects[0], Settings.RemoveColors, locale["noColorNames"], true); ToggleButton(rects[0], Settings.DisableHookArrrows, locale["hideCrosshairArrows"], true); ToggleButton(rects[0], Settings.BombTimerOnCrosshair, locale["bombCdCrosshair"], true); ToggleButton(rects[0], Settings.RacingTimerOnCrosshair, locale["racingStartCrosshair"], true); //Right column LabelCenter(rects[1], locale["lblAbuse"], true); ToggleButton(rects[1], Settings.BodyLeanEnabled, locale["bodylean"], true); ToggleButton(rects[1], Settings.InfiniteGasPvp, locale["infGasPvp"], true); } break; case AnarchyStyle: //TODO: Create separated Style panel LabelCenter(rects[0], locale["windowOffset"], true); HorizontalSlider(rects[0], UIManager.LabelScale, locale.Format("labelScale", (UIManager.LabelScale.Value * 100f).ToString("F0")), 0.75f, 1.5f, Style.LabelOffsetSlider, true); ToggleButton(rects[0], UIManager.HUDAutoScaleGUI, locale["guiAutoScale"], true); if (UIManager.HUDAutoScaleGUI.Value) { HorizontalSlider(rects[0], UIManager.HUDScaleGUI, locale.Format("hudScale", (UIManager.HUDScaleGUI.Value * 100f).ToString("F0")), 0.75f, 1.5f, Style.LabelOffsetSlider, true); } else { Label(rects[0], locale["guiScaleWarning"], true); Label(rects[0], locale["guiScaleWarning1"], true); TextField(rects[0], StyleSettings.FontSize, locale["fontSize"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.WindowWidth, locale["windowWidth"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.WindowHeight, locale["windowHeight"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.Height, locale["height"], Style.BigLabelOffset, true); LabelCenter(rects[0], string.Empty, true); TextField(rects[0], StyleSettings.WindowBottomOffset, locale["windowBottomOffset"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.WindowSideOffset, locale["windowSideOffset"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.WindowTopOffset, locale["windowTopOffset"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.LabelOffset, locale["labelOffset"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.LabelOffsetSlider, locale["labelOffsetSlider"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.BigLabelOffset, locale["bigLabelOffset"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.HorizontalMargin, locale["horizontalMargin"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.VerticalMargin, locale["verticalMargin"], Style.BigLabelOffset, true); TextField(rects[0], StyleSettings.LabelSpace, locale["labelSpace"], Style.BigLabelOffset, true); } LabelCenter(rects[1], locale["styleColors"], true); DropdownMenuScrollable(this, rects[1], StyleSettings.FontSelection, AnarchyAssets.FontNames, locale["fontName"], Style.LabelOffset, 6, true); Style.PublicSettings[1] = TextField(rects[1], Style.PublicSettings[1], locale["background"], Style.LabelOffset, true); HorizontalSlider(rects[1], StyleSettings.BackgroundTransparency, locale.Format("backgroundTransparency", StyleSettings.BackgroundTransparency.Value.ToString("F0")), 32f, 255f, Style.LabelOffsetSlider, true); Style.BackgroundTransparency = System.Convert.ToInt32(StyleSettings.BackgroundTransparency.Value); Style.PublicSettings[2] = Style.BackgroundTransparency.ToString(); rects[1].MoveY(); Style.PublicSettings[3] = TextField(rects[1], Style.PublicSettings[3], locale["text"] + " " + locale["normal"], Style.LabelOffset, true); Style.PublicSettings[4] = TextField(rects[1], Style.PublicSettings[4], locale["text"] + " " + locale["hover"], Style.LabelOffset, true); Style.PublicSettings[5] = TextField(rects[1], Style.PublicSettings[5], locale["text"] + " " + locale["active"], Style.LabelOffset, true); Style.PublicSettings[6] = TextField(rects[1], Style.PublicSettings[6], locale["text"] + " " + locale["onNormal"], Style.LabelOffset, true); Style.PublicSettings[7] = TextField(rects[1], Style.PublicSettings[7], locale["text"] + " " + locale["onHover"], Style.LabelOffset, true); Style.PublicSettings[8] = TextField(rects[1], Style.PublicSettings[8], locale["text"] + " " + locale["onActive"], Style.LabelOffset, true); rects[1].MoveY(); //Label(rects[1], "", true); Style.UseVectors = ToggleButton(rects[1], Style.UseVectors, locale["useVectors"], true); Style.PublicSettings[9] = Style.UseVectors.ToString(); if (Style.UseVectors) { Style.PublicSettings[10] = TextField(rects[1], Style.PublicSettings[10], locale["vector"] + " " + locale["normal"], Style.LabelOffset, true); Style.PublicSettings[11] = TextField(rects[1], Style.PublicSettings[11], locale["vector"] + " " + locale["hover"], Style.LabelOffset, true); Style.PublicSettings[12] = TextField(rects[1], Style.PublicSettings[12], locale["vector"] + " " + locale["active"], Style.LabelOffset, true); Style.PublicSettings[13] = TextField(rects[1], Style.PublicSettings[13], locale["vector"] + " " + locale["onNormal"], Style.LabelOffset, true); Style.PublicSettings[14] = TextField(rects[1], Style.PublicSettings[14], locale["vector"] + " " + locale["onHover"], Style.LabelOffset, true); Style.PublicSettings[15] = TextField(rects[1], Style.PublicSettings[15], locale["vector"] + " " + locale["onActive"], Style.LabelOffset, true); } else { Style.PublicSettings[16] = TextField(rects[1], Style.PublicSettings[16], locale["color"] + " " + locale["normal"], Style.LabelOffset, true); Style.PublicSettings[17] = TextField(rects[1], Style.PublicSettings[17], locale["color"] + " " + locale["hover"], Style.LabelOffset, true); Style.PublicSettings[18] = TextField(rects[1], Style.PublicSettings[18], locale["color"] + " " + locale["active"], Style.LabelOffset, true); Style.PublicSettings[19] = TextField(rects[1], Style.PublicSettings[19], locale["color"] + " " + locale["onNormal"], Style.LabelOffset, true); Style.PublicSettings[20] = TextField(rects[1], Style.PublicSettings[20], locale["color"] + " " + locale["onHover"], Style.LabelOffset, true); Style.PublicSettings[21] = TextField(rects[1], Style.PublicSettings[21], locale["color"] + " " + locale["onActive"], Style.LabelOffset, true); } var left = rects[0]; left.MoveToEndY(WindowPosition, Style.Height); left.width = Style.LabelOffsetSlider; if (Button(left, "Apply changes")) { Style.PublicSettings[0] = AnarchyAssets.FontNames[StyleSettings.FontSelection.Value]; UIManager.HUDScaleGUI.Value = (float)System.Math.Round(UIManager.HUDScaleGUI.Value, 2); Style.Save(); Style.Load(); Style.Initialize(); UIManager.UpdateGUIScaling(); wasClosedByUpdate = true; } break; case AnarchyNameAnimation: LabelCenter(rects[0], "<b><color=red>NOT IMPLEMENTED YET</color></b>"); break; case AnarchyChatAndConsole: LabelCenter(rects[0], locale["chat"], true); ToggleButton(rects[0], Chat.UseBackground, locale["chatBack"], true); if (Chat.UseBackground.Value) { HorizontalSlider(rects[0], Chat.BackgroundTransparency, Style.LabelSpace + locale.Format("chatBackVal", Chat.BackgroundTransparency.Value.ToString("F2")), Style.LabelOffsetSlider, true); } TextField(rects[0], Chat.MessageCount, locale["chatCount"], Style.BigLabelOffset, true); TextField(rects[0], Chat.FontSize, locale["chatSize"], Style.BigLabelOffset, true); TextField(rects[0], Chat.ChatWidth, locale["chatWidth"], Style.BigLabelOffset, true); ToggleButton(rects[0], Chat.UseCustomChatSpace, locale["chatUseCustomSpace"], true); if (Chat.UseCustomChatSpace.Value) { TextField(rects[0], Chat.CustomChatSpaceUp, Style.LabelSpace + locale["chatSpaceUp"], Style.BigLabelOffset, true); TextField(rects[0], Chat.CustomChatSpaceDown, Style.LabelSpace + locale["chatSpaceDown"], Style.BigLabelOffset, true); TextField(rects[0], Chat.CustomChatSpaceLeft, Style.LabelSpace + locale["chatSpaceLeft"], Style.BigLabelOffset, true); TextField(rects[0], Chat.CustomChatSpaceRight, Style.LabelSpace + locale["chatSpaceRight"], Style.BigLabelOffset, true); } LabelCenter(rects[1], locale["console"], true); ToggleButton(rects[1], Log.UseBackground, locale["consoleBack"], true); if (Log.UseBackground.Value) { HorizontalSlider(rects[1], Log.BackgroundTransparency, Style.LabelSpace + locale.Format("consoleBackVal", Log.BackgroundTransparency.Value.ToString("F2")), Style.LabelOffsetSlider, true); } TextField(rects[1], Log.MessageCount, locale["consoleCount"], Style.BigLabelOffset, true); TextField(rects[1], Log.FontSize, locale["consoleSize"], Style.BigLabelOffset, true); TextField(rects[1], Log.LogWidth, locale["consoleWidth"], Style.BigLabelOffset, true); ToggleButton(rects[1], Log.UseCustomLogSpace, locale["consoleUseCustomSpace"], true); if (Log.UseCustomLogSpace.Value) { TextField(rects[1], Log.CustomLogSpaceUp, Style.LabelSpace + locale["consoleSpaceUp"], Style.BigLabelOffset, true); TextField(rects[1], Log.CustomLogSpaceDown, Style.LabelSpace + locale["consoleSpaceDown"], Style.BigLabelOffset, true); TextField(rects[1], Log.CustomLogSpaceLeft, Style.LabelSpace + locale["consoleSpaceLeft"], Style.BigLabelOffset, true); TextField(rects[1], Log.CustomLogSpaceRight, Style.LabelSpace + locale["consoleSpaceRight"], Style.BigLabelOffset, true); } break; } }