Skip to main content

PlayTutorialChecker

A class in Root.Township, the global namespace.

Client tool that, after login, offers players who haven't done the tutorial a prompt to play it, plus a follow-up popup if they skip.

Constructors​

MemberWhat it is
PlayTutorialChecker()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private PopupManager.IPopupConfig followupPopupThe follow-up popup, kept so it can be cancelled.
private const string HasPromptedForTutorialKeyPlayer preferences key set once the prompt has been shown.
private TutorialPromptBoard popupThe tutorial prompt board to show.
private string skipTutorialFollowupMessageBody text of the follow-up popup.
private string skipTutorialFollowupTitleTitle of the follow-up popup.

Methods​

MemberWhat it is
protected override async void LoggedIn()Waits a moment after login, then shows the prompt if allowed.
protected override void LoggedOut()Empty.
4 private and internal methods
MemberWhat it is
private void CancelFollowup()Closes the follow-up popup when the player chooses to join the tutorial.
private bool CanShowTutorialPrompt()True when the player hasn't finished the tutorial and the prompted key exists. The key check looks inverted, so the prompt may never show.
private void Setup(IPopupBoard board)Hooks the prompt board's join button so the follow-up is cancelled.
private void ShowPrompt()Saves the prompted key, then shows the tutorial prompt and the skip follow-up popup.