Invector Integration Journal Button

Announcements, support questions, and discussion for Quest Machine.
wendy3112
Posts: 11
Joined: Sat Jun 15, 2019 8:31 am

Invector Integration Journal Button

Post by wendy3112 »

Hi, when I put a journal button on a separate canvas like in the invector integration demo the j button works to spawn the journal but I am unable to click with the mouse. Now I want it how when you press the I key and the inventory main window comes up. I put a button on that main window panel in hopes that I can click the journal button and the journal comes up but it doesn't work like that at all. Does anyone know how I would be able to achieve this? The quest button meant to open up the journal but it doesn't work.
Attachments
QuestButton.JPG
QuestButton.JPG (23.4 KiB) Viewed 1979 times
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector Integration Journal Button

Post by Tony Li »

Hi,

Your Invector UI canvas(es) may be covering the journal button if it's on a separate canvas. If you want to use a separate canvas, try increasing its Sort Order so it's on top of Invector's canvases. This way Invector's canvases won't block your mouse clicks.

If you want to add the button to Invector's Inventory UI > Main Window, it's instantiated at runtime. This means you can't hook it up to the Quest Journal component that already exists in the scene. Instead, add a small script to find the Quest Journal and toggle it on and off:

ShowHideQuestJournal.cs

Code: Select all

public class ShowHideQuestJournal : UnityEngine.MonoBehaviour
{
    public void ToggleQuestJournal()
    {
        FindObjectOfType<PixelCrushers.QuestMachine.QuestJournal>().ToggleJournalUI();
    }
}
Add this script to the UI button, and configure the button's OnClick() to call ShowHideQuestJournal.ToggleQuestJournal.
wendy3112
Posts: 11
Joined: Sat Jun 15, 2019 8:31 am

Re: Invector Integration Journal Button

Post by wendy3112 »

That worked part of the way but now when I close the journal I lose my mouse to click on anything else. and when I do the hotkey which on mine is returned it will come up but will disappear really quick without clicking on any button. I wanted it similar to the other windows when the items come up the three buttons will disappear and when you exit the window the button will reappear. The selector has worked for me and my lack of coding is getting in the way of this working. I wanted that nice touch to the game instead of just using a plain old hotkey which will be J for journal.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector Integration Journal Button

Post by Tony Li »

Hi,

I'll take a look in the morning and let you know what steps will take care of the mouse cursor. I have a feeling it's possible without having to do any scripting.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector Integration Journal Button

Post by Tony Li »

Hi,

A short script makes the setup much simpler. Here's the updated QM Invector Support package:

QM_InvectorSupport_2019-06-16.unitypackage

Inside it is another unitypackage in the Examples / Extras folder. If you import this, it will create a folder "Quest Machine Examples" with an example scene, script, and brief instructions.
wendy3112
Posts: 11
Joined: Sat Jun 15, 2019 8:31 am

Re: Invector Integration Journal Button

Post by wendy3112 »

You have gone above and beyond thank you so much.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector Integration Journal Button

Post by Tony Li »

Glad to help! I figure it will be useful to almost everyone who is using Invector with Quest Machine, so it was nice to be able to add the feature.
wendy3112
Posts: 11
Joined: Sat Jun 15, 2019 8:31 am

Re: Invector Integration Journal Button

Post by wendy3112 »

This would be an added bonus if it is included in the next release, it works great.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector Integration Journal Button

Post by Tony Li »

I already packed it into the Invector Support package in preparation for the next release. :-)
Skighfyre
Posts: 4
Joined: Thu Nov 05, 2020 2:38 pm

Re: Invector Integration Journal Button

Post by Skighfyre »

Hey I just Downloaded and am having the same problem but your download fix is not available?
Post Reply