private void SetGravityMultiplier(string[] modifiers, out string output) { output = ""; if (ConsoleHeader.TryParseSingle(modifiers[0], out float value)) { output = "gravitational multiplier set to: " + value; GravitationalMultiplier = value; } }
private void SetViewmodelTiltAngle(string[] modifiers, out string output) { output = ""; if (ConsoleHeader.TryParseSingle(modifiers[0], out float value)) { value = Mathf.Clamp(value, 0F, 20F); MaximumZTilt = value; output = "viewmodel z offset set to : (" + value + ")"; } }
private void SetViewmodelOffsetZ(string[] modifiers, out string output) { output = ""; if (ConsoleHeader.TryParseSingle(modifiers[0], out float value)) { value = Mathf.Clamp(value, -2F, 2F); HandsOffset = value; output = "viewmodel z offset set to : (" + value + ")"; } }
public UserInfoBlock() { Header = new ConsoleHeader("Welcome to the Game"); Block = new CanvasBlock(Header); NameList = new CanvasBlockList("What's your Name?"); NameList.Add(new TextInput(5, "Name:")); ColorList = new CanvasColorBlockList("What's Your Favorite Color?", ConsoleColor.Red); Block.Add(NameList); Block.Add(ColorList); }
private void SetVisFOV(string[] modifiers, out string output) { output = ""; if (ConsoleHeader.TryParseSingle(modifiers[0], out float value)) { value = Mathf.Clamp(value, 5F, 120F); VisCamera.fieldOfView = value; switch (value) { case 120F: output = "vis fov set to : Quake Pro (120)"; break; default: output = "vis fov set to : (" + value + ")"; break; } } }
public override kCura.EventHandler.Console GetConsole(PageEvent pageEvent) { int activeWorkspaceId = this.Helper.GetActiveCaseID(); //Construct a console object to build the console appearing in the UI. kCura.EventHandler.Console returnConsole = new kCura.EventHandler.Console(); returnConsole.Items = new List <IConsoleItem>(); returnConsole.Title = CONSOLE_TITLE; string select = "<h3 style='color:#11599E'>Comments Tree</h3>"; List <string> elements = new List <string>(); elements.Add(select); using (kCura.Relativity.Client.IRSAPIClient client = this.Helper.GetServicesManager().CreateProxy <kCura.Relativity.Client.IRSAPIClient>(Relativity.API.ExecutionIdentity.System)) { client.APIOptions.WorkspaceID = this.Helper.GetActiveCaseID(); Service.SqlService.CommentSqlService commentService = new Service.SqlService.CommentSqlService(this.Helper.GetDBContext(this.Helper.GetActiveCaseID())); Service.RSAPIService.CommentRSAPIService commentRSAPIService = new Service.RSAPIService.CommentRSAPIService(client); Data.Entities.Comment comment = commentRSAPIService.Get(this.ActiveArtifact.ArtifactID); comment.CommentChilds = commentService.GetCommentsChild(comment.ArtifactId); drawCommentTree2(ref elements, (comment.CommentChilds).ToList()); returnConsole.HTMLBlocks = elements; } ConsoleHeader header = new ConsoleHeader("Console Application"); //Construct the submit job button. ConsoleButton submitJobButton = new ConsoleButton(); submitJobButton.Name = INSERT_JOB_BUTTON_NAME; submitJobButton.DisplayText = INSERT_JOB_DISPLAY_TEXT; submitJobButton.ToolTip = INSERT_JOB_TOOL_TIP; submitJobButton.RaisesPostBack = true; submitJobButton.Enabled = true; //Construct the delete job button ConsoleButton deleteJobButton = new ConsoleButton() { Name = DELETE_JOB_BUTTON_NAME, DisplayText = DELETE_JOB_DISPLAY_TEXT, ToolTip = DELETE_JOB_TOOL_TIP, RaisesPostBack = true, Enabled = true }; //Button to see the comment data ConsoleButton seeCommentButton = new ConsoleButton() { Name = "See Comment Data", DisplayText = "Commen Data", ToolTip = "Comment Data", RaisesPostBack = true, Enabled = true }; ConsoleSeparator separador = new ConsoleSeparator(); //If a job is already in the queue, change the text and disable the button. if (pageEvent == PageEvent.PreRender) { SqlParameter commentArtifactId = new SqlParameter("@commentArtifacId", System.Data.SqlDbType.Int); commentArtifactId.Value = ActiveArtifact.ArtifactID; int jobCount = this.Helper.GetDBContext(activeWorkspaceId).ExecuteSqlStatementAsScalar <Int32>(JOB_EXISTS_QUERY, new SqlParameter[] { commentArtifactId }); //Use the helper function to check if a job currently exists. Set Enabled to the opposite value. if (jobCount > 0) { submitJobButton.Enabled = false; deleteJobButton.Enabled = true; } else { submitJobButton.Enabled = true; deleteJobButton.Enabled = false; } //Get the base path to the application. String basePath = this.Application.ApplicationUrl.Substring(0, this.Application.ApplicationUrl.IndexOf("/Case/Mask/")); //Construct the path to the custom page with the current patient artifact id and current workspace. String patientProfilePageUrl = String.Format("{0}/CustomPages/{1}/Home/Index/?artifacId={2}", basePath, COMMENT_HISTORY_APPLICATION_GUID, ActiveArtifact.ArtifactID); //Create the JavaScript for the button and set the button property. String windowOpenJavaScript = String.Format("window.open('{0}', '', 'location=no,scrollbars=yes,menubar=no,toolbar=no,status=no,resizable=yes,width=300,height=400');", patientProfilePageUrl); seeCommentButton.OnClickEvent = windowOpenJavaScript; } //Add the buttons to the console. returnConsole.Items.Add(header); returnConsole.Items.Add(submitJobButton); returnConsole.Items.Add(deleteJobButton); returnConsole.Items.Add(seeCommentButton); returnConsole.Items.Add(separador); return(returnConsole); }