private void SetSection(string name, bool display) { TutorialSection section = _sections.GetSection(name); if (section != null) { _currentSection = section; if (display) { lblTitle.Text = _currentSection.TitleText + "(Entry " + _sections.IndexOf(_currentSection) + " of " + _sections.Count + ")"; lblText.Text = _currentSection.Text; btnNext.Enabled = !_currentSection.NextSection.Equals(""); btnPrevious.Enabled = !_currentSection.PrevSection.Equals(""); btnSkip.Enabled = _currentSection.Level != 0; } } else if (display) { MessageBox.Show("Cannot find tutorial section '" + name + "'", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { throw new EMMAException(ExceptionSeverity.Error, "Cannot find tutorial section '" + name + "'"); } }
private void beginTutorial() { tutorialFade.SetActive(true); tutorialBox.SetActive(true); TutorialSection section = currentTutorial.getCurrentSection(); dialogueManager.StartDialogue(section.dialogue, section.nextSectionOnDialogueComplete); highlightObjects(section); }
//Sets them back to their original positions in the object hierarchy (Behind the fade) private void resetObjectPositions() { TutorialSection section = currentTutorial.getCurrentSection(); for (int i = section.highlightedComponents.Length - 1; i >= 0; i--) { Transform currentObject = section.highlightedComponents[i].transform; currentObject.SetParent(section.componentParents[i]); currentObject.SetSiblingIndex(section.originalPositions[i]); } }
private void BuildTree(TreeNode rootNode, TutorialSection rootSection) { foreach (TutorialSection section in rootSection.Subsections) { TreeNode newNode = new TreeNode(section.Title); rootNode.Nodes.Add(newNode); if (section.Subsections.Count > 0) { BuildTree(newNode, section); } } }
private void highlightObjects(TutorialSection section) { section.componentParents = new Transform[section.highlightedComponents.Length]; section.originalPositions = new int[section.highlightedComponents.Length]; for (int i = 0; i < section.highlightedComponents.Length; i++) { GameObject currentObject = section.highlightedComponents[i]; int objectPosition = currentObject.transform.GetSiblingIndex(); section.originalPositions[i] = objectPosition; section.componentParents[i] = currentObject.transform.parent; currentObject.transform.SetParent(focusedObjectHolder.transform); } }
public async Task <IActionResult> Add([Bind("Header,HTMLContent,PageID")] AddTutorialSection tutorialPage) { if (ModelState.IsValid) { if (tutorialPage.PageID <= 0) { return(RedirectToAction(nameof(Index))); } TutorialSection tut = tutorialPage; tut.Page = await _context.TutorialPages.FirstOrDefaultAsync(t => t.ID == tutorialPage.PageID); _context.Add(tut); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index), new { id = tutorialPage.PageID })); } return(View(tutorialPage)); }
public void loadNextSection() { resetObjectPositions(); TutorialSection section = currentTutorial.getNextSection(); if (section == null) { completeTutorial(); } else { highlightObjects(section); dialogueManager.StartDialogue(section.dialogue, section.nextSectionOnDialogueComplete); if (GameManager.activeActivity == 2 && currentTutorial.currentPos == 5) { FindObjectOfType <DropRegion>().clearSelected(); } } determineQuestionLoad(); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Header,HTMLContent,PageID")] AddTutorialSection tutorialSection) { if (id != tutorialSection.ID) { return(NotFound()); } if (ModelState.IsValid) { try { TutorialSection section = tutorialSection; _context.Update(section); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw; } return(RedirectToAction(nameof(Index), new { id = tutorialSection.PageID })); } return(View(tutorialSection)); }
public TutorialSection getCurrentSection() { TutorialSection section = tutorialSections[currentPos]; return(section); }