void CommandGUI() { directEditCommString = ReplayGUI.ToggleField(directEditCommString, "Direct Edit Command String", 2, 1); if (directEditCommString) { bool bak = GUI.enabled; GUI.enabled &= !lockSelect; selectClause = ReplayGUI.BigTextField(selectClause, "SELECT", 4, 1); GUI.enabled = bak; lockSelect = ReplayGUI.ToggleField(lockSelect, lockSelect ? "unlock" : "lock", 1, 2); fromClause = ReplayGUI.BigTextField(fromClause, "FROM", 4, 1); whereClause = ReplayGUI.BigTextField(whereClause, "WHERE", 4, 1); otherClauses = ReplayGUI.BigTextField(otherClauses, "misc", 4, 1); } else { ReplayGUI.Label("I haven't setup indirect command editing yet", 3, 1); } }
private void ConnectionGUI() { bool before = directEditConnString; directEditConnString = ReplayGUI.ToggleField(directEditConnString, "Direct Edit Connection String", 2, 1); if (before && !directEditConnString) { ParseConnString(ConnectionString); } if (directEditConnString) { ConnectionString = ReplayGUI.BigTextField(ConnectionString, "Connection", 4, 1); } else { server = ReplayGUI.TextField(server, "Server Name", 2, 1); portNum = ReplayGUI.TextField(portNum, "Port Number", 2, 1); database = ReplayGUI.TextField(database, "Database Name", 2, 1); userID = ReplayGUI.TextField(userID, "User ID", 2, 1); //The password for the DB if (!showPassword) { password = ReplayGUI.PasswordField(password, "Password", 2, 1); } else { password = ReplayGUI.TextField(password, "Password", 2, 1); } showPassword = ReplayGUI.ToggleField(showPassword, showPassword ? "hide password" : "show password", 1, 4); ConnectionString = System.String.Format("Server={0};Port={1};Database={2};Uid={3};password={4}", server, portNum, database, userID, password); } }
void StandardOptions() { // GUILayout.BeginArea(mainOptionsRect); scrollPosition = GUILayout.BeginScrollView(scrollPosition); GUILayout.BeginVertical(); Application.targetFrameRate = ReplayGUI.IntField(Application.targetFrameRate, "Target Frame Rate", "Set the Application.targetFrameRate, may help improve parity between the replay result and the original recorded data. A value of -1 runs at full speed."); Application.runInBackground = ReplayGUI.ToggleField(Application.runInBackground, "Run Unity in Background", "If checked Unity will continue to run if the editor loses focus.", 2); rae.ExitOnDone = ToggleField(rae.ExitOnDone, "Exit play mode when done", "The RAE will automatically exit playmode when the log reader has run out of logs.", 2); rae.stopCondition = EnumField <ReplayAnalysisEngine.StoppingCondition>(rae.stopCondition, "Stopping Mode", "Controls the conditions that RAE will use to decide when to stop action simulation before running the interpreter."); switch (rae.stopCondition) { case ReplayAnalysisEngine.StoppingCondition.Instant: break; case ReplayAnalysisEngine.StoppingCondition.WaitForStop: case ReplayAnalysisEngine.StoppingCondition.TimeOut: case ReplayAnalysisEngine.StoppingCondition.Simulate: case ReplayAnalysisEngine.StoppingCondition.Custom: rae.TimeAcceleration = ReplayGUI.FloatField(rae.TimeAcceleration, "Time Acceleration", "The multiplier applied to Unity's Time.timescale when running an action.", 1); rae.TimeOut = ReplayGUI.FloatField(rae.TimeOut, "Time Out", "The number of scaled seconds to wait before forcing the RAE to advance to the next action.", 1); break; } //rae.ReplayMode = ReplayGUI.EnumField<ReplayAnalysisEngine.IterationMode>(rae.ReplayMode, "Iteration Mode:", "Whether to iterate action-by-action or only the final action in any attempt."); rae.PauseAfter = ReplayGUI.IntField((int)rae.PauseAfter, "Pause After N Actions", "The RAE will pause itself after every N actions. A value of <= 0 will never pause."); rae.runReportPath = ReplayGUI.TextField(rae.runReportPath, "Report Directory", "The path where the run report of this replay run will be saved."); rae.ScreenShotTiming = EnumField <ReplayAnalysisEngine.ScreenShotTimingOption>(rae.ScreenShotTiming, "Screenshot Setting:", "Change if and when the RAE should take screenshots while processing.", .8f, 0); switch (rae.ScreenShotTiming) { case ReplayAnalysisEngine.ScreenShotTimingOption.Disabled: break; default: rae.ScreenShotMode = ReplayGUI.EnumField <ReplayAnalysisEngine.ScreenShotModeOption>(rae.ScreenShotMode, "Screenshot Mode:", "Which screenshot mode you want to use, JPG will not include a watermark.", 1, 1); rae.screenshotDirectory = ReplayGUI.TextField(rae.screenshotDirectory, "Screenshot Directory", 4, 1); //if (this.writer is TabDelimitedTextFileWriter) { // switch (ReplayGUI.YesNo("Would you like to copy the log path from the AnalysisWriter?",.5f,1)) { // case YesNoResponse.Yes: // rae.screenshotDirectory = (this.writer as TabDelimitedTextFileWriter).logPath; // this.writer = null; // break; // case YesNoResponse.No: // this.writer = null; // break; // default: // break; // } //} if (!string.IsNullOrEmpty(rae.screenshotDirectory) && !Directory.Exists(rae.screenshotDirectory)) { switch (ReplayGUI.YesNo("The screenshot path does not exist would you like to create it?", .5f, 1)) { case YesNoResponse.Yes: Directory.CreateDirectory(rae.screenshotDirectory); break; case YesNoResponse.No: rae.screenshotDirectory = string.Empty; break; default: break; } } break; } GUILayout.EndVertical(); GUILayout.EndScrollView(); // GUILayout.EndArea(); }