Example #1
0
        private bool OnHotkeyJournal(KeyCombination comb)
        {
            if (dialog != null)
            {
                dialog.TryClose();
                dialog = null;
                return(true);
            }

            TreeAttribute tree = new TreeAttribute();

            foreach (var entry in ownJournal.Entries)
            {
                string[] chapters = new string[entry.Chapters.Count];
                for (int i = 0; i < chapters.Length; i++)
                {
                    chapters[i] = entry.Chapters[i].Text;
                }
                tree[entry.Title] = new StringArrayAttribute(chapters);
            }

            dialog = new GuiDialogJournal(tree, capi);
            dialog.TryOpen();
            dialog.OnClosed += () => dialog = null;

            return(true);
        }
Example #2
0
        private bool OnHotkeyJournal(KeyCombination comb)
        {
            if (dialog != null)
            {
                dialog.TryClose();
                dialog = null;
                return(true);
            }

            dialog = new GuiDialogJournal(ownJournal.Entries, capi);
            dialog.TryOpen();
            dialog.OnClosed += () => dialog = null;

            return(true);
        }