PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
RadialMenu.c File Reference

Enumerations

enum  RadialMenuControlType { MOUSE , CONTROLLER }
 

Functions

void RadialMenu ()
 
void ~RadialMenu ()
 
static RadialMenu GetInstance ()
 
void OnWidgetScriptInit (Widget w)
 
void SetControlType (RadialMenuControlType type)
 
bool IsUsingMouse ()
 
bool IsUsingController ()
 
void SetWidgetInitialized (bool state)
 
bool IsWidgetInitialized ()
 
void RegisterClass (UIScriptedMenu class_name)
 
void SetRadiusOffset (float radius_offset)
 
void SetExecuteDistOffset (float execute_dist_offset)
 
void SetOffsetFromTop (float offset_from_top)
 
void SetItemCardRadiusOffset (float item_card_radius_offset)
 
void ActivateControllerTimeout (bool state)
 
void SetWidgetProperties (string delimiter_layout)
 
void Refresh (bool hide_selector=true)
 
protected void ShowRadialSelector (Widget selected_item)
 
protected void HideRadialSelector ()
 
protected int GetItemCardsCount ()
 
protected float GetRadius ()
 
protected void GetParentCenter (out float center_x, out float center_y)
 
protected float GetParentMinSize ()
 
protected Widget GetObjectByDegAngle (float deg_angle)
 
protected float GetMousePointerAngle ()
 
protected float GetMouseDistance ()
 
protected float GetAngleInDegrees (float rad_angle)
 
protected void Update ()
 
float NormalizeInvertAngle (float angle)
 
void UpdataControllerInput ()
 
override bool OnMouseButtonUp (Widget w, int x, int y, int button)
 

Variables

enum RadialMenuControlType m_Parent
 
protected Widget m_ItemCardsContainer
 
protected Widget m_RadialSelector
 
protected ImageWidget m_RadialSelectorImage
 
protected ImageWidget m_RadialSelectorPointerImage
 
protected int m_RadialSelectorOriginalColor
 
protected int m_RadialSelectorDisabledColor
 
protected Widget m_SelectedObject
 
protected ref map< Widget, floatm_RadialItemCards
 
protected float m_AngleRadOffset
 
protected ref Timer m_UpdateTimer
 
static const string RADIAL_SELECTOR = "RadialSelector"
 
static const string RADIAL_SELECTOR_IMAGE = "SelectorImage"
 
static const string RADIAL_SELECTOR_POINTER = "SelectorPointer"
 
static const string RADIAL_DELIMITER_CONTAINER = "RadialDelimiterContainer"
 
static const string RADIAL_ITEM_CARD_CONTAINER = "RadialItemCardContainer"
 
protected RadialMenuControlType m_ControlType
 
private UAIDWrapper m_SelectInputWrapper
 
private UAIDWrapper m_BackInputWrapper
 
protected float m_ControllerAngle
 
protected float m_ControllerTilt
 
protected int m_ControllerTimout
 
protected bool m_IsControllerTimoutEnabled = true
 
protected const float CONTROLLER_DESELECT_TIMEOUT = 1000
 
protected const float CONTROLLER_TILT_TRESHOLD_SELECT = 0.8
 
protected const float CONTROLLER_TILT_TRESHOLD_EXECUTE = 1.0
 
protected bool m_WidgetInitialized
 
protected const float MOUSE_SAFE_ZONE_RADIUS = 120
 
protected float m_RadiusOffset
 
protected float m_ExecuteDistanceOffset
 
protected float m_OffsetFromTop
 
protected float m_ItemCardRadiusOffset
 
protected string m_DelimiterLayout
 
ref UIScriptedMenu m_RegisteredClass
 
static ref RadialMenu m_Instance
 
int last_time = -1
 

Enumeration Type Documentation

◆ RadialMenuControlType

Enumerator
MOUSE 
CONTROLLER 

Function Documentation

◆ ActivateControllerTimeout()

void ActivateControllerTimeout ( bool  state)

◆ GetAngleInDegrees()

protected float GetAngleInDegrees ( float  rad_angle)

◆ GetInstance()

static RadialMenu GetInstance ( )
static

References m_Instance.

◆ GetItemCardsCount()

protected int GetItemCardsCount ( )

References m_ItemCardsContainer.

Referenced by Refresh().

◆ GetMouseDistance()

protected float GetMouseDistance ( )

◆ GetMousePointerAngle()

protected float GetMousePointerAngle ( )

References Math::Atan2(), GetMousePos(), and GetParentCenter().

Referenced by Update().

◆ GetObjectByDegAngle()

protected Widget GetObjectByDegAngle ( float  deg_angle)

◆ GetParentCenter()

protected void GetParentCenter ( out float  center_x,
out float  center_y 
)

References m_Parent.

Referenced by GetMouseDistance(), and GetMousePointerAngle().

◆ GetParentMinSize()

protected float GetParentMinSize ( )

References m_Parent, and Math::Min().

Referenced by GetRadius().

◆ GetRadius()

protected float GetRadius ( )

◆ HideRadialSelector()

protected void HideRadialSelector ( )

References m_RadialSelector.

Referenced by Refresh(), and Update().

◆ IsUsingController()

bool IsUsingController ( )

References m_ControlType.

Referenced by Update().

◆ IsUsingMouse()

bool IsUsingMouse ( )

