added some kbm stuff
This commit is contained in:
1 parent
82e802873f
commit
42fd7414e4
218 files changed
+3758
-258
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
class UIControl_TextInput;
|
||||
class UIControl;
|
||||
|
||||
namespace DirectTextEdit
|
||||
{
|
||||
typedef int (*CommitCallback)(LPVOID param, bool accepted);
|
||||
|
||||
typedef void (*LineNavCallback)(LPVOID param, int dir);
|
||||
|
||||
void Begin(UIControl_TextInput *ctrl, UIControl *parent,
|
||||
const wchar_t *initialText,
|
||||
unsigned int maxChars, int keyboardMode,
|
||||
CommitCallback callback, LPVOID param);
|
||||
|
||||
bool IsActive();
|
||||
|
||||
void Tick();
|
||||
|
||||
void Finish(bool accepted);
|
||||
|
||||
bool TakeText(uint16_t *outText, unsigned int outCapacity);
|
||||
|
||||
void SetLineNav(LineNavCallback callback, LPVOID param);
|
||||
};
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "IUIScene_AbstractContainerMenu.h"
|
||||
#include "UIScene.h"
|
||||
#include "UIControl.h"
|
||||
#include "UIControl_SlotList.h"
|
||||
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
|
||||
@@ -89,6 +92,21 @@ void IUIScene_AbstractContainerMenu::Initialize(int iPad, AbstractContainerMenu*
|
||||
PlatformInitialize(iPad,startIndex);
|
||||
}
|
||||
|
||||
void IUIScene_AbstractContainerMenu::FixSlotGridSize(ESceneSection eSection, UIControl_SlotList &list, UIVec2D §ionSize)
|
||||
{
|
||||
if (sectionSize.x <= 0.0f || sectionSize.y <= 0.0f)
|
||||
{
|
||||
S32 iSlot = list.GetSlotSize();
|
||||
int iCols = 0, iRows = 0;
|
||||
GetSectionDimensions(eSection, &iCols, &iRows);
|
||||
if (iSlot > 0 && iCols > 0 && iRows > 0)
|
||||
{
|
||||
sectionSize.x = (float)(iSlot * iCols);
|
||||
sectionSize.y = (float)(iSlot * iRows);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int IUIScene_AbstractContainerMenu::GetSectionDimensions( ESceneSection eSection, int* piNumColumns, int* piNumRows )
|
||||
{
|
||||
if(IsSectionSlotList(eSection))
|
||||
@@ -257,7 +275,7 @@ void IUIScene_AbstractContainerMenu::UpdateTooltips()
|
||||
}
|
||||
}
|
||||
|
||||
void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
void IUIScene_AbstractContainerMenu::onMouseTick(UIScene *pScene)
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if( pMinecraft->localgameModes[getPad()] != NULL)
|
||||
@@ -289,9 +307,22 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
int iPad = getPad();
|
||||
|
||||
bool bStickInput = false;
|
||||
bool bUsingMouse = false;
|
||||
float fInputX = InputManager.GetJoypadStick_LX( iPad, false )*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f); // apply the sensitivity
|
||||
float fInputY = InputManager.GetJoypadStick_LY( iPad, false )*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f); // apply the sensitivity
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (!InputManager.IsMouseCaptured() && !ui.IsControllerMode())
|
||||
{
|
||||
ui.GetMovieMousePos(pScene, vPointerPos.x, vPointerPos.y);
|
||||
fInputX = 0.0f;
|
||||
fInputY = 0.0f;
|
||||
bUsingMouse = true;
|
||||
m_eCurrTapState = eTapStateNoInput;
|
||||
m_iConsectiveInputTicks = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __ORBIS__
|
||||
// should have sensitivity for the touchpad
|
||||
//(float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_TouchPadInMenu)/100.0f
|
||||
@@ -482,6 +513,22 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
// Centre position of item under pointer, use this to snap pointer to item.
|
||||
D3DXVECTOR3 vSnapPos;
|
||||
|
||||
UIVec2D vMainPanelOffset;
|
||||
vMainPanelOffset.x = 0.0f;
|
||||
vMainPanelOffset.y = 0.0f;
|
||||
if (pScene)
|
||||
{
|
||||
UIControl *pMainPanel = pScene->GetMainPanel();
|
||||
if (pMainPanel)
|
||||
{
|
||||
pMainPanel->UpdateControl();
|
||||
vMainPanelOffset.x = (float)pMainPanel->getXPos();
|
||||
vMainPanelOffset.y = (float)pMainPanel->getYPos();
|
||||
}
|
||||
}
|
||||
|
||||
RefreshSlotControls();
|
||||
|
||||
for ( int iSection = m_eFirstSection; iSection < m_eMaxSection; ++iSection )
|
||||
{
|
||||
// Do not check any further if we have already found the item under the pointer.
|
||||
@@ -496,6 +543,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
// Get position of this section.
|
||||
UIVec2D sectionPos;
|
||||
GetPositionOfSection( eSection, &( sectionPos ) );
|
||||
sectionPos.x += vMainPanelOffset.x;
|
||||
sectionPos.y += vMainPanelOffset.y;
|
||||
|
||||
if(!IsSectionSlotList(eSection))
|
||||
{
|
||||
@@ -671,6 +720,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
// Desired slot after tap input is valid, so make the jump to this slot.
|
||||
UIVec2D sectionPos;
|
||||
GetPositionOfSection( eSectionUnderPointer, &( sectionPos ) );
|
||||
sectionPos.x += vMainPanelOffset.x;
|
||||
sectionPos.y += vMainPanelOffset.y;
|
||||
|
||||
iNewSlotIndex = ( iDesiredSlotY * iNumColumns ) + iDesiredSlotX;
|
||||
|
||||
@@ -692,7 +743,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
|
||||
// If there is no stick input, and we are over a slot, then snap pointer to slot centre.
|
||||
// 4J - TomK - only if this particular component allows so!
|
||||
if(CanHaveFocus(eSectionUnderPointer))
|
||||
if(CanHaveFocus(eSectionUnderPointer) && !bUsingMouse)
|
||||
{
|
||||
vPointerPos.x = vSnapPos.x;
|
||||
vPointerPos.y = vSnapPos.y;
|
||||
@@ -1320,8 +1371,15 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
||||
buttonNum = 0;
|
||||
quickKeyHeld = FALSE;
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
#ifdef _WINDOWS64
|
||||
{ FILE *cf = fopen("inv_debug.log", "a"); if (cf) { fprintf(cf, "CLICK ptr=(%.1f,%.1f) sec=%d sx=%d sy=%d\n", m_pointerPos.x, m_pointerPos.y, (int)m_eCurrSection, m_iCurrSlotX, m_iCurrSlotY);
|
||||
if (m_eCurrSection != eSectionNone) { UIVec2D dsp, dip, disz; int dc=0, dr=0; GetPositionOfSection(m_eCurrSection, &dsp); GetItemScreenData(m_eCurrSection, 0, &dip, &disz); GetSectionDimensions(m_eCurrSection, &dc, &dr);
|
||||
extern int g_iWindowClientW, g_iWindowClientH; int rawx = InputManager.GetMouseX(), rawy = InputManager.GetMouseY();
|
||||
fprintf(cf, " secrect=(%.1f,%.1f) item0=(%.1f,%.1f %.1fx%.1f) cols=%d rows=%d raw=(%d,%d) client=(%d,%d) screen=(%.1f,%.1f)\n", dsp.x, dsp.y, dip.x, dip.y, disz.x, disz.y, dc, dr, rawx, rawy, g_iWindowClientW, g_iWindowClientH, ui.getScreenWidth(), ui.getScreenHeight()); }
|
||||
fclose(cf); } }
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case ACTION_MENU_X:
|
||||
if(!bRepeat)
|
||||
{
|
||||
@@ -1452,12 +1510,12 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
||||
}
|
||||
else
|
||||
{
|
||||
if( IsSectionSlotList( m_eCurrSection ) )
|
||||
{
|
||||
handleSlotListClicked(m_eCurrSection,buttonNum,quickKeyHeld);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( IsSectionSlotList( m_eCurrSection ) )
|
||||
{
|
||||
handleSlotListClicked(m_eCurrSection,buttonNum,quickKeyHeld);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO Clicked something else, like for example the craft result. Do something here
|
||||
|
||||
// 4J WESTY : For pointer system we can legally drop items outside of the window panel here, or may press button while
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
class AbstractContainerMenu;
|
||||
class Slot;
|
||||
class UIScene;
|
||||
class UIControl_SlotList;
|
||||
|
||||
class IUIScene_AbstractContainerMenu
|
||||
{
|
||||
@@ -215,7 +217,9 @@ protected:
|
||||
virtual void PlatformInitialize(int iPad, int startIndex) = 0;
|
||||
virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0) = 0;
|
||||
|
||||
void onMouseTick();
|
||||
void onMouseTick(UIScene *pScene);
|
||||
void FixSlotGridSize(ESceneSection eSection, UIControl_SlotList &list, UIVec2D §ionSize);
|
||||
virtual void RefreshSlotControls() {}
|
||||
bool handleKeyDown(int iPad, int iAction, bool bRepeat);
|
||||
virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld);
|
||||
virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld);
|
||||
|
||||
@@ -411,7 +411,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
{
|
||||
bNoScrollSlots = true;
|
||||
}
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__)
|
||||
bNoScrollSlots = true;
|
||||
#endif
|
||||
|
||||
@@ -983,7 +983,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots()
|
||||
{
|
||||
bNoScrollSlots = true;
|
||||
}
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__)
|
||||
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
|
||||
|
||||
|
||||
@@ -324,7 +324,17 @@ rrbool UIBitmapFont::GetGlyphBitmap(S32 glyph,F32 pixel_scale,IggyBitmapCharacte
|
||||
bitmap->top_left_y = -((S32) m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent;
|
||||
|
||||
bitmap->oversample = 0;
|
||||
#ifdef _WINDOWS64
|
||||
{
|
||||
float frac = targetPixelScale - floorf(targetPixelScale);
|
||||
if (frac < 0.0f) frac = 0.0f;
|
||||
if (frac > 1.0f) frac = 1.0f;
|
||||
float distToInt = (frac < 0.5f) ? frac : (1.0f - frac);
|
||||
bitmap->point_sample = (distToInt < 0.03f);
|
||||
}
|
||||
#else
|
||||
bitmap->point_sample = true;
|
||||
#endif
|
||||
|
||||
// 4J-JEV:
|
||||
// pixel_scale == font size chosen in flash.
|
||||
|
||||
@@ -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,66 @@ 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");
|
||||
bool handled = false;
|
||||
|
||||
if((!ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) && (app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_Tooltips) == 0))
|
||||
return;
|
||||
|
||||
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)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
UIControl_SlotList::UIControl_SlotList()
|
||||
{
|
||||
m_lastHighlighted = -1;
|
||||
m_iSlotSize = 0;
|
||||
}
|
||||
|
||||
bool UIControl_SlotList::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName)
|
||||
@@ -16,8 +17,10 @@ bool UIControl_SlotList::setupControl(UIScene *scene, IggyValuePath *parent, con
|
||||
m_addSlotFunc = registerFastName(L"addSlot");
|
||||
m_setRedBoxFunc = registerFastName(L"SetSlotRedBox");
|
||||
m_setHighlightFunc = registerFastName(L"SetSlotHighlight");
|
||||
m_slotSizeFunc = registerFastName(L"m_iSlotSize");
|
||||
|
||||
m_lastHighlighted = 0;
|
||||
m_iSlotSize = 0;
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -27,6 +30,32 @@ void UIControl_SlotList::ReInit()
|
||||
UIControl_Base::ReInit();
|
||||
|
||||
m_lastHighlighted = -1;
|
||||
m_iSlotSize = 0;
|
||||
}
|
||||
|
||||
S32 UIControl_SlotList::GetSlotSize()
|
||||
{
|
||||
if (m_iSlotSize <= 0)
|
||||
{
|
||||
S32 iSlotSize = 0;
|
||||
IggyValueGetS32RS(getIggyValuePath(), m_slotSizeFunc, NULL, &iSlotSize);
|
||||
m_iSlotSize = iSlotSize;
|
||||
if (m_iSlotSize <= 0)
|
||||
{
|
||||
m_iSlotSize = 50;
|
||||
}
|
||||
}
|
||||
return m_iSlotSize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
S32 UIControl_SlotList::GetFlashSlotCount()
|
||||
{
|
||||
S32 iCount = -1;
|
||||
IggyName slotsName = registerFastName(L"m_aSlots");
|
||||
IggyValueGetArrayLengthRS(getIggyValuePath(), slotsName, NULL, &iCount);
|
||||
return iCount;
|
||||
}
|
||||
|
||||
void UIControl_SlotList::addSlot(int id)
|
||||
@@ -65,6 +94,15 @@ void UIControl_SlotList::setHighlightSlot(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void UIControl_SlotList::clearHighlight()
|
||||
{
|
||||
if(m_lastHighlighted != -1)
|
||||
{
|
||||
setSlotHighlighted(m_lastHighlighted, false);
|
||||
m_lastHighlighted = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void UIControl_SlotList::setSlotHighlighted(int index, bool highlight)
|
||||
{
|
||||
IggyDataValue result;
|
||||
|
||||
@@ -7,8 +7,10 @@ class UIControl_SlotList : public UIControl_Base
|
||||
private:
|
||||
//IggyName m_addSlotFunc, m_getSlotFunc, m_setRedBoxFunc, m_setHighlightFunc;
|
||||
IggyName m_addSlotFunc, m_setRedBoxFunc, m_setHighlightFunc;
|
||||
IggyName m_slotSizeFunc;
|
||||
|
||||
int m_lastHighlighted;
|
||||
int m_iSlotSize;
|
||||
|
||||
public:
|
||||
UIControl_SlotList();
|
||||
@@ -19,8 +21,11 @@ public:
|
||||
|
||||
void addSlot(int id);
|
||||
void addSlots(int iStartValue, int iCount);
|
||||
S32 GetSlotSize();
|
||||
S32 GetFlashSlotCount();
|
||||
|
||||
void setHighlightSlot(int index);
|
||||
void clearHighlight();
|
||||
void showSlotRedBox(int index, bool show);
|
||||
|
||||
virtual void setFocus(bool focus);
|
||||
|
||||
@@ -16,6 +16,8 @@ bool UIControl_TextInput::setupControl(UIScene *scene, IggyValuePath *parent, co
|
||||
m_textName = registerFastName(L"text");
|
||||
m_funcChangeState = registerFastName(L"ChangeState");
|
||||
m_funcSetCharLimit = registerFastName(L"SetCharLimit");
|
||||
m_funcMoveCaretLeft = registerFastName(L"MoveCaretLeft");
|
||||
m_funcMoveCaretRight = registerFastName(L"MoveCaretRight");
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -38,7 +40,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)
|
||||
@@ -73,6 +75,30 @@ void UIControl_TextInput::setFocus(bool focus)
|
||||
}
|
||||
}
|
||||
|
||||
void UIControl_TextInput::SyncCaret(int caretIndex, int textLength)
|
||||
{
|
||||
if (caretIndex < 0) caretIndex = 0;
|
||||
if (caretIndex > textLength) caretIndex = textLength;
|
||||
IggyDataValue result; // placeholder to keep diff small
|
||||
IggyDataValue result2;
|
||||
int i;
|
||||
for (i = 0; i < textLength; ++i)
|
||||
IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcMoveCaretLeft, 0, NULL);
|
||||
for (i = 0; i < caretIndex; ++i)
|
||||
IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcMoveCaretRight, 0, NULL);
|
||||
}
|
||||
|
||||
void UIControl_TextInput::RefreshFocus()
|
||||
{
|
||||
m_bHasFocus = true;
|
||||
|
||||
IggyDataValue result;
|
||||
IggyDataValue value[1];
|
||||
value[0].type = IGGY_DATATYPE_number;
|
||||
value[0].number = 0;
|
||||
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcChangeState, 1, value);
|
||||
}
|
||||
|
||||
void UIControl_TextInput::SetCharLimit(int iLimit)
|
||||
{
|
||||
IggyDataValue result;
|
||||
|
||||
@@ -6,6 +6,7 @@ class UIControl_TextInput : public UIControl_Base
|
||||
{
|
||||
private:
|
||||
IggyName m_textName, m_funcChangeState, m_funcSetCharLimit;
|
||||
IggyName m_funcMoveCaretLeft, m_funcMoveCaretRight;
|
||||
bool m_bHasFocus;
|
||||
|
||||
public:
|
||||
@@ -19,4 +20,8 @@ public:
|
||||
virtual void setFocus(bool focus);
|
||||
|
||||
void SetCharLimit(int iLimit);
|
||||
|
||||
void SyncCaret(int caretIndex, int textLength);
|
||||
|
||||
void RefreshFocus();
|
||||
};
|
||||
@@ -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)
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -21,6 +21,9 @@ public:
|
||||
static CRITICAL_SECTION ms_reloadSkinCS;
|
||||
static bool ms_bReloadSkinCSInitialised;
|
||||
|
||||
static CRITICAL_SECTION UIController::ms_controllerPollCS;
|
||||
static bool UIController::ms_bControllerPollCSInitialised;
|
||||
|
||||
protected:
|
||||
UIComponent_DebugUIConsole *m_uiDebugConsole;
|
||||
UIComponent_DebugUIMarketingGuide *m_uiDebugMarketingGuide;
|
||||
@@ -49,6 +52,31 @@ private:
|
||||
eFont_Korean,
|
||||
|
||||
};
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
enum EControllerType
|
||||
{
|
||||
PS3,
|
||||
PS4,
|
||||
PS5,
|
||||
|
||||
XBOXONE,
|
||||
XBOX360,
|
||||
|
||||
SWITCH,
|
||||
GAMECUBE,
|
||||
|
||||
STANDARD,
|
||||
UNKNOWN,
|
||||
UNSET
|
||||
};
|
||||
|
||||
EControllerType m_LastControllerType;
|
||||
C4JThread *m_controllerPollThread;
|
||||
volatile bool m_bControllerTypeChanged;
|
||||
|
||||
static int controllerPollThreadProc(void *lpParam);
|
||||
#endif
|
||||
|
||||
// 4J-JEV: It's important that currentFont == targetFont, unless updateCurrentLanguage is going to be called.
|
||||
EFont m_eCurrentFont, m_eTargetFont;
|
||||
@@ -70,7 +98,7 @@ public:
|
||||
|
||||
private:
|
||||
// 4J-PB - ui element type for PSVita touch control
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -91,11 +119,28 @@ private:
|
||||
eLibrary_GraphicsInGame,
|
||||
eLibrary_GraphicsTooltips,
|
||||
eLibrary_GraphicsLabels,
|
||||
#ifdef _WINDOWS64
|
||||
eLibrary_ControlTooltips,
|
||||
#endif
|
||||
eLibrary_Labels,
|
||||
eLibrary_InGame,
|
||||
eLibrary_HUD,
|
||||
eLibrary_Tooltips,
|
||||
eLibrary_Default,
|
||||
#ifdef _WINDOWS64
|
||||
eLibrary_Alt_Platform,
|
||||
eLibrary_Alt_GraphicsDefault,
|
||||
eLibrary_Alt_GraphicsHUD,
|
||||
eLibrary_Alt_GraphicsInGame,
|
||||
eLibrary_Alt_GraphicsTooltips,
|
||||
eLibrary_Alt_GraphicsLabels,
|
||||
eLibrary_Alt_ControlTooltips,
|
||||
eLibrary_Alt_Labels,
|
||||
eLibrary_Alt_InGame,
|
||||
eLibrary_Alt_HUD,
|
||||
eLibrary_Alt_Tooltips,
|
||||
eLibrary_Alt_Default,
|
||||
#endif
|
||||
|
||||
eLibrary_Count,
|
||||
};
|
||||
@@ -155,19 +200,49 @@ private:
|
||||
|
||||
public:
|
||||
UIController();
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void TouchBoxAdd(UIControl *pControl,UIScene *pUIScene);
|
||||
bool TouchBoxHit(UIScene *pUIScene,S32 x, S32 y);
|
||||
bool IsTouchBoxUnderPoint(S32 x, S32 y);
|
||||
bool IsTouchBoxUnderPointInScene(UIScene *pUIScene, S32 x, S32 y);
|
||||
bool TouchBoxPointInScene(UIScene *pUIScene,S32 x, S32 y, int iClientW, int iClientH);
|
||||
void TouchBoxesClear(UIScene *pUIScene);
|
||||
void TouchBoxRebuild(UIScene *pUIScene);
|
||||
|
||||
void HandleTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased);
|
||||
void SendTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased);
|
||||
|
||||
bool GetTouchBoxBounds(UIControl *pControl, S32 &x1, S32 &y1, S32 &x2, S32 &y2);
|
||||
|
||||
void GetMovieMousePos(UIScene *pScene, float &fx, float &fy);
|
||||
|
||||
bool IsCraftingMenuDisplayed(int iPad);
|
||||
bool IsSkinSelectMenuDisplayed(int iPad);
|
||||
#ifdef _WINDOWS64
|
||||
bool IsControllerMode() { return m_bControllerMode; }
|
||||
int GetDefaultFocusId(UIScene *pScene);
|
||||
#endif
|
||||
|
||||
private:
|
||||
void TouchBoxAdd(UIControl *pControl,EUIGroup eUIGroup,EUILayer eUILayer,EUIScene eUIscene, UIControl *pMainPanelControl);
|
||||
UIELEMENT *m_ActiveUIElement;
|
||||
UIELEMENT *m_HighlightedUIElement;
|
||||
|
||||
bool wasFocused;
|
||||
|
||||
UIScene *m_pLastHoverScene;
|
||||
int m_iLastHoverId;
|
||||
bool m_bHoverFresh;
|
||||
int m_iFreshMouseX;
|
||||
int m_iFreshMouseY;
|
||||
__int64 m_hoverFreshUntilMs;
|
||||
UIControl *m_pLastListFocusControl;
|
||||
int m_iLastListFocusX;
|
||||
int m_iLastListFocusY;
|
||||
bool m_bControllerMode;
|
||||
int m_iLastDeviceMouseX;
|
||||
int m_iLastDeviceMouseY;
|
||||
void UpdateInputDeviceMode();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
@@ -199,12 +274,18 @@ public:
|
||||
public:
|
||||
// TICKING
|
||||
virtual void tick();
|
||||
#ifdef _WINDOWS64
|
||||
wstring GetControlTooltipsPath(EControllerType ControllerType = EControllerType::UNSET);
|
||||
EControllerType GetControllerType(const char* controllerType);
|
||||
void fetchControlTooltipSWF();
|
||||
#endif
|
||||
|
||||
private:
|
||||
void loadSkins();
|
||||
IggyLibrary loadSkin(const wstring &skinPath, const wstring &skinName);
|
||||
|
||||
public:
|
||||
void reloadSingleSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName);
|
||||
void ReloadSkin();
|
||||
virtual void StartReloadSkinThread();
|
||||
virtual bool IsReloadingSkin();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "UI.h"
|
||||
#include "UILayer.h"
|
||||
#include "UIScene.h"
|
||||
#include "DirectTextEdit.h"
|
||||
|
||||
UILayer::UILayer(UIGroup *parent)
|
||||
{
|
||||
@@ -594,7 +595,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 +614,10 @@ void UILayer::removeComponent(EUIScene scene)
|
||||
|
||||
void UILayer::removeScene(UIScene *scene)
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
#ifdef _WINDOWS64
|
||||
DirectTextEdit::Finish(true);
|
||||
#endif
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
// remove any touchboxes
|
||||
ui.TouchBoxesClear(scene);
|
||||
#endif
|
||||
@@ -643,7 +647,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 +779,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
|
||||
|
||||
@@ -27,6 +27,11 @@ UIScene::UIScene(int iPad, UILayer *parentLayer)
|
||||
m_bUpdateOpacity = false;
|
||||
|
||||
m_backScene = NULL;
|
||||
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
m_bTouchBoxRebuildPending = false;
|
||||
m_touchBoxRebuildUntilMs = 0;
|
||||
#endif
|
||||
|
||||
m_cacheSlotRenders = false;
|
||||
m_needsCacheRendered = true;
|
||||
@@ -231,11 +236,15 @@ void UIScene::initialiseMovie()
|
||||
|
||||
updateSafeZone();
|
||||
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
handleTouchBoxRebuild();
|
||||
#endif
|
||||
|
||||
m_bUpdateOpacity = true;
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
void UIScene::SetFocusToElement(int iID)
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIScene::SetFocusToElement(int iID, bool bQuiet)
|
||||
{
|
||||
IggyDataValue result;
|
||||
IggyDataValue value[1];
|
||||
@@ -245,8 +254,16 @@ void UIScene::SetFocusToElement(int iID)
|
||||
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetFocus , 1 , value );
|
||||
|
||||
// also trigger handle focus change (just in case if anything else in relation needs updating!)
|
||||
_handleFocusChange(iID, 0);
|
||||
if (bQuiet)
|
||||
{
|
||||
m_iFocusControl = iID;
|
||||
m_iFocusChild = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// also trigger handle focus change (just in case if anything else in relation needs updating!)
|
||||
_handleFocusChange(iID, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -318,6 +335,15 @@ void UIScene::loadMovie()
|
||||
moviePath.append(L"720.swf");
|
||||
m_loadedResolution = eSceneResolution_720;
|
||||
|
||||
if(!app.hasArchiveFile(moviePath))
|
||||
{
|
||||
#if defined _WINDOWS64
|
||||
moviePath = getMoviePath();
|
||||
moviePath.append(L"1080.swf");
|
||||
m_loadedResolution = eSceneResolution_1080;
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!app.hasArchiveFile(moviePath))
|
||||
{
|
||||
app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str());
|
||||
@@ -437,6 +463,15 @@ void UIScene::tick()
|
||||
{
|
||||
if(m_bIsReloading) return;
|
||||
if(m_hasTickedOnce) m_bCanHandleInput = true;
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
if (m_bTouchBoxRebuildPending)
|
||||
{
|
||||
UpdateSceneControls();
|
||||
ui.TouchBoxRebuild(this);
|
||||
if (System::currentTimeMillis() >= m_touchBoxRebuildUntilMs)
|
||||
m_bTouchBoxRebuildPending = false;
|
||||
}
|
||||
#endif
|
||||
while(IggyPlayerReadyToTick( swf ))
|
||||
{
|
||||
tickTimers();
|
||||
@@ -454,6 +489,14 @@ UIControl* UIScene::GetMainPanel()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void UIScene::handleTouchBoxRebuild()
|
||||
{
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
m_bTouchBoxRebuildPending = true;
|
||||
m_touchBoxRebuildUntilMs = System::currentTimeMillis() + 750;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void UIScene::addTimer(int id, int ms)
|
||||
{
|
||||
@@ -530,7 +573,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 +1280,7 @@ UIScene *UIScene::getBackScene()
|
||||
{
|
||||
return m_backScene;
|
||||
}
|
||||
#ifdef __PSVITA__
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void UIScene::UpdateSceneControls()
|
||||
{
|
||||
AUTO_VAR(itEnd, GetControls()->end());
|
||||
|
||||
@@ -94,6 +94,11 @@ protected:
|
||||
int m_iPad;
|
||||
bool m_hasTickedOnce;
|
||||
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
bool m_bTouchBoxRebuildPending;
|
||||
__int64 m_touchBoxRebuildUntilMs;
|
||||
#endif
|
||||
|
||||
public:
|
||||
virtual Iggy *getMovie() { return swf; }
|
||||
|
||||
@@ -106,7 +111,10 @@ public:
|
||||
int getRenderWidth() { return m_renderWidth; }
|
||||
int getRenderHeight() { return m_renderHeight; }
|
||||
|
||||
#ifdef __PSVITA__
|
||||
int getMovieWidth() { return m_movieWidth; }
|
||||
int getMovieHeight() { return m_movieHeight; }
|
||||
|
||||
#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,8 +147,8 @@ public:
|
||||
virtual void tick();
|
||||
|
||||
IggyName registerFastName(const wstring &name);
|
||||
#ifdef __PSVITA__
|
||||
void SetFocusToElement(int iID);
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
void SetFocusToElement(int iID, bool bQuiet = false);
|
||||
void UpdateSceneControls();
|
||||
#endif
|
||||
protected:
|
||||
@@ -228,7 +236,7 @@ protected:
|
||||
virtual void handleAnimationEnd() {}
|
||||
virtual void handleSelectionChanged(F64 selectedId) {}
|
||||
virtual void handleRequestMoreData(F64 startIndex, bool up) {}
|
||||
virtual void handleTouchBoxRebuild() {}
|
||||
virtual void handleTouchBoxRebuild();
|
||||
private:
|
||||
void _handleFocusChange(F64 controlId, F64 childId);
|
||||
void _handleInitFocus(F64 controlId, F64 childId);
|
||||
@@ -264,6 +272,10 @@ public:
|
||||
|
||||
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) {}
|
||||
|
||||
virtual void handleMouseHover(float x, float y, int iId) {}
|
||||
|
||||
virtual bool isControlActiveForTouch(UIControl *control) { (void)control; return true; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -97,6 +97,13 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
|
||||
fPanelHeight = m_controlBackgroundPanel.getHeight();
|
||||
fPanelX = m_controlBackgroundPanel.getXPos();
|
||||
fPanelY = m_controlBackgroundPanel.getYPos();
|
||||
if (fPanelWidth <= 0 || fPanelHeight <= 0)
|
||||
{
|
||||
fPanelX = 0.0f;
|
||||
fPanelY = 0.0f;
|
||||
fPanelWidth = (float)m_movieWidth;
|
||||
fPanelHeight = (float)m_movieHeight;
|
||||
}
|
||||
// Get size of pointer
|
||||
m_fPointerImageOffsetX = 0; //floor(fPointerWidth/2.0f);
|
||||
m_fPointerImageOffsetY = 0; //floor(fPointerHeight/2.0f);
|
||||
@@ -142,11 +149,46 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
|
||||
|
||||
UIVec2D sectionPos;
|
||||
GetPositionOfSection( m_eCurrSection, &( sectionPos ) );
|
||||
UIControl *pInitPanel = GetMainPanel();
|
||||
if (pInitPanel)
|
||||
{
|
||||
pInitPanel->UpdateControl();
|
||||
sectionPos.x += (float)pInitPanel->getXPos();
|
||||
sectionPos.y += (float)pInitPanel->getYPos();
|
||||
float fMainX = (float)pInitPanel->getXPos();
|
||||
float fMainY = (float)pInitPanel->getYPos();
|
||||
float fMainMaxX = fMainX + (float)pInitPanel->getWidth();
|
||||
float fMainMaxY = fMainY + (float)pInitPanel->getHeight();
|
||||
float fInvMinX = fMainX + (float)m_slotListInventory.getXPos();
|
||||
float fInvMaxX = fInvMinX + (float)m_slotListInventory.getWidth();
|
||||
float fHotMinX = fMainX + (float)m_slotListHotbar.getXPos();
|
||||
float fHotMaxX = fHotMinX + (float)m_slotListHotbar.getWidth();
|
||||
if (fMainX < m_fPanelMinX) m_fPanelMinX = fMainX;
|
||||
if (fMainY < m_fPanelMinY) m_fPanelMinY = fMainY;
|
||||
if (fMainMaxX > m_fPanelMaxX) m_fPanelMaxX = fMainMaxX;
|
||||
if (fMainMaxY > m_fPanelMaxY) m_fPanelMaxY = fMainMaxY;
|
||||
if (fInvMinX < m_fPanelMinX) m_fPanelMinX = fInvMinX;
|
||||
if (fHotMinX < m_fPanelMinX) m_fPanelMinX = fHotMinX;
|
||||
if (fInvMaxX > m_fPanelMaxX) m_fPanelMaxX = fInvMaxX;
|
||||
if (fHotMaxX > m_fPanelMaxX) m_fPanelMaxX = fHotMaxX;
|
||||
if (m_fPanelMinX - fPointerWidth < m_fPointerMinX) m_fPointerMinX = m_fPanelMinX - fPointerWidth;
|
||||
if (m_fPanelMaxX + fPointerWidth > m_fPointerMaxX) m_fPointerMaxX = m_fPanelMaxX + fPointerWidth;
|
||||
if (m_fPanelMaxY + (fPointerHeight/2) > m_fPointerMaxY) m_fPointerMaxY = m_fPanelMaxY + (fPointerHeight/2);
|
||||
}
|
||||
|
||||
UIVec2D vPointerPos = sectionPos;
|
||||
vPointerPos += itemPos;
|
||||
vPointerPos.x += ( itemSize.x / 2.0f );
|
||||
vPointerPos.y += ( itemSize.y / 2.0f );
|
||||
#ifdef _WINDOWS64
|
||||
{ FILE *cf = fopen("inv_debug.log", "a"); if (cf) { int isz = m_slotListInventory.GetSlotSize(); int ihz = m_slotListHotbar.GetSlotSize();
|
||||
int icnt = m_slotListInventory.GetFlashSlotCount(); int hcnt = m_slotListHotbar.GetFlashSlotCount();
|
||||
fprintf(cf, "INIT mainpanel=(%.1f,%.1f) invlist=(%d,%d %dx%d) slotread_inv=%d slotread_hot=%d flashcount_inv=%d flashcount_hot=%d bg=(%.1f,%.1f %.1fx%.1f) pmin=(%.1f,%.1f) pmax=(%.1f,%.1f)\n",
|
||||
pInitPanel ? (float)pInitPanel->getXPos() : -999.0f, pInitPanel ? (float)pInitPanel->getYPos() : -999.0f,
|
||||
m_slotListInventory.getXPos(), m_slotListInventory.getYPos(), m_slotListInventory.getWidth(), m_slotListInventory.getHeight(), isz, ihz, icnt, hcnt,
|
||||
fPanelX, fPanelY, fPanelWidth, fPanelHeight, m_fPointerMinX, m_fPointerMinY, m_fPointerMaxX, m_fPointerMaxY);
|
||||
fclose(cf); } }
|
||||
#endif
|
||||
|
||||
vPointerPos.x -= m_fPointerImageOffsetX;
|
||||
vPointerPos.y -= m_fPointerImageOffsetY;
|
||||
@@ -172,11 +214,11 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
|
||||
#endif
|
||||
}
|
||||
|
||||
void UIScene_AbstractContainerMenu::tick()
|
||||
void UIScene_AbstractContainerMenu::tick()
|
||||
{
|
||||
UIScene::tick();
|
||||
|
||||
onMouseTick();
|
||||
onMouseTick(this);
|
||||
|
||||
IggyEvent mouseEvent;
|
||||
S32 width, height;
|
||||
@@ -193,6 +235,26 @@ void UIScene_AbstractContainerMenu::tick()
|
||||
|
||||
IggyEventResult result;
|
||||
IggyPlayerDispatchEventRS ( getMovie() , &mouseEvent , &result );
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
{
|
||||
IggyValuePath pointerPath;
|
||||
if (IggyValuePathMakeNameRef(&pointerPath, m_rootPath, "pointerIcon"))
|
||||
{
|
||||
IggyValueSetBooleanRS(&pointerPath, registerFastName(L"visible"), NULL, true);
|
||||
}
|
||||
if (hasMovie())
|
||||
{
|
||||
UIControl *pMainPanel = GetMainPanel();
|
||||
if (pMainPanel)
|
||||
{
|
||||
pMainPanel->UpdateControl();
|
||||
IggyValueSetF64RS(m_cursorPath.getIggyValuePath(), registerFastName(L"x"), NULL, (F64)(m_pointerPos.x - (float)pMainPanel->getXPos()));
|
||||
IggyValueSetF64RS(m_cursorPath.getIggyValuePath(), registerFastName(L"y"), NULL, (F64)(m_pointerPos.y - (float)pMainPanel->getYPos()));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void UIScene_AbstractContainerMenu::render(S32 width, S32 height, C4JRender::eViewportType viewpBort)
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
UIScene_AbstractContainerMenu(int iPad, UILayer *parentLayer);
|
||||
~UIScene_AbstractContainerMenu();
|
||||
|
||||
virtual UIControl* GetMainPanel() { return &m_controlMainPanel; }
|
||||
|
||||
virtual void handleDestroy();
|
||||
|
||||
int getPad() { return m_iPad; }
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "MultiPlayerLocalPlayer.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "UIScene_AnvilMenu.h"
|
||||
#include "DirectTextEdit.h"
|
||||
|
||||
UIScene_AnvilMenu::UIScene_AnvilMenu(int iPad, void *_initData, UILayer *parentLayer) : UIScene_AbstractContainerMenu(iPad, parentLayer)
|
||||
{
|
||||
@@ -170,6 +171,7 @@ void UIScene_AnvilMenu::GetPositionOfSection( ESceneSection eSection, UIVec2D* p
|
||||
pPosition->y = m_slotListResult.getYPos();
|
||||
break;
|
||||
case eSectionAnvilName:
|
||||
m_textInputAnvil.UpdateControl();
|
||||
pPosition->x = m_textInputAnvil.getXPos();
|
||||
pPosition->y = m_textInputAnvil.getYPos();
|
||||
break;
|
||||
@@ -196,26 +198,32 @@ void UIScene_AnvilMenu::GetItemScreenData( ESceneSection eSection, int iItemInde
|
||||
case eSectionAnvilItem1:
|
||||
sectionSize.x = m_slotListItem1.getWidth();
|
||||
sectionSize.y = m_slotListItem1.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListItem1, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilItem2:
|
||||
sectionSize.x = m_slotListItem2.getWidth();
|
||||
sectionSize.y = m_slotListItem2.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListItem2, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilResult:
|
||||
sectionSize.x = m_slotListResult.getWidth();
|
||||
sectionSize.y = m_slotListResult.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListResult, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilName:
|
||||
m_textInputAnvil.UpdateControl();
|
||||
sectionSize.x = m_textInputAnvil.getWidth();
|
||||
sectionSize.y = m_textInputAnvil.getHeight();
|
||||
break;
|
||||
case eSectionAnvilInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionAnvilUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
@@ -239,6 +247,16 @@ void UIScene_AnvilMenu::GetItemScreenData( ESceneSection eSection, int iItemInde
|
||||
else
|
||||
{
|
||||
GetPositionOfSection(eSection, pPosition);
|
||||
if (eSection == eSectionAnvilName)
|
||||
{
|
||||
UIControl *pMainPanel = GetMainPanel();
|
||||
if (pMainPanel)
|
||||
{
|
||||
pMainPanel->UpdateControl();
|
||||
pPosition->x += pMainPanel->getXPos();
|
||||
pPosition->y += pMainPanel->getYPos();
|
||||
}
|
||||
}
|
||||
pSize->x = sectionSize.x;
|
||||
pSize->y = sectionSize.y;
|
||||
}
|
||||
@@ -316,7 +334,10 @@ int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
|
||||
{
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t) );
|
||||
InputManager.GetText(pchText);
|
||||
#ifdef _WINDOWS64
|
||||
if (!DirectTextEdit::TakeText(pchText, 128))
|
||||
#endif
|
||||
InputManager.GetText(pchText);
|
||||
pClass->setEditNameValue((wchar_t *)pchText);
|
||||
pClass->m_itemName = (wchar_t *)pchText;
|
||||
pClass->updateItemName();
|
||||
@@ -326,6 +347,12 @@ int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
|
||||
|
||||
void UIScene_AnvilMenu::handleEditNamePressed()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
DirectTextEdit::Begin(&m_textInputAnvil, GetMainPanel(), m_textInputAnvil.getLabel(), 30,
|
||||
C_4JInput::EKeyboardMode_Default,
|
||||
&UIScene_AnvilMenu::KeyboardCompleteCallback, this);
|
||||
return;
|
||||
#endif
|
||||
setIgnoreInput(true);
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||
int language = XGetLanguage();
|
||||
|
||||
@@ -179,14 +179,17 @@ void UIScene_BeaconMenu::GetItemScreenData( ESceneSection eSection, int iItemInd
|
||||
case eSectionBeaconItem:
|
||||
sectionSize.x = m_slotListActivator.getWidth();
|
||||
sectionSize.y = m_slotListActivator.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListActivator, sectionSize);
|
||||
break;
|
||||
case eSectionBeaconInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionBeaconUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
|
||||
case eSectionBeaconPrimaryTierOneOne:
|
||||
|
||||
@@ -204,26 +204,32 @@ void UIScene_BrewingStandMenu::GetItemScreenData( ESceneSection eSection, int iI
|
||||
case eSectionBrewingBottle1:
|
||||
sectionSize.x = m_slotListBottles[0].getWidth();
|
||||
sectionSize.y = m_slotListBottles[0].getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListBottles[0], sectionSize);
|
||||
break;
|
||||
case eSectionBrewingBottle2:
|
||||
sectionSize.x = m_slotListBottles[1].getWidth();
|
||||
sectionSize.y = m_slotListBottles[1].getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListBottles[1], sectionSize);
|
||||
break;
|
||||
case eSectionBrewingBottle3:
|
||||
sectionSize.x = m_slotListBottles[2].getWidth();
|
||||
sectionSize.y = m_slotListBottles[2].getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListBottles[2], sectionSize);
|
||||
break;
|
||||
case eSectionBrewingIngredient:
|
||||
sectionSize.x = m_slotListIngredient.getWidth();
|
||||
sectionSize.y = m_slotListIngredient.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListIngredient, sectionSize);
|
||||
break;
|
||||
case eSectionBrewingInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionBrewingUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -148,14 +148,17 @@ void UIScene_ContainerMenu::GetItemScreenData( ESceneSection eSection, int iItem
|
||||
case eSectionContainerChest:
|
||||
sectionSize.x = m_slotListContainer.getWidth();
|
||||
sectionSize.y = m_slotListContainer.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListContainer, sectionSize);
|
||||
break;
|
||||
case eSectionContainerInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionContainerUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -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
|
||||
@@ -13,6 +13,9 @@
|
||||
UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
||||
{
|
||||
m_bIgnoreKeyPresses = false;
|
||||
m_bMouseLDownPrev = false;
|
||||
m_bCraftArmed = false;
|
||||
m_iHoverHSlot = -1;
|
||||
|
||||
CraftingPanelScreenInput* initData = (CraftingPanelScreenInput*)_initData;
|
||||
m_iContainerType=initData->iContainerType;
|
||||
@@ -176,13 +179,13 @@ 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)
|
||||
ui.TouchBoxRebuild(this);
|
||||
// initialise vita touch controls with ids
|
||||
for(unsigned int i = 0; i < ETouchInput_Count; ++i)
|
||||
{
|
||||
m_TouchInput[i].init(i);
|
||||
}
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -225,9 +228,7 @@ EUIScene UIScene_CraftingMenu::getSceneType()
|
||||
{
|
||||
return eUIScene_Crafting2x2Menu;
|
||||
}
|
||||
}
|
||||
|
||||
wstring UIScene_CraftingMenu::getMoviePath()
|
||||
} wstring UIScene_CraftingMenu::getMoviePath()
|
||||
{
|
||||
if(app.GetLocalPlayerCount() > 1)
|
||||
{
|
||||
@@ -254,7 +255,238 @@ wstring UIScene_CraftingMenu::getMoviePath()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __PSVITA__
|
||||
void UIScene_CraftingMenu::handleMouseHover(float x, float y, int iId)
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
if (iId == ETouchInput_CraftingHSlots)
|
||||
{
|
||||
UpdateHSlotHover(x, y);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
bool UIScene_CraftingMenu::GetTabSegmentForPoint(float fx, float fy, int &iOut)
|
||||
{
|
||||
int iMaxGroup = (m_iContainerType == RECIPE_TYPE_3x3) ? m_iMaxGroup3x3 : m_iMaxGroup2x2;
|
||||
if (iMaxGroup <= 0) return false;
|
||||
|
||||
m_controlMainPanel.UpdateControl();
|
||||
m_tabRow.UpdateControl();
|
||||
float fOx = (float)m_controlMainPanel.getXPos() + (float)m_tabRow.getXPos();
|
||||
float fOy = (float)m_controlMainPanel.getYPos() + (float)m_tabRow.getYPos();
|
||||
float fW = (float)m_tabRow.getWidth();
|
||||
float fH = (float)m_tabRow.getHeight();
|
||||
if (fW < 4.0f || fH < 4.0f) return false;
|
||||
|
||||
if (fx < fOx || fx >= fOx + fW * (float)iMaxGroup || fy < fOy || fy >= fOy + fH) return false;
|
||||
|
||||
int iSeg = (int)((fx - fOx) / fW);
|
||||
if (iSeg < 0) iSeg = 0;
|
||||
if (iSeg >= iMaxGroup) iSeg = iMaxGroup - 1;
|
||||
iOut = iSeg;
|
||||
return true;
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::SelectGroupTabUnderPoint(float fx, float fy)
|
||||
{
|
||||
int iSeg;
|
||||
if (!GetTabSegmentForPoint(fx, fy, iSeg)) return;
|
||||
|
||||
if (iSeg == m_iGroupIndex)
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Focus);
|
||||
return;
|
||||
}
|
||||
|
||||
showTabHighlight(m_iGroupIndex, false);
|
||||
m_iGroupIndex = iSeg;
|
||||
showTabHighlight(m_iGroupIndex, true);
|
||||
|
||||
m_iCurrentSlotHIndex = 0;
|
||||
m_iCurrentSlotVIndex = 1;
|
||||
CheckRecipesAvailable();
|
||||
iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1;
|
||||
iVSlotIndexA[1] = 0;
|
||||
iVSlotIndexA[2] = 1;
|
||||
ui.PlayUISFX(eSFX_Focus);
|
||||
UpdateVerticalSlots();
|
||||
UpdateHighlight();
|
||||
setGroupText(GetGroupNameText(m_pGroupA[m_iGroupIndex]));
|
||||
}
|
||||
|
||||
bool UIScene_CraftingMenu::GetHSlotIndexForPoint(float fx, float fy, int &iOut)
|
||||
{
|
||||
if (m_iCraftablesMaxHSlotC <= 0) return false;
|
||||
|
||||
m_controlMainPanel.UpdateControl();
|
||||
m_slotListCraftingHSlots.UpdateControl();
|
||||
float fRowX = (float)m_slotListCraftingHSlots.getXPos() + (float)m_controlMainPanel.getXPos();
|
||||
float fRowY = (float)m_slotListCraftingHSlots.getYPos() + (float)m_controlMainPanel.getYPos();
|
||||
S32 iSlotSize = m_slotListCraftingHSlots.GetSlotSize();
|
||||
if (iSlotSize <= 0) iSlotSize = 50;
|
||||
float fRowW = (float)(m_iCraftablesMaxHSlotC * iSlotSize);
|
||||
float fRowH = (float)iSlotSize;
|
||||
if (fRowW < 4.0f || fRowH < 4.0f) return false;
|
||||
if (fx < fRowX || fx >= fRowX + fRowW || fy < fRowY || fy >= fRowY + fRowH) return false;
|
||||
|
||||
float fSlotW = fRowW / (float)m_iCraftablesMaxHSlotC;
|
||||
int iSlot = (int)((fx - fRowX) / fSlotW);
|
||||
if (iSlot < 0) iSlot = 0;
|
||||
if (iSlot >= m_iCraftablesMaxHSlotC) iSlot = m_iCraftablesMaxHSlotC - 1;
|
||||
if (CanBeMadeA[iSlot].iCount == 0) return false;
|
||||
iOut = iSlot;
|
||||
return true;
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::UpdateHSlotHover(float fx, float fy)
|
||||
{
|
||||
int iSlot;
|
||||
if (GetHSlotIndexForPoint(fx, fy, iSlot))
|
||||
{
|
||||
if (iSlot != m_iHoverHSlot)
|
||||
{
|
||||
m_slotListCraftingHSlots.clearHighlight();
|
||||
m_slotListCraftingHSlots.setHighlightSlot(iSlot);
|
||||
m_iHoverHSlot = iSlot;
|
||||
}
|
||||
}
|
||||
else if (m_iHoverHSlot != -1)
|
||||
{
|
||||
m_slotListCraftingHSlots.clearHighlight();
|
||||
m_iHoverHSlot = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::SelectHSlotUnderPoint(float fx, float fy)
|
||||
{
|
||||
int iNewSlot;
|
||||
if (!GetHSlotIndexForPoint(fx, fy, iNewSlot)) return;
|
||||
if (iNewSlot == m_iCurrentSlotHIndex) return;
|
||||
|
||||
int iOldHSlot = m_iCurrentSlotHIndex;
|
||||
m_iCurrentSlotHIndex = iNewSlot;
|
||||
m_iCurrentSlotVIndex = 1;
|
||||
iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1;
|
||||
iVSlotIndexA[1] = 0;
|
||||
iVSlotIndexA[2] = 1;
|
||||
UpdateVerticalSlots();
|
||||
UpdateHighlight();
|
||||
if (CanBeMadeA[iOldHSlot].iCount > 0)
|
||||
{
|
||||
setShowCraftHSlot(iOldHSlot, true);
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::tick()
|
||||
{
|
||||
UIScene::tick();
|
||||
|
||||
if (InputManager.IsMouseCaptured()) return;
|
||||
|
||||
extern int g_iWindowClientW, g_iWindowClientH;
|
||||
float fMovieW = getMovieWidth();
|
||||
float fMovieH = getMovieHeight();
|
||||
if (fMovieW < 1.0f) fMovieW = 1280.0f;
|
||||
if (fMovieH < 1.0f) fMovieH = 720.0f;
|
||||
float fScalex = fMovieW / (float)(g_iWindowClientW > 0 ? g_iWindowClientW : 1280);
|
||||
float fScaley = fMovieH / (float)(g_iWindowClientH > 0 ? g_iWindowClientH : 720);
|
||||
float fx = (float)InputManager.GetMouseX() * fScalex;
|
||||
float fy = (float)InputManager.GetMouseY() * fScaley;
|
||||
|
||||
if (ui.IsControllerMode())
|
||||
{
|
||||
if (m_iHoverHSlot != -1)
|
||||
{
|
||||
m_slotListCraftingHSlots.clearHighlight();
|
||||
m_iHoverHSlot = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateHSlotHover(fx, fy);
|
||||
}
|
||||
|
||||
bool bLDown = InputManager.IsMouseLDown();
|
||||
if (bLDown && !m_bMouseLDownPrev)
|
||||
{
|
||||
m_bCraftArmed = false;
|
||||
int iTab;
|
||||
if (GetTabSegmentForPoint(fx, fy, iTab))
|
||||
{
|
||||
SelectGroupTabUnderPoint(fx, fy);
|
||||
}
|
||||
else
|
||||
{
|
||||
int iSlot;
|
||||
if (GetHSlotIndexForPoint(fx, fy, iSlot))
|
||||
{
|
||||
if (iSlot == m_iCurrentSlotHIndex)
|
||||
m_bCraftArmed = true;
|
||||
else
|
||||
SelectHSlotUnderPoint(fx, fy);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!bLDown && m_bMouseLDownPrev)
|
||||
{
|
||||
if (m_bCraftArmed)
|
||||
{
|
||||
m_bCraftArmed = false;
|
||||
int iSlot;
|
||||
if (GetHSlotIndexForPoint(fx, fy, iSlot) && iSlot == m_iCurrentSlotHIndex)
|
||||
handleKeyDown(m_iPad, ACTION_MENU_A, false);
|
||||
}
|
||||
}
|
||||
m_bMouseLDownPrev = bLDown;
|
||||
}
|
||||
#endif
|
||||
|
||||
void UIScene_CraftingMenu::CycleVerticalVariant(bool bForward)
|
||||
{
|
||||
int iCount = CanBeMadeA[m_iCurrentSlotHIndex].iCount;
|
||||
if (iCount <= 1) return;
|
||||
|
||||
if (iCount > 2)
|
||||
{
|
||||
if (bForward)
|
||||
{
|
||||
if (m_iCurrentSlotVIndex != 2)
|
||||
{
|
||||
m_iCurrentSlotVIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
iVSlotIndexA[0] = iVSlotIndexA[1];
|
||||
iVSlotIndexA[1] = iVSlotIndexA[2];
|
||||
iVSlotIndexA[2] = (iVSlotIndexA[2] == iCount - 1) ? 0 : iVSlotIndexA[2] + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_iCurrentSlotVIndex != 0)
|
||||
{
|
||||
m_iCurrentSlotVIndex--;
|
||||
}
|
||||
else
|
||||
{
|
||||
iVSlotIndexA[2] = iVSlotIndexA[1];
|
||||
iVSlotIndexA[1] = iVSlotIndexA[0];
|
||||
iVSlotIndexA[0] = (iVSlotIndexA[0] == 0) ? iCount - 1 : iVSlotIndexA[0] - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_iCurrentSlotVIndex = (bForward) ? ((m_iCurrentSlotVIndex != 1) ? 1 : 0) : ((m_iCurrentSlotVIndex != 0) ? 0 : 1);
|
||||
}
|
||||
|
||||
ui.PlayUISFX(eSFX_Focus);
|
||||
UpdateVerticalSlots();
|
||||
UpdateHighlight();
|
||||
}
|
||||
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
UIControl* UIScene_CraftingMenu::GetMainPanel()
|
||||
{
|
||||
return &m_controlMainPanel;
|
||||
@@ -369,6 +601,7 @@ void UIScene_CraftingMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int
|
||||
void UIScene_CraftingMenu::handleTouchBoxRebuild()
|
||||
{
|
||||
addTimer(GAME_CRAFTING_TOUCHUPDATE_TIMER_ID,GAME_CRAFTING_TOUCHUPDATE_TIMER_TIME);
|
||||
UIScene::handleTouchBoxRebuild();
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::handleTimerComplete(int id)
|
||||
@@ -556,7 +789,10 @@ void UIScene_CraftingMenu::handleInput(int iPad, int key, bool repeat, bool pres
|
||||
{
|
||||
case ACTION_MENU_OTHER_STICK_UP:
|
||||
case ACTION_MENU_OTHER_STICK_DOWN:
|
||||
sendInputToMovie(key,repeat,pressed,released);
|
||||
if (pressed)
|
||||
{
|
||||
CycleVerticalVariant(key == ACTION_MENU_OTHER_STICK_DOWN);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(pressed)
|
||||
|
||||
@@ -64,7 +64,26 @@ public:
|
||||
|
||||
virtual void customDraw(IggyCustomDrawCallbackRegion *region);
|
||||
|
||||
#ifdef __PSVITA__
|
||||
virtual void tick();
|
||||
|
||||
void SelectHSlotUnderPoint(float fx, float fy);
|
||||
|
||||
bool GetHSlotIndexForPoint(float fx, float fy, int &iOut);
|
||||
|
||||
void UpdateHSlotHover(float fx, float fy);
|
||||
|
||||
int m_iHoverHSlot;
|
||||
|
||||
|
||||
|
||||
void SelectGroupTabUnderPoint(float fx, float fy);
|
||||
bool GetTabSegmentForPoint(float fx, float fy, int &iOut);
|
||||
|
||||
void CycleVerticalVariant(bool bForward);
|
||||
|
||||
virtual void handleMouseHover(float x, float y, int iId);
|
||||
|
||||
#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();
|
||||
@@ -74,6 +93,7 @@ public:
|
||||
protected:
|
||||
UIControl m_controlMainPanel;
|
||||
UIControl m_control1Selector, m_control2Selector, m_control3Selector;
|
||||
UIControl m_tabRow;
|
||||
UIControl_SlotList m_slotListCraftingHSlots;
|
||||
UIControl_SlotList m_slotListCrafting1VSlots, m_slotListCrafting2VSlots[2], m_slotListCrafting3VSlots[3];
|
||||
UIControl_SlotList m_slotListIngredientsLayout, m_slotListCraftingOutput;
|
||||
@@ -86,7 +106,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,
|
||||
@@ -104,11 +124,17 @@ protected:
|
||||
S32 m_iCraftingSlotTouchStartY;
|
||||
#endif
|
||||
|
||||
bool m_bMouseLDownPrev;
|
||||
|
||||
bool m_bCraftArmed;
|
||||
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
UI_MAP_ELEMENT( m_controlMainPanel, "MainPanel" )
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlMainPanel )
|
||||
UI_MAP_ELEMENT( m_slotListCraftingHSlots, "CraftingHSlots")
|
||||
|
||||
UI_MAP_ELEMENT( m_tabRow, "CraftingTabs")
|
||||
|
||||
UI_MAP_ELEMENT( m_control3Selector, "SlotSelector3" )
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS( m_control3Selector)
|
||||
UI_MAP_ELEMENT( m_slotListCrafting3VSlots[0], "Crafting3VSlot1")
|
||||
@@ -157,7 +183,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" )
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "UI.h"
|
||||
#include "UIScene_CreateWorldMenu.h"
|
||||
#include "DirectTextEdit.h"
|
||||
#include "..\..\MinecraftServer.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "..\..\Options.h"
|
||||
@@ -81,6 +82,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
|
||||
m_MoreOptionsParams.bDoDaylightCycle = true;
|
||||
|
||||
m_bGameModeCreative = false;
|
||||
m_lastPackSelId = -1;
|
||||
m_bPackSelTracked = false;
|
||||
m_iGameModeId = GameType::SURVIVAL->getId();
|
||||
m_pDLCPack = NULL;
|
||||
m_bRebuildTouchBoxes = false;
|
||||
@@ -298,6 +301,7 @@ void UIScene_CreateWorldMenu::tick()
|
||||
{
|
||||
slideLeft();
|
||||
m_texturePackDescDisplayed = true;
|
||||
handleTouchBoxRebuild();
|
||||
|
||||
m_bShowTexturePackDescription = false;
|
||||
}
|
||||
@@ -386,8 +390,16 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p
|
||||
case ACTION_MENU_RIGHT:
|
||||
case ACTION_MENU_OTHER_STICK_UP:
|
||||
case ACTION_MENU_OTHER_STICK_DOWN:
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
if (pressed && (key == ACTION_MENU_OTHER_STICK_UP || key == ACTION_MENU_OTHER_STICK_DOWN)
|
||||
&& MouseHoversTexturePackList())
|
||||
{
|
||||
StepTexturePack(key == ACTION_MENU_OTHER_STICK_UP ? -1 : +1);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
}
|
||||
|
||||
bool bOnlineGame = m_checkboxOnline.IsChecked();
|
||||
if (m_MoreOptionsParams.bOnlineGame != bOnlineGame)
|
||||
{
|
||||
@@ -416,8 +428,14 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
|
||||
{
|
||||
case eControl_EditWorldName:
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
DirectTextEdit::Begin(&m_editWorldName, &m_controlMainPanel, m_editWorldName.getLabel(), 25,
|
||||
C_4JInput::EKeyboardMode_Default,
|
||||
&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback, this);
|
||||
#else
|
||||
m_bIgnoreInput=true;
|
||||
InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD),m_editWorldName.getLabel(),(DWORD)0,25,&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback,this,C_4JInput::EKeyboardMode_Default);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case eControl_GameModeToggle:
|
||||
@@ -622,7 +640,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)
|
||||
{
|
||||
@@ -729,7 +747,10 @@ int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bo
|
||||
{
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t) );
|
||||
InputManager.GetText(pchText);
|
||||
#ifdef _WINDOWS64
|
||||
if (!DirectTextEdit::TakeText(pchText, 128))
|
||||
#endif
|
||||
InputManager.GetText(pchText);
|
||||
|
||||
if(pchText[0]!=0)
|
||||
{
|
||||
@@ -742,6 +763,54 @@ int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bo
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIScene_CreateWorldMenu::handleSelectionChanged(F64 selectedId)
|
||||
{
|
||||
m_lastPackSelId = (int)selectedId;
|
||||
m_bPackSelTracked = true;
|
||||
IUIScene_StartGame::handleSelectionChanged(selectedId);
|
||||
}
|
||||
|
||||
bool UIScene_CreateWorldMenu::MouseHoversTexturePackList()
|
||||
{
|
||||
m_controlMainPanel.UpdateControl();
|
||||
m_texturePackList.UpdateControl();
|
||||
float x = (float)m_controlMainPanel.getXPos() + (float)m_texturePackList.getXPos();
|
||||
float y = (float)m_controlMainPanel.getYPos() + (float)m_texturePackList.getYPos();
|
||||
float w = (float)m_texturePackList.getWidth();
|
||||
float h = (float)m_texturePackList.getHeight();
|
||||
if (w < 4.0f || h < 4.0f)
|
||||
return false;
|
||||
float fx = 0.0f, fy = 0.0f;
|
||||
ui.GetMovieMousePos(this, fx, fy);
|
||||
return fx >= x && fx < x + w && fy >= y && fy < y + h;
|
||||
}
|
||||
|
||||
void UIScene_CreateWorldMenu::StepTexturePack(int iDir)
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if (!pMinecraft || !pMinecraft->skins)
|
||||
return;
|
||||
int count = (int)pMinecraft->skins->getTexturePackCount();
|
||||
if (count < 2)
|
||||
return;
|
||||
int step = (iDir < 0 ? -1 : +1);
|
||||
int idx = m_bPackSelTracked ? m_lastPackSelId : (int)m_currentTexturePackIndex;
|
||||
for (;;)
|
||||
{
|
||||
idx += step;
|
||||
if (idx < 0 || idx >= count)
|
||||
return;
|
||||
if (pMinecraft->skins->getTexturePackByIndex(idx) != NULL)
|
||||
break;
|
||||
}
|
||||
m_lastPackSelId = idx;
|
||||
m_bPackSelTracked = true;
|
||||
m_texturePackList.selectSlot(idx);
|
||||
UpdateCurrentTexturePack(idx);
|
||||
UpdateTexturePackDescription(idx);
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
}
|
||||
|
||||
void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
||||
{
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
@@ -1441,4 +1510,5 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor
|
||||
void UIScene_CreateWorldMenu::handleTouchBoxRebuild()
|
||||
{
|
||||
m_bRebuildTouchBoxes = true;
|
||||
UIScene::handleTouchBoxRebuild();
|
||||
}
|
||||
@@ -81,6 +81,11 @@ public:
|
||||
private:
|
||||
void StartSharedLaunchFlow();
|
||||
bool IsLocalMultiplayerAvailable();
|
||||
virtual void handleSelectionChanged(F64 selectedId);
|
||||
bool MouseHoversTexturePackList();
|
||||
void StepTexturePack(int iDir);
|
||||
int m_lastPackSelId;
|
||||
bool m_bPackSelTracked;
|
||||
|
||||
#ifdef _DURANGO
|
||||
static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad);
|
||||
|
||||
@@ -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;
|
||||
@@ -117,6 +117,7 @@ void UIScene_CreativeMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int
|
||||
void UIScene_CreativeMenu::handleTouchBoxRebuild()
|
||||
{
|
||||
addTimer(GAME_CREATIVE_TOUCHUPDATE_TIMER_ID,GAME_CREATIVE_TOUCHUPDATE_TIMER_TIME);
|
||||
UIScene::handleTouchBoxRebuild();
|
||||
}
|
||||
|
||||
void UIScene_CreativeMenu::handleTimerComplete(int id)
|
||||
@@ -326,10 +327,12 @@ void UIScene_CreativeMenu::GetItemScreenData( ESceneSection eSection, int iItemI
|
||||
case eSectionInventoryCreativeSelector:
|
||||
sectionSize.x = m_slotListContainer.getWidth();
|
||||
sectionSize.y = m_slotListContainer.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListContainer, sectionSize);
|
||||
break;
|
||||
case eSectionInventoryCreativeUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
case eSectionInventoryCreativeTab_0:
|
||||
sectionSize.x = m_TouchInput[ETouchInput_TouchPanel_0].getWidth();
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -123,14 +123,17 @@ void UIScene_DispenserMenu::GetItemScreenData( ESceneSection eSection, int iItem
|
||||
case eSectionTrapTrap:
|
||||
sectionSize.x = m_slotListTrap.getWidth();
|
||||
sectionSize.y = m_slotListTrap.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListTrap, sectionSize);
|
||||
break;
|
||||
case eSectionTrapInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionTrapUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -140,14 +140,17 @@ void UIScene_EnchantingMenu::GetItemScreenData( ESceneSection eSection, int iIte
|
||||
case eSectionEnchantSlot:
|
||||
sectionSize.x = m_slotListIngredient.getWidth();
|
||||
sectionSize.y = m_slotListIngredient.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListIngredient, sectionSize);
|
||||
break;
|
||||
case eSectionEnchantInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionEnchantUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
case eSectionEnchantButton1:
|
||||
sectionSize.x = m_enchantButton[0].getWidth();
|
||||
|
||||
@@ -137,18 +137,22 @@ void UIScene_FireworksMenu::GetItemScreenData( ESceneSection eSection, int iItem
|
||||
case eSectionFireworksIngredients:
|
||||
sectionSize.x = m_slotList3x3.getWidth();
|
||||
sectionSize.y = m_slotList3x3.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotList3x3, sectionSize);
|
||||
break;
|
||||
case eSectionFireworksResult:
|
||||
sectionSize.x = m_slotListResult.getWidth();
|
||||
sectionSize.y = m_slotListResult.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListResult, sectionSize);
|
||||
break;
|
||||
case eSectionFireworksInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionFireworksUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -161,22 +161,27 @@ void UIScene_FurnaceMenu::GetItemScreenData( ESceneSection eSection, int iItemIn
|
||||
case eSectionFurnaceResult:
|
||||
sectionSize.x = m_slotListResult.getWidth();
|
||||
sectionSize.y = m_slotListResult.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListResult, sectionSize);
|
||||
break;
|
||||
case eSectionFurnaceFuel:
|
||||
sectionSize.x = m_slotListFuel.getWidth();
|
||||
sectionSize.y = m_slotListFuel.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListFuel, sectionSize);
|
||||
break;
|
||||
case eSectionFurnaceIngredient:
|
||||
sectionSize.x = m_slotListIngredient.getWidth();
|
||||
sectionSize.y = m_slotListIngredient.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListIngredient, sectionSize);
|
||||
break;
|
||||
case eSectionFurnaceInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionFurnaceUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -123,14 +123,17 @@ void UIScene_HopperMenu::GetItemScreenData( ESceneSection eSection, int iItemInd
|
||||
case eSectionHopperContents:
|
||||
sectionSize.x = m_slotListTrap.getWidth();
|
||||
sectionSize.y = m_slotListTrap.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListTrap, sectionSize);
|
||||
break;
|
||||
case eSectionHopperInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionHopperUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -198,14 +198,17 @@ void UIScene_HorseInventoryMenu::GetItemScreenData( ESceneSection eSection, int
|
||||
case eSectionHorseChest:
|
||||
sectionSize.x = m_slotListChest.getWidth();
|
||||
sectionSize.y = m_slotListChest.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListChest, sectionSize);
|
||||
break;
|
||||
case eSectionHorseInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionHorseUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -57,6 +57,10 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void *initData, UILayer
|
||||
#if TO_BE_IMPLEMENTED
|
||||
SetTimer(IGNORE_KEYPRESS_TIMERID,IGNORE_KEYPRESS_TIME);
|
||||
#endif
|
||||
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
UIScene_InGameInfoMenu::~UIScene_InGameInfoMenu()
|
||||
@@ -204,6 +208,7 @@ void UIScene_InGameInfoMenu::tick()
|
||||
{
|
||||
UIScene::tick();
|
||||
|
||||
|
||||
// Update players by index
|
||||
for(DWORD i = 0; i < m_players.size(); ++i)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -118,6 +118,13 @@ int UIScene_InventoryMenu::getSectionRows(ESceneSection eSection)
|
||||
return rows;
|
||||
}
|
||||
|
||||
void UIScene_InventoryMenu::RefreshSlotControls()
|
||||
{
|
||||
m_slotListArmor.UpdateControl();
|
||||
m_slotListInventory.UpdateControl();
|
||||
m_slotListHotbar.UpdateControl();
|
||||
}
|
||||
|
||||
void UIScene_InventoryMenu::GetPositionOfSection( ESceneSection eSection, UIVec2D* pPosition )
|
||||
{
|
||||
switch( eSection )
|
||||
@@ -149,14 +156,17 @@ void UIScene_InventoryMenu::GetItemScreenData( ESceneSection eSection, int iItem
|
||||
case eSectionInventoryArmor:
|
||||
sectionSize.x = m_slotListArmor.getWidth();
|
||||
sectionSize.y = m_slotListArmor.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListArmor, sectionSize);
|
||||
break;
|
||||
case eSectionInventoryInventory:
|
||||
sectionSize.x = m_slotListInventory.getWidth();
|
||||
sectionSize.y = m_slotListInventory.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListInventory, sectionSize);
|
||||
break;
|
||||
case eSectionInventoryUsing:
|
||||
sectionSize.x = m_slotListHotbar.getWidth();
|
||||
sectionSize.y = m_slotListHotbar.getHeight();
|
||||
FixSlotGridSize(eSection, m_slotListHotbar, sectionSize);
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
|
||||
@@ -36,6 +36,7 @@ protected:
|
||||
|
||||
virtual int getSectionColumns(ESceneSection eSection);
|
||||
virtual int getSectionRows(ESceneSection eSection);
|
||||
virtual void RefreshSlotControls();
|
||||
virtual void GetPositionOfSection( ESceneSection eSection, UIVec2D* pPosition );
|
||||
virtual void GetItemScreenData( ESceneSection eSection, int iItemIndex, UIVec2D* pPosition, UIVec2D* pSize );
|
||||
virtual void handleSectionClick(ESceneSection eSection) {}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "UI.h"
|
||||
#include "UIScene_LaunchMoreOptionsMenu.h"
|
||||
#include "DirectTextEdit.h"
|
||||
|
||||
#define GAME_CREATE_ONLINE_TIMER_ID 0
|
||||
#define GAME_CREATE_ONLINE_TIMER_TIME 100
|
||||
@@ -131,6 +132,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
|
||||
// #endif
|
||||
|
||||
m_tabIndex = m_params->bGenerateOptions ? TAB_WORLD_OPTIONS : TAB_GAME_OPTIONS;
|
||||
SyncTabVisibility();
|
||||
|
||||
// set the default text
|
||||
#ifdef _LARGE_WORLDS
|
||||
@@ -161,7 +163,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);
|
||||
@@ -170,6 +172,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
|
||||
#endif
|
||||
|
||||
m_bIgnoreInput = false;
|
||||
m_iLastPanelSig = 0;
|
||||
}
|
||||
|
||||
void UIScene_LaunchMoreOptionsMenu::updateTooltips()
|
||||
@@ -211,6 +214,12 @@ void UIScene_LaunchMoreOptionsMenu::tick()
|
||||
{
|
||||
UIScene::tick();
|
||||
|
||||
{
|
||||
bool bWorld = (m_tabIndex == TAB_WORLD_OPTIONS);
|
||||
if (m_gameOptions.getVisible() == bWorld) m_gameOptions.setVisible(!bWorld);
|
||||
if (m_worldOptions.getVisible() != bWorld) m_worldOptions.setVisible(bWorld);
|
||||
}
|
||||
|
||||
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_params->iPad) && ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
|
||||
|
||||
if (bMultiplayerAllowed != m_bMultiplayerAllowed)
|
||||
@@ -240,6 +249,143 @@ void UIScene_LaunchMoreOptionsMenu::tick()
|
||||
UpdateOnline();
|
||||
m_bUpdateOnline = false;
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
{
|
||||
m_worldOptions.UpdateControl();
|
||||
m_gameOptions.UpdateControl();
|
||||
int sig = m_worldOptions.getXPos();
|
||||
sig = sig * 31 + m_worldOptions.getYPos();
|
||||
sig = sig * 31 + m_worldOptions.getWidth();
|
||||
sig = sig * 31 + m_worldOptions.getHeight();
|
||||
sig = sig * 31 + m_gameOptions.getXPos();
|
||||
sig = sig * 31 + m_gameOptions.getYPos();
|
||||
sig = sig * 31 + m_gameOptions.getWidth();
|
||||
sig = sig * 31 + m_gameOptions.getHeight();
|
||||
if (sig != 0 && sig != m_iLastPanelSig)
|
||||
{
|
||||
m_iLastPanelSig = sig;
|
||||
ui.TouchBoxRebuild(this);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
extern int g_iWindowClientW, g_iWindowClientH;
|
||||
static bool s_bTabLDownPrev = false;
|
||||
static char s_szTabLog[MAX_PATH];
|
||||
static bool s_bTabLogInit = false;
|
||||
if (!s_bTabLogInit)
|
||||
{
|
||||
s_bTabLogInit = true;
|
||||
s_szTabLog[0] = 0;
|
||||
char szExe[MAX_PATH];
|
||||
DWORD dwExe = GetModuleFileNameA(NULL, szExe, MAX_PATH);
|
||||
if (dwExe > 0 && dwExe < MAX_PATH)
|
||||
{
|
||||
int lastSlash = -1;
|
||||
for (int i = 0; szExe[i] != 0; ++i)
|
||||
if (szExe[i] == '\\') lastSlash = i;
|
||||
if (lastSlash > 0 && lastSlash + 32 < MAX_PATH)
|
||||
{
|
||||
int i = 0;
|
||||
for (; i <= lastSlash; ++i) s_szTabLog[i] = szExe[i];
|
||||
const char *tail = "lmo_tabs.log";
|
||||
for (int j = 0; tail[j] != 0; ++j, ++i) s_szTabLog[i] = tail[j];
|
||||
s_szTabLog[i] = 0;
|
||||
}
|
||||
}
|
||||
if (!s_szTabLog[0])
|
||||
{
|
||||
const char *fb = "lmo_tabs.log";
|
||||
int i = 0;
|
||||
for (; fb[i] != 0; ++i) s_szTabLog[i] = fb[i];
|
||||
s_szTabLog[i] = 0;
|
||||
}
|
||||
char szCwd[MAX_PATH];
|
||||
szCwd[0] = 0;
|
||||
GetCurrentDirectoryA(MAX_PATH, szCwd);
|
||||
FILE *phead = fopen(s_szTabLog, "a");
|
||||
if (phead)
|
||||
{
|
||||
fprintf(phead, "=== MoreOptions tick alive. exe=%s cwd=%s movie=%.0fx%.0f log=%s ===\n",
|
||||
szExe, szCwd, (float)getMovieWidth(), (float)getMovieHeight(), s_szTabLog);
|
||||
fclose(phead);
|
||||
}
|
||||
}
|
||||
bool bLDown = InputManager.IsMouseLDown();
|
||||
if (bLDown && !s_bTabLDownPrev)
|
||||
{
|
||||
float fMovieW = (float)getMovieWidth();
|
||||
float fMovieH = (float)getMovieHeight();
|
||||
float fx = (float)InputManager.GetMouseX();
|
||||
float fy = (float)InputManager.GetMouseY();
|
||||
if (fMovieW > 0.0f && fMovieH > 0.0f && g_iWindowClientW > 0 && g_iWindowClientH > 0)
|
||||
{
|
||||
fx = fx * (fMovieW / (float)g_iWindowClientW);
|
||||
fy = fy * (fMovieH / (float)g_iWindowClientH);
|
||||
}
|
||||
|
||||
m_labelWorldOptions.UpdateControl();
|
||||
m_labelGameOptions.UpdateControl();
|
||||
|
||||
const float pad = 32.0f;
|
||||
float wx = (float)m_labelWorldOptions.getXPos() - pad;
|
||||
float wy = (float)m_labelWorldOptions.getYPos() - pad;
|
||||
float ww = (float)m_labelWorldOptions.getWidth() + pad * 2.0f;
|
||||
float wh = (float)m_labelWorldOptions.getHeight() + pad * 2.0f;
|
||||
float gx = (float)m_labelGameOptions.getXPos() - pad;
|
||||
float gy = (float)m_labelGameOptions.getYPos() - pad;
|
||||
float gw = (float)m_labelGameOptions.getWidth() + pad * 2.0f;
|
||||
float gh = (float)m_labelGameOptions.getHeight() + pad * 2.0f;
|
||||
|
||||
bool wHit = (ww > 0.0f && wh > 0.0f && fx >= wx && fx < wx + ww && fy >= wy && fy < wy + wh);
|
||||
bool gHit = (gw > 0.0f && gh > 0.0f && fx >= gx && fx < gx + gw && fy >= gy && fy < gy + gh);
|
||||
|
||||
int iTab = -1;
|
||||
if (wHit && !gHit) iTab = TAB_WORLD_OPTIONS;
|
||||
else if (gHit && !wHit) iTab = TAB_GAME_OPTIONS;
|
||||
else if (wHit && gHit)
|
||||
{
|
||||
float wdx = fx - (wx + ww * 0.5f);
|
||||
float wdy = fy - (wy + wh * 0.5f);
|
||||
float gdx = fx - (gx + gw * 0.5f);
|
||||
float gdy = fy - (gy + gh * 0.5f);
|
||||
iTab = (wdx * wdx + wdy * wdy <= gdx * gdx + gdy * gdy) ? TAB_WORLD_OPTIONS : TAB_GAME_OPTIONS;
|
||||
}
|
||||
|
||||
{
|
||||
char szCwd2[MAX_PATH];
|
||||
szCwd2[0] = 0;
|
||||
GetCurrentDirectoryA(MAX_PATH, szCwd2);
|
||||
FILE *plog = fopen(s_szTabLog[0] ? s_szTabLog : "lmo_tabs.log", "a");
|
||||
if (plog)
|
||||
{
|
||||
fprintf(plog, "CLICK raw=%d,%d client=%dx%d movie=%.0fx%.0f pt=%.1f,%.1f curTab=%d\n",
|
||||
InputManager.GetMouseX(), InputManager.GetMouseY(),
|
||||
g_iWindowClientW, g_iWindowClientH, fMovieW, fMovieH, fx, fy, m_tabIndex);
|
||||
fprintf(plog, " LabelWorld x=%d y=%d w=%d h=%d | LabelGame x=%d y=%d w=%d h=%d | wHit=%d gHit=%d iTab=%d cwd=%s\n",
|
||||
m_labelWorldOptions.getXPos(), m_labelWorldOptions.getYPos(),
|
||||
m_labelWorldOptions.getWidth(), m_labelWorldOptions.getHeight(),
|
||||
m_labelGameOptions.getXPos(), m_labelGameOptions.getYPos(),
|
||||
m_labelGameOptions.getWidth(), m_labelGameOptions.getHeight(),
|
||||
(int)wHit, (int)gHit, iTab, szCwd2);
|
||||
fclose(plog);
|
||||
}
|
||||
}
|
||||
|
||||
if (iTab != -1 && iTab != m_tabIndex)
|
||||
{
|
||||
m_tabIndex = iTab;
|
||||
updateTooltips();
|
||||
IggyDataValue result;
|
||||
IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcChangeTab, 0, NULL);
|
||||
SyncTabVisibility();
|
||||
ui.TouchBoxRebuild(this);
|
||||
}
|
||||
}
|
||||
s_bTabLDownPrev = bLDown;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void UIScene_LaunchMoreOptionsMenu::handleDestroy()
|
||||
@@ -306,15 +452,16 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat,
|
||||
updateTooltips();
|
||||
IggyDataValue result;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , NULL );
|
||||
SyncTabVisibility();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#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)
|
||||
if(bPressed || bReleased)
|
||||
{
|
||||
switch(iId)
|
||||
{
|
||||
@@ -328,6 +475,7 @@ void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S
|
||||
updateTooltips();
|
||||
IggyDataValue result;
|
||||
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , NULL );
|
||||
SyncTabVisibility();
|
||||
}
|
||||
ui.TouchBoxRebuild(this);
|
||||
break;
|
||||
@@ -335,6 +483,7 @@ void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UIControl* UIScene_LaunchMoreOptionsMenu::GetMainPanel()
|
||||
{
|
||||
if(m_tabIndex == 0)
|
||||
@@ -342,6 +491,54 @@ UIControl* UIScene_LaunchMoreOptionsMenu::GetMainPanel()
|
||||
else
|
||||
return &m_gameOptions;
|
||||
}
|
||||
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
bool UIScene_LaunchMoreOptionsMenu::isControlActiveForTouch(UIControl *control)
|
||||
{
|
||||
if (control == &m_TouchTabWorld || control == &m_TouchTabGame)
|
||||
return true;
|
||||
|
||||
bool bWorld = (m_tabIndex == TAB_WORLD_OPTIONS);
|
||||
|
||||
if (control == &m_labelDescription_GameOptions)
|
||||
return !bWorld;
|
||||
{
|
||||
static const int gameBoxes[] =
|
||||
{
|
||||
eLaunchCheckbox_Online, eLaunchCheckbox_InviteOnly, eLaunchCheckbox_AllowFoF,
|
||||
eLaunchCheckbox_PVP, eLaunchCheckbox_HostPrivileges, eLaunchCheckbox_DayLightCycle,
|
||||
eLaunchCheckbox_KeepInventory, eLaunchCheckbox_MobSpawning, eLaunchCheckbox_MobGriefing,
|
||||
eLaunchCheckbox_MobLoot, eLaunchCheckbox_TileDrops, eLaunchCheckbox_NaturalRegeneration
|
||||
};
|
||||
for (int i = 0; i < sizeof(gameBoxes) / sizeof(gameBoxes[0]); ++i)
|
||||
{
|
||||
if (control == &m_checkboxes[gameBoxes[i]])
|
||||
return !bWorld;
|
||||
}
|
||||
}
|
||||
|
||||
if (control == &m_labelDescription_WorldOptions
|
||||
|| control == &m_editSeed
|
||||
|| control == &m_sliderWorldSize
|
||||
|| control == &m_sliderWorldResize)
|
||||
return bWorld;
|
||||
{
|
||||
static const int worldBoxes[] =
|
||||
{
|
||||
eLaunchCheckbox_ResetNether, eLaunchCheckbox_Structures, eLaunchCheckbox_FlatWorld,
|
||||
eLaunchCheckbox_BonusChest, eLaunchCheckbox_DisableSaving, eLaunchCheckbox_WorldResizeType,
|
||||
eLaunchCheckbox_TrustSystem, eLaunchCheckbox_FireSpreads, eLaunchCheckbox_TNT
|
||||
};
|
||||
for (int i = 0; i < sizeof(worldBoxes) / sizeof(worldBoxes[0]); ++i)
|
||||
{
|
||||
if (control == &m_checkboxes[worldBoxes[i]])
|
||||
return bWorld;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void UIScene_LaunchMoreOptionsMenu::handleCheckboxToggled(F64 controlId, bool selected)
|
||||
@@ -557,7 +754,10 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t) );
|
||||
#endif
|
||||
InputManager.GetText(pchText);
|
||||
#ifdef _WINDOWS64
|
||||
if (!DirectTextEdit::TakeText(pchText, 128))
|
||||
#endif
|
||||
InputManager.GetText(pchText);
|
||||
pClass->m_editSeed.setLabel((wchar_t *)pchText);
|
||||
pClass->m_params->seed = (wchar_t *)pchText;
|
||||
}
|
||||
@@ -572,6 +772,11 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
{
|
||||
case eControl_EditSeed:
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
DirectTextEdit::Begin(&m_editSeed, &m_worldOptions, m_editSeed.getLabel(), 60,
|
||||
C_4JInput::EKeyboardMode_Default,
|
||||
&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback, this);
|
||||
#else
|
||||
m_bIgnoreInput=true;
|
||||
#ifdef __PS3__
|
||||
int language = XGetLanguage();
|
||||
@@ -589,6 +794,7 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
}
|
||||
#else
|
||||
InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -652,4 +858,13 @@ void UIScene_LaunchMoreOptionsMenu::UpdateOnline()
|
||||
|
||||
m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(bOnline);
|
||||
m_checkboxes[eLaunchCheckbox_AllowFoF].SetEnable(bOnline);
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_LaunchMoreOptionsMenu::SyncTabVisibility()
|
||||
{
|
||||
bool bWorld = (m_tabIndex == TAB_WORLD_OPTIONS);
|
||||
m_gameOptions.getVisible();
|
||||
m_worldOptions.getVisible();
|
||||
m_gameOptions.setVisible(!bWorld);
|
||||
m_worldOptions.setVisible(bWorld);
|
||||
}
|
||||
@@ -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")
|
||||
@@ -124,6 +124,7 @@ private:
|
||||
bool m_bMultiplayerAllowed;
|
||||
bool m_bIgnoreInput;
|
||||
int m_tabIndex;
|
||||
int m_iLastPanelSig; // geometry signature for touch-box rebuilds
|
||||
|
||||
public:
|
||||
UIScene_LaunchMoreOptionsMenu(int iPad, void *initData, UILayer *parentLayer);
|
||||
@@ -157,9 +158,11 @@ private:
|
||||
|
||||
bool m_bUpdateOnline; // If true, update online settings on next tick
|
||||
void UpdateOnline();
|
||||
void SyncTabVisibility();
|
||||
|
||||
#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 bool isControlActiveForTouch(UIControl *control);
|
||||
#endif //__PSVITA__
|
||||
};
|
||||
@@ -560,6 +560,7 @@ void UIScene_LoadMenu::tick()
|
||||
{
|
||||
slideLeft();
|
||||
m_texturePackDescDisplayed = true;
|
||||
handleTouchBoxRebuild();
|
||||
|
||||
m_bShowTexturePackDescription = false;
|
||||
}
|
||||
@@ -953,12 +954,13 @@ void UIScene_LoadMenu::handleSliderMove(F64 sliderId, F64 currentValue)
|
||||
void UIScene_LoadMenu::handleTouchBoxRebuild()
|
||||
{
|
||||
m_bRebuildTouchBoxes = true;
|
||||
UIScene::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)
|
||||
{
|
||||
|
||||
@@ -1210,6 +1210,15 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
handled = true;
|
||||
break;
|
||||
case ACTION_MENU_OTHER_STICK_UP:
|
||||
case ACTION_MENU_OTHER_STICK_DOWN:
|
||||
if (m_buttonListSaves.hasFocus() || m_buttonListGames.hasFocus())
|
||||
{
|
||||
sendInputToMovie(key == ACTION_MENU_OTHER_STICK_UP ? ACTION_MENU_UP : ACTION_MENU_DOWN,
|
||||
repeat, pressed, released);
|
||||
handled = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -109,6 +109,10 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa
|
||||
gameMode->getTutorial()->showTutorialPopup(false);
|
||||
}
|
||||
m_bErrorDialogRunning = false;
|
||||
|
||||
#if defined(__PSVITA__) || defined(_WINDOWS64)
|
||||
ui.TouchBoxRebuild(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
UIScene_PauseMenu::~UIScene_PauseMenu()
|
||||
@@ -137,12 +141,11 @@ wstring UIScene_PauseMenu::getMoviePath()
|
||||
{
|
||||
return L"PauseMenu";
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_PauseMenu::tick()
|
||||
}void UIScene_PauseMenu::tick()
|
||||
{
|
||||
UIScene::tick();
|
||||
|
||||
|
||||
#ifdef __PSVITA__
|
||||
// 4J-MGH - Need to check for installed DLC here, as we delay the installation of the key file on Vita
|
||||
if(!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(0);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ void UIScene_SettingsControlMenu::updateComponents()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UIScene_SettingsControlMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
|
||||
{
|
||||
ui.AnimateKeyPress(iPad, key, repeat, pressed, released);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "UI.h"
|
||||
#include "UIScene_SignEntryMenu.h"
|
||||
#include "DirectTextEdit.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "..\..\MultiPlayerLocalPlayer.h"
|
||||
#include "..\..\MultiPlayerLevel.h"
|
||||
@@ -149,7 +150,10 @@ int UIScene_SignEntryMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
|
||||
{
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t) );
|
||||
InputManager.GetText(pchText);
|
||||
#ifdef _WINDOWS64
|
||||
if (!DirectTextEdit::TakeText(pchText, 128))
|
||||
#endif
|
||||
InputManager.GetText(pchText);
|
||||
pClass->m_textInputLines[pClass->m_iEditingLine].setLabel((wchar_t *)pchText);
|
||||
}
|
||||
return 0;
|
||||
@@ -169,8 +173,14 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId)
|
||||
case eControl_Line3:
|
||||
case eControl_Line4:
|
||||
{
|
||||
m_iEditingLine = (int)controlId;
|
||||
m_bIgnoreInput = true;
|
||||
m_iEditingLine = (int)controlId;
|
||||
#ifdef _WINDOWS64
|
||||
DirectTextEdit::Begin(&m_textInputLines[m_iEditingLine], NULL, m_textInputLines[m_iEditingLine].getLabel(), 15,
|
||||
C_4JInput::EKeyboardMode_Alphabet,
|
||||
&UIScene_SignEntryMenu::KeyboardCompleteCallback, this);
|
||||
DirectTextEdit::SetLineNav(&UIScene_SignEntryMenu::DirectTextLineNav, this);
|
||||
#else
|
||||
m_bIgnoreInput = true;
|
||||
#ifdef _XBOX_ONE
|
||||
// 4J-PB - Xbox One uses the Windows virtual keyboard, and doesn't have the Xbox 360 Latin keyboard type, so we can't restrict the input set to alphanumeric. The closest we get is the emailSmtpAddress type.
|
||||
int language = XGetLanguage();
|
||||
@@ -188,9 +198,29 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId)
|
||||
#else
|
||||
InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(DWORD)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_SignEntryMenu::DirectTextLineNav(LPVOID pParam, int iDir)
|
||||
{
|
||||
UIScene_SignEntryMenu *pClass = (UIScene_SignEntryMenu *)pParam;
|
||||
int line = pClass->m_iEditingLine + iDir;
|
||||
if (line < 0 || line > 3)
|
||||
{
|
||||
if (iDir > 0)
|
||||
pClass->m_bConfirmed = true;
|
||||
return;
|
||||
}
|
||||
pClass->m_iEditingLine = line;
|
||||
#ifdef _WINDOWS64
|
||||
DirectTextEdit::Begin(&pClass->m_textInputLines[line], NULL, pClass->m_textInputLines[line].getLabel(), 15,
|
||||
C_4JInput::EKeyboardMode_Alphabet,
|
||||
&UIScene_SignEntryMenu::KeyboardCompleteCallback, pClass);
|
||||
DirectTextEdit::SetLineNav(&UIScene_SignEntryMenu::DirectTextLineNav, pClass);
|
||||
#endif
|
||||
}
|
||||
|
||||
void UIScene_SignEntryMenu::handleDestroy()
|
||||
|
||||
@@ -54,5 +54,6 @@ public:
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
static int KeyboardCompleteCallback(LPVOID lpParam,const bool bRes);
|
||||
static void DirectTextLineNav(LPVOID pParam, int iDir);
|
||||
virtual void handleDestroy();
|
||||
};
|
||||
@@ -54,6 +54,12 @@ UIScene_SkinSelectMenu::UIScene_SkinSelectMenu(int iPad, void *initData, UILayer
|
||||
m_bAnimatingMove = false;
|
||||
m_bSkinIndexChanged = false;
|
||||
|
||||
m_fMouseDragStartX = 0.0f;
|
||||
m_bMouseDragActive = false;
|
||||
m_bMouseDragScrolled = false;
|
||||
m_bMouseLDownPrev = false;
|
||||
m_iPressedPackTab = 0;
|
||||
|
||||
m_currentNavigation = eSkinNavigation_Skin;
|
||||
|
||||
m_currentPackCount = 0;
|
||||
@@ -77,7 +83,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);
|
||||
@@ -165,7 +171,248 @@ void UIScene_SkinSelectMenu::tick()
|
||||
handleSkinIndexChanged();
|
||||
}
|
||||
|
||||
// check for new DLC installed
|
||||
#ifdef _WINDOWS64
|
||||
{
|
||||
m_TouchIggyCharacters.UpdateControl();
|
||||
bool bHaveTouch = (m_TouchIggyCharacters.getWidth() >= 4 && m_TouchIggyCharacters.getHeight() >= 4);
|
||||
|
||||
bool bLDown = InputManager.IsMouseLDown();
|
||||
static char s_szSkinLog[MAX_PATH];
|
||||
static bool s_bSkinLogInit = false;
|
||||
if (!s_bSkinLogInit)
|
||||
{
|
||||
s_bSkinLogInit = true;
|
||||
s_szSkinLog[0] = 0;
|
||||
char szExe[MAX_PATH];
|
||||
DWORD dwExe = GetModuleFileNameA(NULL, szExe, MAX_PATH);
|
||||
if (dwExe > 0 && dwExe < MAX_PATH)
|
||||
{
|
||||
int lastSlash = -1;
|
||||
for (int i = 0; szExe[i] != 0; ++i)
|
||||
if (szExe[i] == '\\') lastSlash = i;
|
||||
if (lastSlash > 0 && lastSlash + 32 < MAX_PATH)
|
||||
{
|
||||
int i = 0;
|
||||
for (; i <= lastSlash; ++i) s_szSkinLog[i] = szExe[i];
|
||||
const char *tail = "skin_drag.log";
|
||||
for (int j = 0; tail[j] != 0; ++j, ++i) s_szSkinLog[i] = tail[j];
|
||||
s_szSkinLog[i] = 0;
|
||||
}
|
||||
}
|
||||
if (!s_szSkinLog[0])
|
||||
{
|
||||
const char *fb = "skin_drag.log";
|
||||
int i = 0;
|
||||
for (; fb[i] != 0; ++i) s_szSkinLog[i] = fb[i];
|
||||
s_szSkinLog[i] = 0;
|
||||
}
|
||||
m_probeTabLeft.UpdateControl();
|
||||
m_probeTabCenter.UpdateControl();
|
||||
m_probeTabRight.UpdateControl();
|
||||
FILE *phead = fopen(s_szSkinLog, "a");
|
||||
if (phead)
|
||||
{
|
||||
fprintf(phead, "=== SkinSelect tick alive. touchClip=%dx%d movie=%.0fx%.0f log=%s ===\n",
|
||||
m_TouchIggyCharacters.getWidth(), m_TouchIggyCharacters.getHeight(),
|
||||
(float)getMovieWidth(), (float)getMovieHeight(), s_szSkinLog);
|
||||
fprintf(phead, " probeLeft x=%d y=%d w=%d h=%d | probeCenter x=%d y=%d w=%d h=%d | probeRight x=%d y=%d w=%d h=%d\n",
|
||||
m_probeTabLeft.getXPos(), m_probeTabLeft.getYPos(),
|
||||
m_probeTabLeft.getWidth(), m_probeTabLeft.getHeight(),
|
||||
m_probeTabCenter.getXPos(), m_probeTabCenter.getYPos(),
|
||||
m_probeTabCenter.getWidth(), m_probeTabCenter.getHeight(),
|
||||
m_probeTabRight.getXPos(), m_probeTabRight.getYPos(),
|
||||
m_probeTabRight.getWidth(), m_probeTabRight.getHeight());
|
||||
fclose(phead);
|
||||
}
|
||||
}
|
||||
if (!bHaveTouch)
|
||||
{
|
||||
extern int g_iWindowClientW, g_iWindowClientH;
|
||||
float fMovieW = (float)getMovieWidth();
|
||||
float fMovieH = (float)getMovieHeight();
|
||||
float fx = (float)InputManager.GetMouseX();
|
||||
float fy = (float)InputManager.GetMouseY();
|
||||
if (fMovieW > 0.0f && fMovieH > 0.0f && g_iWindowClientW > 0 && g_iWindowClientH > 0)
|
||||
{
|
||||
fx = fx * (fMovieW / (float)g_iWindowClientW);
|
||||
fy = fy * (fMovieH / (float)g_iWindowClientH);
|
||||
}
|
||||
|
||||
m_controlIggyCharacters.UpdateControl();
|
||||
float ox = (float)m_controlIggyCharacters.getXPos();
|
||||
float oy = (float)m_controlIggyCharacters.getYPos();
|
||||
m_characters[eCharacter_Current].UpdateControl();
|
||||
m_characters[eCharacter_Next1].UpdateControl();
|
||||
m_characters[eCharacter_Previous1].UpdateControl();
|
||||
const float pad = 48.0f;
|
||||
float x1 = ox + (float)m_characters[eCharacter_Current].getXPos();
|
||||
float y1 = oy + (float)m_characters[eCharacter_Current].getYPos();
|
||||
float x2 = x1 + (float)m_characters[eCharacter_Current].getWidth();
|
||||
float y2 = y1 + (float)m_characters[eCharacter_Current].getHeight();
|
||||
const int adj[2] = { eCharacter_Next1, eCharacter_Previous1 };
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
float ax1 = ox + (float)m_characters[adj[i]].getXPos();
|
||||
float ay1 = oy + (float)m_characters[adj[i]].getYPos();
|
||||
float ax2 = ax1 + (float)m_characters[adj[i]].getWidth();
|
||||
float ay2 = ay1 + (float)m_characters[adj[i]].getHeight();
|
||||
if (ax2 <= ax1 || ay2 <= ay1) continue;
|
||||
if (ax1 < x1) x1 = ax1;
|
||||
if (ay1 < y1) y1 = ay1;
|
||||
if (ax2 > x2) x2 = ax2;
|
||||
if (ay2 > y2) y2 = ay2;
|
||||
}
|
||||
bool bValidSurface = (x2 > x1 && y2 > y1);
|
||||
bool bInside = bValidSurface
|
||||
&& fx >= x1 - pad && fx < x2 + pad
|
||||
&& fy >= y1 - pad && fy < y2 + pad;
|
||||
|
||||
if (bLDown && !m_bMouseLDownPrev)
|
||||
{
|
||||
FILE *ppress = fopen(s_szSkinLog[0] ? s_szSkinLog : "skin_drag.log", "a");
|
||||
if (ppress)
|
||||
{
|
||||
fprintf(ppress, "PRESS pt=%.1f,%.1f surf=%.0f,%.0f-%.0f,%.0f valid=%d inside=%d nav=%d skin=%u touch=%dx%d cont=%d,%d\n",
|
||||
fx, fy, x1, y1, x2, y2, (int)bValidSurface, (int)bInside,
|
||||
(int)m_currentNavigation, m_skinIndex,
|
||||
m_TouchIggyCharacters.getWidth(), m_TouchIggyCharacters.getHeight(),
|
||||
m_controlIggyCharacters.getXPos(), m_controlIggyCharacters.getYPos());
|
||||
fclose(ppress);
|
||||
}
|
||||
}
|
||||
|
||||
if (bLDown && !m_bMouseLDownPrev)
|
||||
{
|
||||
m_iPressedPackTab = 0;
|
||||
m_bMouseDragActive = false;
|
||||
int iTabHit = HitPackTab(fx, fy);
|
||||
{
|
||||
FILE *ptab = fopen(s_szSkinLog[0] ? s_szSkinLog : "skin_drag.log", "a");
|
||||
if (ptab)
|
||||
{
|
||||
fprintf(ptab, "PACKPRESS tab=%d nav=%d pack=%u\n", iTabHit, (int)m_currentNavigation, m_packIndex);
|
||||
fclose(ptab);
|
||||
}
|
||||
}
|
||||
if (iTabHit != 0)
|
||||
{
|
||||
m_iPressedPackTab = iTabHit;
|
||||
if (m_currentNavigation != eSkinNavigation_Pack)
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
m_currentNavigation = eSkinNavigation_Pack;
|
||||
sendInputToMovie(ACTION_MENU_UP, false, true, false);
|
||||
}
|
||||
}
|
||||
else if (bInside)
|
||||
{
|
||||
if (m_packIndex == SKIN_SELECT_PACK_FAVORITES
|
||||
&& app.GetPlayerFavoriteSkinsCount(m_iPad) == 0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_currentNavigation != eSkinNavigation_Skin)
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
m_currentNavigation = eSkinNavigation_Skin;
|
||||
sendInputToMovie(ACTION_MENU_DOWN, false, true, false);
|
||||
}
|
||||
m_fMouseDragStartX = fx;
|
||||
m_bMouseDragScrolled = false;
|
||||
m_bMouseDragActive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bLDown && m_bMouseDragActive)
|
||||
{
|
||||
if (m_currentNavigation == eSkinNavigation_Skin)
|
||||
{
|
||||
if (fx < m_fMouseDragStartX - 50.0f)
|
||||
{
|
||||
if (!m_bAnimatingMove && !m_bMouseDragScrolled)
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
m_skinIndex = getNextSkinIndex(m_skinIndex);
|
||||
|
||||
m_bSlidingSkins = true;
|
||||
m_bAnimatingMove = true;
|
||||
|
||||
m_characters[eCharacter_Current].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Right, true);
|
||||
m_characters[eCharacter_Next1].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Forward, true);
|
||||
|
||||
sendInputToMovie(ACTION_MENU_LEFT, false, true, false);
|
||||
|
||||
m_bMouseDragScrolled = true;
|
||||
}
|
||||
}
|
||||
else if (fx > m_fMouseDragStartX + 50.0f)
|
||||
{
|
||||
if (!m_bAnimatingMove && !m_bMouseDragScrolled)
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
|
||||
m_skinIndex = getPreviousSkinIndex(m_skinIndex);
|
||||
|
||||
m_bSlidingSkins = true;
|
||||
m_bAnimatingMove = true;
|
||||
|
||||
m_characters[eCharacter_Current].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Left, true);
|
||||
m_characters[eCharacter_Previous1].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Forward, true);
|
||||
|
||||
sendInputToMovie(ACTION_MENU_RIGHT, false, true, false);
|
||||
|
||||
m_bMouseDragScrolled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!bLDown && (m_bMouseDragActive || m_iPressedPackTab != 0))
|
||||
{
|
||||
int iTabRel = (m_iPressedPackTab != 0) ? HitPackTab(fx, fy) : 0;
|
||||
FILE *prel = fopen(s_szSkinLog[0] ? s_szSkinLog : "skin_drag.log", "a");
|
||||
if (prel)
|
||||
{
|
||||
fprintf(prel, "RELEASE scrolled=%d skin=%u packTab=%d relTab=%d pack=%u\n",
|
||||
(int)m_bMouseDragScrolled, m_skinIndex, m_iPressedPackTab, iTabRel, m_packIndex);
|
||||
fclose(prel);
|
||||
}
|
||||
if (m_iPressedPackTab != 0 && iTabRel == m_iPressedPackTab)
|
||||
{
|
||||
if (m_currentNavigation == eSkinNavigation_Pack
|
||||
&& (m_iPressedPackTab == 1 || m_iPressedPackTab == 3))
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
DWORD startingIndex = m_packIndex;
|
||||
if (m_iPressedPackTab == 1)
|
||||
m_packIndex = getPreviousPackIndex(m_packIndex);
|
||||
else
|
||||
m_packIndex = getNextPackIndex(m_packIndex);
|
||||
if (startingIndex != m_packIndex)
|
||||
{
|
||||
handlePackIndexChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_bMouseDragActive && !m_bMouseDragScrolled)
|
||||
{
|
||||
if (HitSkinPreview(fx, fy) != -1)
|
||||
InputActionOK(m_iPad);
|
||||
}
|
||||
m_bMouseDragActive = false;
|
||||
m_iPressedPackTab = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bMouseDragActive = false;
|
||||
m_iPressedPackTab = 0;
|
||||
}
|
||||
m_bMouseLDownPrev = bLDown;
|
||||
}
|
||||
#endif
|
||||
|
||||
// check for new DLC installed
|
||||
|
||||
// check for the patch error dialog
|
||||
#ifdef __ORBIS__
|
||||
@@ -184,6 +431,80 @@ void UIScene_SkinSelectMenu::tick()
|
||||
#endif
|
||||
}
|
||||
|
||||
int UIScene_SkinSelectMenu::HitPackTab(float fx, float fy)
|
||||
{
|
||||
m_probeTabLeft.UpdateControl();
|
||||
m_probeTabCenter.UpdateControl();
|
||||
m_probeTabRight.UpdateControl();
|
||||
const float tpad = 12.0f;
|
||||
UIControl *tabs[3] = { &m_probeTabLeft, &m_probeTabCenter, &m_probeTabRight };
|
||||
|
||||
bool probesValid = false;
|
||||
float tabsX[3], tabsY[3], tabsW[3], tabsH[3];
|
||||
for (int ti = 0; ti < 3; ++ti)
|
||||
{
|
||||
float tw = (float)tabs[ti]->getWidth();
|
||||
float th = (float)tabs[ti]->getHeight();
|
||||
if (tw >= 4.0f && th >= 4.0f)
|
||||
{
|
||||
probesValid = true;
|
||||
tabsX[ti] = (float)tabs[ti]->getXPos() - tpad;
|
||||
tabsY[ti] = (float)tabs[ti]->getYPos() - tpad;
|
||||
tabsW[ti] = tw + tpad * 2.0f;
|
||||
tabsH[ti] = th + tpad * 2.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (probesValid)
|
||||
{
|
||||
for (int ti = 0; ti < 3; ++ti)
|
||||
{
|
||||
if (fx >= tabsX[ti] && fx < tabsX[ti] + tabsW[ti] && fy >= tabsY[ti] && fy < tabsY[ti] + tabsH[ti])
|
||||
return ti + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float movieH = (float)getMovieHeight();
|
||||
float tabHeight = movieH * 0.15f;
|
||||
float tabWidth = (float)getMovieWidth() * 0.33f;
|
||||
float t = 8.0f;
|
||||
|
||||
for (int ti = 0; ti < 3; ++ti)
|
||||
{
|
||||
float tx = (float)getMovieWidth() * (ti * 0.33f);
|
||||
float ty = 0.0f;
|
||||
if (fx >= tx && fx < tx + tabWidth + t * 2.0f && fy >= ty && fy < ty + tabHeight + t * 2.0f)
|
||||
return ti + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UIScene_SkinSelectMenu::HitSkinPreview(float fx, float fy)
|
||||
{
|
||||
m_controlIggyCharacters.UpdateControl();
|
||||
m_characters[eCharacter_Current].UpdateControl();
|
||||
m_characters[eCharacter_Next1].UpdateControl();
|
||||
m_characters[eCharacter_Previous1].UpdateControl();
|
||||
float ox = (float)m_controlIggyCharacters.getXPos();
|
||||
float oy = (float)m_controlIggyCharacters.getYPos();
|
||||
const int ids[3] = { eCharacter_Previous1, eCharacter_Current, eCharacter_Next1 };
|
||||
for (int k = 0; k < 3; ++k)
|
||||
{
|
||||
int id = ids[k];
|
||||
float w = (float)m_characters[id].getWidth();
|
||||
float h = (float)m_characters[id].getHeight();
|
||||
if (w < 4.0f || h < 4.0f) continue;
|
||||
float x = ox + (float)m_characters[id].getXPos();
|
||||
float y = oy + (float)m_characters[id].getYPos();
|
||||
if (fx >= x && fx < x + w && fy >= y && fy < y + h)
|
||||
return id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void UIScene_SkinSelectMenu::handleAnimationEnd()
|
||||
{
|
||||
if(m_bSlidingSkins)
|
||||
@@ -1300,7 +1621,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,18 +50,22 @@ private:
|
||||
UIControl_Label m_labelSkinName, m_labelSkinOrigin;
|
||||
UIControl_Label m_labelSelected;
|
||||
UIControl m_controlSkinNamePlate, m_controlSelectedPanel, m_controlIggyCharacters, m_controlTimer;
|
||||
#ifdef __PSVITA__
|
||||
UIControl m_probeTabLeft, m_probeTabCenter, m_probeTabRight;
|
||||
#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" )
|
||||
UI_MAP_ELEMENT( m_TouchIggyCharacters, "TouchIggyCharacters" )
|
||||
#endif
|
||||
UI_MAP_ELEMENT( m_probeTabLeft, "Left" )
|
||||
UI_MAP_ELEMENT( m_probeTabCenter, "Center" )
|
||||
UI_MAP_ELEMENT( m_probeTabRight, "Right" )
|
||||
UI_MAP_ELEMENT( m_controlSkinNamePlate, "SkinNamePlate")
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlSkinNamePlate )
|
||||
UI_MAP_ELEMENT( m_labelSkinName, "SkinTitle1")
|
||||
@@ -116,6 +120,9 @@ private:
|
||||
|
||||
S32 m_iTouchXStart;
|
||||
bool m_bTouchScrolled;
|
||||
float m_fMouseDragStartX;
|
||||
bool m_bMouseDragActive, m_bMouseDragScrolled, m_bMouseLDownPrev;
|
||||
int m_iPressedPackTab;
|
||||
public:
|
||||
UIScene_SkinSelectMenu(int iPad, void *initData, UILayer *parentLayer);
|
||||
#ifdef __PSVITA__
|
||||
@@ -174,7 +181,9 @@ private:
|
||||
void AddFavoriteSkin(int iPad,int iSkinID);
|
||||
|
||||
void InputActionOK(unsigned int iPad);
|
||||
#ifdef __PSVITA__
|
||||
int HitPackTab(float fx, float fy);
|
||||
int HitSkinPreview(float fx, float fy);
|
||||
#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();
|
||||
|
||||
Reference in new issue
Block a user