protected void DoTopicGUI(GuidedTour.Topic topic) { if (!guidedTour.IsVisible(topic)) { return; } var isRepaint = Event.current.type == EventType.Repaint; // setup selected styles var isSelected = guidedTour.IsHighlighted(topic); var rowStyle = isSelected ? FsmEditorStyles.ActionItemSelected : FsmEditorStyles.ActionItem; var labelStyle = isSelected ? FsmEditorStyles.ActionLabelSelected : FsmEditorStyles.ActionLabel; GUILayout.BeginHorizontal(rowStyle); GUILayout.Space(topic.Indent * 10f); if (!string.IsNullOrEmpty(topic.HelpUrl)) { if (FsmEditorGUILayout.HelpButton()) { Application.OpenURL(topic.HelpUrl); } } else { GUILayout.Space(18f); } if (GUILayout.Button(topic.Label, labelStyle)) { autoScroll = true; guidedTour.HighlightTopic(topic); FsmEditor.RepaintAll(); GUIUtility.ExitGUI(); } GUILayout.Space(20); // reserve space for scrollbar GUILayout.EndHorizontal(); // Store selectedRect for auto scroll if (isRepaint) { if (isSelected) { selectedRect = GUILayoutUtility.GetLastRect(); selectedRect.y -= scrollPosition.y + 20; selectedRect.height += 20; // pad to scroll a little further } if (topic.IsNew(NewVersion)) { var rect = GUILayoutUtility.GetLastRect(); GUI.Label(rect, NewTag, FsmEditorStyles.NewTag); } } }
public GuidedTour.Topic AddTopic(GuidedTour.Topic parent, string label, string tooltip = "", string helpText = "", string highlightID = "", string helpUrl = "") { return(guidedTour.AddTopic(parent, label, tooltip, helpText, highlightID, helpUrl)); }