add kbm support

This commit is contained in:
2026-08-13 09:11:13 +03:00
parent fb2e8eefd9
commit 7c7386099a
62 changed files with 1036 additions and 134 deletions
@@ -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
+1 -1
View File
@@ -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
};
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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)
+698 -2
View File
@@ -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
+4 -2
View File
@@ -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:
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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
+2 -2
View File
@@ -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
+3 -3
View File
@@ -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());
+2 -2
View File
@@ -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
}
+1 -1
View File
@@ -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
}
+2 -2
View File
@@ -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)
+3 -3
View File
@@ -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();