the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 116 lines 3.8 kB view raw
1#pragma once 2 3#include "UIScene.h" 4 5class UIComponent_Tooltips : public UIScene 6{ 7private: 8 bool m_bSplitscreen; 9 10protected: 11 typedef struct _TooltipValues 12 { 13 bool show; 14 int iString; 15 16 UIString label; 17 18 _TooltipValues() 19 { 20 show = false; 21 iString = -1; 22 } 23 } TooltipValues; 24 25 TooltipValues m_tooltipValues[eToolTipNumButtons]; 26 27 IggyName m_funcSetTooltip, m_funcSetOpacity, m_funcSetABSwap, m_funcUpdateLayout; 28 29#ifdef __PSVITA__ 30 enum ETouchInput 31 { 32 ETouchInput_Touch_A, 33 ETouchInput_Touch_B, 34 ETouchInput_Touch_X, 35 ETouchInput_Touch_Y, 36 ETouchInput_Touch_LT, 37 ETouchInput_Touch_RightTrigger, 38 ETouchInput_Touch_LeftBumper, 39 ETouchInput_Touch_RightBumper, 40 ETouchInput_Touch_LeftStick, 41 ETouchInput_Touch_RightStick, 42 ETouchInput_Touch_Select, 43 44 ETouchInput_Count, 45 }; 46 UIControl_Touch m_TouchController[ETouchInput_Count]; 47#endif 48 49 UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) 50#ifdef __PSVITA__ 51 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_A], "Touch_A") 52 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_B], "Touch_B") 53 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_X], "Touch_X") 54 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_Y], "Touch_Y") 55 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_LT], "Touch_LT") 56 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_RightTrigger], "Touch_RightTrigger") 57 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_LeftBumper], "Touch_LeftBumper") 58 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_RightBumper], "Touch_RightBumper") 59 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_LeftStick], "Touch_LeftStick") 60 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_RightStick], "Touch_RightStick") 61 UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_Select], "Touch_Select") 62#endif 63 UI_MAP_NAME( m_funcSetTooltip, L"SetToolTip") 64 UI_MAP_NAME( m_funcSetOpacity, L"SetOpacity") 65 UI_MAP_NAME( m_funcSetABSwap, L"SetABSwap") 66 UI_MAP_NAME( m_funcUpdateLayout, L"UpdateLayout") 67 UI_END_MAP_ELEMENTS_AND_NAMES() 68 69 virtual wstring getMoviePath(); 70 71 virtual F64 getSafeZoneHalfWidth(); 72 73public: 74 UIComponent_Tooltips(int iPad, void *initData, UILayer *parentLayer); 75 76 virtual EUIScene getSceneType() { return eUIComponent_Tooltips;} 77 78 // Returns true if this scene handles input 79 virtual bool stealsFocus() { return false; } 80 81 // Returns true if this scene has focus for the pad passed in 82 virtual bool hasFocus(int iPad) { return false; } 83 84 // Returns true if lower scenes in this scenes layer, or in any layer below this scenes layers should be hidden 85 virtual bool hidesLowerScenes() { return false; } 86 87 virtual void updateSafeZone(); 88 89 virtual void tick(); 90 91 // RENDERING 92 virtual void render(S32 width, S32 height, C4JRender::eViewportType viewport); 93 94 virtual void SetTooltipText( unsigned int tooltip, int iTextID ); 95 virtual void SetEnableTooltips( bool bVal ); 96 virtual void ShowTooltip( unsigned int tooltip, bool show ); 97 virtual void SetTooltips( int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, int iRS=-1, int iBack=-1, bool forceUpdate = false); 98 virtual void EnableTooltip( unsigned int tooltip, bool enable ); 99 100 virtual void handleReload(); 101 virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); 102 103 void overrideSFX(int iPad, int key, bool bVal); 104 105 106private: 107 bool _SetTooltip(unsigned int iToolTip, int iTextID); 108 void _SetTooltip(unsigned int iToolTipId, UIString label, bool show, bool force = false); 109 void _Relayout(); 110 111 bool m_overrideSFX[XUSER_MAX_COUNT][ACTION_MAX_MENU]; 112 113#ifdef __PSVITA__ 114 virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); 115#endif 116};