/// <summary> /// Opens the wiki window to a specific page from a specific wiki. /// </summary> public static void ShowPage(ModWiki wiki, WikiPage page) { if (wiki == null || page == null) { return; } if (WikiWindow.CurrentActive != null && WikiWindow.CurrentActive.Wiki == wiki) { WikiWindow.CurrentActive.CurrentPage = page; } else { WikiWindow.Open(wiki, page); } }
public static WikiWindow Open(ModWiki wiki, WikiPage page = null) { if (wiki == null) return null; if (CurrentActive != null && CurrentActive.Wiki != wiki) { //Log.Warn("There is already an open wiki page, closing old."); CurrentActive.Close(true); } var created = new WikiWindow(wiki); created.CurrentPage = page; CurrentActive = created; Find.WindowStack?.Add(created); return created; }
/// <summary> /// Opens this wiki to whatever page was last opened. /// </summary> public void Show() { WikiWindow.Open(this); }