public static void WindowLayoutConsoleOptionsGUI(int windowID) { GUI.backgroundColor = backgroundColor; if (GUILayout.Button(back, GUILayout.MaxWidth(25))) { Switch(); } toolbarInt = GUILayout.Toolbar(toolbarInt, toolbarStrings); scrollView = GUILayout.BeginScrollView(scrollView); switch (toolbarInt) { case 0: CommandsGUI.OnGUI(); break; case 1: DebugLevelsGUI.OnGUI(); break; case 2: SettingsGUI.OnGUI(); break; } GUILayout.EndScrollView(); GUI.DragWindow(); }
void Start() { UnityEngine.Object.DontDestroyOnLoad(base.gameObject); Messages = new List <ConsoleMessage>(); EnterCommand("/info"); SettingsGUI.LoadPrefs(); SettingsGUI.ApplyChangesIfModified(); Visible = VisibleOnStart; }
private void Start() { fieldGUI = transform.GetComponent <FieldGUI>(); fieldUI = transform.GetComponent <FieldUI>(); fieldContainer = transform.GetComponent <FieldContainer>(); fieldContainerUI = transform.GetComponent <FieldContainerUI>(); settingsGUI = transform.GetComponent <SettingsGUI>(); panel = transform.GetComponent <Panel>(); isingAlgorithm = transform.GetComponent <IsingAlgorithm>(); }
private void InitUncensorConfigs <T>(string sex, string part, Dictionary <string, T> uncensorDictionary, string[] defaultChoices, int order, out ConfigEntry <string> defaultConf, out ConfigEntry <string> excludeConf) where T : IUncensorData { byte sexValue = (byte)(sex == "Male" ? 0 : 1); if (!RandomExcludedSets.TryGetValue(sexValue, out var sexExcluded)) { sexExcluded = RandomExcludedSets[sexValue] = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase); } if (!sexExcluded.TryGetValue(part, out var partExcluded)) { partExcluded = sexExcluded[part] = new HashSet <string>(StringComparer.OrdinalIgnoreCase); } var defaultDescAttrs = new ConfigurationManagerAttributes { Order = order }; var defaultDesc = new ConfigDescription($"{part} to use if the character does not have one set. The {(part == "Body" ? "censored" : "mosaic")} {part.ToLower()} will not be selected randomly if there are any alternatives.", new AcceptableValueList <string>(defaultChoices), defaultDescAttrs); defaultConf = Config.Bind("Config", $"Default {sex} {part}", "Random", defaultDesc); var settingsGUI = new SettingsGUI <T>(uncensorDictionary, sexValue, part); SettingsGUIs.Add(settingsGUI); var excludedDescAttrs = new ConfigurationManagerAttributes { HideDefaultButton = true, CustomDrawer = settingsGUI.DrawSettingsGUI, Order = order }; var excludedDesc = new ConfigDescription($"{part} uncensors to exclude from random selection for {sex.ToLower()}s", null, excludedDescAttrs); excludeConf = Config.Bind("Random Excluded", $"{sex} {part}", string.Empty, excludedDesc); //Apply initial config file value now UpdateGuidSet(excludeConf.Value, partExcluded); //Update on change excludeConf.SettingChanged += (s, a) => { if (!(a is SettingChangedEventArgs args) || !(args.ChangedSetting is ConfigEntry <string> conf)) { Logger.LogError("Unexpected error, unable to handle changed settings."); return; } UpdateGuidSet(conf.Value, partExcluded); }; }
protected override bool DrawUniqueDetectorProperties() { var detector = self; if (detector == null) { return(false); } DrawHeader("Specific settings"); if (PropertyFieldChanged(checkRigidbody, new GUIContent("Rigidbody"))) { detector.CheckRigidbody = checkRigidbody.boolValue; } if (PropertyFieldChanged(checkController, new GUIContent("Character Controller"))) { detector.CheckController = checkController.boolValue; } if (PropertyFieldChanged(checkWireframe, new GUIContent("Wireframe"))) { detector.CheckWireframe = checkWireframe.boolValue; } EditorGUI.indentLevel++; EditorGUILayout.PropertyField(wireframeDelay, new GUIContent("Delay")); EditorGUI.indentLevel--; if (PropertyFieldChanged(checkRaycast, new GUIContent("Raycast"))) { detector.CheckRaycast = checkRaycast.boolValue; } EditorGUI.indentLevel++; EditorGUILayout.PropertyField(raycastDelay, new GUIContent("Delay")); EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUILayout.PropertyField(spawnPosition); if (Vector3.Distance(spawnPosition.vector3Value, Vector3.zero) <= 0.001f) { EditorGUILayout.HelpBox("Please consider placing spawn position as far from your moving objects as possible to avoid false positives", MessageType.Warning); EditorGUILayout.Space(); } EditorGUILayout.PropertyField(maxFalsePositives); EditorGUILayout.Separator(); if (checkWireframe.boolValue && !SettingsGUI.IsWallhackDetectorShaderIncluded()) { using (GUITools.Vertical(GUITools.PanelWithBackground)) { EditorGUILayout.Separator(); EditorGUILayout.HelpBox("Wallhack Detector shader for Wireframe checks is not included into the build! Detector may work incorrectly", MessageType.Error, true); if (GUILayout.Button("Include in Settings...")) { ACTkSettings.Show(); } EditorGUILayout.Separator(); } } if (checkRaycast.boolValue || checkController.boolValue || checkRigidbody.boolValue) { var layerId = LayerMask.NameToLayer("Ignore Raycast"); if (Physics.GetIgnoreLayerCollision(layerId, layerId)) { EditorGUILayout.LabelField("IgnoreRaycast physics layer should collide with itself to avoid false positives! See readme's troubleshooting section for details.", EditorStyles.wordWrappedLabel); if (GUILayout.Button("Edit in Physics settings")) { EditorApplication.ExecuteMenuItem("Edit/Project Settings/Physics"); } } } return(true); }
private static void OnHierarchyChanged() { if (!injectionValidated && !ACTkSettings.Instance.DisableInjectionDetectorValidation) { var instance = InjectionDetector.Instance; if (instance != null) { if (InjectionRoutines.IsInjectionPossible()) { if (!ACTkSettings.Instance.InjectionDetectorEnabled) { var result = EditorUtility.DisplayDialogComplex("Anti-Cheat Toolkit Validation", "ACTk noticed you're using Injection Detector but you have build detection support disabled.\n" + "Injection Detector needs it enabled in order to work properly.\nWould you like to enable it now?", "Yes", "Open Settings", "No, never ask again"); if (result == 0) { ACTkSettings.Instance.InjectionDetectorEnabled = true; } else if (result == 1) { ACTkSettings.Show(); return; } else { ACTkSettings.Instance.DisableInjectionDetectorValidation = true; } } } } injectionValidated = true; } if (!wallhackValidated && !ACTkSettings.Instance.DisableWallhackDetectorValidation) { var instance = WallHackDetector.Instance; if (instance != null && instance.CheckWireframe) { if (!SettingsGUI.IsWallhackDetectorShaderIncluded()) { var result = EditorUtility.DisplayDialog("Anti-Cheat Toolkit Validation", "ACTk noticed you're using Wallhack Detector with Wireframe option enabled but you have no required shader added" + " to the Always Included Shaders.\n" + "Would you like to exit Play Mode and open Settings to include it now?", "Yes", "No, never ask again"); if (result) { EditorApplication.isPlaying = false; ACTkSettings.Show(); } else { ACTkSettings.Instance.DisableWallhackDetectorValidation = true; } } } wallhackValidated = true; } }