Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Override Statusbar Click

Discussion in 'Immediate Mode GUI (IMGUI)' started by figbash, May 1, 2016.

  1. figbash

    figbash

    Joined:
    May 13, 2008
    Posts:
    60
    Hi, I'm the creator of the Editor Console Pro replacement console extension. I have had numerous people ask me over the years if there was a way to capture the status bar click to open my console instead of the default Unity one, but I have always come up blank. I was wondering if anybody has any ideas on how to pull this off?
     
  2. skalev

    skalev

    Joined:
    Feb 16, 2012
    Posts:
    264
    You can't.

    If you get ILSpy (or any other decompiler) you can look at the AppStatusBar class in UnityEditor namespace.

    It is an internal class that handles everything, so you can't access it. Even if you could, it is loaded from the C++ side, so you can't replace it. Additionally, the click call is an extern call, going back to the C++ side, so again, can't override or piggyback off of it.

    They only way you *might* be able to do so, is to listen to the OS mouse clicks, and catch the ones that occur in the status bar. Not really a good robust way :)
     
  3. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Reviving this thread to say that I would like to know this too! :) The developer of Console Enhanced Pro says in the description that "ConsoleE is the only replacement console that can capture mouse clicks from Unity's status bar.". I haven't confirmed it, as I don't have the asset, but if true there's at least one way.

    UPDATE: I tested the free version and it works indeed.