mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 17:11:15 +00:00
Remove Win32 input types from abstract container menus
This commit is contained in:
parent
12bc5aa597
commit
3b199b9ba2
|
|
@ -204,7 +204,7 @@ void IUIScene_AbstractContainerMenu::SetToolTip( EToolTipButton eButton, EToolTi
|
|||
void IUIScene_AbstractContainerMenu::UpdateTooltips()
|
||||
{
|
||||
// Table gives us text id for tooltip.
|
||||
static const DWORD kaToolTipextIds[ eNumToolTips ] =
|
||||
static const int kaToolTipextIds[ eNumToolTips ] =
|
||||
{
|
||||
IDS_TOOLTIPS_PICKUPPLACE, //eToolTipPickupPlace_OLD
|
||||
IDS_TOOLTIPS_EXIT, // eToolTipExit
|
||||
|
|
@ -231,18 +231,18 @@ void IUIScene_AbstractContainerMenu::UpdateTooltips()
|
|||
IDS_TOOLTIPS_REPAIR, // eToolTipRepair
|
||||
};
|
||||
|
||||
BYTE focusUser = getPad();
|
||||
int focusUser = getPad();
|
||||
|
||||
for ( int i = 0; i < eToolTipNumButtons; ++i )
|
||||
{
|
||||
if ( m_aeToolTipSettings[ i ] == eToolTipNone )
|
||||
{
|
||||
ui.ShowTooltip( focusUser, i, FALSE );
|
||||
ui.ShowTooltip( focusUser, i, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.SetTooltipText( focusUser, i, kaToolTipextIds[ m_aeToolTipSettings[ i ] ] );
|
||||
ui.ShowTooltip( focusUser, i, TRUE );
|
||||
ui.ShowTooltip( focusUser, i, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1274,9 +1274,9 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
|||
#endif
|
||||
|
||||
int buttonNum=0; // 0 = LeftMouse, 1 = RightMouse
|
||||
BOOL quickKeyHeld=FALSE; // Represents shift key on PC
|
||||
bool quickKeyHeld = false; // Represents shift key on PC
|
||||
|
||||
BOOL validKeyPress = FALSE;
|
||||
bool validKeyPress = false;
|
||||
//BOOL itemEditorKeyPress = FALSE;
|
||||
|
||||
// Ignore input from other players
|
||||
|
|
@ -1297,22 +1297,22 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
|||
#endif
|
||||
if(!bRepeat)
|
||||
{
|
||||
validKeyPress = TRUE;
|
||||
validKeyPress = true;
|
||||
|
||||
// Standard left click
|
||||
buttonNum = 0;
|
||||
quickKeyHeld = FALSE;
|
||||
quickKeyHeld = false;
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_X:
|
||||
if(!bRepeat)
|
||||
{
|
||||
validKeyPress = TRUE;
|
||||
validKeyPress = true;
|
||||
|
||||
// Standard right click
|
||||
buttonNum = 1;
|
||||
quickKeyHeld = FALSE;
|
||||
quickKeyHeld = false;
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
break;
|
||||
|
|
@ -1327,11 +1327,11 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
|||
// No quick move tooltip is shown if something is carried, so disable the action as well
|
||||
//if(!bIsItemCarried)
|
||||
{
|
||||
validKeyPress = TRUE;
|
||||
validKeyPress = true;
|
||||
|
||||
// Shift and left click
|
||||
buttonNum = 0;
|
||||
quickKeyHeld = TRUE;
|
||||
quickKeyHeld = true;
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
}
|
||||
|
|
@ -1428,12 +1428,12 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
|||
}
|
||||
}
|
||||
}
|
||||
bHandled = TRUE;
|
||||
bHandled = true;
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
||||
if( validKeyPress == TRUE )
|
||||
if(validKeyPress)
|
||||
{
|
||||
if(handleValidKeyPress(iPad,buttonNum,quickKeyHeld))
|
||||
{
|
||||
|
|
@ -1482,7 +1482,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
|||
if( XuiIsInstanceOf( hFocusObjectParent, hClassCXuiCtrlSlotList ) )
|
||||
{
|
||||
CXuiCtrlSlotList* slotList;
|
||||
VOID *pObj;
|
||||
void *pObj;
|
||||
XuiObjectFromHandle( hFocusObjectParent, &pObj );
|
||||
slotList = (CXuiCtrlSlotList *)pObj;
|
||||
|
||||
|
|
@ -1517,12 +1517,12 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
|||
return bHandled;
|
||||
}
|
||||
|
||||
bool IUIScene_AbstractContainerMenu::handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld)
|
||||
bool IUIScene_AbstractContainerMenu::handleValidKeyPress(int iUserIndex, int buttonNum, bool quickKeyHeld)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void IUIScene_AbstractContainerMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld)
|
||||
void IUIScene_AbstractContainerMenu::handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld)
|
||||
{
|
||||
// Drop items.
|
||||
|
||||
|
|
@ -1540,7 +1540,7 @@ void IUIScene_AbstractContainerMenu::handleAdditionalKeyPress(int iAction)
|
|||
// Do nothing
|
||||
}
|
||||
|
||||
void IUIScene_AbstractContainerMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld)
|
||||
void IUIScene_AbstractContainerMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld)
|
||||
{
|
||||
int currentIndex = getCurrentIndex(eSection);
|
||||
|
||||
|
|
|
|||
|
|
@ -181,17 +181,17 @@ protected:
|
|||
// 4J - WESTY - Added for pointer prototype.
|
||||
void SetPointerOutsideMenu( bool bOutside ) { m_bPointerOutsideMenu = bOutside; }
|
||||
|
||||
void Initialize(int m_iPad, AbstractContainerMenu* menu, bool autoDeleteMenu, int startIndex,ESceneSection firstSection,ESceneSection maxSection, bool bNavigateBack=FALSE);
|
||||
void Initialize(int m_iPad, AbstractContainerMenu* menu, bool autoDeleteMenu, int startIndex,ESceneSection firstSection,ESceneSection maxSection, bool bNavigateBack=false);
|
||||
virtual void PlatformInitialize(int iPad, int startIndex) = 0;
|
||||
virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0) = 0;
|
||||
|
||||
void onMouseTick();
|
||||
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);
|
||||
virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, bool quickKeyHeld);
|
||||
virtual void handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld);
|
||||
virtual void handleOtherClicked(int iPad, ESceneSection eSection, int buttonNum, bool quickKey);
|
||||
virtual void handleAdditionalKeyPress(int iAction);
|
||||
virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld);
|
||||
virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld);
|
||||
virtual void handleSectionClick(ESceneSection eSection) = 0;
|
||||
void slotClicked(int slotId, int buttonNum, bool quickKey);
|
||||
int getCurrentIndex(ESceneSection eSection);
|
||||
|
|
|
|||
|
|
@ -786,7 +786,7 @@ IUIScene_AbstractContainerMenu::ESceneSection IUIScene_CreativeMenu::GetSectionA
|
|||
return newSection;
|
||||
}
|
||||
|
||||
bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL quickKeyHeld)
|
||||
bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, bool quickKeyHeld)
|
||||
{
|
||||
// 4J Added - Make pressing the X button clear the hotbar
|
||||
if(buttonNum == 1)
|
||||
|
|
@ -808,7 +808,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL qu
|
|||
return false;
|
||||
}
|
||||
|
||||
void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld)
|
||||
void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld)
|
||||
{
|
||||
// Drop items.
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
|
@ -882,7 +882,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction)
|
|||
}
|
||||
}
|
||||
|
||||
void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld)
|
||||
void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld)
|
||||
{
|
||||
int currentIndex = getCurrentIndex(eSection);
|
||||
|
||||
|
|
@ -901,7 +901,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
|
|||
{
|
||||
playerInventory->setCarried(ItemInstance::clone(clicked));
|
||||
carried = playerInventory->getCarried();
|
||||
if (quickKeyHeld == TRUE)
|
||||
if(quickKeyHeld)
|
||||
{
|
||||
carried->count = carried->getMaxStackSize();
|
||||
}
|
||||
|
|
@ -925,7 +925,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
|
|||
setSectionSelectedSlot(eSectionInventoryCreativeUsing,m_iCurrSlotX,m_iCurrSlotY);
|
||||
currentIndex = getCurrentIndex(eSectionInventoryCreativeUsing);
|
||||
buttonNum = 0;
|
||||
quickKeyHeld = FALSE;
|
||||
quickKeyHeld = false;
|
||||
}
|
||||
m_menu->clicked(currentIndex, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, pMinecraft->localplayers[getPad()]);
|
||||
std::shared_ptr<ItemInstance> newItem = m_menu->getSlot(currentIndex)->getItem();
|
||||
|
|
|
|||
|
|
@ -108,10 +108,10 @@ protected:
|
|||
virtual void updateTabHighlightAndText(ECreativeInventoryTabs tab) = 0;
|
||||
virtual void updateScrollCurrentPage(int currentPage, int pageCount) = 0;
|
||||
virtual ESceneSection GetSectionAndSlotInDirection( ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY );
|
||||
virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld);
|
||||
virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld);
|
||||
virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, bool quickKeyHeld);
|
||||
virtual void handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld);
|
||||
virtual void handleAdditionalKeyPress(int iAction);
|
||||
virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld);
|
||||
virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld);
|
||||
bool getEmptyInventorySlot(std::shared_ptr<ItemInstance> item, int &slotX);
|
||||
int getSectionStartOffset(ESceneSection eSection);
|
||||
virtual bool IsSectionSlotList( ESceneSection eSection );
|
||||
|
|
@ -119,4 +119,4 @@ protected:
|
|||
|
||||
virtual bool overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
|
||||
EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue