Next Conversation Shortcut?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Next Conversation Shortcut?

Post by VoodooDetective »

I was looking around to see if I could find a "next conversation" shortcut. Is that something that exists?

EDIT:
I was looking through DialogueEditorWindowConversationNodeEditor and I think there is currently no shortcut. I think I can add one, but I'm not sure how to lookup the next conversation from the current conversation going by drop-down selector ordering.

Something like this?

Code: Select all

                                if (Event.current.keyCode == KeyCode.PageUp)
                {
                    // PageUp canvas:
                    // PageUpCanvas();
                    Conversation prevConversation = GetConversationByTitleIndex(GetCurrentConversationIndex() - 1);
                    if (prevConversation != null) SetCurrentEntry(prevConversation.GetFirstDialogueEntry());
                    Event.current.Use();
                }
                if (Event.current.keyCode == KeyCode.PageDown)
                {
                    // PageDown canvas:
                    // PageDownCanvas();
                    Conversation nextConversation = GetConversationByTitleIndex(GetCurrentConversationIndex() + 1);
                    if (nextConversation != null) SetCurrentEntry(nextConversation.GetFirstDialogueEntry());
                    Event.current.Use();
                }

Is this safe?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Next Conversation Shortcut?

Post by Tony Li »

Hi,

Run this code to change to the next conversation:

Code: Select all

                SetConversationDropdownIndex(GetCurrentConversationIndex() + 1);
                OpenConversation(GetConversationByTitleIndex(conversationIndex);
                InitializeDialogueTree();
                inspectorSelection = currentConversation;
It assumes there is a next conversation. You can check database.conversations.Count before calling OpenConversation.

I had better add this as a keyboard shortcut in the original source. Otherwise when you update the Dialogue System you'll lose your customizations.

I'm working on a revamp of the Dialogue Editor code to speed up responsiveness on very large databases and generally streamline the code after 8 years of incremental growth. I can include next/previous conversation keyboard shortcuts. Any key combo suggestions? Ctrl+Shift+PgUp and PgDn?
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: Next Conversation Shortcut?

Post by VoodooDetective »

Oh awesome! I think SetConversationEntry() does the same thing you shared, but add:

Code: Select all

            newSelectedLink = null;
            if (entry != currentEntry) ResetLuaWizards();
            currentEntry = entry;
            multinodeSelection.nodes.Clear();
            multinodeSelection.nodes.Add(entry);
            UpdateEntrySelection();
Am I safe keeping it as is for now?

Awesome that you're thinking of adding it! I'm on a mac using a baby keyboard with no numpad or pgup/dn so my personal preference would be:

cmd+shift+"<" OR ">"
or
ctrl+shift+"<" OR ">"

But i'm pretty easy. I'd be glad to have it around regardless.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Next Conversation Shortcut?

Post by Tony Li »

Hi,

Yes, I think that code looks fine.

Those look like fine shortcuts for next/previous conversation. I'll use them when I add that feature.
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: Next Conversation Shortcut?

Post by VoodooDetective »

Awesome, thanks so much!
Post Reply