References m_ControlType.

Referenced by Update().

◆ IsWidgetInitialized()

bool IsWidgetInitialized ( )

References m_WidgetInitialized.

◆ NormalizeInvertAngle()

float NormalizeInvertAngle ( float  angle)

Referenced by UpdataControllerInput().

◆ OnMouseButtonUp()

override bool OnMouseButtonUp ( Widget  w,
int  x,
int  y,
int  button 
)

◆ OnWidgetScriptInit()

◆ RadialMenu()

◆ Refresh()

◆ RegisterClass()

void RegisterClass ( UIScriptedMenu  class_name)

◆ SetControlType()

◆ SetExecuteDistOffset()

void SetExecuteDistOffset ( float  execute_dist_offset)

◆ SetItemCardRadiusOffset()

void SetItemCardRadiusOffset ( float  item_card_radius_offset)

◆ SetOffsetFromTop()

void SetOffsetFromTop ( float  offset_from_top)

References m_OffsetFromTop.

◆ SetRadiusOffset()

void SetRadiusOffset ( float  radius_offset)

References m_RadiusOffset.

◆ SetWidgetInitialized()

void SetWidgetInitialized ( bool  state)

References m_WidgetInitialized.

◆ SetWidgetProperties()

void SetWidgetProperties ( string  delimiter_layout)

References m_DelimiterLayout.

◆ ShowRadialSelector()

◆ UpdataControllerInput()

◆ ~RadialMenu()

void ~RadialMenu ( )

Variable Documentation

◆ CONTROLLER_DESELECT_TIMEOUT

protected const float CONTROLLER_DESELECT_TIMEOUT = 1000

Referenced by Update().

◆ CONTROLLER_TILT_TRESHOLD_EXECUTE

protected const float CONTROLLER_TILT_TRESHOLD_EXECUTE = 1.0

◆ CONTROLLER_TILT_TRESHOLD_SELECT

protected const float CONTROLLER_TILT_TRESHOLD_SELECT = 0.8

Referenced by Update().

◆ last_time

int last_time = -1

Referenced by Update().

◆ m_AngleRadOffset

protected float m_AngleRadOffset

Referenced by GetObjectByDegAngle(), and Refresh().

◆ m_BackInputWrapper

◆ m_ControllerAngle

protected float m_ControllerAngle

◆ m_ControllerTilt

protected float m_ControllerTilt

◆ m_ControllerTimout

protected int m_ControllerTimout

Referenced by UpdataControllerInput(), and Update().

◆ m_ControlType

◆ m_DelimiterLayout

protected string m_DelimiterLayout

Referenced by Refresh(), and SetWidgetProperties().

◆ m_ExecuteDistanceOffset

protected float m_ExecuteDistanceOffset

Referenced by SetExecuteDistOffset().

◆ m_Instance

◆ m_IsControllerTimoutEnabled

protected bool m_IsControllerTimoutEnabled = true

◆ m_ItemCardRadiusOffset

protected float m_ItemCardRadiusOffset

Referenced by Refresh(), and SetItemCardRadiusOffset().

◆ m_ItemCardsContainer

protected Widget m_ItemCardsContainer

◆ m_OffsetFromTop

protected float m_OffsetFromTop

Referenced by Refresh(), and SetOffsetFromTop().

◆ m_Parent

enum RadialMenuControlType m_Parent

◆ m_RadialItemCards

protected ref map<Widget, float> m_RadialItemCards

◆ m_RadialSelector

protected Widget m_RadialSelector

◆ m_RadialSelectorDisabledColor

protected int m_RadialSelectorDisabledColor

◆ m_RadialSelectorImage

protected ImageWidget m_RadialSelectorImage

◆ m_RadialSelectorOriginalColor

protected int m_RadialSelectorOriginalColor

◆ m_RadialSelectorPointerImage

protected ImageWidget m_RadialSelectorPointerImage

◆ m_RadiusOffset

protected float m_RadiusOffset

Referenced by GetRadius(), and SetRadiusOffset().

◆ m_RegisteredClass

◆ m_SelectedObject

◆ m_SelectInputWrapper

private UAIDWrapper m_SelectInputWrapper

◆ m_UpdateTimer

◆ m_WidgetInitialized

protected bool m_WidgetInitialized

◆ MOUSE_SAFE_ZONE_RADIUS

protected const float MOUSE_SAFE_ZONE_RADIUS = 120

Referenced by Update().

◆ RADIAL_DELIMITER_CONTAINER

const string RADIAL_DELIMITER_CONTAINER = "RadialDelimiterContainer"
static

Referenced by Refresh().

◆ RADIAL_ITEM_CARD_CONTAINER

const string RADIAL_ITEM_CARD_CONTAINER = "RadialItemCardContainer"
static

Referenced by OnWidgetScriptInit(), and Refresh().

◆ RADIAL_SELECTOR

const string RADIAL_SELECTOR = "RadialSelector"
static

Referenced by OnWidgetScriptInit().

◆ RADIAL_SELECTOR_IMAGE

const string RADIAL_SELECTOR_IMAGE = "SelectorImage"
static

Referenced by OnWidgetScriptInit().

◆ RADIAL_SELECTOR_POINTER

const string RADIAL_SELECTOR_POINTER = "SelectorPointer"
static

Referenced by OnWidgetScriptInit().