forked from cafeberry/cafeberry
add kbm support
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -411,7 +411,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
{
|
||||
bNoScrollSlots = true;
|
||||
}
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
bNoScrollSlots = true;
|
||||
#endif
|
||||
|
||||
@@ -983,7 +983,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots()
|
||||
{
|
||||
bNoScrollSlots = true;
|
||||
}
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
bNoScrollSlots = true;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "UIControl_SpaceIndicatorBar.h"
|
||||
#include "UIControl_BeaconEffectButton.h"
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
#include "UIControl_Touch.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ UIComponent_Tooltips::UIComponent_Tooltips(int iPad, void *initData, UILayer *pa
|
||||
// Setup all the Iggy references we need for this scene
|
||||
initialiseMovie();
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// initialise vita touch controls with ids
|
||||
for(unsigned int i = 0; i < ETouchInput_Count; ++i)
|
||||
{
|
||||
@@ -353,13 +353,13 @@ void UIComponent_Tooltips::_Relayout()
|
||||
IggyDataValue result;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcUpdateLayout, 0 , NULL );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// rebuild touchboxes
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__)
|
||||
void UIComponent_Tooltips::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased)
|
||||
{
|
||||
//app.DebugPrintf("ToolTip Touch ID = %i\n", iId);
|
||||
@@ -427,6 +427,69 @@ void UIComponent_Tooltips::handleTouchInput(unsigned int iPad, S32 x, S32 y, int
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif defined(_WINDOWS64)
|
||||
void UIComponent_Tooltips::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased)
|
||||
{
|
||||
app.DebugPrintf("MY NAME IS CLEVELEND BROWN\n");
|
||||
//app.DebugPrintf("ToolTip Touch ID = %i\n", iId);
|
||||
bool handled = false;
|
||||
|
||||
// 4J - TomK no tooltips no touch!
|
||||
if((!ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) && (app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_Tooltips) == 0))
|
||||
return;
|
||||
|
||||
// perform action on release
|
||||
if(bReleased)
|
||||
{
|
||||
switch(iId)
|
||||
{
|
||||
case ETouchInput_Touch_A:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_A\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_A);
|
||||
break;
|
||||
case ETouchInput_Touch_B:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_B\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_B);
|
||||
break;
|
||||
case ETouchInput_Touch_X:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_X\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_X);
|
||||
break;
|
||||
case ETouchInput_Touch_Y:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_Y\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_Y);
|
||||
break;
|
||||
case ETouchInput_Touch_LT:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_LT\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_LT);
|
||||
break;
|
||||
case ETouchInput_Touch_RightTrigger:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_RT\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_RT);
|
||||
break;
|
||||
case ETouchInput_Touch_LeftBumper:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_LB\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_LB);
|
||||
break;
|
||||
case ETouchInput_Touch_RightBumper:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_RB\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_RB);
|
||||
break;
|
||||
case ETouchInput_Touch_LeftStick:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_LTHUMB\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_LTHUMB);
|
||||
break;
|
||||
case ETouchInput_Touch_RightStick:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_RTHUMB\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_RTHUMB);
|
||||
break;
|
||||
case ETouchInput_Touch_Select:
|
||||
app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_BACK\n", iId);
|
||||
InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_BACK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void UIComponent_Tooltips::handleReload()
|
||||
|
||||
@@ -26,7 +26,7 @@ protected:
|
||||
|
||||
IggyName m_funcSetTooltip, m_funcSetOpacity, m_funcSetABSwap, m_funcUpdateLayout;
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
enum ETouchInput
|
||||
{
|
||||
ETouchInput_Touch_A,
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
#endif
|
||||
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_A], "Touch_A")
|
||||
UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_B], "Touch_B")
|
||||
UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_X], "Touch_X")
|
||||
@@ -110,7 +110,7 @@ private:
|
||||
|
||||
bool m_overrideSFX[XUSER_MAX_COUNT][ACTION_MAX_MENU];
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased);
|
||||
#endif
|
||||
};
|
||||
@@ -42,7 +42,7 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
|
||||
return res;
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIControl::UpdateControl()
|
||||
{
|
||||
F64 fx, fy, fwidth, fheight;
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
UIControl();
|
||||
|
||||
virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName);
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UpdateControl();
|
||||
void setHidden(bool bHidden) {m_bHidden=bHidden;}
|
||||
bool getHidden(void) {return m_bHidden;}
|
||||
|
||||
@@ -35,7 +35,7 @@ void UIControl_Button::init(UIString label, int id)
|
||||
value[1].number = id;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-PB - add this button to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
|
||||
@@ -35,7 +35,7 @@ void UIControl_ButtonList::init(int id)
|
||||
value[0].number = id;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 1 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-PB - add this buttonlist to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
@@ -159,7 +159,7 @@ void UIControl_ButtonList::setButtonLabel(int iButtonId, const wstring &label)
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcSetButtonLabel, 2 , value );
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIControl_ButtonList::SetTouchFocus(S32 iX, S32 iY, bool bRepeat)
|
||||
{
|
||||
IggyDataValue result;
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
void setButtonLabel(int iButtonId, const wstring &label);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void SetTouchFocus(S32 iX, S32 iY, bool bRepeat);
|
||||
bool CanTouchTrigger(S32 iX, S32 iY);
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,7 @@ void UIControl_CheckBox::init(UIString label, int id, bool checked)
|
||||
value[2].boolval = checked;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 3 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-TomK - add checkbox to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
|
||||
@@ -44,7 +44,7 @@ void UIControl_DynamicLabel::ReInit()
|
||||
|
||||
void UIControl_DynamicLabel::SetupTouch()
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-TomK - add this dynamic label to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
|
||||
@@ -49,7 +49,7 @@ void UIControl_HTMLLabel::setLabel(const string &label)
|
||||
|
||||
void UIControl_HTMLLabel::SetupTouch()
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-TomK - add this dynamic label to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
|
||||
@@ -17,7 +17,7 @@ bool UIControl_LeaderboardList::setupControl(UIScene *scene, IggyValuePath *pare
|
||||
m_funcResetLeaderboard = registerFastName(L"ResetLeaderboard");
|
||||
m_funcSetupTitles = registerFastName(L"SetupTitles");
|
||||
m_funcSetColumnIcon = registerFastName(L"SetColumnIcon");
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
m_funcSetTouchFocus = registerFastName(L"SetTouchFocus");
|
||||
m_bTouchInitialised = false;
|
||||
#endif
|
||||
@@ -82,7 +82,7 @@ void UIControl_LeaderboardList::initLeaderboard(int iFirstFocus, int iTotalEntri
|
||||
value[2].number = iNumColumns;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_funcInitLeaderboard , 3 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-PB - add this button to the vita touch box list
|
||||
if(!m_bTouchInitialised)
|
||||
{
|
||||
@@ -220,7 +220,7 @@ void UIControl_LeaderboardList::addDataSet(bool bLast, int iId, int iRank, const
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_funcAddDataSet , 12 , value );
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIControl_LeaderboardList::SetTouchFocus(S32 iX, S32 iY, bool bRepeat)
|
||||
{
|
||||
IggyDataValue result;
|
||||
|
||||
@@ -8,7 +8,7 @@ private:
|
||||
IggyName m_funcInitLeaderboard, m_funcAddDataSet;
|
||||
IggyName m_funcResetLeaderboard;
|
||||
IggyName m_funcSetupTitles, m_funcSetColumnIcon;
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
IggyName m_funcSetTouchFocus;
|
||||
bool m_bTouchInitialised;
|
||||
#endif
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
void setColumnIcon(int iColumn, int iType);
|
||||
void addDataSet(bool bLast, int iId, int iRank, const wstring &gamertag, bool bDisplayMessage, const wstring &col0, const wstring &col1, const wstring &col2, const wstring &col3, const wstring &col4, const wstring &col5, const wstring &col6);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void SetTouchFocus(S32 iX, S32 iY, bool bRepeat);
|
||||
#endif
|
||||
};
|
||||
@@ -52,7 +52,7 @@ void UIControl_Slider::init(UIString label, int id, int min, int max, int curren
|
||||
value[4].number = (int)current;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 5 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-TomK - add slider to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
|
||||
@@ -38,7 +38,7 @@ void UIControl_TextInput::init(UIString label, int id)
|
||||
value[1].number = id;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-TomK - add this buttonlist to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
|
||||
@@ -41,7 +41,7 @@ void UIControl_TexturePackList::init(const wstring &label, int id)
|
||||
value[1].number = id;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J-TomK - add this texturepack list to the vita touch box list
|
||||
|
||||
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
||||
|
||||
@@ -179,6 +179,10 @@ UIController::UIController()
|
||||
m_navigateToHomeOnReload = false;
|
||||
|
||||
m_bCleanupOnReload = false;
|
||||
|
||||
// PIEBOT: LCE UIs have the first element focused by default.
|
||||
// This is our solution.
|
||||
wasFocused = true;
|
||||
m_mcTTFFont = NULL;
|
||||
m_moj7 = NULL;
|
||||
m_moj11 = NULL;
|
||||
@@ -242,7 +246,7 @@ UIController::UIController()
|
||||
InitializeCriticalSection(&m_registeredCallbackScenesCS);
|
||||
//m_bSysUIShowing=false;
|
||||
m_bSystemUIShowing=false;
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
m_bTouchscreenPressed=false;
|
||||
#endif
|
||||
|
||||
@@ -938,7 +942,7 @@ void UIController::handleInput()
|
||||
handleKeyPress(iPad, key);
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
//CD - Vita requires key press 40 - select [MINECRAFT_ACTION_GAME_INFO]
|
||||
handleKeyPress(iPad, MINECRAFT_ACTION_GAME_INFO);
|
||||
#endif
|
||||
@@ -1144,6 +1148,203 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
|
||||
// ignore any other presses if the touchscreen has been used
|
||||
if(bTouchScreenInput) return;
|
||||
}
|
||||
#elif defined(_WINDOWS64)
|
||||
if(key==ACTION_MENU_OK)
|
||||
{
|
||||
bool bTouchScreenInput=false;
|
||||
|
||||
int mouseX = InputManager.GetMouseX();
|
||||
int mouseY = InputManager.GetMouseY();
|
||||
|
||||
bool lclick = InputManager.IsMouseLDown();
|
||||
|
||||
// fullscreen first
|
||||
UIScene *pScene=m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene();
|
||||
// also check tooltip scene if we're not touching anything in the main scene
|
||||
UIScene *pToolTips=m_groups[(int)eUIGroup_Fullscreen]->getTooltips();
|
||||
|
||||
if(pScene)
|
||||
{
|
||||
// scene touch check
|
||||
if(TouchBoxHit(pScene,mouseX,mouseY))
|
||||
{
|
||||
down=true;
|
||||
bTouchScreenInput=true;
|
||||
}
|
||||
// tooltip touch check (if scene exists but not component has been touched)
|
||||
else if(TouchBoxHit(pToolTips,mouseX,mouseY))
|
||||
{
|
||||
down=true;
|
||||
bTouchScreenInput=true;
|
||||
}
|
||||
else if (wasFocused)
|
||||
{
|
||||
// PIEBOT: New iID! -2 tells the SWF to deselect and unhighlight every element
|
||||
// so that we get proper mouse support!
|
||||
|
||||
if(pScene)
|
||||
{
|
||||
pScene->SetFocusToElement(-2);
|
||||
}
|
||||
else if (pToolTips)
|
||||
{
|
||||
pToolTips->SetFocusToElement(-2);
|
||||
}
|
||||
m_HighlightedUIElement = NULL;
|
||||
wasFocused = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pScene=m_groups[(EUIGroup)(iPad+1)]->getCurrentScene();
|
||||
pToolTips=m_groups[(int)iPad+1]->getTooltips();
|
||||
if(pScene)
|
||||
{
|
||||
// scene touch check
|
||||
if(TouchBoxHit(pScene,mouseX,mouseY))
|
||||
{
|
||||
down=true;
|
||||
bTouchScreenInput=true;
|
||||
}
|
||||
// tooltip touch check (if scene exists but not component has been touched)
|
||||
else if(TouchBoxHit(pToolTips,mouseX,mouseY))
|
||||
{
|
||||
down=true;
|
||||
bTouchScreenInput=true;
|
||||
}
|
||||
else if (wasFocused)
|
||||
{
|
||||
if(pScene)
|
||||
{
|
||||
pScene->SetFocusToElement(-2);
|
||||
}
|
||||
else if (pToolTips)
|
||||
{
|
||||
pToolTips->SetFocusToElement(-2);
|
||||
}
|
||||
m_HighlightedUIElement = NULL;
|
||||
wasFocused = false;
|
||||
}
|
||||
}
|
||||
else if(pToolTips)
|
||||
{
|
||||
// tooltip touch check (if scene does not exist)
|
||||
if(TouchBoxHit(pToolTips,mouseX,mouseY))
|
||||
{
|
||||
down=true;
|
||||
bTouchScreenInput=true;
|
||||
}
|
||||
else if (wasFocused)
|
||||
{
|
||||
if (pToolTips)
|
||||
{
|
||||
pToolTips->SetFocusToElement(-2);
|
||||
}
|
||||
m_HighlightedUIElement = NULL;
|
||||
wasFocused = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(down && m_HighlightedUIElement && bTouchScreenInput)
|
||||
{
|
||||
m_HighlightedUIElement->pControl->getParentScene()->SetFocusToElement(m_HighlightedUIElement->pControl->getId());
|
||||
|
||||
if (m_HighlightedUIElement->pControl->getControlType() == UIControl::eButtonList ||
|
||||
m_HighlightedUIElement->pControl->getControlType() == UIControl::eSaveList)
|
||||
{
|
||||
if (m_HighlightedUIElement->pControl->getControlType() == UIControl::eButtonList)
|
||||
{
|
||||
UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_HighlightedUIElement->pControl;
|
||||
pButtonList->SetTouchFocus((S32)mouseX, (S32)mouseY, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIControl_SaveList *pButtonList=(UIControl_SaveList *)m_HighlightedUIElement->pControl;
|
||||
pButtonList->SetTouchFocus((S32)mouseX, (S32)mouseY, false);
|
||||
}
|
||||
}
|
||||
wasFocused = true;
|
||||
}
|
||||
|
||||
if(down && lclick && !m_bTouchscreenPressed)
|
||||
{
|
||||
// just pressed
|
||||
pressed=true;
|
||||
m_bTouchscreenPressed=true;
|
||||
bTouchScreenInput=true;
|
||||
}
|
||||
else if(m_bTouchscreenPressed && !lclick)
|
||||
{
|
||||
// just released
|
||||
released=true;
|
||||
m_bTouchscreenPressed=false;
|
||||
bTouchScreenInput=true;
|
||||
}
|
||||
|
||||
/*
|
||||
if(pressed)
|
||||
{
|
||||
// Start repeat timer
|
||||
m_actionRepeatTimer[iPad][key] = GetTickCount() + UI_REPEAT_KEY_DELAY_MS;
|
||||
}
|
||||
else if (released)
|
||||
{
|
||||
// Stop repeat timer
|
||||
m_actionRepeatTimer[iPad][key] = 0;
|
||||
}
|
||||
else if (down)
|
||||
{
|
||||
// Check is enough time has elapsed to be a repeat key
|
||||
DWORD currentTime = GetTickCount();
|
||||
if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key])
|
||||
{
|
||||
repeat = true;
|
||||
pressed = true;
|
||||
m_actionRepeatTimer[iPad][key] = currentTime + UI_REPEAT_KEY_REPEAT_RATE_MS;
|
||||
}
|
||||
}
|
||||
*/
|
||||
// handle touch input
|
||||
HandleTouchInput(iPad, key, pressed, repeat, released);
|
||||
|
||||
// ignore any other presses if the touchscreen has been used
|
||||
if(bTouchScreenInput) return;
|
||||
}
|
||||
/*
|
||||
else if (InputManager.IsPadActive(0) && m_HighlightedUIElement == NULL)
|
||||
{
|
||||
// fullscreen first
|
||||
UIScene *pScene=m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene();
|
||||
// also check tooltip scene if we're not touching anything in the main scene
|
||||
UIScene *pToolTips=m_groups[(int)eUIGroup_Fullscreen]->getTooltips();
|
||||
|
||||
if(pScene)
|
||||
{
|
||||
if(pScene)
|
||||
{
|
||||
pScene->SetFocusToElement(-1);
|
||||
}
|
||||
else if (pToolTips)
|
||||
{
|
||||
pToolTips->SetFocusToElement(-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pScene=m_groups[(EUIGroup)(iPad+1)]->getCurrentScene();
|
||||
pToolTips=m_groups[(int)iPad+1]->getTooltips();
|
||||
|
||||
if(pScene)
|
||||
{
|
||||
pScene->SetFocusToElement(-1);
|
||||
}
|
||||
else if (pToolTips)
|
||||
{
|
||||
pToolTips->SetFocusToElement(-1);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
|
||||
down = InputManager.ButtonDown(iPad,key);
|
||||
@@ -3291,5 +3492,500 @@ void UIController::SendTouchInput(unsigned int iPad, unsigned int key, bool bPre
|
||||
}
|
||||
}
|
||||
|
||||
#elif _WINDOWS64
|
||||
void UIController::TouchBoxAdd(UIControl *pControl,UIScene *pUIScene)
|
||||
{
|
||||
EUIGroup eUIGroup=pUIScene->GetParentLayerGroup();
|
||||
EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer;
|
||||
EUIScene eUIscene=pUIScene->getSceneType();
|
||||
|
||||
TouchBoxAdd(pControl,eUIGroup,eUILayer,eUIscene, pUIScene->GetMainPanel());
|
||||
}
|
||||
|
||||
void UIController::TouchBoxAdd(UIControl *pControl,EUIGroup eUIGroup,EUILayer eUILayer,EUIScene eUIscene, UIControl *pMainPanelControl)
|
||||
{
|
||||
UIELEMENT *puiElement = new UIELEMENT;
|
||||
puiElement->pControl = pControl;
|
||||
|
||||
S32 iControlWidth = pControl->getWidth();
|
||||
S32 iControlHeight = pControl->getHeight();
|
||||
S32 iMainPanelOffsetX = 0;
|
||||
S32 iMainPanelOffsetY= 0;
|
||||
|
||||
// 4J-TomK add main panel offset if controls do not live in the root scene
|
||||
if(pMainPanelControl)
|
||||
{
|
||||
iMainPanelOffsetX = pMainPanelControl->getXPos();
|
||||
iMainPanelOffsetY = pMainPanelControl->getYPos();
|
||||
}
|
||||
|
||||
// 4J-TomK override control width / height where needed
|
||||
if(puiElement->pControl->getControlType() == UIControl::eSlider)
|
||||
{
|
||||
// Sliders are never scaled but masked, so we have to get the real width from AS
|
||||
UIControl_Slider *pSlider = (UIControl_Slider *)puiElement->pControl;
|
||||
iControlWidth = pSlider->GetRealWidth();
|
||||
}
|
||||
else if(puiElement->pControl->getControlType() == UIControl::eTexturePackList)
|
||||
{
|
||||
// The origin of the TexturePackList is NOT in the top left corner but where the slot area starts. therefore we need the height of the slot area itself.
|
||||
UIControl_TexturePackList *pTexturePackList = (UIControl_TexturePackList *)puiElement->pControl;
|
||||
iControlHeight = pTexturePackList->GetRealHeight();
|
||||
}
|
||||
else if(puiElement->pControl->getControlType() == UIControl::eDynamicLabel)
|
||||
{
|
||||
// The height and width of this control changes per how to play page
|
||||
UIControl_DynamicLabel *pDynamicLabel = (UIControl_DynamicLabel *)puiElement->pControl;
|
||||
iControlWidth = pDynamicLabel->GetRealWidth();
|
||||
iControlHeight = pDynamicLabel->GetRealHeight();
|
||||
}
|
||||
else if(puiElement->pControl->getControlType() == UIControl::eHTMLLabel)
|
||||
{
|
||||
// The height and width of this control changes per how to play page
|
||||
UIControl_HTMLLabel *pHtmlLabel = (UIControl_HTMLLabel *)puiElement->pControl;
|
||||
iControlWidth = pHtmlLabel->GetRealWidth();
|
||||
iControlHeight = pHtmlLabel->GetRealHeight();
|
||||
}
|
||||
|
||||
puiElement->x1=(S32)((float)pControl->getXPos() + (float)iMainPanelOffsetX);
|
||||
puiElement->y1=(S32)((float)pControl->getYPos() + (float)iMainPanelOffsetY);
|
||||
puiElement->x2=(S32)(((float)pControl->getXPos() + (float)iControlWidth + (float)iMainPanelOffsetX));
|
||||
puiElement->y2=(S32)(((float)pControl->getYPos() + (float)iControlHeight + (float)iMainPanelOffsetY));
|
||||
|
||||
if(puiElement->pControl->getControlType() == UIControl::eNoControl)
|
||||
{
|
||||
app.DebugPrintf("NO CONTROL!");
|
||||
}
|
||||
|
||||
if(puiElement->x1 == puiElement->x2 || puiElement->y1 == puiElement->y2)
|
||||
{
|
||||
app.DebugPrintf("NOT adding touchbox %d,%d,%d,%d\n",puiElement->x1,puiElement->y1,puiElement->x2,puiElement->y2);
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Adding touchbox %d,%d,%d,%d\n",puiElement->x1,puiElement->y1,puiElement->x2,puiElement->y2);
|
||||
m_TouchBoxes[eUIGroup][eUILayer][eUIscene].push_back(puiElement);
|
||||
}
|
||||
}
|
||||
|
||||
void UIController::TouchBoxRebuild(UIScene *pUIScene)
|
||||
{
|
||||
EUIGroup eUIGroup=pUIScene->GetParentLayerGroup();
|
||||
EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer;
|
||||
EUIScene eUIscene=pUIScene->getSceneType();
|
||||
|
||||
// if we delete an element, it's possible that the scene has re-arranged all the elements, so we need to rebuild the boxes
|
||||
ui.TouchBoxesClear(pUIScene);
|
||||
|
||||
// rebuild boxes
|
||||
AUTO_VAR(itEnd, pUIScene->GetControls()->end());
|
||||
for (AUTO_VAR(it, pUIScene->GetControls()->begin()); it != itEnd; it++)
|
||||
{
|
||||
UIControl *control=(UIControl *)*it;
|
||||
|
||||
if(control->getControlType() == UIControl::eButton ||
|
||||
control->getControlType() == UIControl::eSlider ||
|
||||
control->getControlType() == UIControl::eCheckBox ||
|
||||
control->getControlType() == UIControl::eTexturePackList ||
|
||||
control->getControlType() == UIControl::eButtonList ||
|
||||
control->getControlType() == UIControl::eTextInput ||
|
||||
control->getControlType() == UIControl::eDynamicLabel ||
|
||||
control->getControlType() == UIControl::eHTMLLabel ||
|
||||
control->getControlType() == UIControl::eLeaderboardList ||
|
||||
control->getControlType() == UIControl::eTouchControl)
|
||||
{
|
||||
if(control->getVisible())
|
||||
{
|
||||
// 4J-TomK update the control (it might have been moved by flash / AS)
|
||||
control->UpdateControl();
|
||||
|
||||
ui.TouchBoxAdd(control,eUIGroup,eUILayer,eUIscene, pUIScene->GetMainPanel());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UIController::TouchBoxesClear(UIScene *pUIScene)
|
||||
{
|
||||
EUIGroup eUIGroup=pUIScene->GetParentLayerGroup();
|
||||
EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer;
|
||||
EUIScene eUIscene=pUIScene->getSceneType();
|
||||
|
||||
AUTO_VAR(itEnd, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].end());
|
||||
for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; it++)
|
||||
{
|
||||
UIELEMENT *element=(UIELEMENT *)*it;
|
||||
delete element;
|
||||
}
|
||||
m_TouchBoxes[eUIGroup][eUILayer][eUIscene].clear();
|
||||
}
|
||||
|
||||
bool UIController::TouchBoxHit(UIScene *pUIScene,S32 x, S32 y)
|
||||
{
|
||||
EUIGroup eUIGroup=pUIScene->GetParentLayerGroup();
|
||||
EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer;
|
||||
EUIScene eUIscene=pUIScene->getSceneType();
|
||||
|
||||
// 4J-TomK let's do the transformation from touch resolution to screen resolution here, so our touchbox values always are in screen resolution!
|
||||
// PIEBOT: Thanks for the code TomK! Unfortunately we do have to make modifications
|
||||
// because this isn't a touchscreen device.
|
||||
|
||||
x *= (m_fScreenWidth/1280.0f);
|
||||
y *= (m_fScreenHeight/720.0f);
|
||||
|
||||
if(m_TouchBoxes[eUIGroup][eUILayer][eUIscene].size()>0)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].end());
|
||||
for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; it++)
|
||||
{
|
||||
UIELEMENT *element=(UIELEMENT *)*it;
|
||||
if(element->pControl->getHidden() == false && element->pControl->getVisible()) // ignore removed controls
|
||||
{
|
||||
if((x>=element->x1) &&(x<=element->x2) && (y>=element->y1) && (y<=element->y2))
|
||||
{
|
||||
if(!m_bTouchscreenPressed)
|
||||
{
|
||||
app.DebugPrintf("SET m_ActiveUIElement (Layer: %i) at x = %i y = %i\n", (int)eUILayer, (int)x, (int)y);
|
||||
m_ActiveUIElement = element;
|
||||
}
|
||||
// remember the currently highlighted element
|
||||
m_HighlightedUIElement = element;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//app.DebugPrintf("MISS at x = %i y = %i\n", (int)x, (int)y);
|
||||
m_HighlightedUIElement = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Handle Touch Input
|
||||
//
|
||||
void UIController::HandleTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased)
|
||||
{
|
||||
// no input? no handling!
|
||||
if(!bPressed && !bRepeat && !bReleased)
|
||||
{
|
||||
// override for instand repeat without delay!
|
||||
if(m_bTouchscreenPressed && m_ActiveUIElement && (
|
||||
m_ActiveUIElement->pControl->getControlType() == UIControl::eSlider ||
|
||||
m_ActiveUIElement->pControl->getControlType() == UIControl::eButtonList ||
|
||||
m_ActiveUIElement->pControl->getControlType() == UIControl::eTexturePackList ||
|
||||
m_ActiveUIElement->pControl->getControlType() == UIControl::eDynamicLabel ||
|
||||
m_ActiveUIElement->pControl->getControlType() == UIControl::eHTMLLabel ||
|
||||
m_ActiveUIElement->pControl->getControlType() == UIControl::eLeaderboardList ||
|
||||
m_ActiveUIElement->pControl->getControlType() == UIControl::eTouchControl))
|
||||
bRepeat = true; // the above controls need to be controllable without having the finger over them
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
int mouseX = InputManager.GetMouseX();
|
||||
int mouseY = InputManager.GetMouseY();
|
||||
|
||||
float x = mouseX * (m_fScreenWidth/1280.0f);
|
||||
float y = mouseY * (m_fScreenHeight/720.0f);
|
||||
|
||||
if(bPressed && !bRepeat && !bReleased) // PRESSED HANDLING
|
||||
{
|
||||
wasFocused = true;
|
||||
app.DebugPrintf("touch input pressed\n");
|
||||
switch(m_ActiveUIElement->pControl->getControlType())
|
||||
{
|
||||
case UIControl::eButton:
|
||||
{
|
||||
// set focus
|
||||
UIControl_Button *pButton=(UIControl_Button *)m_ActiveUIElement->pControl;
|
||||
pButton->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId());
|
||||
// override bPressed to false. we only want the button to trigger on touch release!
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eSlider:
|
||||
{
|
||||
// set focus
|
||||
UIControl_Slider *pSlider=(UIControl_Slider *)m_ActiveUIElement->pControl;
|
||||
pSlider->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId());
|
||||
break;
|
||||
}
|
||||
case UIControl::eCheckBox:
|
||||
{
|
||||
// set focus
|
||||
UIControl_CheckBox *pCheckbox=(UIControl_CheckBox *)m_ActiveUIElement->pControl;
|
||||
pCheckbox->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId());
|
||||
// override bPressed. we only want the checkbox to trigger on touch release!
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eSaveList:
|
||||
case UIControl::eButtonList:
|
||||
{
|
||||
// set focus to list
|
||||
UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl;
|
||||
pButtonList->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId());
|
||||
// tell list where we tapped it so it can set focus to the correct button
|
||||
pButtonList->SetTouchFocus((float)x, (float)y, false);
|
||||
// override bPressed. we only want the ButtonList to trigger on touch release!
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eTexturePackList:
|
||||
{
|
||||
// set focus to list
|
||||
UIControl_TexturePackList *pTexturePackList=(UIControl_TexturePackList *)m_ActiveUIElement->pControl;
|
||||
pTexturePackList->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId());
|
||||
// tell list where we tapped it so it can set focus to the correct texture pack
|
||||
pTexturePackList->SetTouchFocus((float)x - (float)m_ActiveUIElement->x1, (float)y - (float)m_ActiveUIElement->y1, false);
|
||||
// override bPressed. we only want the TexturePack List to trigger on touch release!
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eTextInput:
|
||||
{
|
||||
// set focus
|
||||
UIControl_TextInput *pTextInput=(UIControl_TextInput *)m_ActiveUIElement->pControl;
|
||||
pTextInput->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId());
|
||||
// override bPressed to false. we only want the textinput to trigger on touch release!
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eDynamicLabel:
|
||||
{
|
||||
// handle dynamic label scrolling
|
||||
UIControl_DynamicLabel *pDynamicLabel=(UIControl_DynamicLabel *)m_ActiveUIElement->pControl;
|
||||
pDynamicLabel->TouchScroll(y, true);
|
||||
// override bPressed to false
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eHTMLLabel:
|
||||
{
|
||||
// handle dynamic label scrolling
|
||||
UIControl_HTMLLabel *pHtmlLabel=(UIControl_HTMLLabel *)m_ActiveUIElement->pControl;
|
||||
pHtmlLabel->TouchScroll(y, true);
|
||||
// override bPressed to false
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eLeaderboardList:
|
||||
{
|
||||
// set focus to list
|
||||
UIControl_LeaderboardList *pLeaderboardList=(UIControl_LeaderboardList *)m_ActiveUIElement->pControl;
|
||||
// tell list where we tapped it so it can set focus to the correct button
|
||||
pLeaderboardList->SetTouchFocus((float)x, (float)y, false);
|
||||
// override bPressed. we only want the ButtonList to trigger on touch release!
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eTouchControl:
|
||||
{
|
||||
// pass on touch input to relevant parent scene so we can handle it there!
|
||||
m_ActiveUIElement->pControl->getParentScene()->handleTouchInput(iPad, x, y, m_ActiveUIElement->pControl->getId(), bPressed, bRepeat, bReleased);
|
||||
// override bPressed to false
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
case UIControl::eSaveList:
|
||||
{
|
||||
// pass on touch input to relevant parent scene so we can handle it there!
|
||||
app.DebugPrintf("Hmmm\n");
|
||||
// override bPressed to false
|
||||
bPressed = false;
|
||||
break;
|
||||
}
|
||||
*/
|
||||
default:
|
||||
app.DebugPrintf("PRESSED - UNHANDLED UI ELEMENT\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(bRepeat) // REPEAT HANDLING
|
||||
{
|
||||
wasFocused = true;
|
||||
switch(m_ActiveUIElement->pControl->getControlType())
|
||||
{
|
||||
case UIControl::eButton:
|
||||
/* no action */
|
||||
break;
|
||||
case UIControl::eSlider:
|
||||
{
|
||||
// handle slider movement
|
||||
UIControl_Slider *pSlider=(UIControl_Slider *)m_ActiveUIElement->pControl;
|
||||
float fNewSliderPos = ((float)x - (float)m_ActiveUIElement->x1) / (float)pSlider->GetRealWidth();
|
||||
pSlider->SetSliderTouchPos(fNewSliderPos);
|
||||
break;
|
||||
}
|
||||
case UIControl::eCheckBox:
|
||||
{
|
||||
/* no action */
|
||||
bRepeat = false;
|
||||
bPressed = false;
|
||||
}
|
||||
break;
|
||||
case UIControl::eButtonList:
|
||||
{
|
||||
// handle button list scrolling
|
||||
UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl;
|
||||
pButtonList->SetTouchFocus((float)x, (float)y, true);
|
||||
}
|
||||
break;
|
||||
case UIControl::eTexturePackList:
|
||||
{
|
||||
// handle texturepack list scrolling
|
||||
UIControl_TexturePackList *pTexturePackList=(UIControl_TexturePackList *)m_ActiveUIElement->pControl;
|
||||
pTexturePackList->SetTouchFocus((float)x - (float)m_ActiveUIElement->x1, (float)y - (float)m_ActiveUIElement->y1, true);
|
||||
break;
|
||||
}
|
||||
case UIControl::eTextInput:
|
||||
/* no action */
|
||||
bRepeat = false;
|
||||
bPressed = false;
|
||||
break;
|
||||
case UIControl::eDynamicLabel:
|
||||
{
|
||||
// handle dynamic label scrolling
|
||||
UIControl_DynamicLabel *pDynamicLabel=(UIControl_DynamicLabel *)m_ActiveUIElement->pControl;
|
||||
pDynamicLabel->TouchScroll(y, true);
|
||||
// override bPressed & bRepeat to false
|
||||
bPressed = false;
|
||||
bRepeat = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eHTMLLabel:
|
||||
{
|
||||
// handle dynamic label scrolling
|
||||
UIControl_HTMLLabel *pHtmlLabel=(UIControl_HTMLLabel *)m_ActiveUIElement->pControl;
|
||||
pHtmlLabel->TouchScroll(y, true);
|
||||
// override bPressed & bRepeat to false
|
||||
bPressed = false;
|
||||
bRepeat = false;
|
||||
break;
|
||||
}
|
||||
case UIControl::eLeaderboardList:
|
||||
{
|
||||
// handle button list scrolling
|
||||
UIControl_LeaderboardList *pLeaderboardList=(UIControl_LeaderboardList *)m_ActiveUIElement->pControl;
|
||||
pLeaderboardList->SetTouchFocus((float)x, (float)y, true);
|
||||
break;
|
||||
}
|
||||
case UIControl::eTouchControl:
|
||||
{
|
||||
// override bPressed to false
|
||||
bPressed = false;
|
||||
// pass on touch input to relevant parent scene so we can handle it there!
|
||||
m_ActiveUIElement->pControl->getParentScene()->handleTouchInput(iPad, x, y, m_ActiveUIElement->pControl->getId(), bPressed, bRepeat, bReleased);
|
||||
// override bRepeat to false
|
||||
bRepeat = false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
app.DebugPrintf("REPEAT - UNHANDLED UI ELEMENT\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(bReleased) // RELEASED HANDLING
|
||||
{
|
||||
wasFocused = true;
|
||||
app.DebugPrintf("touch input released\n");
|
||||
switch(m_ActiveUIElement->pControl->getControlType())
|
||||
{
|
||||
case UIControl::eButton:
|
||||
// trigger button on release (ONLY if the finger is still on it!)
|
||||
if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl)
|
||||
bPressed = true;
|
||||
break;
|
||||
case UIControl::eSlider:
|
||||
/* no action */
|
||||
break;
|
||||
case UIControl::eCheckBox:
|
||||
// trigger checkbox on release (ONLY if the finger is still on it!)
|
||||
if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl)
|
||||
{
|
||||
UIControl_CheckBox *pCheckbox=(UIControl_CheckBox *)m_ActiveUIElement->pControl;
|
||||
if(pCheckbox->IsEnabled()) // only proceed if checkbox is enabled!
|
||||
pCheckbox->TouchSetCheckbox(!pCheckbox->IsChecked());
|
||||
}
|
||||
bReleased = false;
|
||||
break;
|
||||
case UIControl::eButtonList:
|
||||
// trigger buttonlist on release (ONLY if the finger is still on it!)
|
||||
if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl)
|
||||
{
|
||||
UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl;
|
||||
if(pButtonList->CanTouchTrigger(x,y))
|
||||
bPressed = true;
|
||||
}
|
||||
break;
|
||||
case UIControl::eTexturePackList:
|
||||
// trigger texturepack list on release (ONLY if the finger is still on it!)
|
||||
if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl)
|
||||
{
|
||||
UIControl_TexturePackList *pTexturePackList=(UIControl_TexturePackList *)m_ActiveUIElement->pControl;
|
||||
if(pTexturePackList->CanTouchTrigger((float)x - (float)m_ActiveUIElement->x1, (float)y - (float)m_ActiveUIElement->y1))
|
||||
bPressed = true;
|
||||
}
|
||||
break;
|
||||
case UIControl::eTextInput:
|
||||
// trigger TextInput on release (ONLY if the finger is still on it!)
|
||||
if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl)
|
||||
bPressed = true;
|
||||
break;
|
||||
case UIControl::eDynamicLabel:
|
||||
{
|
||||
// handle dynamic label scrolling
|
||||
UIControl_DynamicLabel *pDynamicLabel=(UIControl_DynamicLabel *)m_ActiveUIElement->pControl;
|
||||
pDynamicLabel->TouchScroll(y, false);
|
||||
break;
|
||||
}
|
||||
case UIControl::eHTMLLabel:
|
||||
{
|
||||
// handle dynamic label scrolling
|
||||
UIControl_HTMLLabel *pHtmlLabel=(UIControl_HTMLLabel *)m_ActiveUIElement->pControl;
|
||||
pHtmlLabel->TouchScroll(y, false);
|
||||
break;
|
||||
}
|
||||
case UIControl::eLeaderboardList:
|
||||
/* no action */
|
||||
break;
|
||||
case UIControl::eTouchControl:
|
||||
// trigger only if touch is released over the same component!
|
||||
if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl)
|
||||
{
|
||||
// pass on touch input to relevant parent scene so we can handle it there!
|
||||
m_ActiveUIElement->pControl->getParentScene()->handleTouchInput(iPad, x, y, m_ActiveUIElement->pControl->getId(), bPressed, bRepeat, bReleased);
|
||||
}
|
||||
// override bReleased to false
|
||||
bReleased = false;
|
||||
break;
|
||||
default:
|
||||
app.DebugPrintf("RELEASED - UNHANDLED UI ELEMENT\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// only proceed if there's input to be handled
|
||||
if(bPressed || bRepeat || bReleased)
|
||||
{
|
||||
SendTouchInput(iPad, key, bPressed, bRepeat, bReleased);
|
||||
}
|
||||
}
|
||||
|
||||
void UIController::SendTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased)
|
||||
{
|
||||
bool handled = false;
|
||||
|
||||
// Send the key to the fullscreen group first
|
||||
m_groups[(int)eUIGroup_Fullscreen]->handleInput(iPad, key, bRepeat, bPressed, bReleased, handled);
|
||||
if(!handled)
|
||||
{
|
||||
// If it's not been handled yet, then pass the event onto the players specific group
|
||||
m_groups[(iPad+1)]->handleInput(iPad, key, bRepeat, bPressed, bReleased, handled);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
|
||||
private:
|
||||
// 4J-PB - ui element type for PSVita touch control
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -190,7 +190,7 @@ private:
|
||||
|
||||
public:
|
||||
UIController();
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void TouchBoxAdd(UIControl *pControl,UIScene *pUIScene);
|
||||
bool TouchBoxHit(UIScene *pUIScene,S32 x, S32 y);
|
||||
void TouchBoxesClear(UIScene *pUIScene);
|
||||
@@ -203,6 +203,8 @@ public:
|
||||
void TouchBoxAdd(UIControl *pControl,EUIGroup eUIGroup,EUILayer eUILayer,EUIScene eUIscene, UIControl *pMainPanelControl);
|
||||
UIELEMENT *m_ActiveUIElement;
|
||||
UIELEMENT *m_HighlightedUIElement;
|
||||
|
||||
bool wasFocused;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@@ -18,7 +18,7 @@ UIGroup::UIGroup(EUIGroup group, int iPad)
|
||||
for(unsigned int i = 0; i < eUILayer_COUNT; ++i)
|
||||
{
|
||||
m_layers[i] = new UILayer(this);
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
m_layers[i]->m_iLayer=(EUILayer)i;
|
||||
#endif
|
||||
}
|
||||
@@ -206,7 +206,7 @@ bool UIGroup::HasFocus(int iPad)
|
||||
return hasFocus;
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UIScene *UIGroup::getCurrentScene()
|
||||
{
|
||||
UIScene *pScene;
|
||||
|
||||
@@ -37,7 +37,7 @@ private:
|
||||
public:
|
||||
UIGroup(EUIGroup group, int iPad);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
EUIGroup GetGroup() {return m_group;}
|
||||
#endif
|
||||
UIComponent_Tooltips *getTooltips() { return m_tooltips; }
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
// INPUT
|
||||
void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// Current active scene
|
||||
UIScene *getCurrentScene();
|
||||
#endif
|
||||
|
||||
@@ -594,7 +594,7 @@ void UILayer::removeComponent(EUIScene scene)
|
||||
{
|
||||
if( (*compIt)->getSceneType() == scene)
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// remove any touchboxes
|
||||
ui.TouchBoxesClear((*compIt));
|
||||
#endif
|
||||
@@ -613,7 +613,7 @@ void UILayer::removeComponent(EUIScene scene)
|
||||
|
||||
void UILayer::removeScene(UIScene *scene)
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// remove any touchboxes
|
||||
ui.TouchBoxesClear(scene);
|
||||
#endif
|
||||
@@ -643,7 +643,7 @@ void UILayer::closeAllScenes()
|
||||
m_sceneStack.clear();
|
||||
for(AUTO_VAR(it, temp.begin()); it != temp.end(); ++it)
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// remove any touchboxes
|
||||
ui.TouchBoxesClear(*it);
|
||||
#endif
|
||||
@@ -775,7 +775,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */)
|
||||
return m_hasFocus;
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UIScene *UILayer::getCurrentScene()
|
||||
{
|
||||
// Note: reverse iterator, the last element is the top of the stack
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
bool m_bIgnoreAutosaveMenuDisplayed;
|
||||
bool m_bIgnorePlayerJoinMenuDisplayed;
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
EUILayer m_iLayer;
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
// INPUT
|
||||
void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// Current active scene
|
||||
UIScene *getCurrentScene();
|
||||
#endif
|
||||
|
||||
@@ -234,7 +234,7 @@ void UIScene::initialiseMovie()
|
||||
m_bUpdateOpacity = true;
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIScene::SetFocusToElement(int iID)
|
||||
{
|
||||
IggyDataValue result;
|
||||
@@ -530,7 +530,7 @@ void UIScene::removeControl( UIControl_Base *control, bool centreScene)
|
||||
value[1].boolval = centreScene;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcRemoveObject , 2 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// update the button positions since they may have changed
|
||||
UpdateSceneControls();
|
||||
|
||||
@@ -1237,7 +1237,7 @@ UIScene *UIScene::getBackScene()
|
||||
{
|
||||
return m_backScene;
|
||||
}
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIScene::UpdateSceneControls()
|
||||
{
|
||||
AUTO_VAR(itEnd, GetControls()->end());
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
int getRenderWidth() { return m_renderWidth; }
|
||||
int getRenderHeight() { return m_renderHeight; }
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UILayer *GetParentLayer() {return m_parentLayer;}
|
||||
EUIGroup GetParentLayerGroup() {return m_parentLayer->m_parentGroup->GetGroup();}
|
||||
vector<UIControl *> *GetControls() {return &m_controls;}
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
virtual void tick();
|
||||
|
||||
IggyName registerFastName(const wstring &name);
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void SetFocusToElement(int iID);
|
||||
void UpdateSceneControls();
|
||||
#endif
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
|
||||
#include "UIScene_CraftingMenu.h"
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
#define GAME_CRAFTING_TOUCHUPDATE_TIMER_ID 0
|
||||
#define GAME_CRAFTING_TOUCHUPDATE_TIMER_TIME 100
|
||||
#endif
|
||||
@@ -176,7 +176,7 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p
|
||||
// 4J-PB - Must be after the CanBeMade list has been set up with CheckRecipesAvailable
|
||||
UpdateTooltips();
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// initialise vita touch controls with ids
|
||||
for(unsigned int i = 0; i < ETouchInput_Count; ++i)
|
||||
{
|
||||
@@ -254,7 +254,7 @@ wstring UIScene_CraftingMenu::getMoviePath()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UIControl* UIScene_CraftingMenu::GetMainPanel()
|
||||
{
|
||||
return &m_controlMainPanel;
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
virtual void customDraw(IggyCustomDrawCallbackRegion *region);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased);
|
||||
virtual UIControl* GetMainPanel();
|
||||
virtual void handleTouchBoxRebuild();
|
||||
@@ -86,7 +86,7 @@ protected:
|
||||
IggyName m_funcMoveSelector, m_funcSelectVerticalItem, m_funcSetActiveTab;
|
||||
IggyName m_funcShowPanelDisplay, m_funcShowIngredientSlot;
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
enum ETouchInput
|
||||
{
|
||||
ETouchInput_TouchPanel_0,
|
||||
@@ -157,7 +157,7 @@ protected:
|
||||
UI_MAP_NAME( m_funcShowPanelDisplay, L"showPanelDisplay")
|
||||
UI_MAP_NAME( m_funcShowIngredientSlot, L"ShowIngredient")
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_0], "TouchPanel_0" )
|
||||
UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_1], "TouchPanel_1" )
|
||||
UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_2], "TouchPanel_2" )
|
||||
|
||||
@@ -622,7 +622,7 @@ void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue)
|
||||
|
||||
void UIScene_CreateWorldMenu::handleTimerComplete(int id)
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls
|
||||
if(m_bRebuildTouchBoxes)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
#define GAME_CREATIVE_TOUCHUPDATE_TIMER_ID 0
|
||||
#define GAME_CREATIVE_TOUCHUPDATE_TIMER_TIME 100
|
||||
#endif
|
||||
@@ -54,7 +54,7 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p
|
||||
m_curTab = eCreativeInventoryTab_COUNT;
|
||||
switchTab(eCreativeInventoryTab_BuildingBlocks);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// initialise vita touch controls with ids
|
||||
for(unsigned int i = 0; i < ETouchInput_Count; ++i)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ wstring UIScene_CreativeMenu::getMoviePath()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UIControl* UIScene_CreativeMenu::GetMainPanel()
|
||||
{
|
||||
return &m_controlMainPanel;
|
||||
|
||||
@@ -29,7 +29,7 @@ protected:
|
||||
ETouchInput_Count,
|
||||
};
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// 4J - TomK - this only needs to be a touch component on vita!
|
||||
UIControl_Touch m_TouchInput[ETouchInput_Count];
|
||||
#else
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
// INPUT
|
||||
virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased);
|
||||
virtual UIControl* GetMainPanel();
|
||||
virtual void handleTouchBoxRebuild();
|
||||
|
||||
@@ -69,7 +69,7 @@ UIScene_DLCOffersMenu::UIScene_DLCOffersMenu(int iPad, void *initData, UILayer *
|
||||
addTimer( PLAYER_ONLINE_TIMER_ID, PLAYER_ONLINE_TIMER_TIME );
|
||||
#endif
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ UIScene_EULA::UIScene_EULA(int iPad, void *initData, UILayer *parentLayer) : UIS
|
||||
|
||||
//ui.setFontCachingCalculationBuffer(20000);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData,
|
||||
thread->Run();
|
||||
threadStarted = true;
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
|
||||
@@ -200,7 +200,7 @@ void UIScene_FullscreenProgress::tick()
|
||||
m_threadCompleted = true;
|
||||
m_buttonConfirm.setVisible( true );
|
||||
// 4J-TomK - rebuild touch after confirm button made visible again
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
updateTooltips();
|
||||
|
||||
@@ -337,7 +337,7 @@ void UIScene_HowToPlay::StartPage( EHowToPlayPage ePage )
|
||||
|
||||
TelemetryManager->RecordMenuShown(m_iPad, eUIScene_HowToPlay, (ETelemetry_HowToPlay_SubMenuId)ePage);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ UIScene_InGamePlayerOptionsMenu::UIScene_InGamePlayerOptionsMenu(int iPad, void
|
||||
|
||||
g_NetworkManager.RegisterPlayerChangedCallback(m_iPad, &UIScene_InGamePlayerOptionsMenu::OnPlayerChanged, this);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ UIScene_Intro::UIScene_Intro(int iPad, void *initData, UILayer *parentLayer) : U
|
||||
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetIntroPlatform , 3 , value );
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// initialise vita touch controls with ids
|
||||
m_TouchToSkip.init(0);
|
||||
#endif
|
||||
@@ -106,7 +106,7 @@ void UIScene_Intro::handleInput(int iPad, int key, bool repeat, bool pressed, bo
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIScene_Intro::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased)
|
||||
{
|
||||
if(bReleased)
|
||||
|
||||
@@ -9,11 +9,11 @@ private:
|
||||
bool m_bAnimationEnded;
|
||||
|
||||
IggyName m_funcSetIntroPlatform;
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UIControl_Touch m_TouchToSkip;
|
||||
#endif
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UI_MAP_ELEMENT( m_TouchToSkip, "TouchToSkip" )
|
||||
#endif
|
||||
UI_MAP_NAME( m_funcSetIntroPlatform, L"SetIntroPlatform")
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
virtual void handleAnimationEnd();
|
||||
virtual void handleGainFocus(bool navBack);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
|
||||
|
||||
addTimer(GAME_CREATE_ONLINE_TIMER_ID,GAME_CREATE_ONLINE_TIMER_TIME);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// initialise vita tab controls with ids
|
||||
m_TouchTabWorld.init(ETouchInput_TabWorld);
|
||||
m_TouchTabGame.init(ETouchInput_TabGame);
|
||||
@@ -311,7 +311,7 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased)
|
||||
{
|
||||
if(bPressed)
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
eControl_Count
|
||||
};
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
enum ETouchInput
|
||||
{
|
||||
ETouchInput_TabWorld = eControl_Count,
|
||||
@@ -68,7 +68,7 @@ private:
|
||||
|
||||
UI_MAP_ELEMENT( m_gameOptions, "GameOptions")
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS(m_gameOptions)
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UI_MAP_ELEMENT( m_TouchTabGame, "TouchTabGame" )
|
||||
#endif
|
||||
UI_MAP_ELEMENT( m_labelDescription_GameOptions, "Description_GameOptions")
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
|
||||
UI_MAP_ELEMENT(m_worldOptions, "WorldOptions")
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS(m_worldOptions)
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UI_MAP_ELEMENT( m_TouchTabWorld, "TouchTabWorld" )
|
||||
#endif
|
||||
UI_MAP_ELEMENT( m_labelDescription_WorldOptions, "Description_WorldOptions")
|
||||
@@ -158,7 +158,7 @@ private:
|
||||
bool m_bUpdateOnline; // If true, update online settings on next tick
|
||||
void UpdateOnline();
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased);
|
||||
virtual UIControl* GetMainPanel();
|
||||
#endif //__PSVITA__
|
||||
|
||||
@@ -958,7 +958,7 @@ void UIScene_LoadMenu::handleTouchBoxRebuild()
|
||||
|
||||
void UIScene_LoadMenu::handleTimerComplete(int id)
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls
|
||||
if(m_bRebuildTouchBoxes)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ UIScene_MessageBox::UIScene_MessageBox(int iPad, void *initData, UILayer *parent
|
||||
parentLayer->addComponent(iPad,eUIComponent_MenuBackground);
|
||||
|
||||
// 4J-TomK - rebuild touch after auto resize
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ UIScene_NewUpdateMessage::UIScene_NewUpdateMessage(int iPad, void *initData, UIL
|
||||
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ UIScene_SaveMessage::UIScene_SaveMessage(int iPad, void *initData, UILayer *pare
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
// 4J-TomK - rebuild touch after auto resize
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ UIScene_SkinSelectMenu::UIScene_SkinSelectMenu(int iPad, void *initData, UILayer
|
||||
m_centreLabel = L"";
|
||||
m_rightLabel = L"";
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// initialise vita tab controls with ids
|
||||
m_TouchTabLeft.init(ETouchInput_TabLeft);
|
||||
m_TouchTabRight.init(ETouchInput_TabRight);
|
||||
@@ -1300,7 +1300,7 @@ void UIScene_SkinSelectMenu::setRightLabel(const wstring &label)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIScene_SkinSelectMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased)
|
||||
{
|
||||
if(bPressed)
|
||||
|
||||
@@ -11,7 +11,7 @@ private:
|
||||
// 4J Stu - How many to show on each side of the main control
|
||||
static const BYTE sidePreviewControls = 4;
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
enum ETouchInput
|
||||
{
|
||||
ETouchInput_TabLeft = 10,
|
||||
@@ -50,13 +50,13 @@ private:
|
||||
UIControl_Label m_labelSkinName, m_labelSkinOrigin;
|
||||
UIControl_Label m_labelSelected;
|
||||
UIControl m_controlSkinNamePlate, m_controlSelectedPanel, m_controlIggyCharacters, m_controlTimer;
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UIControl_Touch m_TouchTabLeft, m_TouchTabRight, m_TouchTabCenter, m_TouchIggyCharacters;
|
||||
#endif
|
||||
IggyName m_funcSetPlayerCharacterSelected, m_funcSetCharacterLocked;
|
||||
IggyName m_funcSetLeftLabel, m_funcSetRightLabel, m_funcSetCentreLabel;
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UI_MAP_ELEMENT( m_TouchTabLeft, "TouchTabLeft" )
|
||||
UI_MAP_ELEMENT( m_TouchTabRight, "TouchTabRight" )
|
||||
UI_MAP_ELEMENT( m_TouchTabCenter, "TouchTabCenter" )
|
||||
@@ -174,7 +174,7 @@ private:
|
||||
void AddFavoriteSkin(int iPad,int iSkinID);
|
||||
|
||||
void InputActionOK(unsigned int iPad);
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased);
|
||||
#endif //__PSVITA__
|
||||
virtual void handleReload();
|
||||
|
||||
@@ -22,6 +22,8 @@ Input::Input()
|
||||
|
||||
void Input::tick(LocalPlayer *player)
|
||||
{
|
||||
if(!InputManager.IsMouseCaptured())
|
||||
InputManager.SetMouseCaptured(true);
|
||||
// 4J Stu - Assume that we only need one input class, even though the java has subclasses for keyboard/controller
|
||||
// This function is based on the ControllerInput class in the Java, and will probably need changed
|
||||
//OutputDebugString("INPUT: Beginning input tick\n");
|
||||
@@ -40,6 +42,14 @@ void Input::tick(LocalPlayer *player)
|
||||
else
|
||||
ya = 0.0f;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (InputManager.IsKeyDown('A')) xa = 1.0f;
|
||||
else if (InputManager.IsKeyDown('D')) xa = -1.0f;
|
||||
|
||||
if (InputManager.IsKeyDown('W')) ya = 1.0f;
|
||||
else if (InputManager.IsKeyDown('S')) ya = -1.0f;
|
||||
#endif
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if (app.GetFreezePlayers())
|
||||
{
|
||||
@@ -99,8 +109,26 @@ void Input::tick(LocalPlayer *player)
|
||||
}
|
||||
tx = ty = 0.0f;
|
||||
}
|
||||
player->interpolateTurn(tx * abs(tx) * turnSpeed, ty * abs(ty) * turnSpeed);
|
||||
|
||||
|
||||
float turnX = tx * abs(tx) * turnSpeed;
|
||||
float turnY = ty * abs(ty) * turnSpeed;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
//if (InputManager.IsMouseCaptured())
|
||||
{
|
||||
float mouseSensitivity = ((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InGame)) / 100.0f;
|
||||
float mx = (float)InputManager.GetRawMouseX() * (mouseSensitivity * 5.0f);
|
||||
float my = -(float)InputManager.GetRawMouseY() * (mouseSensitivity * 5.0f);
|
||||
if ( app.GetGameSettings(iPad,eGameSetting_ControlInvertLook) )
|
||||
my = -my;
|
||||
|
||||
turnX += mx;
|
||||
turnY += my;
|
||||
}
|
||||
//else
|
||||
#endif
|
||||
player->interpolateTurn(turnX, turnY);
|
||||
|
||||
//jumping = controller.isButtonPressed(0);
|
||||
|
||||
|
||||
@@ -110,6 +138,12 @@ void Input::tick(LocalPlayer *player)
|
||||
else
|
||||
jumping = false;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (InputManager.IsKeyDown(VK_SPACE)) jumping = true;
|
||||
if (InputManager.IsKeyDown(VK_SHIFT)) sneaking = true;
|
||||
else sneaking = false;
|
||||
#endif
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if (app.GetFreezePlayers()) jumping = false;
|
||||
#endif
|
||||
|
||||
@@ -1032,7 +1032,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CU</C
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>__DISABLE_MILES__;_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallAttributedProfiling>Disabled</CallAttributedProfiling>
|
||||
<AdditionalIncludeDirectories>Windows64\Iggy\include;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
@@ -4485,13 +4485,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
|
||||
@@ -21642,13 +21642,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -501,6 +501,13 @@ void Minecraft::setScreen(Screen *screen)
|
||||
this->screen->removed();
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (screen != nullptr && InputManager.IsMouseCaptured())
|
||||
{
|
||||
InputManager.SetMouseCaptured(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
//4J Gordon: Do not force a stats save here
|
||||
/*if (dynamic_cast<TitleScreen *>(screen)!=NULL)
|
||||
{
|
||||
@@ -2184,8 +2191,24 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (iPad == ProfileManager.GetPrimaryPad())
|
||||
{
|
||||
if ((screen != nullptr || ui.GetMenuDisplayed(iPad)) && InputManager.IsMouseCaptured())
|
||||
{
|
||||
InputManager.SetMouseCaptured(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (screen == NULL && !ui.GetMenuDisplayed(iPad) )
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
if (iPad == ProfileManager.GetPrimaryPad() && !InputManager.IsMouseCaptured() /*&& InputManager.IsWindowFocused()*/)
|
||||
{
|
||||
InputManager.SetMouseCaptured(true);
|
||||
}
|
||||
#endif
|
||||
// 4J-PB - add some tooltips if required
|
||||
int iA=-1, iB=-1, iX, iY=IDS_CONTROLS_INVENTORY, iLT=-1, iRT=-1, iLB=-1, iRB=-1, iLS=-1, iRS=-1;
|
||||
|
||||
|
||||
@@ -53,16 +53,16 @@ HRESULT PS3LeaderboardManager::destroyTransactionContext(int transactionContext)
|
||||
return sceNpScoreDestroyTransactionCtx(transactionContext);
|
||||
}
|
||||
|
||||
HRESULT PS3LeaderboardManager::getFriendsList(const SceNpId &myNpId, SceNpId* &npIds, uint32_t &len)
|
||||
{
|
||||
EFilterMode filterMode = m_eFilterMode;
|
||||
m_eFilterMode = eFM_Friends;
|
||||
|
||||
HRESULT ret = fillByIdsQuery(myNpId, npIds, len);
|
||||
|
||||
m_eFilterMode = filterMode;
|
||||
|
||||
return ret;
|
||||
HRESULT PS3LeaderboardManager::getFriendsList(const SceNpId &myNpId, SceNpId* &npIds, uint32_t &len)
|
||||
{
|
||||
EFilterMode filterMode = m_eFilterMode;
|
||||
m_eFilterMode = eFM_Friends;
|
||||
|
||||
HRESULT ret = fillByIdsQuery(myNpId, npIds, len);
|
||||
|
||||
m_eFilterMode = filterMode;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *PS3LeaderboardManager::getComment(SceNpScoreComment *comment)
|
||||
|
||||
@@ -34,3 +34,4 @@ public:
|
||||
};
|
||||
|
||||
extern CConsoleMinecraftApp app;
|
||||
extern HWND g_hWnd;
|
||||
@@ -76,8 +76,10 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]=
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
BOOL g_bWidescreen = TRUE;
|
||||
int g_iScreenWidth = 1920;
|
||||
int g_iScreenHeight = 1080;
|
||||
|
||||
// PIEBOT: currently touchcontrol KBM only works on 720p
|
||||
int g_iScreenWidth = 1280;
|
||||
int g_iScreenHeight = 720;
|
||||
|
||||
void DefineActions(void)
|
||||
{
|
||||
@@ -358,6 +360,89 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
pMinecraft->soundEngine->playMusicTick();
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
if (!(lParam & 0x40000000))
|
||||
{
|
||||
InputManager.OnKeyDown((int)wParam);
|
||||
}
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
InputManager.OnKeyUp((int)wParam);
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_CHAR:
|
||||
InputManager.OnChar((wchar_t)wParam);
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_INPUT:
|
||||
{
|
||||
UINT dwSize = 0;
|
||||
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, nullptr, &dwSize, sizeof(RAWINPUTHEADER));
|
||||
if (dwSize > 0 && dwSize <= 256)
|
||||
{
|
||||
BYTE rawBuffer[256];
|
||||
if (GetRawInputData((HRAWINPUT)lParam, RID_INPUT, rawBuffer, &dwSize, sizeof(RAWINPUTHEADER)) == dwSize)
|
||||
{
|
||||
const RAWINPUT* raw = (RAWINPUT*)rawBuffer;
|
||||
if (raw->header.dwType == RIM_TYPEMOUSE)
|
||||
{
|
||||
InputManager.OnRawMouseDelta(raw->data.mouse.lLastX, raw->data.mouse.lLastY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
InputManager.OnMouseMove(LOWORD(lParam), HIWORD(lParam));
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
InputManager.OnLButtonDown(LOWORD(lParam), HIWORD(lParam));
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
InputManager.OnLButtonUp(LOWORD(lParam), HIWORD(lParam));
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
InputManager.OnRButtonDown(LOWORD(lParam), HIWORD(lParam));
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
InputManager.OnRButtonUp(LOWORD(lParam), HIWORD(lParam));
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_MBUTTONDOWN:
|
||||
InputManager.OnMButtonDown(LOWORD(lParam), HIWORD(lParam));
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
InputManager.OnMButtonUp(LOWORD(lParam), HIWORD(lParam));
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_MOUSEWHEEL:
|
||||
{
|
||||
POINT pt = { (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam) };
|
||||
ScreenToClient(hWnd, &pt);
|
||||
InputManager.OnMouseWheel((short)HIWORD(wParam), pt.x, pt.y);
|
||||
}
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
InputManager.SetWindowFocused(false);
|
||||
if (InputManager.IsMouseCaptured())
|
||||
InputManager.SetMouseCaptured(false);
|
||||
break;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
InputManager.SetWindowFocused(true);
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
@@ -973,12 +1058,13 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
MSG msg = {0};
|
||||
while( WM_QUIT != msg.message )
|
||||
{
|
||||
if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
|
||||
{
|
||||
if (msg.message == WM_QUIT) break;
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
continue;
|
||||
}
|
||||
if (msg.message == WM_QUIT) break;
|
||||
RenderManager.StartFrame();
|
||||
#if 0
|
||||
if(pMinecraft->soundEngine->isStreamingWavebankReady() &&
|
||||
@@ -1027,6 +1113,10 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
// g_NetworkManager.DoWork();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0,"Input manager tick mouse");
|
||||
InputManager.TickKBM();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
// LeaderboardManager::Instance()->Tick();
|
||||
// Render game graphics.
|
||||
if(app.GetGameStarted())
|
||||
|
||||
@@ -862,7 +862,7 @@
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>__DISABLE_MILES__;_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallAttributedProfiling>Disabled</CallAttributedProfiling>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<ShowIncludes>false</ShowIncludes>
|
||||
|
||||
@@ -17,10 +17,13 @@ typedef unsigned __int64 __uint64;
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <malloc.h>
|
||||
#include <tchar.h>
|
||||
// TODO: reference additional headers your program requires here
|
||||
#include <d3d11.h>
|
||||
|
||||
extern HWND g_hWnd;
|
||||
#endif
|
||||
|
||||
#ifdef _DURANGO
|
||||
|
||||
+10
-20
@@ -52,8 +52,7 @@ Global
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|ORBIS.Build.0 = ContentPackage_NO_TU|ORBIS
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|PS3.ActiveCfg = ContentPackage_NO_TU|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|PS3.Build.0 = ContentPackage_NO_TU|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|PSVita.ActiveCfg = ContentPackage_NO_TU|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|PSVita.Build.0 = ContentPackage_NO_TU|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|PSVita.ActiveCfg = ContentPackage_NO_TU|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|Windows64.ActiveCfg = ContentPackage_NO_TU|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|Windows64.Build.0 = ContentPackage_NO_TU|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage_NO_TU|Xbox 360.ActiveCfg = ContentPackage_NO_TU|Xbox 360
|
||||
@@ -63,8 +62,7 @@ Global
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|ORBIS.Build.0 = CONTENTPACKAGE_SYMBOLS|ORBIS
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|PS3.ActiveCfg = CONTENTPACKAGE_SYMBOLS|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|PS3.Build.0 = CONTENTPACKAGE_SYMBOLS|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|PSVita.ActiveCfg = CONTENTPACKAGE_SYMBOLS|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|PSVita.Build.0 = CONTENTPACKAGE_SYMBOLS|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|PSVita.ActiveCfg = CONTENTPACKAGE_SYMBOLS|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|Windows64.ActiveCfg = CONTENTPACKAGE_SYMBOLS|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|Windows64.Build.0 = CONTENTPACKAGE_SYMBOLS|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.CONTENTPACKAGE_SYMBOLS|Xbox 360.ActiveCfg = CONTENTPACKAGE_SYMBOLS|Xbox 360
|
||||
@@ -74,8 +72,7 @@ Global
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|ORBIS.Build.0 = ContentPackage|ORBIS
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|PS3.ActiveCfg = ContentPackage|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|PS3.Build.0 = ContentPackage|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|PSVita.ActiveCfg = ContentPackage|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|PSVita.Build.0 = ContentPackage|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|PSVita.ActiveCfg = ContentPackage|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|Windows64.ActiveCfg = ContentPackage|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|Windows64.Build.0 = ContentPackage|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ContentPackage|Xbox 360.ActiveCfg = ContentPackage|Xbox 360
|
||||
@@ -85,8 +82,7 @@ Global
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|ORBIS.Build.0 = Debug|ORBIS
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|PS3.ActiveCfg = Debug|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|PS3.Build.0 = Debug|PS3
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|PSVita.ActiveCfg = Debug|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|PSVita.Build.0 = Debug|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|PSVita.ActiveCfg = Debug|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|Windows64.ActiveCfg = Debug|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|Windows64.Build.0 = Debug|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360
|
||||
@@ -106,8 +102,7 @@ Global
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|ORBIS.ActiveCfg = ReleaseForArt|ORBIS
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|ORBIS.Build.0 = ReleaseForArt|ORBIS
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|PS3.ActiveCfg = ReleaseForArt|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|PSVita.ActiveCfg = ReleaseForArt|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|PSVita.Build.0 = ReleaseForArt|PSVita
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|PSVita.ActiveCfg = ReleaseForArt|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|Windows64.ActiveCfg = ReleaseForArt|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|Windows64.Build.0 = ReleaseForArt|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|Xbox 360.ActiveCfg = ReleaseForArt|Xbox 360
|
||||
@@ -117,8 +112,7 @@ Global
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|ORBIS.Build.0 = ContentPackage_NO_TU|ORBIS
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|PS3.ActiveCfg = ContentPackage_NO_TU|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|PS3.Build.0 = ContentPackage_NO_TU|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|PSVita.ActiveCfg = ContentPackage_NO_TU|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|PSVita.Build.0 = ContentPackage_NO_TU|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|PSVita.ActiveCfg = ContentPackage_NO_TU|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|Windows64.ActiveCfg = ContentPackage_NO_TU|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|Windows64.Build.0 = ContentPackage_NO_TU|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage_NO_TU|Xbox 360.ActiveCfg = ContentPackage_NO_TU|Xbox 360
|
||||
@@ -128,8 +122,7 @@ Global
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|ORBIS.Build.0 = CONTENTPACKAGE_SYMBOLS|ORBIS
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|PS3.ActiveCfg = CONTENTPACKAGE_SYMBOLS|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|PS3.Build.0 = CONTENTPACKAGE_SYMBOLS|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|PSVita.ActiveCfg = CONTENTPACKAGE_SYMBOLS|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|PSVita.Build.0 = CONTENTPACKAGE_SYMBOLS|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|PSVita.ActiveCfg = CONTENTPACKAGE_SYMBOLS|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|Windows64.ActiveCfg = CONTENTPACKAGE_SYMBOLS|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|Windows64.Build.0 = CONTENTPACKAGE_SYMBOLS|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.CONTENTPACKAGE_SYMBOLS|Xbox 360.ActiveCfg = CONTENTPACKAGE_SYMBOLS|Xbox 360
|
||||
@@ -139,8 +132,7 @@ Global
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|ORBIS.Build.0 = ContentPackage|ORBIS
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|PS3.ActiveCfg = ContentPackage|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|PS3.Build.0 = ContentPackage|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|PSVita.ActiveCfg = ContentPackage|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|PSVita.Build.0 = ContentPackage|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|PSVita.ActiveCfg = ContentPackage|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|Windows64.ActiveCfg = ContentPackage|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|Windows64.Build.0 = ContentPackage|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ContentPackage|Xbox 360.ActiveCfg = ContentPackage|Xbox 360
|
||||
@@ -150,8 +142,7 @@ Global
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|ORBIS.Build.0 = Debug|ORBIS
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|PS3.ActiveCfg = Debug|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|PS3.Build.0 = Debug|PS3
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|PSVita.ActiveCfg = Debug|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|PSVita.Build.0 = Debug|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|PSVita.ActiveCfg = Debug|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|Windows64.ActiveCfg = Debug|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|Windows64.Build.0 = Debug|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360
|
||||
@@ -172,8 +163,7 @@ Global
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|ORBIS.ActiveCfg = ReleaseForArt|ORBIS
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|ORBIS.Build.0 = ReleaseForArt|ORBIS
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|PS3.ActiveCfg = ReleaseForArt|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|PSVita.ActiveCfg = ReleaseForArt|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|PSVita.Build.0 = ReleaseForArt|PSVita
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|PSVita.ActiveCfg = ReleaseForArt|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|Windows64.ActiveCfg = ReleaseForArt|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|Windows64.Build.0 = ReleaseForArt|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|Xbox 360.ActiveCfg = ReleaseForArt|Xbox 360
|
||||
|
||||
Reference in New Issue
Block a user