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