private void drawEditDegreeState(Rectangle bounds, SpriteBatch sb) { if (Button.doButton(456010, bounds.X + 2, bounds.Y + 2, 160, 30, "Back", darkThemeColor)) state = ADDState.Entry; var pos = new Vector2(bounds.X + 10f, bounds.Y + 60f); var flag = editedField == ADDEditField.None; TextItem.doSmallLabel(pos, "University:", new Color?()); pos.X += 110f; TextItem.doSmallLabel(pos, searchedDegrees[editedIndex].uni, editedField == ADDEditField.Uni ? themeColor : Color.White); pos.X -= 110f; pos.Y += 20f; if (flag && Button.doButton(46700, (int) pos.X, (int) pos.Y, 80, 20, "Edit", darkThemeColor)) { editedField = ADDEditField.Uni; os.execute("getString University"); } pos.Y += 30f; TextItem.doSmallLabel(pos, "Degree:", new Color?()); pos.X += 110f; TextItem.doSmallLabel(pos, searchedDegrees[editedIndex].name, editedField == ADDEditField.Degree ? themeColor : Color.White); pos.X -= 110f; pos.Y += 20f; if (flag && Button.doButton(46705, (int) pos.X, (int) pos.Y, 80, 20, "Edit", darkThemeColor)) { editedField = ADDEditField.Degree; os.execute("getString Degree"); } pos.Y += 30f; TextItem.doSmallLabel(pos, "GPA:", new Color?()); pos.X += 110f; TextItem.doSmallLabel(pos, string.Concat(searchedDegrees[editedIndex].GPA), editedField == ADDEditField.GPA ? themeColor : Color.White); pos.X -= 110f; pos.Y += 20f; if (flag && Button.doButton(46710, (int) pos.X, (int) pos.Y, 80, 20, "Edit", darkThemeColor)) { editedField = ADDEditField.GPA; os.execute("getString GPA"); } pos.Y += 30f; if (editedField != ADDEditField.None) { if (!doEditField()) return; editedField = ADDEditField.None; os.getStringCache = ""; saveChangesToEntry(); } else { if ( !Button.doButton(486012, bounds.X + 2, bounds.Y + bounds.Height - 40, 180, 30, "Save And Return", backThemeColor)) return; state = ADDState.Entry; comp.log(string.Concat("ACADEMIC_DATABASE::RecordEdit_:_#", editedIndex, "_: ", searchedName.Replace(" ", "_"))); } }
private void drawEditDegreeState(Rectangle bounds, SpriteBatch sb) { if (Button.doButton(456010, bounds.X + 2, bounds.Y + 2, 160, 30, "Back", darkThemeColor)) { state = ADDState.Entry; } var pos = new Vector2(bounds.X + 10f, bounds.Y + 60f); var flag = editedField == ADDEditField.None; TextItem.doSmallLabel(pos, "University:", new Color?()); pos.X += 110f; TextItem.doSmallLabel(pos, searchedDegrees[editedIndex].uni, editedField == ADDEditField.Uni ? themeColor : Color.White); pos.X -= 110f; pos.Y += 20f; if (flag && Button.doButton(46700, (int)pos.X, (int)pos.Y, 80, 20, "Edit", darkThemeColor)) { editedField = ADDEditField.Uni; os.execute("getString University"); } pos.Y += 30f; TextItem.doSmallLabel(pos, "Degree:", new Color?()); pos.X += 110f; TextItem.doSmallLabel(pos, searchedDegrees[editedIndex].name, editedField == ADDEditField.Degree ? themeColor : Color.White); pos.X -= 110f; pos.Y += 20f; if (flag && Button.doButton(46705, (int)pos.X, (int)pos.Y, 80, 20, "Edit", darkThemeColor)) { editedField = ADDEditField.Degree; os.execute("getString Degree"); } pos.Y += 30f; TextItem.doSmallLabel(pos, "GPA:", new Color?()); pos.X += 110f; TextItem.doSmallLabel(pos, string.Concat(searchedDegrees[editedIndex].GPA), editedField == ADDEditField.GPA ? themeColor : Color.White); pos.X -= 110f; pos.Y += 20f; if (flag && Button.doButton(46710, (int)pos.X, (int)pos.Y, 80, 20, "Edit", darkThemeColor)) { editedField = ADDEditField.GPA; os.execute("getString GPA"); } pos.Y += 30f; if (editedField != ADDEditField.None) { if (!doEditField()) { return; } editedField = ADDEditField.None; os.getStringCache = ""; saveChangesToEntry(); } else { if ( !Button.doButton(486012, bounds.X + 2, bounds.Y + bounds.Height - 40, 180, 30, "Save And Return", backThemeColor)) { return; } state = ADDState.Entry; comp.log(string.Concat("ACADEMIC_DATABASE::RecordEdit_:_#", editedIndex, "_: ", searchedName.Replace(" ", "_"))); } }
private void drawEntryState(Rectangle bounds, SpriteBatch sb) { if (state == ADDState.Entry && os.hasConnectionPermission(true)) state = ADDState.EditPerson; if (Button.doButton(456010, bounds.X + 2, bounds.Y + 2, 160, 30, "Back", darkThemeColor)) state = ADDState.Welcome; var x = bounds.X + 20f; var y1 = bounds.Y + 50f; TextItem.doFontLabel(new Vector2(x, y1), searchedName, GuiData.font, new Color?(), bounds.Width - (x - bounds.X), 60f); var y2 = y1 + 30f; if (searchedDegrees.Count == 0) TextItem.doFontLabel(new Vector2(x, y2), " -No Degrees Found", GuiData.smallfont, new Color?(), float.MaxValue, float.MaxValue); for (var index = 0; index < searchedDegrees.Count; ++index) { var text = "Degree :" + searchedDegrees[index].name + "\nUni :" + searchedDegrees[index].uni + "\nGPA :" + searchedDegrees[index].GPA; TextItem.doFontLabel(new Vector2(x, y2), text, GuiData.smallfont, new Color?(), bounds.Width - (bounds.X - x), 50f); y2 += 60f; if (state == ADDState.EditPerson) { var num = y2 - 10f; if (Button.doButton(457900 + index, (int) x, (int) num, 100, 20, "Edit", new Color?())) { state = ADDState.EditEntry; editedField = ADDEditField.None; editedIndex = index; } if (Button.doButton(456900 + index, (int) x + 105, (int) num, 100, 20, needsDeletionConfirmation ? "Delete" : "Confirm?", needsDeletionConfirmation ? Color.Gray : Color.Red)) { if (needsDeletionConfirmation) { needsDeletionConfirmation = false; } else { comp.log(string.Concat("ACADEMIC_DATABASE::RecordDeletion_:_#", index, "_: ", searchedName.Replace(" ", "_"))); searchedDegrees.RemoveAt(index); saveChangesToEntry(); --index; needsDeletionConfirmation = true; } } y2 = num + 35f; } } var num1 = y2 + 10f; if (state != ADDState.EditPerson || !Button.doButton(458009, (int) x, (int) num1, 170, 30, "Add Degree", themeColor)) return; var degree = new Degree("UNKNOWN", "UNKNOWN", 0.0f); searchedDegrees.Add(degree); editedIndex = searchedDegrees.IndexOf(degree); state = ADDState.EditEntry; comp.log(string.Concat("ACADEMIC_DATABASE::RecordAdd_:_#", editedIndex, "_: ", searchedName.Replace(" ", "_"))); }
private void drawEntryState(Rectangle bounds, SpriteBatch sb) { if (state == ADDState.Entry && os.hasConnectionPermission(true)) { state = ADDState.EditPerson; } if (Button.doButton(456010, bounds.X + 2, bounds.Y + 2, 160, 30, "Back", darkThemeColor)) { state = ADDState.Welcome; } var x = bounds.X + 20f; var y1 = bounds.Y + 50f; TextItem.doFontLabel(new Vector2(x, y1), searchedName, GuiData.font, new Color?(), bounds.Width - (x - bounds.X), 60f); var y2 = y1 + 30f; if (searchedDegrees.Count == 0) { TextItem.doFontLabel(new Vector2(x, y2), " -No Degrees Found", GuiData.smallfont, new Color?(), float.MaxValue, float.MaxValue); } for (var index = 0; index < searchedDegrees.Count; ++index) { var text = "Degree :" + searchedDegrees[index].name + "\nUni :" + searchedDegrees[index].uni + "\nGPA :" + searchedDegrees[index].GPA; TextItem.doFontLabel(new Vector2(x, y2), text, GuiData.smallfont, new Color?(), bounds.Width - (bounds.X - x), 50f); y2 += 60f; if (state == ADDState.EditPerson) { var num = y2 - 10f; if (Button.doButton(457900 + index, (int)x, (int)num, 100, 20, "Edit", new Color?())) { state = ADDState.EditEntry; editedField = ADDEditField.None; editedIndex = index; } if (Button.doButton(456900 + index, (int)x + 105, (int)num, 100, 20, needsDeletionConfirmation ? "Delete" : "Confirm?", needsDeletionConfirmation ? Color.Gray : Color.Red)) { if (needsDeletionConfirmation) { needsDeletionConfirmation = false; } else { comp.log(string.Concat("ACADEMIC_DATABASE::RecordDeletion_:_#", index, "_: ", searchedName.Replace(" ", "_"))); searchedDegrees.RemoveAt(index); saveChangesToEntry(); --index; needsDeletionConfirmation = true; } } y2 = num + 35f; } } var num1 = y2 + 10f; if (state != ADDState.EditPerson || !Button.doButton(458009, (int)x, (int)num1, 170, 30, "Add Degree", themeColor)) { return; } var degree = new Degree("UNKNOWN", "UNKNOWN", 0.0f); searchedDegrees.Add(degree); editedIndex = searchedDegrees.IndexOf(degree); state = ADDState.EditEntry; comp.log(string.Concat("ACADEMIC_DATABASE::RecordAdd_:_#", editedIndex, "_: ", searchedName.Replace(" ", "_"))); }