@ -8,6 +8,7 @@
# pragma once
# pragma once
# include <AzCore/EBus/EBus.h>
# include <AzCore/EBus/EBus.h>
# include <AzCore/EBus/Event.h>
// Forward Declares
// Forward Declares
struct ImVec2 ;
struct ImVec2 ;
@ -86,9 +87,19 @@ namespace ImGui
virtual void SetImGuiRenderResolution ( const ImVec2 & res ) = 0 ;
virtual void SetImGuiRenderResolution ( const ImVec2 & res ) = 0 ;
virtual void OverrideRenderWindowSize ( uint32_t width , uint32_t height ) = 0 ;
virtual void OverrideRenderWindowSize ( uint32_t width , uint32_t height ) = 0 ;
virtual void RestoreRenderWindowSizeToDefault ( ) = 0 ;
virtual void RestoreRenderWindowSizeToDefault ( ) = 0 ;
virtual void ToggleThroughImGuiVisibleState ( ) = 0 ;
virtual void SetDpiScalingFactor ( float dpiScalingFactor ) = 0 ;
virtual void SetDpiScalingFactor ( float dpiScalingFactor ) = 0 ;
virtual float GetDpiScalingFactor ( ) const = 0 ;
virtual float GetDpiScalingFactor ( ) const = 0 ;
virtual void Render ( ) = 0 ;
virtual void Render ( ) = 0 ;
using ImGuiSetEnabledEvent = AZ : : Event < bool > ;
ImGuiSetEnabledEvent m_setEnabledEvent ;
// interface
void ConnectImGuiSetEnabledChangedHandler ( ImGuiSetEnabledEvent : : Handler & handler )
{
handler . Connect ( m_setEnabledEvent ) ;
}
} ;
} ;
class IImGuiManagerRequests
class IImGuiManagerRequests
@ -101,19 +112,30 @@ namespace ImGui
} ;
} ;
using ImGuiManagerBus = AZ : : EBus < IImGuiManager , IImGuiManagerRequests > ;
using ImGuiManagerBus = AZ : : EBus < IImGuiManager , IImGuiManagerRequests > ;
class IImGuiManagerNotifications : public AZ : : EBusTraits
{
public :
static const AZ : : EBusHandlerPolicy HandlerPolicy = AZ : : EBusHandlerPolicy : : Multiple ;
static const AZ : : EBusAddressPolicy AddressPolicy = AZ : : EBusAddressPolicy : : Single ;
using Bus = AZ : : EBus < IImGuiManagerNotifications > ;
virtual void ImGuiSetEnabled ( [ [ maybe_unused ] ] bool enabled ) { }
} ;
using ImGuiManagerNotificationBus = AZ : : EBus < IImGuiManagerNotifications > ;
// Bus for getting notifications from the IMGUI Entity Outliner
// Bus for getting notifications from the IMGUI Entity Outliner
class IImGuiEntityOutlinerNotifcations : public AZ : : EBusTraits
class IImGuiEntityOutlinerNotif i cations : public AZ : : EBusTraits
{
{
public :
public :
static const char * GetUniqueName ( ) { return " IImGuiEntityOutlinerNotifcations " ; }
static const char * GetUniqueName ( ) { return " IImGuiEntityOutlinerNotif i cations" ; }
static const AZ : : EBusHandlerPolicy HandlerPolicy = AZ : : EBusHandlerPolicy : : Multiple ;
static const AZ : : EBusHandlerPolicy HandlerPolicy = AZ : : EBusHandlerPolicy : : Multiple ;
static const AZ : : EBusAddressPolicy AddressPolicy = AZ : : EBusAddressPolicy : : Single ;
static const AZ : : EBusAddressPolicy AddressPolicy = AZ : : EBusAddressPolicy : : Single ;
using Bus = AZ : : EBus < IImGuiEntityOutlinerNotifcations > ;
using Bus = AZ : : EBus < IImGuiEntityOutlinerNotif i cations> ;
// Callback for game code to handle targetting an IMGUI entity
// Callback for game code to handle targetting an IMGUI entity
virtual void OnImGuiEntityOutlinerTarget ( AZ : : EntityId target ) { ( void ) target ; }
virtual void OnImGuiEntityOutlinerTarget ( AZ : : EntityId target ) { ( void ) target ; }
} ;
} ;
typedef AZ : : EBus < IImGuiEntityOutlinerNotif cations> ImGuiEntityOutlinerNotif cationBus;
typedef AZ : : EBus < IImGuiEntityOutlinerNotif i cations> ImGuiEntityOutlinerNotif i cationBus;
// a pair of an entity id, and a typeid, used to represent component rtti type info
// a pair of an entity id, and a typeid, used to represent component rtti type info
typedef AZStd : : pair < AZ : : EntityId , AZ : : TypeId > ImGuiEntComponentId ;
typedef AZStd : : pair < AZ : : EntityId , AZ : : TypeId > ImGuiEntComponentId ;